private void handleHyperlinkDefaultKeyModifierModified() {
    String modifiers = fHyperlinkDefaultKeyModifierText.getText();

    int stateMask = computeStateMask(modifiers);

    if (fHyperlinksEnabledCheckBox.getSelection()
        && (stateMask == -1 || (stateMask & SWT.SHIFT) != 0)) {
      if (stateMask == -1)
        fHyperlinkKeyModifierStatus =
            new StatusInfo(
                IStatus.ERROR,
                NLSUtility.format(
                    TextEditorMessages.HyperlinkKeyModifier_error_modifierIsNotValid, modifiers));
      else
        fHyperlinkKeyModifierStatus =
            new StatusInfo(
                IStatus.ERROR, TextEditorMessages.HyperlinkKeyModifier_error_shiftIsDisabled);
      applyToStatusLine(getHyperlinkKeyModifierStatus());
      fPreferencePage.setValid(getHyperlinkKeyModifierStatus().isOK());
    } else {
      fStore.setValue(
          AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, modifiers);
      fHyperlinkKeyModifierStatus = new StatusInfo();
      fPreferencePage.setValid(true);
      applyToStatusLine(fHyperlinkKeyModifierStatus);
      fHyperlinkDetectorsViewer.refresh();
      handleListSelection();
    }
  }
  private void handleHyperlinkKeyModifierModified() {
    String modifiers = fHyperlinkKeyModifierText.getText();

    int stateMask = computeStateMask(modifiers);

    if (fHyperlinksEnabledCheckBox.getSelection()
        && (stateMask == -1 || (stateMask & SWT.SHIFT) != 0)) {
      if (stateMask == -1)
        fHyperlinkKeyModifierStatus =
            new StatusInfo(
                IStatus.ERROR,
                NLSUtility.format(
                    TextEditorMessages.HyperlinkKeyModifier_error_modifierIsNotValid, modifiers));
      else
        fHyperlinkKeyModifierStatus =
            new StatusInfo(
                IStatus.ERROR, TextEditorMessages.HyperlinkKeyModifier_error_shiftIsDisabled);
      applyToStatusLine(getHyperlinkKeyModifierStatus());
      fPreferencePage.setValid(getHyperlinkKeyModifierStatus().isOK());
    } else {
      ListItem item = getSelectedItem();
      if (item != null) {
        if (item.modifierKeys != null
            || !modifiers.equalsIgnoreCase(fHyperlinkDefaultKeyModifierText.getText()))
          item.modifierKeys = modifiers;
        fHyperlinkDetectorsViewer.refresh(getSelectedItem());
        fStore.setValue(item.id + HyperlinkDetectorDescriptor.STATE_MASK_POSTFIX, stateMask);
      }
      fHyperlinkKeyModifierStatus = new StatusInfo();
      fPreferencePage.setValid(true);
      applyToStatusLine(fHyperlinkKeyModifierStatus);
    }
  }
コード例 #3
0
 @Override
 public void performDefaults() {
   super.performDefaults();
   fOverlayStore.loadDefaults();
   handleSyntaxColorListSelection();
   fPreviewViewer.invalidateTextPresentation();
 }
コード例 #4
0
  /*
   * @see PreferencePage#performDefaults()
   */
  @Override
  protected void performDefaults() {
    IPreferenceStore store = getPreferenceStore();
    for (int i = 0; i < fCheckBoxes.size(); i++) {
      Button button = fCheckBoxes.get(i);
      String key = (String) button.getData();
      button.setSelection(store.getDefaultBoolean(key));
    }
    for (int i = 0; i < fRadioButtons.size(); i++) {
      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 = fTextControls.get(i);
      String key = (String) text.getData();
      text.setText(store.getDefaultString(key));
    }
    if (fJRECombo != null) {
      fJRECombo.select(store.getDefaultInt(CLASSPATH_JRELIBRARY_INDEX));
    }

    validateFolders();
    super.performDefaults();
  }
コード例 #5
0
 public void dispose() {
   LogManager.logInfo("Disposing", this);
   super.dispose();
   stpDC.dispose();
   stpKC.dispose();
   stpEC.dispose();
   stpEE.dispose();
   stpCC.dispose();
   stpTC.dispose();
   stpSC.dispose();
   cDC.dispose();
   cKC.dispose();
   cPC.dispose();
   cCC.dispose();
   cTC.dispose();
   cSC.dispose();
   stpDC = null;
   stpKC = null;
   stpEC = null;
   stpEE = null;
   stpCC = null;
   stpTC = null;
   stpSC = null;
   cDC = null;
   cKC = null;
   cPC = null;
   cCC = null;
   cTC = null;
   cSC = null;
 }
