當前位置: 首頁>>代碼示例>>Java>>正文


Java IScopeContext.getNode方法代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.preferences.IScopeContext.getNode方法的典型用法代碼示例。如果您正苦於以下問題:Java IScopeContext.getNode方法的具體用法?Java IScopeContext.getNode怎麽用?Java IScopeContext.getNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.runtime.preferences.IScopeContext的用法示例。


在下文中一共展示了IScopeContext.getNode方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateConfigurationFromSettings

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
private static boolean updateConfigurationFromSettings(AsciidocConfiguration configuration, IProject project) {
	final IScopeContext projectScope = new ProjectScope(project);
	IEclipsePreferences preferences = projectScope.getNode(Activator.PLUGIN_ID);
	try {
		createSettings(project, BACKEND_DEFAULT, RESOURCESPATH_DEFAULT, SOURCESPATH_DEFAULT, STYLESHEETPATH_DEFAULT, TARGETPATH_DEFAULT);
		configuration.setBackend(preferences.get(BACKEND_PROPERTY, BACKEND_DEFAULT));
		configuration.setResourcesPath(preferences.get(RESOURCESPATH_PROPERTY, RESOURCESPATH_DEFAULT));
		configuration.setSourcesPath(preferences.get(SOURCESPATH_PROPERTY, SOURCESPATH_DEFAULT));
		configuration.setStylesheetPath(preferences.get(STYLESHEETPATH_PROPERTY, STYLESHEETPATH_DEFAULT));
		configuration.setTargetPath(preferences.get(TARGETPATH_PROPERTY, TARGETPATH_DEFAULT));
	} catch (BackingStoreException e) {
		Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage(), e));
		return false;
	}
	configuration.source = AsciidocConfigurationSource.SETTINGS;
	return true;
}
 
開發者ID:awltech,項目名稱:eclipse-asciidoctools,代碼行數:18,代碼來源:AsciidocConfiguration.java

示例2: addSettings

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
private static void addSettings(IProject project, String workspaceRoot, List<String> targets,
    List<String> buildFlags) throws BackingStoreException {
  IScopeContext projectScope = new ProjectScope(project);
  Preferences projectNode = projectScope.getNode(Activator.PLUGIN_ID);
  int i = 0;
  for (String target : targets) {
    projectNode.put("target" + i, target);
    i++;
  }
  projectNode.put("workspaceRoot", workspaceRoot);
  i = 0;
  for (String flag : buildFlags) {
    projectNode.put("buildFlag" + i, flag);
    i++;
  }
  projectNode.flush();
}
 
開發者ID:bazelbuild,項目名稱:eclipse,代碼行數:18,代碼來源:BazelProjectSupport.java

示例3: getProjectPreferences

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
private final IEclipsePreferences getProjectPreferences() {
  final IAdaptable element = getElement();
  IProject project = null;
  if (element instanceof IJavaProject) {
    project = ((IJavaProject) element).getProject();
  }
  else if (element instanceof IProject) {
    project = (IProject) element;
  }

  if (project != null) {
    final IScopeContext context = new ProjectScope(project);
    return context.getNode(BaseIds.ID);
  }
  return null;
}
 
開發者ID:sealuzh,項目名稱:PerformanceHat,代碼行數:17,代碼來源:AbstractFeedbackPropertyPage.java

