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