Bug 305161 Dynamic Path Variable ui.ide API review
Dynamic Path Variable ui.ide API review
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/dialogs/ImportTypeDialog.java
pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager();
		String[] variables = pathVariableManager.getPathVariableNames();
		
		ArrayList items = new ArrayList();
		for (int i = 0; i < variables.length; i++) {
			if (variables[i].equals("PARENT")) 
				continue;
			items.add(variables[i]);
		}
		items.add(IDEWorkbenchMessages.ImportTypeDialog_editVariables);
		variableCombo.setItems((String[]) items.toArray(new String[0]));
		super.getShell().layout(true);
	}
	private void writeContextPreference(String key, String value) {
		String oldValue = IDEWorkbenchPlugin.getDefault().getPreferenceStore().getString(key);
		StringBuffer buffer = new StringBuffer();
		String [] keyPairs = oldValue.split(":"); 
		boolean found = false;
		for (int i = 0; i < keyPairs.length; i++) {
			if (i > 0)
				buffer.append(":"); 
			String [] element = keyPairs[i].split(","); 
			if (element.length == 2) {
				if (element[0].equals(Integer.toString(operationMask))) {
					buffer.append(element[0] + "," + value); 
					found = true;
				}
				else
					buffer.append(keyPairs[i]);
			}