public AddUnimplementedConstructorsDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider, CompilationUnitEditor editor, IType type) throws JavaModelException { super(parent, labelProvider, contentProvider, editor, type, true); IDialogSettings dialogSettings= JavaPlugin.getDefault().getDialogSettings(); fAddConstructorsSettings= dialogSettings.getSection(SETTINGS_SECTION); if (fAddConstructorsSettings == null) { fAddConstructorsSettings= dialogSettings.addNewSection(SETTINGS_SECTION); fAddConstructorsSettings.put(OMIT_SUPER, false); } fOmitSuper= fAddConstructorsSettings.getBoolean(OMIT_SUPER); }
private WorkingSetModelAwareSelectionDialog(Shell shell, GrayedCheckedModel model, IAdaptable[] elements) { super(shell); setTitle(WorkingSetMessages.ConfigureWorkingSetAssignementAction_WorkingSetAssignments_title); fModel= model; fElements= elements; fCreatedWorkingSets= new ArrayList<>(); fSettings= JavaPlugin.getDefault().getDialogSettingsSection(DIALOG_SETTINGS_SECTION); if (fSettings.get(SETTINGS_SHOW_VISIBLE_ONLY) == null) { fSettings.put(SETTINGS_SHOW_VISIBLE_ONLY, true); } fShowVisibleOnly= fSettings.getBoolean(SETTINGS_SHOW_VISIBLE_ONLY); }
private IDialogSettings getSettingsSection(IDialogSettings master) { IDialogSettings setting = master.getSection(STORE_SECTION); if (setting == null) { setting = master.addNewSection(STORE_SECTION); } return setting; }
private void saveBounds(Rectangle bounds) { IDialogSettings dialogBounds= fSettings.getSection(DIALOG_BOUNDS_KEY); if (dialogBounds == null) { dialogBounds= new DialogSettings(DIALOG_BOUNDS_KEY); fSettings.addSection(dialogBounds); } dialogBounds.put(X, bounds.x); dialogBounds.put(Y, bounds.y); dialogBounds.put(WIDTH, bounds.width); dialogBounds.put(HEIGHT, bounds.height); } }
protected IDialogSettings getDialogSettings() { IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings(); IDialogSettings section = settings.getSection(SETTINGS_ID); if (section == null) { section = settings.addNewSection(SETTINGS_ID); section.put(SETTING_CAUGHT_CHECKED, true); section.put(SETTING_UNCAUGHT_CHECKED, true); } return section; }
private void setLastUsedBranch() { String lastBranch = settings.get(lastBranchKey); if (lastBranch != null) branchText.setText(lastBranch); }
private void restoreWidgetValues() { IDialogSettings settings = getDialogSettings(); if (settings != null && settings.get(STORE_NESTED_PROJECTS) != null) { nestedProjects = settings.getBoolean(STORE_NESTED_PROJECTS); nestedProjectsCheckbox.setSelection(nestedProjects); lastNestedProjects = nestedProjects; } }
public void init(IDialogSettings settings) { boolean enabled= false; String[] selectedEnums= defaultSelectedEnums(); if (settings != null) { IDialogSettings section= settings.getSection(dialogSettingsSectionName()); if (section != null) { enabled= section.getBoolean(SETTINGS_ENABLED); selectedEnums= section.getArray(SETTINGS_SELECTED_ENUMS); } } applyInitialSettings(enabled, selectedEnums); }
/** * Called by the {@link ApiToolingSetupWizard} when finishing the wizard * * @return true if the page finished normally, false otherwise */ public boolean finish() { IDialogSettings settings = ApiUIPlugin.getDefault().getDialogSettings().addNewSection(SETTINGS_SECTION); settings.put(SETTINGS_REMOVECXML, removecxml.getSelection()); notifyNoDefaultProfile(); return true; }
public DeleteWorkingsetsMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex) { super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex); IDialogSettings section = getDialogSettings(); fDeleteBreakpoints = section.getBoolean(DELETE_BREAKPOINTS); fDeleteWorkingsets = section.getBoolean(DELETE_WORKINGSETS); }
@Override protected void saveWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { String[] directoryNames= settings.getArray(fStoreDestinationNamesId); if (directoryNames == null) directoryNames= new String[0]; directoryNames= addToHistory(directoryNames, getDestinationValue()); settings.put(fStoreDestinationNamesId, directoryNames); } }
public void setOmitSuper(boolean omitSuper) { if (fOmitSuper != omitSuper) { fOmitSuper= omitSuper; fGenConstructorSettings.put(OMIT_SUPER, omitSuper); } } }
public static String[] getTemplates(IDialogSettings dialogSettings) { String[] result= dialogSettings.getArray(ToStringGenerationSettings.SETTINGS_TEMPLATES); if (result != null && result.length > 0) return result; return new String[] { ToStringTemplateParser.DEFAULT_TEMPLATE }; }
/** * Saves the state of the widgets on the page */ void saveWidgetState() { IDialogSettings rootsettings = ApiUIPlugin.getDefault().getDialogSettings(); IDialogSettings settings = rootsettings.getSection(SETTINGS_SECTION); if(settings == null) { settings = rootsettings.addNewSection(SETTINGS_SECTION); } settings.put(BASELINE_STATE, this.baselineName); } }
protected IDialogSettings getDialogBoundsSettings() { String sectionName= getClass().getName() + "_dialogBounds"; //$NON-NLS-1$ IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings(); IDialogSettings section= settings.getSection(sectionName); if (section == null) section= settings.addNewSection(sectionName); return section; }
protected boolean getBooleanSetting(String key, boolean defaultValue) { String update= getRefactoringSettings().get(key); if (update != null) return Boolean.valueOf(update).booleanValue(); else return defaultValue; }
@Override protected void updatePreviewCode() { if (fDialogSettings.getBoolean(CUSTOM_PREVIEW_TOGGLE_PREFERENCE_KEY)) { String previewText= fDialogSettings.get(CUSTOM_PREVIEW_CONTENT_PREFERENCE_KEY); if (previewText == null) previewText= "// " + FormatterMessages.FormatterModifyDialog_preview_custom_contents_default_comment; //$NON-NLS-1$ fPreview.setPreviewText(previewText, CodeFormatter.K_UNKNOWN); } else { super.updatePreviewCode(); } }
public void init(IDialogSettings settings) { boolean enabled= false; String[] selectedEnums= defaultSelectedEnums(); if (settings != null) { IDialogSettings section= settings.getSection(dialogSettingsSectionName()); if (section != null) { enabled= section.getBoolean(SETTINGS_ENABLED); selectedEnums= section.getArray(SETTINGS_SELECTED_ENUMS); } } applyInitialSettings(enabled, selectedEnums); }