コード例 #6
0
 @Override
 protected void performDefaults() {
   for (FieldEditor e : editors) {
     e.loadDefault();
   }
   super.performDefaults();
 }
コード例 #7
0
 @Override
 protected void performDefaults() {
   preferences.resetToDefaults();
   updateControlsFromPrefs();
   updateControlsEnabled();
   super.performDefaults();
 }
コード例 #8
0
 @Override
 protected void performApply() {
   super.performApply();
   performOk();
   doLoad();
   setInput();
 }
コード例 #9
0
  @Override
  protected void performDefaults() {

    _isModified = true;

    _spinnerRecentTags.setSelection( //
        _prefStore.getDefaultInt(ITourbookPreferences.APPEARANCE_NUMBER_OF_RECENT_TAGS));

    _spinnerRecentTourTypes.setSelection( //
        _prefStore.getDefaultInt(ITourbookPreferences.APPEARANCE_NUMBER_OF_RECENT_TOUR_TYPES));

    _chkAutoOpenTagging.setSelection(
        _prefStore.getDefaultBoolean(ITourbookPreferences.APPEARANCE_IS_TAGGING_AUTO_OPEN));
    _chkTaggingAnimation.setSelection(
        _prefStore.getDefaultBoolean(ITourbookPreferences.APPEARANCE_IS_TAGGING_ANIMATION));
    _spinnerAutoOpenDelay.setSelection(
        _prefStore.getDefaultInt(ITourbookPreferences.APPEARANCE_TAGGING_AUTO_OPEN_DELAY));

    _chkMemMonitor.setSelection(
        _prefStore.getDefaultBoolean(ITourbookPreferences.APPEARANCE_SHOW_MEMORY_MONITOR));

    super.performDefaults();

    // this do not work, I have no idea why, but with the apply button it works :-(
    //		fireModificationEvent();

    enableControls();
  }
コード例 #10
0
  @Override
  protected void performApply() {

    saveState();

    super.performApply();
  }
コード例 #11
0
 /** @see PreferencePage#createControl(Composite) */
 @Override
 public void createControl(Composite parent) {
   super.createControl(parent);
   PlatformUI.getWorkbench()
       .getHelpSystem()
       .setHelp(getControl(), IJavaHelpContextIds.NEW_JAVA_PROJECT_PREFERENCE_PAGE);
 }
コード例 #12
0
  @Override
  protected void performDefaults() {
    textMaxLineWidth.setText(Integer.toString(CorePlugin.ECL_EDITOR_LINE_WIDTH_DEFAULT));
    textIndent.setText(Integer.toString(CorePlugin.ECL_EDITOR_INDENT_DEFAULT));

    super.performDefaults();
  }
コード例 #13
0
  public boolean validate(final PreferencePage parent) {
    boolean retval = true;
    String errorMsg = null;

    if (impls.size() <= 0) {
      errorMsg = UITexts.cabalImplsBlock_noCabalInstallations;
      retval = !retval;
    } else {
      Object[] checked = viewer.getCheckedElements();
      if (checked.length > 0) {
        if (checked.length > 1) {
          errorMsg = UITexts.cabalImplsBlock_multipleImplsSelected;
          retval = !retval;
        }
      } else {
        // <= 0...
        errorMsg = UITexts.cabalImplsBlock_noCabalInstallationSelected;
        retval = !retval;
      }
    }

    if (!retval) {
      parent.setErrorMessage(errorMsg);
    }

    return retval;
  }
コード例 #14
0
  protected void performDefaults() {
    txtMaxDataSetRow.setStringValue(String.valueOf(MAX_DATASET_ROW_DEFAULT));
    txtMaxRowLevelMember.setStringValue(String.valueOf(MAX_CUBE_ROW_LEVEL_MEMBER_DEFAULT));
    txtMaxColumnLevelMember.setStringValue(String.valueOf(MAX_CUBE_COLUMN_LEVEL_MEMBER_DEFAULT));
    txtMaxInMemoryCubeSize.setStringValue(String.valueOf(MAX_IN_MEMORY_CUBE_SIZE_DEFAULT));

    super.performDefaults();
  }
コード例 #15
0
 /*
  * @see DialogPage#dispose()
  */
 @Override
 public void dispose() {
   if (fOverlayStore != null) {
     fOverlayStore.stop();
     fOverlayStore = null;
   }
   super.dispose();
 }
コード例 #16
0
  @Override
  protected void performDefaults() {
    store.setValue(VALGRIND_ENABLE, store.getDefaultBoolean(VALGRIND_ENABLE));
    enableButton.setSelection(store.getDefaultBoolean(VALGRIND_ENABLE));

    store.setValue(VALGRIND_PATH, store.getDefaultString(VALGRIND_PATH));
    binText.setText(store.getDefaultString(VALGRIND_PATH));
    super.performDefaults();
  }
