List of usage examples for org.eclipse.jface.preference IPreferenceStore getDefaultBoolean
boolean getDefaultBoolean(String name);
From source file:org.rubypeople.rdt.internal.ui.preferences.NewRubyProjectPreferencePage.java
License:Open Source License
protected void performDefaults() { IPreferenceStore store = getPreferenceStore(); for (int i = 0; i < fCheckBoxes.size(); i++) { Button button = (Button) fCheckBoxes.get(i); String key = (String) button.getData(); button.setSelection(store.getDefaultBoolean(key)); }//from w ww. ja va2 s . co m for (int i = 0; i < fRadioButtons.size(); i++) { Button button = (Button) fRadioButtons.get(i); String[] info = (String[]) button.getData(); button.setSelection(info[1].equals(store.getDefaultString(info[0]))); } for (int i = 0; i < fTextControls.size(); i++) { Text text = (Text) fTextControls.get(i); String key = (String) text.getData(); text.setText(store.getDefaultString(key)); } if (fJRECombo != null) { fJRECombo.select(store.getDefaultInt(LOADPATH_JRELIBRARY_INDEX)); } validateFolders(); super.performDefaults(); }
From source file:org.seasar.dblauncher.preferences.H2PreferencesPage.java
License:Apache License
protected void performDefaults() { IPreferenceStore store = getPreferenceStore(); this.useH2.setSelection(false); this.isDebug.setSelection(store.getDefaultBoolean(Constants.PREF_IS_DEBUG)); this.baseDir.setText(H2PreferencesImpl.getDefaultBaseDir(getProject())); this.dbPortNo.setText(store.getDefaultString(Constants.PREF_DB_PORTNO)); this.webPortNo.setText(store.getDefaultString(Constants.PREF_WEB_PORTNO)); super.performDefaults(); }
From source file:org.seasar.weblauncher.preferences.WebLauncherPropertyPage.java
License:Apache License
protected void performDefaults() { IPreferenceStore store = getPreferenceStore(); this.useWebLauncher.setSelection(false); this.contextName.setText(store.getDefaultString(Constants.PREF_CONTEXT_NAME)); this.baseDir.setText(store.getDefaultString(Constants.PREF_BASE_DIR)); this.webPortNo.setText(store.getDefaultString(Constants.PREF_WEB_PORTNO)); this.config.setText(store.getDefaultString(Constants.PREF_CONFIG)); this.isCheckServer.setSelection(store.getDefaultBoolean(Constants.PREF_CHECK_SERVER)); this.isDebug.setSelection(store.getDefaultBoolean(Constants.PREF_IS_DEBUG)); this.isLite.setSelection(store.getDefaultBoolean(Constants.PREF_IS_LITE)); this.useInternalWebBrowser.setSelection(store.getDefaultBoolean(Constants.PREF_USE_INTERNAL_WEBBROWSER)); }
From source file:org.spearce.egit.ui.internal.preferences.GitDecoratorPreferencePage.java
License:Open Source License
/** * Defaults was clicked. Restore the Git decoration preferences to their * default values/*from ww w .j a va 2 s .c o m*/ */ protected void performDefaults() { super.performDefaults(); IPreferenceStore store = getPreferenceStore(); recomputeAncestorDecorations .setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_RECOMPUTE_ANCESTORS)); containerRecurseLimit.setSelection(store.getDefaultInt(UIPreferences.DECORATOR_RECURSIVE_LIMIT)); fileTextFormat.setText(store.getDefaultString(UIPreferences.DECORATOR_FILETEXT_DECORATION)); folderTextFormat.setText(store.getDefaultString(UIPreferences.DECORATOR_FOLDERTEXT_DECORATION)); projectTextFormat.setText(store.getDefaultString(UIPreferences.DECORATOR_PROJECTTEXT_DECORATION)); showTracked.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_TRACKED_ICON)); showUntracked.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON)); showStaged.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_STAGED_ICON)); showConflicts.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_CONFLICTS_ICON)); showAssumeValid.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_ASSUME_VALID_ICON)); }
From source file:org.talend.designer.core.ui.action.GEFDeleteAction.java
License:Open Source License
@Override public Command createDeleteCommand(List objects) { objects = filterSameObject(objects); if (objects.isEmpty()) { return null; }/*from w w w . j a v a 2s . com*/ if (!(objects.get(0) instanceof EditPart)) { return null; } EditPart object = (EditPart) objects.get(0); // for TUP-1015 boolean isConnAttachedJLTriggerComp = false; ConnectionPart connectionPart = null; if (object instanceof ConnectionPart) { connectionPart = (ConnectionPart) object; } else if (object instanceof ConnLabelEditPart) { connectionPart = (ConnectionPart) object.getParent(); } if (connectionPart != null) { Node srcNode = null; Object srcModel = connectionPart.getSource().getModel(); if (srcModel instanceof Node) { srcNode = (Node) srcModel; } Node tarNode = null; Object tarModel = connectionPart.getTarget().getModel(); if (tarModel instanceof Node) { tarNode = (Node) tarModel; } if (srcNode == null || tarNode == null) { return null; } IProcess process = srcNode.getProcess(); if (AbstractProcessProvider.isExtensionProcessForJoblet(process)) { IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault() .getService(IJobletProviderService.class); if (service != null && (service.isTriggerNode(srcNode) || service.isTriggerNode(tarNode))) { isConnAttachedJLTriggerComp = true; } } } IPreferenceStore preferenceStore = DesignerPlugin.getDefault().getPreferenceStore(); String preKey = TalendDesignerPrefConstants.NOT_SHOW_WARNING_WHEN_DELETE_LINK_WITH_JOBLETTRIGGERLINKCOMPONENT; if (isConnAttachedJLTriggerComp && !preferenceStore.getBoolean(preKey)) { MessageDialogWithToggle jlTriggerConfirmDialog = new MessageDialogWithToggle(null, Messages.getString("GEFDeleteAction.deleteConnectionDialog.title"), //$NON-NLS-1$ null, // accept the default window icon Messages.getString("GEFDeleteAction.deleteConnectionDialog.msg"), MessageDialog.WARNING, //$NON-NLS-1$ new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0, Messages.getString("GEFDeleteAction.deleteConnectionDialog.toggleMsg"), //$NON-NLS-1$ preferenceStore.getDefaultBoolean(preKey)); jlTriggerConfirmDialog.setPrefStore(preferenceStore); jlTriggerConfirmDialog.setPrefKey(preKey); if (jlTriggerConfirmDialog.open() != IDialogConstants.YES_ID) { return null; } preferenceStore.setValue(preKey, jlTriggerConfirmDialog.getToggleState()); } List nodeParts = new ArrayList(); List noteParts = new ArrayList(); List others = new ArrayList(objects); for (Object o : objects) { if (o instanceof NodePart) { others.remove(o); Node model = (Node) ((NodePart) o).getModel(); if (model.getJobletNode() != null) { continue; } nodeParts.add(o); } else if (o instanceof NoteEditPart) { noteParts.add(o); others.remove(o); } else if (o instanceof SubjobContainerPart) { others.remove(o); SubjobContainerPart subjob = (SubjobContainerPart) o; for (Iterator iterator = subjob.getChildren().iterator(); iterator.hasNext();) { NodeContainerPart nodeContainerPart = (NodeContainerPart) iterator.next(); if (nodeContainerPart instanceof JobletContainerPart) { JobletContainer jobletCon = (JobletContainer) ((JobletContainerPart) nodeContainerPart) .getModel(); JobletContainerFigure jobletFigure = (JobletContainerFigure) ((JobletContainerPart) nodeContainerPart) .getFigure(); if (!jobletCon.isCollapsed()) { jobletFigure.doCollapse(); } } NodePart nodePart = nodeContainerPart.getNodePart(); if (nodePart != null) { nodeParts.add(nodePart); } } } } if (others.size() == 0) { // so notes & nodes only CompoundCommand cpdCmd = new CompoundCommand(); cpdCmd.setLabel(Messages.getString("GEFDeleteAction.DeleteItems")); //$NON-NLS-1$ if (nodeParts.size() != 0) { GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE); deleteReq.setEditParts(nodeParts); cpdCmd.add(((NodePart) nodeParts.get(0)).getCommand(deleteReq)); } if (noteParts.size() != 0) { GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE); deleteReq.setEditParts(noteParts); cpdCmd.add(((NoteEditPart) noteParts.get(0)).getCommand(deleteReq)); } return cpdCmd; } else { GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE); deleteReq.setEditParts(objects); Command cmd = object.getCommand(deleteReq); return cmd; } }
From source file:org.tigris.subversion.subclipse.ui.preferences.SVNDecoratorPreferencesPage.java
License:Open Source License
/** * Defaults was clicked. Restore the SVN preferences to * their default values/* www .j ava2 s.c o m*/ */ protected void performDefaults() { super.performDefaults(); IPreferenceStore store = getPreferenceStore(); Preferences corePreferences = SVNProviderPlugin.getPlugin().getPluginPreferences(); fileTextFormat.setText(store.getDefaultString(ISVNUIConstants.PREF_FILETEXT_DECORATION)); folderTextFormat.setText(store.getDefaultString(ISVNUIConstants.PREF_FOLDERTEXT_DECORATION)); projectTextFormat.setText(store.getDefaultString(ISVNUIConstants.PREF_PROJECTTEXT_DECORATION)); dateFormatText.setText(""); //$NON-NLS-1$ addedFlag.setText(store.getDefaultString(ISVNUIConstants.PREF_ADDED_FLAG)); dirtyFlag.setText(store.getDefaultString(ISVNUIConstants.PREF_DIRTY_FLAG)); externalFlag.setText(store.getDefaultString(ISVNUIConstants.PREF_EXTERNAL_FLAG)); imageShowDirty.setSelection(store.getDefaultBoolean(ISVNUIConstants.PREF_SHOW_DIRTY_DECORATION)); imageShowAdded.setSelection(store.getDefaultBoolean(ISVNUIConstants.PREF_SHOW_ADDED_DECORATION)); imageShowHasRemote.setSelection(store.getDefaultBoolean(ISVNUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); imageShowNewResource .setSelection(store.getDefaultBoolean(ISVNUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)); imageShowExternal.setSelection(store.getDefaultBoolean(ISVNUIConstants.PREF_SHOW_EXTERNAL_DECORATION)); imageShowReadOnly.setSelection(false); showDirty.setSelection(store.getDefaultBoolean(ISVNUIConstants.PREF_CALCULATE_DIRTY)); enableFontDecorators.setSelection(store.getDefaultBoolean(ISVNUIConstants.PREF_USE_FONT_DECORATORS)); setValid(true); }
From source file:org.topcased.modeler.uml.componentdiagram.preferences.ComponentRealizationPreferencePage.java
License:Open Source License
/** * @see org.topcased.modeler.preferences.AbstractEdgePreferencePage#getDefaultHiddenElements() * @generated//from w w w . ja va2s . c o m */ protected List<String> getDefaultHiddenElements() { List<String> choiceOfValues = new ArrayList<String>(); IPreferenceStore ps = getPreferenceStore(); if (!ps.getDefaultBoolean( ComponentDiagramPreferenceConstants.COMPONENTREALIZATION_STEREOTYPE_EDGE_OBJECT_DEFAULT_VISIBILITY)) { choiceOfValues.add(ComponentEdgeObjectConstants.STEREOTYPE_EDGE_OBJECT_ID); } return choiceOfValues; }
From source file:org.topcased.modeler.uml.componentdiagram.preferences.ComponentRealizationPreferencePage.java
License:Open Source License
/** * @see org.topcased.modeler.preferences.AbstractEdgePreferencePage#getDefaultVisibleElements() * @generated/*from ww w . j a v a 2 s. com*/ */ protected List<String> getDefaultVisibleElements() { List<String> choiceOfValues = new ArrayList<String>(); IPreferenceStore ps = getPreferenceStore(); if (ps.getDefaultBoolean( ComponentDiagramPreferenceConstants.COMPONENTREALIZATION_STEREOTYPE_EDGE_OBJECT_DEFAULT_VISIBILITY)) { choiceOfValues.add(ComponentEdgeObjectConstants.STEREOTYPE_EDGE_OBJECT_ID); } return choiceOfValues; }
From source file:uk.ac.diamond.scisoft.analysis.rcp.histogram.HistogramUI.java
License:Apache License
private boolean getPreferenceAutoConstrastChoice() { if (histoView != null && autoScaleSettings.get(histoView.getPartName()) != null) { return autoScaleSettings.get(histoView.getPartName()); }//from www . ja va2s . c o m IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore(); return preferenceStore.isDefault(PreferenceConstants.PLOT_VIEW_PLOT2D_AUTOCONTRAST) ? preferenceStore.getDefaultBoolean(PreferenceConstants.PLOT_VIEW_PLOT2D_AUTOCONTRAST) : preferenceStore.getBoolean(PreferenceConstants.PLOT_VIEW_PLOT2D_AUTOCONTRAST); }
From source file:uk.ac.diamond.scisoft.analysis.rcp.inspector.InspectionTab.java
License:Apache License
private boolean isAbstractPlottingXAxisAutoscaled() { IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore(); return preferenceStore.isDefault(PreferenceConstants.PLOT_VIEW_ABSTRACT_PLOTTING_X_AXIS_AUTOSCALE) ? preferenceStore .getDefaultBoolean(PreferenceConstants.PLOT_VIEW_ABSTRACT_PLOTTING_X_AXIS_AUTOSCALE) : preferenceStore.getBoolean(PreferenceConstants.PLOT_VIEW_ABSTRACT_PLOTTING_X_AXIS_AUTOSCALE); }