示例4: initPreferencesStore

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
private void initPreferencesStore() {
    IScopeContext projectScope = new ProjectScope(project);
    preferences = projectScope.getNode(FileSyncPlugin.PLUGIN_ID);
    buildPathMap(preferences);
    preferences.addPreferenceChangeListener(this);
    preferences.addNodeChangeListener(this);
    IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
    manager.addValueVariableListener(this);
    jobChangeAdapter = new JobChangeAdapter(){
        @Override
        public void done(IJobChangeEvent event) {
            // XXX dirty trick to re-evaluate dynamic egit variables on branch change
            if(!event.getJob().getClass().getName().contains("org.eclipse.egit.ui.internal.branch.BranchOperationUI")){
                return;
            }
            rebuildPathMap();
        }
    };
    Job.getJobManager().addJobChangeListener(jobChangeAdapter);
    ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
 
開發者ID:iloveeclipse,項目名稱:filesync4eclipse,代碼行數:22,代碼來源:ProjectProperties.java

示例5: writeToPreferenceStore

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
/**
 * Update all formatter settings with the settings of the specified profile.
 * @param profile The profile to write to the preference store
 */
private void writeToPreferenceStore(Profile profile, IScopeContext context) {
	final Map<String, String> profileOptions= profile.getSettings();

	for (int i= 0; i < fKeySets.length; i++) {
        updatePreferences(context.getNode(fKeySets[i].getNodeName()), fKeySets[i].getKeys(), profileOptions);
       }

	final IEclipsePreferences uiPrefs= context.getNode(JavaUI.ID_PLUGIN);
	if (uiPrefs.getInt(fProfileVersionKey, 0) != fProfileVersioner.getCurrentVersion()) {
		uiPrefs.putInt(fProfileVersionKey, fProfileVersioner.getCurrentVersion());
	}

	if (context.getName() == InstanceScope.SCOPE) {
		uiPrefs.put(fProfileKey, profile.getID());
	} else if (context.getName() == ProjectScope.SCOPE && !profile.isSharedProfile()) {
		uiPrefs.put(fProfileKey, profile.getID());
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:23,代碼來源:ProfileManager.java

示例6: updateProfilesWithName

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
protected void updateProfilesWithName(String oldName, Profile newProfile, boolean applySettings) {
	IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects();
	for (int i= 0; i < projects.length; i++) {
		IScopeContext projectScope= fPreferencesAccess.getProjectScope(projects[i]);
		IEclipsePreferences node= projectScope.getNode(JavaUI.ID_PLUGIN);
		String profileId= node.get(fProfileKey, null);
		if (oldName.equals(profileId)) {
			if (newProfile == null) {
				node.remove(fProfileKey);
			} else {
				if (applySettings) {
					writeToPreferenceStore(newProfile, projectScope);
				} else {
					node.put(fProfileKey, newProfile.getID());
				}
			}
		}
	}

	IScopeContext instanceScope= fPreferencesAccess.getInstanceScope();
	final IEclipsePreferences uiPrefs= instanceScope.getNode(JavaUI.ID_PLUGIN);
	if (newProfile != null && oldName.equals(uiPrefs.get(fProfileKey, null))) {
		writeToPreferenceStore(newProfile, instanceScope);
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:26,代碼來源:ProfileManager.java

示例7: getEclipsePreferences

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
/**
 * Returns the eclipse preferences.
 * @return the eclipse preferences
 */
public IEclipsePreferences getEclipsePreferences() {
	if (eclipsePreferences==null) {
		IScopeContext iScopeContext = ConfigurationScope.INSTANCE;
		eclipsePreferences = iScopeContext.getNode(PlugInActivator.PLUGIN_ID);
		eclipsePreferences.addPreferenceChangeListener(this.getChangeListener());
	}
	return eclipsePreferences;
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:13,代碼來源:BundleProperties.java

示例8: testRemove

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
@Test
public void testRemove() throws Exception {
	IJavaProject pj = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, false, false);
	String[] values = new String[] { PreferenceManager.SUFFIX_PREFERENCE_FOR_TEST_IMPLEMENTATION };
	SettingsManager.remove(pj.getProject(), values);

	IScopeContext context = new ProjectScope(pj.getProject());
	IEclipsePreferences projectPreferences = context.getNode(Activator.PLUGIN_ID);
	String val = projectPreferences.get(PreferenceManager.SUFFIX_PREFERENCE_FOR_TEST_IMPLEMENTATION, "");

	assertEquals("", val);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:13,代碼來源:SettingsManagerTest.java

示例9: addNodeListeners

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
protected void addNodeListeners() {
	for (IScopeContext scopeContext : SCOPE_CONTEXTS) {
		try {
			IEclipsePreferences node = scopeContext.getNode("");
			node.accept((curNode) -> {
					curNode.addPreferenceChangeListener(changeListener);
					return true;
			});
			node.addNodeChangeListener(nodeListener);
		} catch (BackingStoreException e) {
			PrefEditorPlugin.log(e);
		}
	}
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:15,代碼來源:PlatformPreferenceProvider.java

示例10: removeNodeListeners

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
protected void removeNodeListeners() {
	for (IScopeContext scopeContext : SCOPE_CONTEXTS) {
		try {
			IEclipsePreferences node = scopeContext.getNode("");
			node.removeNodeChangeListener(nodeListener);
			node.accept((curNode) -> {
					curNode.removePreferenceChangeListener(changeListener);
					return true;
			});
		} catch (BackingStoreException e) {
			PrefEditorPlugin.log(e);
		}
	}
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:15,代碼來源:PlatformPreferenceProvider.java

示例11: loadPrefs

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
protected void loadPrefs() {
	try {
		for (IScopeContext scopeContext : SCOPE_CONTEXTS) {
			IEclipsePreferences node = scopeContext.getNode("");
			node.accept((curNode) -> {
										loadPrefsFromNode(curNode);
										return true;
									 });
		}
	} catch (BackingStoreException e) {
		PrefEditorPlugin.log(e);
	}
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:14,代碼來源:PlatformPreferenceProvider.java

示例12: getNode

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
protected IEclipsePreferences getNode(String categoryName) {
	for (IScopeContext scopeContext : SCOPE_CONTEXTS) {
		String preffix = "/" + scopeContext.getName() + "/";
		if (categoryName.startsWith(preffix)) {
			IEclipsePreferences node = scopeContext.getNode(categoryName.substring(preffix.length()));
			return node;
		}
		
	}
	return null;
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:12,代碼來源:PlatformPreferenceProvider.java

示例13: readExportDataDefaultPathFromFile

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
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,代碼行數:8,代碼來源:ExportAction.java

示例14: createPreferences

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
public void createPreferences() {
		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(GlobalSettings.get("AnalysisProject"));
		IScopeContext projectScope = new ProjectScope(project);
		IEclipsePreferences pref = projectScope.getNode(Activator.PLUGIN_ID);
		for (String stmt : getStatementTypes()) {
//			pref.putInt(stmt, -16743169);
			pref.putInt(stmt, -6037505);
		}
		try {
			pref.flush();
		} catch (BackingStoreException e) {
			e.printStackTrace();
		}
	}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:15,代碼來源:ProjectPreferences.java

示例15: updateColorPreferences

import org.eclipse.core.runtime.preferences.IScopeContext; //導入方法依賴的package包/類
public void updateColorPreferences(String stmtType, int color) {
	IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(GlobalSettings.get("AnalysisProject"));
	IScopeContext projectScope = new ProjectScope(project);
	IEclipsePreferences pref = projectScope.getNode(Activator.PLUGIN_ID);
	pref.putInt(stmtType, color);
	try {
		pref.flush();
	} catch (BackingStoreException e) {
		e.printStackTrace();
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:12,代碼來源:ProjectPreferences.java


注:本文中的org.eclipse.core.runtime.preferences.IScopeContext.getNode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。