コード例 #17
0
 @Override
 public boolean openPage(String pageId, Object data) {
   setPageData(data);
   setCurrentPageId(pageId);
   IPreferencePage page = getCurrentPage();
   if (page instanceof PreferencePage) {
     ((PreferencePage) page).applyData(data);
   }
   return true;
 }
  @Override
  protected void performDefaults() {
    super.performDefaults();

    IPlatform platform = null;
    if (currentSelection != NULL_SELECTION) platform = (IPlatform) currentSelection;

    selections.put(currentSelection, getDefaults(platform));
    showCurrent();
  }
コード例 #19
0
  @Override
  protected void performDefaults() {
    color.loadDefault();
    styleBold.loadDefault();
    styleItalic.loadDefault();
    styleUnderline.loadDefault();
    styleStrikethrough.loadDefault();

    super.performDefaults();
  }
 /* (non-Javadoc)
  * @see org.eclipse.jface.preference.PreferencePage#applyData(java.lang.Object)
  */
 @Override
 public void applyData(Object data) {
   if (data instanceof Map && fVariableBlock != null) {
     Object id = ((Map<?, ?>) data).get(DATA_SELECT_VARIABLE);
     if (id instanceof String) {
       fVariableBlock.setSelection((String) id);
     }
   }
   super.applyData(data);
 }
コード例 #21
0
  @Override
  protected void createPage(IPreferenceNode node) {

    super.createPage(node);
    if (this.pageData == null) {
      return;
    }
    // Apply the data if it has been set.
    IPreferencePage page = node.getPage();
    if (page instanceof PreferencePage) {
      ((PreferencePage) page).applyData(this.pageData);
    }
  }
コード例 #22
0
  /** {@inheritDoc} */
  @Override
  protected void performDefaults() {
    super.performDefaults();

    if (isControlCreated()) {
      backgroundColorField.loadDefault();
      commentColorField.loadDefault();
      commonVariableColorField.loadDefault();
      defaultColorField.loadDefault();
      keywordColorField.loadDefault();
      literalColorField.loadDefault();
      hyperlinkColorField.loadDefault();
    }
  }
コード例 #23
0
  /**
   * Apply the data to the first page if there is any.
   *
   * @param data The data to be applied
   * @param displayedIds The ids to filter to.
   * @param dialog The dialog to apply to.
   */
  private static void applyOptions(
      Object data, String[] displayedIds, FilteredPreferenceDialog dialog) {
    if (data != null) {
      dialog.setPageData(data);
      IPreferencePage page = dialog.getCurrentPage();
      if (page instanceof PreferencePage) {
        ((PreferencePage) page).applyData(data);
      }
    }

    if (displayedIds != null) {
      dialog.showOnly(displayedIds);
    }
  }
コード例 #24
0
  @Override
  protected void performDefaults() {
    typeTable.removeAll();
    colorPicker.removeAll();
    for (DBPConnectionType source : DataSourceProviderRegistry.getInstance().getConnectionTypes()) {
      addTypeToTable(source, new DBPConnectionType(source));
    }
    typeTable.select(0);
    if (selectedType != null) {
      for (int i = 0; i < typeTable.getItemCount(); i++) {
        if (typeTable.getItem(i).getData().equals(selectedType)) {
          typeTable.select(i);
          break;
        }
      }
    }
    // Ad predefined colors
    int[] colorList = {
      SWT.COLOR_WHITE,
      SWT.COLOR_BLACK,
      SWT.COLOR_RED,
      SWT.COLOR_DARK_RED,
      SWT.COLOR_GREEN,
      SWT.COLOR_DARK_GREEN,
      SWT.COLOR_YELLOW,
      SWT.COLOR_DARK_YELLOW,
      SWT.COLOR_BLUE,
      SWT.COLOR_DARK_BLUE,
      SWT.COLOR_MAGENTA,
      SWT.COLOR_DARK_MAGENTA,
      SWT.COLOR_CYAN,
      SWT.COLOR_DARK_CYAN,
      SWT.COLOR_GRAY,
      SWT.COLOR_DARK_GRAY
    };
    for (int colorCode : colorList) {
      Color color = colorPicker.getShell().getDisplay().getSystemColor(colorCode);
      colorPicker.add(null, COLOR_TEXT, color, color);
    }
    showSelectedType(getSelectedType());

    typeTable.addControlListener(
        new ControlAdapter() {
          @Override
          public void controlResized(ControlEvent e) {
            UIUtils.packColumns(typeTable, true);
          }
        });
    super.performDefaults();
  }
