List of usage examples for org.eclipse.jface.preference PreferenceStore PreferenceStore
public PreferenceStore()
From source file:org.axdt.common.preferences.AbstractLauncherPreferenceTab.java
License:Open Source License
protected IPreferenceStore retrievePreferenceStore(AbstractPreferences prefs) { PreferenceStore store = new PreferenceStore(); IPreferenceStore prefstore = prefs.getStore(); for (FieldSpec<?> spec : page.getFieldSpecs()) { spec.setDefault(store, spec.getDefault(prefstore)); }//from w w w. ja v a 2 s. c o m return store; }
From source file:org.bc.eclipse.hadoop.debug.JavaRetryConnectTab.java
License:Open Source License
/** * Update the argument area to show the selected connector's arguments *//*ww w .j a v a 2s . co m*/ private void handleConnectorComboModified() { int index = fConnectorCombo.getSelectionIndex(); if ((index < 0) || (index >= fConnectors.length)) { return; } IVMConnector vm = fConnectors[index]; if (vm.equals(fConnector)) { return; // selection did not change } fConnector = vm; try { fArgumentMap = vm.getDefaultArguments(); } catch (CoreException e) { JDIDebugUIPlugin.statusDialog(LauncherMessages.JavaConnectTab_Unable_to_display_connection_arguments__2, e.getStatus()); return; } // Dispose of any current child widgets in the tab holder area Control[] children = fArgumentComposite.getChildren(); for (int i = 0; i < children.length; i++) { children[i].dispose(); } fFieldEditorMap.clear(); PreferenceStore store = new PreferenceStore(); // create editors Iterator<String> keys = vm.getArgumentOrder().iterator(); while (keys.hasNext()) { String key = keys.next(); Connector.Argument arg = fArgumentMap.get(key); FieldEditor field = null; if (arg instanceof Connector.IntegerArgument) { store.setDefault(arg.name(), ((Connector.IntegerArgument) arg).intValue()); field = new IntegerFieldEditor(arg.name(), arg.label(), fArgumentComposite); } else if (arg instanceof Connector.SelectedArgument) { List<String> choices = ((Connector.SelectedArgument) arg).choices(); String[][] namesAndValues = new String[choices.size()][2]; Iterator<String> iter = choices.iterator(); int count = 0; while (iter.hasNext()) { String choice = iter.next(); namesAndValues[count][0] = choice; namesAndValues[count][1] = choice; count++; } store.setDefault(arg.name(), arg.value()); field = new ComboFieldEditor(arg.name(), arg.label(), namesAndValues, fArgumentComposite); } else if (arg instanceof Connector.StringArgument) { store.setDefault(arg.name(), arg.value()); field = new StringFieldEditor(arg.name(), arg.label(), fArgumentComposite); } else if (arg instanceof Connector.BooleanArgument) { store.setDefault(arg.name(), ((Connector.BooleanArgument) arg).booleanValue()); field = new BooleanFieldEditor(arg.name(), arg.label(), fArgumentComposite); } if (field != null) { field.setPreferenceStore(store); field.loadDefault(); field.setPropertyChangeListener(this); fFieldEditorMap.put(key, field); } } fArgumentComposite.getParent().getParent().layout(); fArgumentComposite.layout(true); updateLaunchConfigurationDialog(); }
From source file:org.brainwy.liclipsetext.editor.common.partitioning.DummyColorCache.java
License:Open Source License
public DummyColorCache(boolean forceDisposeOfColors) { super(new PreferenceStore()); this.forceDisposeOfColors = forceDisposeOfColors; }
From source file:org.brainwy.liclipsetext.editor.preferences.LiClipseTextPreferences.java
License:Open Source License
public static IPreferenceStore getChainedPreferenceStore() { if (chainedPreferenceStore == null) { List<IPreferenceStore> stores = new ArrayList<IPreferenceStore>(); if (LiClipseTextEditorPlugin.PLUGIN_STARTED) { try { ILiClipseEditorCustomizer editorCustomizer = (ILiClipseEditorCustomizer) BaseExtensionHelper .getParticipant("org.brainwy.liclipsetext.editor.liclipse_editor_customizer", false); if (editorCustomizer != null) { IPreferenceStore preferenceStore = editorCustomizer.getPreferenceStore(); if (preferenceStore != null) { stores.add(preferenceStore); }/*from ww w . j av a2 s. c o m*/ } } catch (Exception e) { Log.log(e); } //Note: the order is important stores.add(LiClipseTextEditorPlugin.getDefault().getPreferenceStore()); stores.add(EditorsUI.getPreferenceStore()); } else { //In tests stores.add(new PreferenceStore()); } chainedPreferenceStore = new ChainedPreferenceStore( stores.toArray(new IPreferenceStore[stores.size()])); } return chainedPreferenceStore; }
From source file:org.caleydo.core.internal.MyPreferences.java
License:Open Source License
public static IPreferenceStore prefs() { Activator a = Activator.getDefault(); if (a == null) return new PreferenceStore(); return a.getPreferenceStore(); }
From source file:org.cfeclipse.cfml.preferences.OverlayPreferenceStore.java
License:Open Source License
public OverlayPreferenceStore(IPreferenceStore parent, OverlayKey overlayKeys[]) { fParent = parent; fOverlayKeys = overlayKeys; fStore = new PreferenceStore(); }
From source file:org.chromium.debug.ui.launcher.ChromiumRemoteTab.java
License:Open Source License
@Override protected ELEMENTS createElements(Composite parent, Runnable modifyListener) { Composite composite = createDefaultComposite(parent); setControl(composite);/*w w w . ja v a2 s .c o m*/ PreferenceStore store = new PreferenceStore(); composite.setFont(parent.getFont()); return createDialogElements(composite, modifyListener, store); }
From source file:org.codehaus.groovy.eclipse.refactoring.formatter.FormatterPreferencesOnStore.java
License:Apache License
/** * Create Formatter Preferences for a given GroovyCompilationUnit. * The formatter preferences object will cache preferences it fetches * from the preferences store. This cache is never updated so you must * create a new instance to update preferences. *//*from w w w .j a va 2 s . c o m*/ public FormatterPreferencesOnStore(IPreferenceStore preferences) { if (preferences == null) preferences = new PreferenceStore(); refresh(preferences); }
From source file:org.codehaus.groovy.eclipse.refactoring.test.TestPrefInitializer.java
License:Apache License
public static IPreferenceStore initializePreferences(HashMap<String, String> properties) { IPreferenceStore pref = new PreferenceStore(); String indentation = properties.get("indentation"); if (indentation != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_INDENTATION, indentation); }/*from w ww . ja va 2 s. com*/ String tabsize = properties.get("tabsize"); // Older tests will use tabsize assuming its the same as indentsize, so // set both of these! if (tabsize != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_INDENTATION_SIZE, Integer.parseInt(tabsize)); pref.setValue(PreferenceConstants.GROOVY_FORMATTER_TAB_SIZE, Integer.parseInt(tabsize)); } String indentsize = properties.get("indentsize"); if (indentsize != null) { // GRECLIPSE-1137 This is strange, but it looks like the JDT preferences are switched for spaces mode if ("space".equals(indentation)) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_TAB_SIZE, Integer.parseInt(indentsize)); } else { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_INDENTATION_SIZE, Integer.parseInt(indentsize)); } } String multiInd = properties.get("multilineIndentation"); if (multiInd != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_MULTILINE_INDENTATION, Integer.parseInt(multiInd)); } String bracesStart = properties.get("bracesStart"); if (bracesStart != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_BRACES_START, bracesStart); } String bracesEnd = properties.get("bracesEnd"); if (bracesEnd != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_BRACES_END, bracesEnd); } String maxLineLength = properties.get("maxLineLegth"); if (maxLineLength != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_MAX_LINELENGTH, Integer.parseInt(maxLineLength)); } String longListLength = properties.get("longListLength"); if (longListLength != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_LONG_LIST_LENGTH, Integer.parseInt(longListLength)); } String indentEmptyLines = properties.get("indentEmptyLines"); if (indentEmptyLines != null) { pref.setValue(DefaultCodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, indentEmptyLines); } String removeUnnecessarySemicolons = properties.get("removeUnnecessarySemicolons"); if (removeUnnecessarySemicolons != null) { pref.setValue(PreferenceConstants.GROOVY_FORMATTER_REMOVE_UNNECESSARY_SEMICOLONS, removeUnnecessarySemicolons); } return pref; }
From source file:org.dsource.ddt.lang.text.LangAutoEditStragetyTest.java
License:Open Source License
protected PreferenceStore createPreferenceStore() { PreferenceStore prefStore = new PreferenceStore(); prefStore.setValue(LangAutoEditPreferenceConstants.AE_SMART_INDENT, true); prefStore.setValue(LangAutoEditPreferenceConstants.AE_SMART_DEINDENT, true); prefStore.setValue(LangAutoEditPreferenceConstants.AE_PARENTHESES_AS_BLOCKS, true); prefStore.setValue(LangAutoEditPreferenceConstants.AE_CLOSE_BRACES, true); prefStore.setValue(LangAutoEditPreferenceConstants.AE_CLOSE_BRACKETS, true); prefStore.setValue(LangAutoEditPreferenceConstants.AE_CLOSE_STRINGS, true); prefStore.setValue(PreferenceConstants.EDITOR_SMART_PASTE, true); prefStore.setValue(CodeFormatterConstants.FORMATTER_TAB_SIZE, 4); prefStore.setValue(CodeFormatterConstants.FORMATTER_TAB_CHAR, TabStyle.TAB.getName()); return prefStore; }