List of usage examples for org.eclipse.jface.dialogs IDialogSettings addSection
void addSection(IDialogSettings section);
From source file:com.bdaum.zoom.ui.internal.dialogs.ZResizableDialog.java
License:Open Source License
protected void saveBounds(IDialogSettings settings, String key, Rectangle bounds) { IDialogSettings dialogBounds = settings.getSection(key); if (dialogBounds == null) settings.addSection(dialogBounds = new DialogSettings(key)); dialogBounds.put(X, bounds.x);/*from w w w . j av a 2s . c o m*/ dialogBounds.put(Y, bounds.y); dialogBounds.put(WIDTH, bounds.width); dialogBounds.put(HEIGHT, bounds.height); }
From source file:com.bdaum.zoom.ui.internal.ZUiPlugin.java
License:Open Source License
public IDialogSettings getDialogSettings(String id) { IDialogSettings settings = getDialogSettings(); if (settings != null) { IDialogSettings section = settings.getSection(id); if (section == null) settings.addSection(section = new DialogSettings(id)); return section; }/*from ww w .j av a2 s . c o m*/ return new DialogSettings(id); }
From source file:com.mentor.nucleus.bp.core.ui.dialogs.ElementSelectionFlatView.java
License:Open Source License
public ElementSelectionFlatView(Composite parent, int style, String action, boolean loneSelection, NonRootModelElement[] elements, String initialFilter, ElementSelectionDialog dialog, NonRootModelElement currentElement, boolean enableVisibilityFiltering, Package_c hostPackage) { super(parent, style); fSorter.setIgnoreCase(true);/*w w w .j a v a2 s .co m*/ fElements = elements; fSorter.sort(fElements); fLoneSelection = loneSelection; fInitialFilterText = initialFilter; fDialog = dialog; fCurrentElement = currentElement; this.enableVisibilityFiltering = enableVisibilityFiltering; this.hostPackage = hostPackage; createContent(action, elements); IDialogSettings settings = CorePlugin.getDefault().getDialogSettings(); fSettings = settings.getSection(DIALOG_SETTINGS); if (fSettings == null) { fSettings = new DialogSettings(DIALOG_SETTINGS); settings.addSection(fSettings); } else { String string = fSettings.get(CACHED_SEARCH_PATTERN); if (string != null && !string.equals("")) { fCurrentFilterText = string; fFilter.setText(string); // move the cursor to the end of the text field fFilter.setSelection(fCurrentFilterText.length(), 0); fFilter.setFocus(); patternChanged(); } } updateCheckedBoxStatus(); patternChanged(); selectCachedElement(); }
From source file:cz.hell.eclipse.run.dialog.AbstractDialog.java
License:Apache License
public void initSettings() { final IDialogSettings pluginSettings = RunPlugin.getDefault().getDialogSettings(); IDialogSettings settings = pluginSettings.getSection(DIALOG_SETTINGS); if (settings == null) { settings = new DialogSettings(DIALOG_SETTINGS); settings.put(KEY_WIDTH, DEFAULT_KEY_WIDTH); settings.put(KEY_HEIGHT, DEFAULT_KEY_HEIGHT); pluginSettings.addSection(settings); }// ww w. j av a2 s . co m this.settings = settings; }
From source file:ext.org.eclipse.jdt.internal.ui.dialogs.TypeSelectionComponent.java
License:Open Source License
public TypeSelectionComponent(Composite parent, int style, String message, boolean multi, IJavaSearchScope scope, int elementKind, String initialFilter, ITitleLabel titleLabel, TypeSelectionExtension extension) { super(parent, style); setFont(parent.getFont());//from w w w . ja v a 2 s . com fMultipleSelection = multi; fScope = scope; fInitialFilterText = initialFilter; fTitleLabel = titleLabel; fTypeSelectionExtension = extension; IDialogSettings settings = JavaPlugin.getDefault().getDialogSettings(); fSettings = settings.getSection(DIALOG_SETTINGS); if (fSettings == null) { fSettings = new DialogSettings(DIALOG_SETTINGS); settings.addSection(fSettings); } if (fSettings.get(SHOW_STATUS_LINE) == null) { fSettings.put(SHOW_STATUS_LINE, true); } createContent(message, elementKind); }
From source file:ext.org.eclipse.jdt.internal.ui.javadocexport.RecentSettingsStore.java
License:Open Source License
public void store(IDialogSettings settings) { IDialogSettings projectsSection = settings.addNewSection(SECTION_PROJECTS); //Write all project information to DialogSettings. Set<IJavaProject> keys = fPerProjectSettings.keySet(); for (Iterator<IJavaProject> iter = keys.iterator(); iter.hasNext();) { IJavaProject curr = iter.next(); IDialogSettings proj = projectsSection.addNewSection(curr.getElementName()); if (!keys.contains(curr)) { proj.put(HREF, ""); //$NON-NLS-1$ proj.put(DESTINATION, ""); //$NON-NLS-1$ proj.put(ANTPATH, ""); //$NON-NLS-1$ } else {//from w w w .j a v a 2s. c o m ProjectData data = fPerProjectSettings.get(curr); proj.put(HREF, data.getHRefs()); proj.put(DESTINATION, data.getDestination()); proj.put(ANTPATH, data.getAntPath()); } projectsSection.addSection(proj); } }
From source file:gov.nasa.ensemble.common.ui.PickListSetEditor.java
License:Open Source License
@Override protected void doStore() { try {/*from ww w .ja v a2 s . com*/ int index = combo.getSelectionIndex(); IDialogSettings settings = new DialogSettings(getPreferenceName()); settings.put(P_SET_KEYS, combo.getItems()); settings.put(P_SELECTED_SET, combo.getItem(index)); for (int i = 0; i < combo.getItemCount(); i++) { String key = combo.getItem(i); if (key.equals(ITEM_NEW)) { continue; } PickListSet set = setsByName.get(key); if (i == index) { set = new PickListSet(key, Arrays.asList(pickListEditor.getSelectedListControl().getItems())); setsByName.put(key, set); } settings.addSection(set.getSettings()); } StringWriter w = new StringWriter(); settings.save(w); getPreferenceStore().putValue(getPreferenceName(), w.toString()); } catch (Exception e) { trace.error(e.getMessage(), e); } }
From source file:gov.nasa.ensemble.common.ui.PickListSetEditor.java
License:Open Source License
public static IDialogSettings buildSettings(String settingsName, List<PickListSet> list) { IDialogSettings settings = new DialogSettings(settingsName); List<String> keys = new ArrayList<String>(); for (PickListSet set : list) { settings.addSection(set.getSettings()); keys.add(set.getName());//from w w w.j av a 2s. c om } settings.put(P_SET_KEYS, keys.toArray(new String[0])); return settings; }
From source file:net.sourceforge.fraglets.zeig.eclipse.views.ZeigView.java
License:Open Source License
protected IDialogSettings getSection(String name) { IDialogSettings settings = BrowserPlugin.getDefault().getDialogSettings(); IDialogSettings result = settings.getSection(getClass().getName()); if (result == null) { result = new DialogSettings(getClass().getName()); settings.addSection(result); }/*from www . j a v a2s . com*/ settings = result; result = settings.getSection(name); if (result == null) { result = new DialogSettings(name); settings.addSection(result); } return result; }
From source file:org.brainwy.liclipsetext.shared_ui.dialogs.DialogMemento.java
License:Open Source License
public DialogMemento(Shell parent, String dialogSettings) { IDialogSettings settings = SharedUiPlugin.getDefault().getDialogSettings(); fSettings = settings.getSection(dialogSettings); if (fSettings == null) { fSettings = new DialogSettings(dialogSettings); settings.addSection(fSettings); fSettings.put(WIDTH, 480);/*from w ww . j av a 2s . c o m*/ fSettings.put(HEIGHT, 320); } }