Java Code Examples for org.eclipse.jface.preference.IPreferenceStore#getDefaultInt()

The following examples show how to use org.eclipse.jface.preference.IPreferenceStore#getDefaultInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IndentGuidePreferencePage.java    From xds-ide with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void performDefaults() {
    super.performDefaults();
    IPreferenceStore store = getPreferenceStore();
    enabled.setSelection(store
            .getDefaultBoolean(PreferenceConstants.ENABLED));
    lineAlpha.setSelection(store
            .getDefaultInt(PreferenceConstants.LINE_ALPHA));
    int index = store.getDefaultInt(PreferenceConstants.LINE_STYLE) - 1;
    if (index < 0 || index >= styles.length) {
        index = 0;
    }
    lineStyle.setText(styles[index]);
    lineWidth.setSelection(store
            .getDefaultInt(PreferenceConstants.LINE_WIDTH));
    lineShift.setSelection(store
            .getDefaultInt(PreferenceConstants.LINE_SHIFT));
    colorFieldEditor.loadDefault();
    enableControls(enabled.getSelection());
}
 
Example 2
Source File: SVNMenuIconsPreferencesPage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Defaults was clicked. Restore the SVN preferences to
 * their default values
 */
protected void performDefaults() {
	super.performDefaults();

	IPreferenceStore store = getPreferenceStore();

	int iconSet = store.getDefaultInt(ISVNUIConstants.PREF_MENU_ICON_SET);
	useTortoiseSVN.setSelection(ISVNUIConstants.MENU_ICON_SET_TORTOISESVN == iconSet);
	useDefault.setSelection(ISVNUIConstants.MENU_ICON_SET_DEFAULT == iconSet);
	useDefault.setSelection(ISVNUIConstants.MENU_ICON_SET_SUBVERSIVE == iconSet);
	
       verifyValidation();
}
 
Example 3
Source File: IndentGuidePreferencePage.java    From IndentGuide with MIT License 5 votes vote down vote up
@Override
protected void performDefaults() {
  super.performDefaults();
  final IPreferenceStore store = getPreferenceStore();
  enabled.setSelection(store
      .getDefaultBoolean(PreferenceConstants.ENABLED));
  lineAlpha.setSelection(store
      .getDefaultInt(PreferenceConstants.LINE_ALPHA));
  int index = store.getDefaultInt(PreferenceConstants.LINE_STYLE) - 1;
  if (index < 0 || index >= styles.length) {
    index = 0;
  }
  lineStyle.setText(styles[index]);
  lineWidth.setSelection(store
      .getDefaultInt(PreferenceConstants.LINE_WIDTH));
  lineShift.setSelection(store
      .getDefaultInt(PreferenceConstants.LINE_SHIFT));
  colorFieldEditor.loadDefault();
  drawLeftEnd.setSelection(store
      .getDefaultBoolean(PreferenceConstants.DRAW_LEFT_END));
  drawBlankLine.setSelection(store
      .getDefaultBoolean(PreferenceConstants.DRAW_BLANK_LINE));
  skipCommentBlock.setSelection(store
      .getDefaultBoolean(PreferenceConstants.SKIP_COMMENT_BLOCK));
  enableControls(enabled.getSelection());
  for (final TreeItem item : contentTypesTree.getItems()) {
    checkItems(item, false);
  }
  final String type = store.getDefaultString(PreferenceConstants.CONTENT_TYPES);
  final String types[] = type.split("\\|");
  for (final TreeItem child : contentTypesTree.getItems()) {
    checkContentType(child, types);
  }
}
 
Example 4
Source File: Preferences.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
public static void init() {
	Logger log = LoggerFactory.getLogger(Preferences.class);
	log.trace("init preferences");
	IPreferenceStore store = getStore();
	int acc = store.getDefaultInt(NUMBER_ACCURACY);
	Numbers.setDefaultAccuracy(acc);
	log.trace("preference {} = {}", NUMBER_ACCURACY, acc);
}
 
Example 5
Source File: TLCChainedPreferenceStore.java    From tlaplus with MIT License 4 votes vote down vote up
public int getDefaultInt(String name) {
	IPreferenceStore visibleStore= getVisibleStore(name);
	if (visibleStore != null)
		return visibleStore.getDefaultInt(name);
	return INT_DEFAULT_DEFAULT;
}