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


Java Preferences.getInt方法代碼示例

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


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

示例1: restore

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
/**
 * Restores table column widths. Users of this class should have already
 * added some mappings before calling this method. Any persisted widths
 * whose keys do not correspond to indices into the {@link Table}'s columns
 * will be ignored.
 */
public void restore() {
    final Preferences node = getPreferencesNode(key);

    for (final Iterator it = mappings.keySet().iterator(); it.hasNext();) {
        final String columnKey = (String) it.next();
        final int ix = getIndexForKey(columnKey);
        if (ix == -1) {
            continue;
        }
        final TableColumn tableColumn = table.getColumn(ix);
        final int persistedWidth = node.getInt(columnKey, -1);
        if (persistedWidth != -1) {
            tableColumn.setWidth(persistedWidth);
        }
    }
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:23,代碼來源:TableColumnWidthsPersistence.java

示例2: loadPreferences

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
/**
 * Load the parameters to run ModularityCheck.
 */
public void loadPreferences() {
	@SuppressWarnings("deprecation")
	Preferences preferences = new InstanceScope().getNode(PLUGIN_ID);
	try {
		repoType = preferences.getInt(REPO_TYPE, 0);
		repoManager = preferences.getInt(REPO_MANAGER, 0);
		repoUrl = preferences.get(REPO_URL, " ");
		repoXml = preferences.get(REPO_XML, " ");
		repoBegin = new SimpleDateFormat("yyyy-MM-dd").parse(preferences
				.get(REPO_BEGIN, (new Date()).toString()));
		repoEnd = new SimpleDateFormat("yyyy-MM-dd").parse(preferences.get(
				REPO_END, (new Date()).toString()));
		lastExec = preferences.get(LAST_EXEC_PARAMS, " ");
	} catch (ParseException e) {
		ConfigurationsDialog cd = new ConfigurationsDialog();
		cd.showDialog(Display.getDefault().getActiveShell());
	}
}
 
開發者ID:aserg-ufmg,項目名稱:ModularityCheck,代碼行數:22,代碼來源:ModularityCheck.java

示例3: GitModeMenuMgr

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
GitModeMenuMgr(String text, String id, Preferences pref, String prefKey, int[] modes) {
	super(text, id);
	this.pref = pref;
	this.prefKey = prefKey;
	int def = pref.getInt(prefKey, modes[0]);
	for (int i = 0; i < modes.length; i++) {
		int mode = modes[i];
		String label = "Current branch head";
		switch (mode) {
			case MODE_OTHERS: 		label = "&Other branch/tag/reference"; break;
			case MODE_WORKING_AREA: label = "&Working area"; break;
			case MODE_STAGING: 		label = "&Staging area"; break;
			case IGNORE_EXCLUDE: 	label = "&Exclude ignored file"; break;
			case IGNORE_INCLUDE: 	label = "&Include ignored file"; break;
			case IGNORE_ONLY: 		label = "&Only ignored files"; break;
		}
		XAction action = new XAction(label, mode);
		add(action);
		if (mode == def) {
			action.setChecked(true);
		}
	}
}
 
開發者ID:BeckYang,項目名稱:TeamFileList,代碼行數:24,代碼來源:GitModeMenuMgr.java

示例4: readConfig

import org.osgi.service.prefs.Preferences; //導入方法依賴的package包/類
public static ArrayList<Group> readConfig() throws BackingStoreException {
	ArrayList<Group> groups = new ArrayList<Group>();
	IEclipsePreferences pref = getPreferences();
	
	for(String child: pref.childrenNames()) {
		Preferences prefG = pref.node(child);
		Group g = new Group(Integer.parseInt(child.substring(GROUPID.length())));
		for(int i = 0; i < prefG.getInt(MEMBERCOUNT, 0); ++i) {
			g.addMember(prefG.get(MEMBER + i, "default"));
		}
		groups.add(g);
	}
	
	return groups;
}
 
開發者ID:CedricHanebaum,項目名稱:Correct,代碼行數:16,代碼來源:PrefIO.java


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