当前位置: 首页>>代码示例>>Java>>正文


Java InstanceScope.INSTANCE属性代码示例

本文整理汇总了Java中org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE属性的典型用法代码示例。如果您正苦于以下问题:Java InstanceScope.INSTANCE属性的具体用法?Java InstanceScope.INSTANCE怎么用?Java InstanceScope.INSTANCE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.core.runtime.preferences.InstanceScope的用法示例。


在下文中一共展示了InstanceScope.INSTANCE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFieldEditors

/**
 * Create contents of the preference page.
 */
@Override
protected void createFieldEditors() {
	// Create the field editors
	IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.bbaw.bts.app");
	Composite container = (Composite) this.getControl();
	container.setLayout(new GridLayout(1, false));

	Label activeConfigLB = new Label(container, SWT.NONE);
	activeConfigLB.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false,
			false, 1, 1));
	activeConfigLB.setText("Currently active Configuration");

	activeConfigcomboViewer = new ComboViewer(container, SWT.READ_ONLY);
	activeConfigcomboViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
			false, 1, 1));
	ComposedAdapterFactory factory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
	AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(factory);
	activeConfigcomboViewer.setContentProvider(new AdapterFactoryContentProvider(factory));
	activeConfigcomboViewer.setLabelProvider(labelProvider);		
	
	
	init(null);
	loaded = true;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:27,代码来源:ConfigurationPage.java

示例2: createFieldEditors

/**
	 * Create contents of the preference page.
	 */
	@Override
	protected void createFieldEditors() {
		// Create the field editors
		IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.bbaw.bts.app");
		

//		addField(new BooleanFieldEditor("remember_me", "Remember my login credentials on startup", BooleanFieldEditor.DEFAULT, getFieldEditorParent()));
		Composite container = (Composite) this.getControl();
		container.setLayout(new GridLayout(1, false));
		Label lblNewLabel = new Label(container, SWT.NONE);
		lblNewLabel.setText("Login Preferences");
		
		btnCheckButton = new Button(container, SWT.CHECK);
		btnCheckButton.setText("Remember my login credentials on startup");
		
		init(null);
		loaded = true;
	}
 
开发者ID:cplutte,项目名称:bts,代码行数:21,代码来源:LoginRememberMePage.java

示例3: forceStaticImports

private void forceStaticImports() {
	try {
		IPreferenceStore s = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.jdt.ui");
		String favorites = s.getString(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS);
		for (String f : defaultFavorites) {
			if (!favorites.contains(f)) {
				if (!favorites.isEmpty()) {
					favorites += ";";
				}
				favorites += f;
			}
		}
		Log.info("forcing favorite static members: " + favorites);
		s.setValue(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS, favorites);
	} catch (Exception e) {
		Log.error(e);
	}
}
 
开发者ID:cincheo,项目名称:jsweet-eclipse-plugin,代码行数:18,代码来源:JSweetBuilder.java

示例4: getLineDelimiterPreference

