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


Java Preferences.node方法代碼示例

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


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

示例1: loadAnnotationPreferenceNodes

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
/**
 * @return
 */
private List<EclipsePreferences> loadAnnotationPreferenceNodes() {
	Preferences rootNode = ConfigurationScope.INSTANCE.getNode(Activator.BUNDLE_ID);
	
	annotationsNode = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
	List<EclipsePreferences> nodes = new Vector<EclipsePreferences>();
	if (annotationsNode != null)
	{
		try {
			for (String n : annotationsNode.childrenNames())
			{
				if (annotationsNode.nodeExists(n))
				{
					nodes.add((EclipsePreferences) annotationsNode.node(n));
				}
			}
		} catch (BackingStoreException e) {
			e.printStackTrace();
		}
	}
			
	return nodes;
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:26,代碼來源:TextAnnotationSettingsPage.java

示例2: preApply

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
public IEclipsePreferences preApply(IEclipsePreferences node) {
	// the node does not need to be the root of the hierarchy
	Preferences root = node.node("/"); //$NON-NLS-1$
	try {
		// we must not create empty preference nodes, so first check if the node exists
		if (root.nodeExists(InstanceScope.SCOPE)) {
			Preferences instance = root.node(InstanceScope.SCOPE);
			// we must not create empty preference nodes, so first check if the node exists
			if (instance.nodeExists(JavaCore.PLUGIN_ID)) {
				cleanJavaCore(instance.node(JavaCore.PLUGIN_ID));
			}
		}
	} catch (BackingStoreException e) {
		// do nothing
	}
	return super.preApply(node);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:18,代碼來源:JavaCorePreferenceModifyListener.java

示例3: getPreferencesNode

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
private static Preferences getPreferencesNode(final String viewDataKey, final TFSTeamProjectCollection connection) {
    final IEclipsePreferences prefs = new InstanceScope().getNode(TFSCommonUIClientPlugin.PLUGIN_ID);
    Preferences node = prefs.node("WorkspacesControl"); //$NON-NLS-1$
    if (viewDataKey != null) {
        node = node.node(viewDataKey);
    }
    node = node.node(connection.getInstanceID().toString());
    node = node.node(connection.getAuthorizedTFSUser().toString());
    return node;
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:11,代碼來源:WorkspacesControl.java

示例4: getPreferencesNode

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
private static Preferences getPreferencesNode(final String key) {
    final IEclipsePreferences prefs = new InstanceScope().getNode(TFSCommonUIClientPlugin.PLUGIN_ID);

    Preferences node = prefs.node(TABLE_COLUMN_WIDTHS_NODE_NAME);
    node = node.node(key);

    return node;
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:9,代碼來源:TableColumnWidthsPersistence.java

示例5: createPartControl

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
@PostConstruct
	public void createPartControl(Composite parent) {
		if (parentShell == null)
		{
			parentShell = new Shell();
		}
		try {
			part = partService.findPart(PART_ID);
		} catch (Exception e) {
//			logger.warn("Part Service couldn't find org.fuberlin.bts.ui.corpus.egy.annotations.TextAnnotationsPart ");
			e.printStackTrace();
		}
		parent.setLayout(new GridLayout());
		((GridLayout) parent.getLayout()).marginHeight = 0;
		((GridLayout) parent.getLayout()).marginWidth = 0;
//		contextService
//				.activateContext("org.eclipse.ui.contexts.dialogAndWindow");
		IEclipseContext child = context.createChild();
		child.set(Composite.class, parent);
		child.set(IBTSEditor.class, TextAnnotationsPart.this);
		textAnnotatationEditor = ContextInjectionFactory.make(
				TextAnnotationsComposite.class, child);
		
		// load annotatin styling settings node
		Preferences rootNode = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus");
		annotationSettings = (EclipsePreferences) rootNode.node(BTSCorpusConstants.PREF_ANNOTATION_SETTINGS);
		AnnotationToolbarItemCreator.processAndUpateToolbarItemsAnnotationShortcut(part, annotationSettings);

		Map<String, Boolean> filters = (Map<String, Boolean>) context.get("org.bbaw.bts.corpus.annotationsPart.filter");
		textAnnotatationEditor.setFilters(filters );
		if (text != null)
		{
			loadInput(text);
		}
		
		parent.layout();
		parent.pack();
		constructed = true;
	}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:40,代碼來源:TextAnnotationsPart.java

示例6: persist

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
private void persist(DockerConnectionElement connElem) {
	Preferences preferences = InstanceScope.INSTANCE
			.getNode(Activator.PLUGIN_ID);
	
	if(connElem != null){
		String name = connElem.getName();
		String authPath = connElem.getAuthPath();
		String host = connElem.getHost();
		boolean isUseDefault = connElem.isUseDefault();
		boolean isUseUnixSocket = connElem.isUseUnixSocket();
		boolean isUseHTTPS = connElem.isUseHTTPS();
		boolean isEnableAuth = connElem.isEnableAuth();
		String socketPath = connElem.getSocketPath();
		Preferences sub1 = preferences.node(name);
		sub1.put("name", name);
		sub1.putBoolean("isUseDefault", isUseDefault);
		sub1.putBoolean("isUseUnixSocket", isUseUnixSocket);
		sub1.put("socketPath", socketPath);
		sub1.putBoolean("isUseHTTPS", isUseHTTPS);
		sub1.put("host", host);
		sub1.putBoolean("isEnableAuth", isEnableAuth);
		sub1.put("authPath", authPath);			
	}

	try {
		// forces the application to save the preferences
		preferences.flush();
	} catch (BackingStoreException e2) {
		e2.printStackTrace();
	}
}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:32,代碼來源:DockerConnectionWizard.java

示例7: getNode

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
public IEclipsePreferences getNode(String qualifier) {
	if (qualifier == null)
		throw new IllegalArgumentException();
	if (pref == null) {
		Preferences pnode = Platform.getPreferencesService().getRootNode().node(SCOPE);
		String ps = context.getFullPath().makeRelative().toPortableString();
		ps = ps.replace('/', ';');
		pref = pnode.node(ps);
	}
	return (IEclipsePreferences) pref.node(qualifier);
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:12,代碼來源:ResourceScope.java

示例8: loadLastDirSelect

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
private String loadLastDirSelect(int mode) {
	String ret = ".";
	Preferences preferences = InstanceScope.INSTANCE.getNode(PREF_PATH);
	Preferences sub1 = preferences.node("paths");
	ret = sub1.get("lastDir_" + mode, ".");
	return ret;
}
 
開發者ID:dmvstar,項目名稱:eclipse-asveditor,代碼行數:8,代碼來源:ASVEditView.java

示例9: getNestedPreferences

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
@Override
public Preferences getNestedPreferences(final Preferences startingNode) {
    final Preferences parentNode = super.getNestedPreferences(startingNode);
    return parentNode.node(workspaceName);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:6,代碼來源:TFSWorkspaceScope.java

示例10: getNestedPreferences

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
@Override
public Preferences getNestedPreferences(final Preferences startingNode) {
    return startingNode.node(rootNodeName);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:5,代碼來源:DefaultScope.java

示例11: getInitInput

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
private DockerConnectionTreeParent getInitInput(){
	DockerConnectionTreeParent invisibleRoot = new DockerConnectionTreeParent(
			"invisibleRoot", null);			
	
	Preferences preferences = InstanceScope.INSTANCE
			.getNode(Activator.PLUGIN_ID);
	try {
		String[] childrenNames = preferences.childrenNames();
		if(childrenNames != null){
			for (int i = 0; i < childrenNames.length; i++) {
				Preferences sub1 = preferences.node(childrenNames[i]);
				String name = sub1.get("name", "");
				boolean isUseDefault = sub1.getBoolean("isUseDefault", true);
				boolean isUseUnixSocket = sub1.getBoolean("isUseUnixSocket", false);
				String socketPath = sub1.get("socketPath", "");
				boolean isUseHTTPS = sub1.getBoolean("isUseHTTPS", false);
				String host = sub1.get("host", "");
				boolean isEnableAuth = sub1.getBoolean("isEnableAuth", false);
				String authPath = sub1.get("authPath", "");		
				
				DockerConnectionElement connElem = new DockerConnectionElement();
				connElem.setAuthPath(authPath);
				connElem.setEnableAuth(isEnableAuth);
				connElem.setHost(host);
				connElem.setName(name);
				connElem.setSocketPath(socketPath);
				connElem.setUseDefault(isUseDefault);
				connElem.setUseHTTPS(isUseHTTPS);
				connElem.setUseUnixSocket(isUseUnixSocket);
				
				String connName = name;
				if (connElem.isUseDefault()) {
					connName += "[Default]";
				} else if (connElem.isUseHTTPS()) {
					connName += "[" + connElem.getHost() + "]";
				}
				DockerConnectionTreeParent conn = new DockerConnectionTreeParent(
						connName, connElem);

				DockerConnectionTreeParent containersTreeParent = new DockerConnectionContainersTreeParent(
						"Containers", connElem);
				conn.addChild(containersTreeParent);
				DockerConnectionTreeParent imagesTreeParent = new DockerConnectionImagesTreeParent(
						"Images", connElem);
				conn.addChild(imagesTreeParent);
				
				invisibleRoot.addChild(conn);
			}
		}
	} catch (BackingStoreException e) {
		 e.printStackTrace();
	}
	return invisibleRoot;
}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:55,代碼來源:DockerExplorerView.java

示例12: getCloudServerURL

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
public static CloudServerURL getCloudServerURL(String serverName){
	if(serverName == null)
		return null;
	
	Preferences preferences = InstanceScope.INSTANCE
			.getNode(Activator.PLUGIN_ID);
	try {
		String[] childrenNames = preferences.childrenNames();
		if(childrenNames != null){
			for (int i = 0; i < childrenNames.length; i++) {
				Preferences sub1 = preferences.node(childrenNames[i]);
				String name = sub1.get("name", "");
				if(!serverName.equals(name))
					continue;
				boolean isUseDefault = sub1.getBoolean("isUseDefault", true);
				boolean isUseUnixSocket = sub1.getBoolean("isUseUnixSocket", false);
				String socketPath = sub1.get("socketPath", "");
				boolean isUseHTTPS = sub1.getBoolean("isUseHTTPS", false);
				String host = sub1.get("host", "");
				boolean isEnableAuth = sub1.getBoolean("isEnableAuth", false);
				String authPath = sub1.get("authPath", "");		
				
				DockerConnectionElement connElem = new DockerConnectionElement();
				connElem.setAuthPath(authPath);
				connElem.setEnableAuth(isEnableAuth);
				connElem.setHost(host);
				connElem.setName(name);
				connElem.setSocketPath(socketPath);
				connElem.setUseDefault(isUseDefault);
				connElem.setUseHTTPS(isUseHTTPS);
				connElem.setUseUnixSocket(isUseUnixSocket);
				
				String connName = name;
				if (connElem.isUseDefault()) {
					connName += "[Default]";
				} else if (connElem.isUseHTTPS()) {
					connName += "[" + connElem.getHost() + "]";
				}
				
				return (new CloudServerURL(name, connName, true, null, connElem));
			}
		}
	} catch (BackingStoreException e) {
		 e.printStackTrace();
	}
	return null;
}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:48,代碼來源:CloudUiUtil.java

示例13: PreferenceStore

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
public PreferenceStore( String plugin_id )
{
	attributes = new ArrayList<PersistentAttribute>();
	Preferences preferences = ConfigurationScope.INSTANCE.getNode( plugin_id );
	jxtaPreferences = preferences.node(JXTA_SETTINGS);
}
 
開發者ID:chaupal,項目名稱:jp2p,代碼行數:7,代碼來源:PreferenceStore.java


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