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


Java IEclipsePreferences.keys方法代碼示例

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


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

示例1: getConfigEclipse

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //導入方法依賴的package包/類
private  Map<ConfigTypes, String> getConfigEclipse(IEclipsePreferences pref ) {
    Map<ConfigTypes, String> ret = new HashMap<ConfigTypes, String>();
    for (ConfigTypes k:ConfigTypes.values()){
        if (defaults.containsKey(k))
            ret.put(k,defaults.get(k));
        else
            ret.put(k,"");
    }

    try {
        for (String configKey : pref.keys()) {
            for (ConfigTypes c : configKeys.keySet()) {
                if (configKey.equals(configKeys.get(c))){
                    ret.put(c, pref.get(configKey, ""));
                }
            }
        }
    } catch (BackingStoreException e) {
    }


    return ret;
}
 
開發者ID:Ericsson,項目名稱:CodeCheckerEclipsePlugin,代碼行數:24,代碼來源:CcConfiguration.java

示例2: createSettings

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //導入方法依賴的package包/類
private static void createSettings(IProject project, String backend, String resourcesPath, String sourcesPath, String stylesheetPath,
		String targetPath) throws BackingStoreException {
	final IScopeContext projectScope = new ProjectScope(project);
	IEclipsePreferences preferences = projectScope.getNode(Activator.PLUGIN_ID);
	if (preferences.keys().length == 0) {
		preferences.put(BACKEND_PROPERTY, backend);
		preferences.put(RESOURCESPATH_PROPERTY, resourcesPath);
		preferences.put(SOURCESPATH_PROPERTY, sourcesPath);
		preferences.put(STYLESHEETPATH_PROPERTY, stylesheetPath);
		preferences.put(TARGETPATH_PROPERTY, targetPath);
		preferences.flush();
	}
}
 
開發者ID:awltech,項目名稱:eclipse-asciidoctools,代碼行數:14,代碼來源:AsciidocConfiguration.java

示例3: loadPreferences

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //導入方法依賴的package包/類
/**
 * Loads the specified {@link ConnectionTable} based on the current
 * preferences.
 * 
 * @param table
 *            The table to load the current preferences into.
 */
private void loadPreferences(ConnectionTable table) {
	// Get the preference node for connection preferences.
	CustomScopedPreferenceStore store = (CustomScopedPreferenceStore) getPreferenceStore();
	IEclipsePreferences node = store
			.getNode(getConnectionsPreferenceNodeId());

	// Load the current preferences into the table.
	String[] existingKeys;
	try {
		existingKeys = node.keys();
		for (String key : existingKeys) {
			int index = table.addRow();
			List<VizEntry> row = table.getRow(index);

			// Update the key/name in the table.
			row.get(0).setValue(key);
			// Update the other properties.
			String[] preferences = unserializeConnectionPreferences(
					node.get(key, null));
			for (int i = 0; i < preferences.length; i++) {
				row.get(i + 1).setValue(preferences[i]);
			}
		}
	} catch (BackingStoreException e) {
		e.printStackTrace();
	}

	return;
}
 
開發者ID:eclipse,項目名稱:eavp,代碼行數:37,代碼來源:VizConnectionPreferencePage.java

示例4: setPreferenceStore

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //導入方法依賴的package包/類
@Override
public ArrayList<Future<ConnectionState>> setPreferenceStore(
		CustomScopedPreferenceStore store, String preferenceNodeId)
		throws NullPointerException {
	// Throw an exception if the preference node ID is null. We must have a
	// valid node ID if we have a store.
	if (store != null && preferenceNodeId == null) {
		throw new NullPointerException("VizConnectionManager error: "
				+ "Preference node ID cannot be null.");
	}

	// A list of future references to conenction states of all attempted
	// connections for the manager
	ArrayList<Future<ConnectionState>> states = new ArrayList<Future<ConnectionState>>();

	if (store != preferenceStore
			|| !preferenceNodeId.equals(connectionsNodeId)) {
		// If the old store/node ID is valid, unregister the preferences
		// listener and remove all current connections from the manager.
		if (preferenceStore != null) {
			preferenceStore.getNode(connectionsNodeId)
					.removePreferenceChangeListener(preferenceListener);
			preferenceStore = null;
			connectionsNodeId = null;

			// Remove all current connections.
			connectionsByName.clear();
			connectionsByHost.clear();
		}

		// If the new store/node ID is valid, add all new connections, then
		// register the preferences listener.
		if (store != null) {
			// Get the node under which the connections will be stored.
			IEclipsePreferences node = store.getNode(preferenceNodeId);
			// Add all connections in the new preference store.
			try {
				String[] connectionNames = node.keys();
				for (String connection : connectionNames) {
					String preferences = node.get(connection, null);
					states.add(addConnection(connection, preferences));
				}
			} catch (BackingStoreException e) {
				e.printStackTrace();
			}

			// Register with the new store.
			node.addPreferenceChangeListener(preferenceListener);
		}

		// Update the references to the store and the ID.
		preferenceStore = store;
		connectionsNodeId = preferenceNodeId;
	}

	return states;
}
 
開發者ID:eclipse,項目名稱:eavp,代碼行數:58,代碼來源:VizConnectionManager.java


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