本文整理汇总了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);
}
}
}
示例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());
}
}
示例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);
}
}
}
示例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;
}