类org.eclipse.ui.preferences.WorkingCopyManager源码实例Demo

下面列出了怎么用org.eclipse.ui.preferences.WorkingCopyManager的API类实例代码及写法,或者点击链接到github查看源代码。

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();
}
 
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();
}
 
 类所在包
 同包方法