else if (type == IJavaElement.FIELD) presetOffset= ((IField)element).getSourceRange().getOffset();
else if (type == IJavaElement.METHOD) presetOffset= ((IMethod)element).getSourceRange().getOffset();
	private void fillWithPossibleInsertPositions(Combo combo) {		try {			int position= 0;			int presetOffset= 0;			if (getEditor() != null) {				presetOffset= ((TextSelection)getEditor().getSelectionProvider().getSelection()).getOffset();			}			else {				List preselected= getInitialElementSelections();					int size= preselected.size();				if ((size > 1) || (size == 0))					presetOffset= 0;						else {									IJavaElement element= (IJavaElement) preselected.get(0);					int type= element.getElementType();					if (type == IJavaElement.FIELD)						presetOffset= ((IField)element).getSourceRange().getOffset();														else if (type == IJavaElement.FIELD)						presetOffset= ((IField)element).getSourceRange().getOffset();					}			}						Object allFields[]= getContentProvider().getElements(null);			IField field= (IField)allFields[0];			combo.add(ActionMessages.getString("GetterSetterTreeSelectionDialog.first_method")); //$NON-NLS-1$							IMethod[] methods= field.getDeclaringType().getMethods();			int bestDiff= Integer.MAX_VALUE;						for (int i= 0; i < methods.length; i++) {				int currDiff= 0;				IMethod curr= methods[i];				combo.add(JavaElementLabels.getElementLabel(methods[i], JavaElementLabels.M_PARAMETER_TYPES));				// calculate method to pre-select				currDiff= presetOffset - curr.getSourceRange().getOffset();				if (currDiff >= 0)					if(currDiff < bestDiff) {						bestDiff= currDiff;						position= i + 1;	// first entry is "as first method"					}					else						break;			}				combo.select(position);			setInsertionIndex(combo.getSelectionIndex());		} catch (JavaModelException e) {		}		}