Package org.eclipse.jface.preference

Examples of org.eclipse.jface.preference.IPreferenceStore


        DebugUIPlugin.getDefault().getPreferenceStore()
                .addPropertyChangeListener(this);
        JFaceResources.getFontRegistry().addListener(this);

        fSashForm = new SashForm(parent, SWT.NONE);
        IPreferenceStore prefStore = DebugUIPlugin.getDefault()
                .getPreferenceStore();
        String orientString = prefStore
                .getString(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION);
        setDetailPaneOrientation(orientString);

        final TreeViewer variablesViewer = new DroolsVariablesViewer(getSashForm(),
                SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, this);
View Full Code Here


     */
    protected void buttonPressed( int buttonId )
    {
        if ( buttonId == IDialogConstants.OK_ID )
        {
            IPreferenceStore store = BrowserCommonActivator.getDefault().getPreferenceStore();
            store.setValue( BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_OBJECTCLASS_AND_MUST_ATTRIBUTES_FIRST,
                objectClassAndMustAttributesFirstButton.getSelection() );
            store.setValue( BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_OPERATIONAL_ATTRIBUTES_LAST,
                operationalAttributesLastButton.getSelection() );
            store.setValue( BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_DEFAULT_SORT_ORDER, sortDescendingButton
                .getSelection() ? BrowserCoreConstants.SORT_ORDER_DESCENDING
                : BrowserCoreConstants.SORT_ORDER_ASCENDING );
            store.setValue( BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_DEFAULT_SORT_BY, sortByCombo
                .getSelectionIndex() == 2 ? BrowserCoreConstants.SORT_BY_VALUE
                : sortByCombo.getSelectionIndex() == 1 ? BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION
                    : BrowserCoreConstants.SORT_BY_NONE );
        }

View Full Code Here

            }
            catch ( NumberFormatException nfe )
            {
            }

            IPreferenceStore store = BrowserCommonActivator.getDefault().getPreferenceStore();
            store.setValue( BrowserCommonConstants.PREFERENCE_BROWSER_LEAF_ENTRIES_FIRST, leafEntriesFirstButton
                .getSelection() );
            store.setValue( BrowserCommonConstants.PREFERENCE_BROWSER_CONTAINER_ENTRIES_FIRST,
                containerEntriesFirstButton.getSelection() );
            store.setValue( BrowserCommonConstants.PREFERENCE_BROWSER_META_ENTRIES_LAST, metaEntriesLastButton
                .getSelection() );
            store.setValue( BrowserCommonConstants.PREFERENCE_BROWSER_SORT_LIMIT, sortLimit );
            store.setValue( BrowserCommonConstants.PREFERENCE_BROWSER_SORT_ORDER,
                sortDescendingButton.getSelection() ? BrowserCoreConstants.SORT_ORDER_DESCENDING
                    : BrowserCoreConstants.SORT_ORDER_ASCENDING );
            store.setValue( BrowserCommonConstants.PREFERENCE_BROWSER_SORT_BY,
                sortByCombo.getSelectionIndex() == 2 ? BrowserCoreConstants.SORT_BY_RDN_VALUE : sortByCombo
                    .getSelectionIndex() == 1 ? BrowserCoreConstants.SORT_BY_RDN : BrowserCoreConstants.SORT_BY_NONE );
        }
        else
        {
View Full Code Here

        final Button btnHideEclipseClasspath = new Button(grpEclipseClasspathEntries, SWT.RADIO);
        btnHideEclipseClasspath.setText("Hide Eclipse classpath entries (safer)");

        // LOAD DATA
        IPreferenceStore store = getPreferenceStore();
        action = CompileErrorAction.parse(store.getString(CompileErrorAction.PREFERENCE_KEY));
        switch (action) {
        case delete :
            btnDelete.setSelection(true);
            btnSkip.setSelection(false);
            btnContinue.setSelection(false);
            break;
        case skip :
            btnDelete.setSelection(false);
            btnSkip.setSelection(true);
            btnContinue.setSelection(false);
            break;
        case build :
            btnDelete.setSelection(false);
            btnSkip.setSelection(false);
            btnContinue.setSelection(true);
            break;
        }
        classpathPref = EclipseClasspathPreference.parse(store.getString(EclipseClasspathPreference.PREFERENCE_KEY));
        switch (classpathPref) {
        case expose :
            btnExposeEclipseClasspath.setSelection(true);
            btnHideEclipseClasspath.setSelection(false);
            break;
View Full Code Here

        throw new IllegalArgumentException("Target element does not adapt to IProject");
    }

    @Override
    public boolean performOk() {
        IPreferenceStore store = getPreferenceStore();
        store.setValue(CompileErrorAction.PREFERENCE_KEY, action.name());
        store.setValue(EclipseClasspathPreference.PREFERENCE_KEY, classpathPref.name());

        return true;
    }
View Full Code Here

        .hasIntro();
  }

  private void refreshFromLocal() {
    String[] commandLineArgs = Platform.getCommandLineArgs();
    IPreferenceStore store = IDEWorkbenchPlugin.getDefault()
        .getPreferenceStore();
    boolean refresh = store
        .getBoolean(IDEInternalPreferences.REFRESH_WORKSPACE_ON_STARTUP);
    if (!refresh) {
      return;
    }
View Full Code Here

    /**
     * The default button has been pressed.
     */
    protected void performDefaults() {
        IPreferenceStore store = getIDEPreferenceStore();

        refreshButton
                .setSelection(store
                        .getDefaultBoolean(IDEInternalPreferences.REFRESH_WORKSPACE_ON_STARTUP));
        exitPromptButton
                .setSelection(store
                        .getDefaultBoolean(IDEInternalPreferences.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW));

        super.performDefaults();
    }
View Full Code Here

    /**
     * The user has pressed Ok. Store/apply this page's values appropriately.
     */
    public boolean performOk() {
        IPreferenceStore store = getIDEPreferenceStore();

        // store the refresh workspace on startup setting
        store.setValue(IDEInternalPreferences.REFRESH_WORKSPACE_ON_STARTUP,
                refreshButton.getSelection());

        // store the exit prompt on last window close setting
        store.setValue(IDEInternalPreferences.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW,
                exitPromptButton.getSelection());

        IDEWorkbenchPlugin.getDefault().savePluginPreferences();

        return super.performOk();
View Full Code Here

   * @return <code>true</code> if OK to exit, <code>false</code> if the user
   *         canceled
   * @since 3.6
   */
  static boolean promptOnExit(Shell parentShell) {
    IPreferenceStore store = IDEWorkbenchPlugin.getDefault()
        .getPreferenceStore();
    boolean promptOnExit = store
        .getBoolean(IDEInternalPreferences.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW);

    if (promptOnExit) {
      if (parentShell == null) {
        IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        if (workbenchWindow != null) {
          parentShell = workbenchWindow.getShell();
        }
      }
      if (parentShell != null) {
        parentShell.setMinimized(false);
        parentShell.forceActive();
      }
     
      String message;

      String productName = null;
      IProduct product = Platform.getProduct();
      if (product != null) {
        productName = product.getName();
      }
      if (productName == null) {
        message = IDEWorkbenchMessages.PromptOnExitDialog_message0;
      } else {
        message = NLS.bind(
            IDEWorkbenchMessages.PromptOnExitDialog_message1,
            productName);
      }

      MessageDialogWithToggle dlg = MessageDialogWithToggle
          .openOkCancelConfirm(parentShell,
              IDEWorkbenchMessages.PromptOnExitDialog_shellTitle,
              message,
              IDEWorkbenchMessages.PromptOnExitDialog_choice,
              false, null, null);
      if (dlg.getReturnCode() != IDialogConstants.OK_ID) {
        return false;
      }
      if (dlg.getToggleState()) {
        store
            .setValue(
                IDEInternalPreferences.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW,
                false);
        IDEWorkbenchPlugin.getDefault().savePluginPreferences();
      }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
   */
  public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault()
        .getPreferenceStore();
    store.setDefault(PreferenceConstants.P_INT_HITS_PER_PAINT, "10000");
    store.setDefault(PreferenceConstants.P_STRING_DEFAULT_LOG_FILE, "");
    store.setDefault(PreferenceConstants.P_STRING_DEFAULT_TYPE_FILE, "");
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.preference.IPreferenceStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.