当前位置: 首页>>代码示例>>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;未经允许,请勿转载。