org.eclipse.ui.preferences.WorkingCopyManager Java Examples

The following examples show how to use org.eclipse.ui.preferences.WorkingCopyManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OptionsConfigurationBlock.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public OptionsConfigurationBlock(IStatusChangeListener context, IProject project, PreferenceKey[] allKeys,
		IWorkbenchPreferenceContainer container)
{
	fContext = context;
	fProject = project;
	fAllKeys = allKeys;
	fContainer = container;
	if (container == null)
	{
		fManager = new WorkingCopyManager();
	}
	else
	{
		fManager = container.getWorkingCopyManager();
	}

	if (fProject != null)
	{
		fLookupOrder = new IScopeContext[] { new ProjectScope(fProject), EclipseUtil.instanceScope(),
				EclipseUtil.defaultScope() };
	}
	else
	{
		fLookupOrder = new IScopeContext[] { EclipseUtil.instanceScope(), EclipseUtil.defaultScope() };
	}

	testIfOptionsComplete(allKeys);
	if (fProject == null || hasProjectSpecificOptions(fProject))
	{
		fDisabledProjectSettings = null;
	}
	else
	{
		fDisabledProjectSettings = new HashMap<PreferenceKey, String>();
		for (int i = 0; i < allKeys.length; i++)
		{
			PreferenceKey curr = allKeys[i];
			fDisabledProjectSettings.put(curr, curr.getStoredValue(fLookupOrder, false, fManager));
		}
	}

	fRebuildCount = getRebuildCount();
}
 
Example #2
Source File: OptionsConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public OptionsConfigurationBlock(IStatusChangeListener context, IProject project, Key[] allKeys, IWorkbenchPreferenceContainer container) {
	fContext= context;
	fProject= project;
	fAllKeys= allKeys;
	fContainer= container;
	if (container == null) {
		fManager= new WorkingCopyManager();
	} else {
		fManager= container.getWorkingCopyManager();
	}

	if (fProject != null) {
		fLookupOrder= new IScopeContext[] {
			new ProjectScope(fProject),
			InstanceScope.INSTANCE,
			DefaultScope.INSTANCE
		};
	} else {
		fLookupOrder= new IScopeContext[] {
			InstanceScope.INSTANCE,
			DefaultScope.INSTANCE
		};
	}
	testIfOptionsComplete(allKeys);
	if (fProject == null || hasProjectSpecificOptions(fProject)) {
		fDisabledProjectSettings= null;
	} else {
		fDisabledProjectSettings= new IdentityHashMap<Key, String>();
		for (int i= 0; i < allKeys.length; i++) {
			Key curr= allKeys[i];
			fDisabledProjectSettings.put(curr, curr.getStoredValue(fLookupOrder, false, fManager));
		}
	}

	settingsUpdated();

	fCheckBoxes= new ArrayList<Button>();
	fComboBoxes= new ArrayList<Combo>();
	fTextBoxes= new ArrayList<Text>(2);
	fLinks= new ArrayList<Link>(2);
	fLabels= new HashMap<Control, Label>();
	fExpandableComposites= new ArrayList<ExpandableComposite>();

	fRebuildCount= getRebuildCount();
}