コード例 #25
0
 /*
  * @see PreferencePage#performDefaults()
  */
 protected void performDefaults() {
   IPreferenceStore prefs = getPreferenceStore();
   fShowMethodReturnType.setSelection(prefs.getDefaultBoolean(PREF_METHOD_RETURNTYPE));
   //		fShowMethodTypeParameters.setSelection(prefs.getDefaultBoolean(PREF_METHOD_TYPEPARAMETERS));
   fShowCategory.setSelection(prefs.getDefaultBoolean(PREF_CATEGORY));
   fShowMembersInPackageView.setSelection(prefs.getDefaultBoolean(SHOW_CU_CHILDREN));
   //
   //	fStackBrowsingViewsVertically.setSelection(prefs.getDefaultBoolean(STACK_BROWSING_VIEWS_VERTICALLY));
   //		fPackageNamePattern.setText(prefs.getDefaultString(PREF_PKG_NAME_PATTERN_FOR_PKG_VIEW));
   //		fCompressPackageNames.setSelection(prefs.getDefaultBoolean(PREF_COMPRESS_PACKAGE_NAMES));
   fFoldPackagesInPackageExplorer.setSelection(
       prefs.getDefaultBoolean(PREF_FOLD_PACKAGES_IN_PACKAGE_EXPLORER));
   fShowColoredLabels.setSelection(false);
   super.performDefaults();
 }
コード例 #26
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
  */
 @Override
 protected void performDefaults() {
   IPreferenceStore store = getPreferenceStore();
   for (Button button : fileManagerButtons) {
     if (store
         .getDefaultString(IPreferenceConstants.LINUX_FILE_MANAGER)
         .equals((String) button.getData())) {
       button.setSelection(true);
       selectedFileManager = (String) button.getData();
     } else {
       button.setSelection(false);
     }
   }
   fileManagerPath.setText(store.getDefaultString(IPreferenceConstants.LINUX_FILE_MANAGER_PATH));
   super.performDefaults();
 }
コード例 #27
0
 @Override
 protected void performDefaults() {
   prefs = new CodeAssistPreferences();
   try {
     prefs.load();
     if (autoActivateButton == null) {
       return;
     }
     autoActivateButton.setSelection(prefs.isAutoActivate());
     delayText.setText(Integer.toString(prefs.getDelayInMS()));
     erlangTriggersText.setText(prefs.getErlangTriggers());
     eDocTriggersText.setText(prefs.geteDocTriggers());
   } catch (final BackingStoreException e) {
     ErlLogger.warn(e);
   }
   super.performDefaults();
 }
コード例 #28
0
  @Override
  protected void performDefaults() {

    // merge all tracks into one tour
    _chkOneTour.setSelection(RawDataView.STATE_IS_MERGE_TRACKS_DEFAULT);

    // convert waypoints
    _chkConvertWayPoints.setSelection(RawDataView.STATE_IS_CONVERT_WAYPOINTS_DEFAULT);

    // relative/absolute distance
    final boolean isRelativeDistance =
        _prefStore.getDefaultBoolean(IPreferences.GPX_IS_RELATIVE_DISTANCE_VALUE);

    _rdoDistanceAbsolute.setSelection(isRelativeDistance == false);
    _rdoDistanceRelative.setSelection(isRelativeDistance);

    super.performDefaults();
  }
コード例 #29
0
  protected void performDefaults() {
    LogManager.logDebug("Start performDefaults:", this);
    stpDC.loadDefault();
    stpKC.loadDefault();
    stpEC.loadDefault();
    stpEE.loadDefault();
    stpCC.loadDefault();
    stpTC.loadDefault();
    stpSC.loadDefault();
    cDC.loadDefault();
    cKC.loadDefault();
    cPC.loadDefault();
    cCC.loadDefault();
    cTC.loadDefault();
    cSC.loadDefault();

    super.performDefaults();
    LogManager.logDebug("End performDefaults:", this);
  }
 /* (non-Javadoc)
  * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)
  */
 @Override
 public void setVisible(boolean visible) {
   // check if the stored settings have changed
   if (visible) {
     if (fStoredSettings != null && !fStoredSettings.equals(getCurrentSettings())) {
       fVariableBlock.refresh(null);
     }
   } else {
     if (fVariableBlock.hasChanges()) {
       String title = PreferencesMessages.ClasspathVariablesPreferencePage_savechanges_title;
       String message = PreferencesMessages.ClasspathVariablesPreferencePage_savechanges_message;
       if (MessageDialog.openQuestion(getShell(), title, message)) {
         performOk();
       }
       fVariableBlock.setChanges(false); // forget
     }
     fStoredSettings = getCurrentSettings();
   }
   super.setVisible(visible);
 }