ISelection sel= new StructuredSelection(new StructuredSelection(initSelectedElement));
ISelection sel= new StructuredSelection(initSelectedElement);
	public VariableBlock(IStatusChangeListener context, boolean useAsSelectionDialog, String initSelection) {			fContext= context;		fUseAsSelectionDialog= useAsSelectionDialog;		fSelectionStatus= new StatusInfo();					String[] buttonLabels= new String[] { 			JavaPlugin.getResourceString(ADD), JavaPlugin.getResourceString(EDIT)		};						VariablesAdapter adapter= new VariablesAdapter();				CPVariableElementLabelProvider labelProvider= new CPVariableElementLabelProvider();				fVariablesList= new ListDialogField(adapter, buttonLabels, labelProvider, 0);		fVariablesList.setDialogFieldListener(adapter);		fVariablesList.setLabelText(JavaPlugin.getResourceString(VARS + ".label"));		fVariablesList.setRemoveButtonLabel(JavaPlugin.getResourceString(VARS + ".remove.button"));		fReservedList= new ListDialogField(adapter, null, labelProvider, 0);		fReservedList.setDialogFieldListener(adapter);		fReservedList.setLabelText(JavaPlugin.getResourceString(RESERVED + ".label"));				CPVariableElement initSelectedElement= null;				String[] reservedName= getReservedVariableNames();		ArrayList reserved= new ArrayList(reservedName.length);		for (int i= 0; i < reservedName.length; i++) {			String name= reservedName[i];			CPVariableElement resVar= new CPVariableElement(name, null);			reserved.add(resVar);						if (name.equals(initSelection)) {				initSelectedElement= resVar;			}		}				boolean isInReserved= (initSelectedElement != null);				String[] entries= JavaCore.getClasspathVariableNames();		ArrayList elements= new ArrayList(entries.length);		for (int i= 0; i < entries.length; i++) {			String name= entries[i];			IPath entryPath= JavaCore.getClasspathVariable(name);			if (entryPath != null) {				CPVariableElement elem= new CPVariableElement(name, entryPath);				if (!reserved.contains(elem)) {					elements.add(elem);					if (name.equals(initSelection)) {						initSelectedElement= elem;					}				}			} else {				JavaPlugin.log(new Exception("classpath variable not found: " + name));			}		}		fVariablesList.setElements(elements);		fReservedList.setElements(reserved);				Object selElement= null;		if (initSelectedElement != null) {			ISelection sel= new StructuredSelection(new StructuredSelection(initSelectedElement));			if (isInReserved) {				fReservedList.selectElements(sel);			} else {				fVariablesList.selectElements(sel);			}		} else {			if (fVariablesList.getSize() > 0) {				fVariablesList.selectElements(new StructuredSelection(fVariablesList.getElement(0)));			} else if (fReservedList.getSize() > 0) {				fReservedList.selectElements(new StructuredSelection(fReservedList.getElement(0)));			}		}			}