public static String getLineDelimiterPreference(IProject project) {
  IScopeContext[] scopeContext;
  if (project != null) {
    // project preference
    scopeContext = new IScopeContext[] {new ProjectScope(project)};
    String lineDelimiter =
        Platform.getPreferencesService()
            .getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
    if (lineDelimiter != null) return lineDelimiter;
  }
  // workspace preference
  scopeContext = new IScopeContext[] {InstanceScope.INSTANCE};
  String platformDefault =
      System.getProperty("line.separator", "\n"); // $NON-NLS-1$ //$NON-NLS-2$
  return Platform.getPreferencesService()
      .getString(
          Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, platformDefault, scopeContext);
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:StubUtility.java

示例5: loadSaveParticipantOptions

public static Map<String, String> loadSaveParticipantOptions(IScopeContext context) {
	IEclipsePreferences node;
	if (hasSettingsInScope(context)) {
		node= context.getNode(JavaUI.ID_PLUGIN);
	} else {
		IScopeContext instanceScope= InstanceScope.INSTANCE;
		if (hasSettingsInScope(instanceScope)) {
			node= instanceScope.getNode(JavaUI.ID_PLUGIN);
		} else {
			return JavaPlugin.getDefault().getCleanUpRegistry().getDefaultOptions(CleanUpConstants.DEFAULT_SAVE_ACTION_OPTIONS).getMap();
		}
	}

	Map<String, String> result= new HashMap<String, String>();
	Set<String> keys= JavaPlugin.getDefault().getCleanUpRegistry().getDefaultOptions(CleanUpConstants.DEFAULT_SAVE_ACTION_OPTIONS).getKeys();
	for (Iterator<String> iterator= keys.iterator(); iterator.hasNext();) {
        String key= iterator.next();
        result.put(key, node.get(SAVE_PARTICIPANT_KEY_PREFIX + key, CleanUpOptions.FALSE));
       }

	return result;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:CleanUpPreferenceUtil.java

示例6: createPlottingSystem

/**
 * Reads the extension points for the plotting systems registered and returns
 * a plotting system based on the users current preferences.
 * 
 * @return
 */
@SuppressWarnings("unchecked")
public static <T> IPlottingSystem<T> createPlottingSystem() throws Exception {

	final ScopedPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE,"org.dawb.workbench.ui");
	String plotType = store.getString("org.dawb.plotting.system.choice");
	if (plotType.isEmpty()) plotType = System.getProperty("org.dawb.plotting.system.choice");// For Geoff et. al. can override.
	if (plotType==null) plotType = "org.dawb.workbench.editors.plotting.lightWeightPlottingSystem"; // That is usually around

	IPlottingSystem<T> system = createPlottingSystem(plotType);
	if (system!=null) return system;

	IConfigurationElement[] systems = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.dawnsci.plotting.api.plottingClass");
	if (systems.length == 0) {
		return null;
	}

	IPlottingSystem<T> ifnotfound = (IPlottingSystem<T>)systems[0].createExecutableExtension("class");
	store.setValue("org.dawb.plotting.system.choice", systems[0].getAttribute("id"));
	return ifnotfound;
}
 
开发者ID:eclipse,项目名称:dawnsci,代码行数:26,代码来源:PlottingFactory.java

示例7: getEclipseEditorBackground

public static Color getEclipseEditorBackground( )
{
	ScopedPreferenceStore preferenceStore = new ScopedPreferenceStore( InstanceScope.INSTANCE,
			"org.eclipse.ui.editors" );//$NON-NLS-1$
	Color color = null;
	if ( preferenceStore != null )
	{
		color = preferenceStore.getBoolean( AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT ) ? null
				: createColor( preferenceStore,
						AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND,
						Display.getCurrent( ) );
	}
	if ( color == null )
	{
		color = Display.getDefault( )
				.getSystemColor( SWT.COLOR_LIST_BACKGROUND );
	}
	return color;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:UIUtil.java

示例8: setUp

@Override
public void setUp() throws Exception {
	super.setUp();
	preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, getEditorId());
	comparer = new IOutlineNodeComparer.Default();

	// when using in XPECT, XPECT already creates the project structure
	if (shouldCreateProjectStructure()) {
		createProjectStructure();
	}
	//
	openXtextDocument();
	openOutlineView();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:14,代码来源:AbstractOutlineWorkbenchTest.java

示例9: readExportDataDefaultPathFromFile

private String readExportDataDefaultPathFromFile() {
	IScopeContext context = InstanceScope.INSTANCE;
	IEclipsePreferences eclipsePreferences = context.getNode(Activator.PLUGIN_ID);
	String exportDataDefaultpath = eclipsePreferences.get(EXPORT_DATA_DEFAULT_PATH, DEFAULT);
	exportDataDefaultpath = exportDataDefaultpath.equalsIgnoreCase(DEFAULT) ? " " : exportDataDefaultpath;
	return exportDataDefaultpath;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:7,代码来源:ExportAction.java

示例10: getLineDelimiterPreference

private static String getLineDelimiterPreference(IContainer file) {
	IScopeContext[] scopeContext;
	if (file != null && file.getProject() != null) {
		// project preference
		scopeContext = new IScopeContext[] { new ProjectScope(file.getProject()) };
		String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME,
				Platform.PREF_LINE_SEPARATOR, null, scopeContext);
		if (lineDelimiter != null)
			return lineDelimiter;
	}
	// workspace preference
	scopeContext = new IScopeContext[] { InstanceScope.INSTANCE };
	return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null,
			scopeContext);
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:15,代码来源:NewEditorConfigWizard.java

示例11: resolveScopeContext

/**
 * Resolve the given scheme to a preference scope.
 * 
 * @param scheme the preference scheme
 * @return the corresponding preference scope
 * @throws IllegalArgumentException if unable to resolve the scheme to a preference scope
 */
private static IScopeContext resolveScopeContext(String scheme) throws IllegalArgumentException {
  switch (scheme) {
    case "instance":
      return InstanceScope.INSTANCE;
    case "configuration":
      return ConfigurationScope.INSTANCE;
    default:
      throw new IllegalArgumentException("Unknown scheme: " + scheme);
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:PreferenceResolver.java

示例12: getPreferenceStore

public static IPreferenceStore getPreferenceStore(IProject project) {
	if (project != null) {
		IPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(project), Activator.PLUGIN_ID);
		if(store.getBoolean(PreferenceConstants.GENERATOR_PROJECT_SETTINGS))
		return store;
	}
	return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);//Activator.PLUGIN_ID);
}
 
开发者ID:UrsZeidler,项目名称:uml2solidity,代码行数:8,代码来源:PreferenceConstants.java

示例13: getPreferenceStore

public static IPreferenceStore getPreferenceStore(IProject project) {
	if (project != null) {
		IPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(project), Activator.PLUGIN_ID);
		if(store.getBoolean(PreferenceConstants.COMPILER_PROJECT_SETTINGS)|| store.getBoolean(PreferenceConstants.BUILDER_PROJECT_SETTINGS))
		return store;
	}
	return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);//Activator.PLUGIN_ID);
}
 
开发者ID:UrsZeidler,项目名称:uml2solidity,代码行数:8,代码来源:PreferenceConstants.java

示例14: providePreferenceStore

public PreferenceStoreWrapper providePreferenceStore() {
    IPreferenceStore[] preferenceStores = new IPreferenceStore[2];
    preferenceStores[0] = Activator.getDefault().getPreferenceStore();

    ScopedPreferenceStore jdtCorePreferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.jdt.core");
    if (currentJavaProject.isPresent()) { // if we are in a project add to search scope
        jdtCorePreferenceStore.setSearchContexts(new IScopeContext[] { new ProjectScope(currentJavaProject.get().getProject()), InstanceScope.INSTANCE });
    }
    preferenceStores[1] = jdtCorePreferenceStore;

    return new PreferenceStoreWrapper(new ChainedPreferenceStore(preferenceStores));
}
 
开发者ID:helospark,项目名称:SparkBuilderGenerator,代码行数:12,代码来源:PreferenceStoreProvider.java

示例15: isAutoBuildEnabled

protected static boolean isAutoBuildEnabled() {
	IPreferencesService service = Platform.getPreferencesService();
	String qualifier = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
	String key = "description.autobuilding";
	IScopeContext[] contexts = { InstanceScope.INSTANCE, ConfigurationScope.INSTANCE };
	return service.getBoolean(qualifier, key, false, contexts);
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:7,代码来源:BuildUtils.java


注:本文中的org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。