public void initialize() {
    String modifierString =
        fStore.getString(
            AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER);
    if (computeStateMask(modifierString) == -1) {
      // Fix possible illegal modifier string
      int stateMask =
          fStore.getInt(
              AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER_MASK);
      if (stateMask == -1) fHyperlinkDefaultKeyModifierText.setText(""); // $NON-NLS-1$
      else fHyperlinkDefaultKeyModifierText.setText(getModifierString(stateMask));
    } else fHyperlinkDefaultKeyModifierText.setText(modifierString);
    boolean isEnabled =
        fStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED);
    fHyperlinksEnabledCheckBox.setSelection(isEnabled);
    fHyperlinkKeyModifierText.setEnabled(isEnabled);
    fHyperlinkDefaultKeyModifierText.setEnabled(isEnabled);

    fListModel = createListModel();
    fHyperlinkDetectorsViewer.setInput(fListModel);
    fHyperlinkDetectorsViewer.setAllChecked(false);
    fHyperlinkDetectorsViewer.setCheckedElements(getCheckedItems());
    fHyperlinkDetectorsViewer.getTable().setEnabled(isEnabled);

    fHyperlinkKeyModifierText.setText(""); // $NON-NLS-1$

    handleListSelection();
  }
 private void updateServerRolesUI(boolean enable) {
   serverUrlText.setEnabled(enable);
   userNameText.setEnabled(enable);
   passwordText.setEnabled(enable);
   roleNamePatternText.setEnabled(enable);
   userRolesTable.setEnabled(enable);
   getRolesButton.setEnabled(enable);
 }
 private void updateAuthGroup() {
   Protocol p = getProtocol();
   if (p != null) {
     hostText.setEnabled(p.hasHost());
     portText.setEnabled(p.hasPort());
     UIUtils.setEnabledRecursively(authGroup, p.canAuthenticate());
   }
 }
 private void setUILocked(boolean locked) {
   if (main == null || main.isDisposed()) {
     return;
   }
   usernameText.setEnabled(!locked);
   passwordText.setEnabled(!locked);
   testButton.setEnabled(!locked);
   createAccountButton.setEnabled(!locked);
 }
  private void validateFolders() {
    boolean useFolders = fFoldersAsSourceFolder.getSelection();

    fSrcFolderNameText.setEnabled(useFolders);
    fBinFolderNameText.setEnabled(useFolders);
    fSrcFolderNameLabel.setEnabled(useFolders);
    fBinFolderNameLabel.setEnabled(useFolders);
    if (useFolders) {
      String srcName = fSrcFolderNameText.getText();
      String binName = fBinFolderNameText.getText();
      if (srcName.length() + binName.length() == 0) {
        updateStatus(
            new StatusInfo(
                IStatus.ERROR,
                PreferencesMessages.NewJavaProjectPreferencePage_folders_error_namesempty));
        return;
      }
      IWorkspace workspace = JavaPlugin.getWorkspace();
      IProject dmy = workspace.getRoot().getProject("project"); // $NON-NLS-1$

      IStatus status;
      IPath srcPath = dmy.getFullPath().append(srcName);
      if (srcName.length() != 0) {
        status = workspace.validatePath(srcPath.toString(), IResource.FOLDER);
        if (!status.isOK()) {
          String message =
              Messages.format(
                  PreferencesMessages.NewJavaProjectPreferencePage_folders_error_invalidsrcname,
                  status.getMessage());
          updateStatus(new StatusInfo(IStatus.ERROR, message));
          return;
        }
      }
      IPath binPath = dmy.getFullPath().append(binName);
      if (binName.length() != 0) {
        status = workspace.validatePath(binPath.toString(), IResource.FOLDER);
        if (!status.isOK()) {
          String message =
              Messages.format(
                  PreferencesMessages.NewJavaProjectPreferencePage_folders_error_invalidbinname,
                  status.getMessage());
          updateStatus(new StatusInfo(IStatus.ERROR, message));
          return;
        }
      }
      IClasspathEntry entry = JavaCore.newSourceEntry(srcPath);
      status =
          JavaConventions.validateClasspath(
              JavaCore.create(dmy), new IClasspathEntry[] {entry}, binPath);
      if (!status.isOK()) {
        String message = PreferencesMessages.NewJavaProjectPreferencePage_folders_error_invalidcp;
        updateStatus(new StatusInfo(IStatus.ERROR, message));
        return;
      }
    }
    updateStatus(new StatusInfo()); // set to OK
  }
예제 #6
0
 public void setFormEnabled(boolean enabled) {
   logger.info("AddTodoView set enabled to: " + enabled);
   saveChanges.setEnabled(enabled);
   statusText.setEnabled(enabled);
   priorityText.setEnabled(enabled);
   titleText.setEnabled(enabled);
   dateTime.setEnabled(enabled);
   descriptionText.setEnabled(enabled);
 }
  private void updateUI(Event event) {
    if (((Button) event.widget).getText().equals("Define Inline")) {
      inlineUserRolesText.setEnabled(true);
      updateServerRolesUI(false);

    } else {
      updateServerRolesUI(true);
      inlineUserRolesText.setEnabled(false);
    }
  }
 private void handleListSelection() {
   ListItem item = getSelectedItem();
   if (item == null) {
     fHyperlinkKeyModifierText.setEnabled(false);
     return;
   }
   fHyperlinkKeyModifierText.setEnabled(fHyperlinkDetectorsViewer.getChecked(item));
   String text = item.modifierKeys;
   if (text == null) text = fHyperlinkDefaultKeyModifierText.getText();
   fHyperlinkKeyModifierText.setText(text);
 }
  /**
   * We handle radio button selections by enabling and disabling various controls. There are only
   * two sources of these events that we care about.
   */
  @Override
  protected void radioButtonSelected(Object source) {
    if (source == existingApplicationRadioButton || source == createNewApplicationRadioButton) {
      boolean isCreatingNewApplication =
          (Boolean) createNewApplicationRadioButtonObservable.getValue();

      existingApplicationCombo.setEnabled(!isCreatingNewApplication);
      newApplicationNameText.setEnabled(isCreatingNewApplication);
      newApplicationDescriptionText.setEnabled(isCreatingNewApplication);
    }
  }
예제 #10
0
 protected void updateTemaplteCheck() {
   if (!applyTemplateCheck.getSelection()) {
     templateCombo.setEnabled(false);
     templateCodeText.setEnabled(false);
     outputFileText.setEnabled(false);
   } else {
     templateCombo.setEnabled(true);
     templateCodeText.setEnabled(true);
     outputFileText.setEnabled(true);
   }
 }
 protected void updateFilename() {
   if (fFileNameDefault.getSelection()) {
     fFileName.setEnabled(true);
     if (!getOption(NAME, "").equals("")) {
       fFileName.setText(getOption(NAME, "") + fFileExt);
     } else {
       fFileName.setText("");
     }
     fFileName.setEnabled(false);
   }
 }
예제 #12
0
 private void setEnabled_(boolean enabled) {
   jobChainGroup.setEnabled(enabled);
   parameterGroup.setEnabled(enabled);
   comboLanguage.setEnabled(enabled);
   txtJobchainNote.setEnabled(enabled);
   txtName.setEnabled(enabled);
   txtValue.setEnabled(enabled);
   tableParams.setEnabled(enabled);
   txtParamNote.setEnabled(enabled);
   butRemove.setEnabled(enabled);
 }
예제 #13
0
 private void updateGroup(boolean enabled) {
   fKeystoreLabel.setEnabled(enabled);
   fKeystoreText.setEnabled(enabled);
   fBrowseButton.setEnabled(enabled);
   fAliasLabel.setEnabled(enabled);
   fAliasText.setEnabled(enabled);
   fPasswordLabel.setEnabled(enabled);
   fPasswordText.setEnabled(enabled);
   fKeypassLabel.setEnabled(enabled);
   fKeypassText.setEnabled(enabled);
 }
  private void switchToSourceKind(@NonNull SourceKind kind, boolean broadcastChanges) {
    fRadioBinaryFile.setSelection(kind == SourceKind.BINARY);
    fTextBinaryFile.setEnabled(kind == SourceKind.BINARY);
    fButtonBrowseBinary.setEnabled(kind == SourceKind.BINARY);

    fRadioMappingFile.setSelection(kind == SourceKind.MAPPING);
    fTextMappingFile.setEnabled(kind == SourceKind.MAPPING);
    fButtonBrowseMapping.setEnabled(kind == SourceKind.MAPPING);
    if (broadcastChanges) {
      broadcastChanges();
    }
  }
예제 #15
0
 private void updateContents() {
   if (mBufferData != null) {
     mTextControl.setText(
         GLUtils.formatData(mBufferData, GLEnum.valueOf(mDisplayFormatCombo.getText())));
     mTextControl.setEnabled(true);
     mDisplayFormatCombo.setEnabled(true);
   } else {
     mTextControl.setText("");
     mTextControl.setEnabled(false);
     mDisplayFormatCombo.setEnabled(false);
   }
 }
예제 #16
0
  /**
   * Handle player.
   *
   * @param player the player
   */
  private void handlePlayer(IPlayer player, IGameEntry entry) {
    if (player != null) {
      TableViewerColumn column;
      // mark column
      column = this.playerColumn.get(player);
      TableViewerColumn c;
      for (IPlayer p : this.game.getPlayers()) {
        c = this.playerColumn.get(p);
        if (c.equals(column)) {
          c.getColumn().setImage(ProtoPlugin.getImage(ISharedImages.IMG_ARROW_DECO));
        } else {
          c.getColumn().setImage(null);
        }
      }
      // enable/disable inputs & focus
      Text playerInputTxt = this.playerScoreInput.get(player);
      for (Text inputTxt : this.playerScoreInput.values()) {
        if (playerInputTxt.equals(inputTxt)) {
          inputTxt.setEnabled(true);
          inputTxt.setBackground(
              OpenDartsFormsToolkit.getToolkit()
                  .getColors()
                  .getColor(OpenDartsFormsToolkit.COLOR_ACTIVE));
          inputTxt.setFocus();
        } else {
          inputTxt.setEnabled(false);
          inputTxt.setText("");
          inputTxt.setBackground(
              OpenDartsFormsToolkit.getToolkit()
                  .getColors()
                  .getColor(OpenDartsFormsToolkit.COLOR_INACTIVE));
        }
      }

      // IA playing
      if (player.isComputer()) {
        ThreeDartsComputerDialog computerThrow =
            new DartsComputerX01Dialog(
                this.getSite().getShell(), player, this.game, (GameX01Entry) entry);
        computerThrow.open();

        IDartsThrow dartThrow = computerThrow.getComputerThrow();
        if (dartThrow instanceof WinningX01DartsThrow) {
          this.gameService.addWinningPlayerThrow(this.game, player, dartThrow);
        } else {
          this.gameService.addPlayerThrow(this.game, player, dartThrow);
        }
      }
    }
  }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.ecoretools.design.properties.ecore.parts.EClassPropertiesEditionPart#setName(String
  *     newValue)
  */
 public void setName(String newValue) {
   if (newValue != null) {
     name.setText(newValue);
   } else {
     name.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState = isReadOnly(EcoreViewsRepository.EClass.Properties.name);
   if (eefElementEditorReadOnlyState && name.isEnabled()) {
     name.setEnabled(false);
     name.setToolTipText(EcoreMessages.EClass_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !name.isEnabled()) {
     name.setEnabled(true);
   }
 }
예제 #18
0
 /**
  * Allows this entire block to be enabled/disabled
  *
  * @param enabled whether to enable it or not
  */
 protected void setEnabled(boolean enabled) {
   fUseDefaultDirButton.setEnabled(enabled);
   fUseOtherDirButton.setEnabled(enabled);
   if (fOtherWorkingText.isEnabled()) {
     fOtherWorkingText.setEnabled(enabled);
     fWorkspaceButton.setEnabled(enabled);
     fVariablesButton.setEnabled(enabled);
     fFileSystemButton.setEnabled(enabled);
   }
   // in the case where the 'other' text is selected and we want to enable
   if (fUseOtherDirButton.getSelection() && enabled == true) {
     fOtherWorkingText.setEnabled(enabled);
   }
 }
예제 #19
0
  @Override
  public void performDefaults() {
    // Missing builder info
    if (fBuildInfo == null) {
      return;
    }
    IMakeBuilderInfo info;
    if (getContainer().getProject() != null) {
      info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, false);
    } else {
      info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, true);
    }
    if (info.isStopOnError()) stopOnErrorButton.setSelection(true);
    else stopOnErrorButton.setSelection(false);
    if (info.getBuildCommand() != null) {
      StringBuffer cmd = new StringBuffer(info.getBuildCommand().toOSString());
      if (!info.isDefaultBuildCmd()) {
        String args = info.getBuildArguments();
        if (args != null && !args.equals("")) { // $NON-NLS-1$
          cmd.append(" "); // $NON-NLS-1$
          cmd.append(args);
        }
      }
      buildCommand.setText(cmd.toString());
    }
    if (info.isDefaultBuildCmd()) {
      buildCommand.setEnabled(false);
      argumentVariablesButton.setEnabled(false);
      stopOnErrorButton.setEnabled(true);
    } else {
      buildCommand.setEnabled(true);
      argumentVariablesButton.setEnabled(true);
      stopOnErrorButton.setEnabled(false);
    }

    defButton.setSelection(info.isDefaultBuildCmd());

    autoButton.setSelection(info.isAutoBuildEnable());
    autoVariableButton.setEnabled(info.isAutoBuildEnable());
    targetAuto.setEnabled(info.isAutoBuildEnable());
    targetAuto.setText(info.getAutoBuildTarget());
    incrButton.setSelection(info.isIncrementalBuildEnabled());
    incrVariableButton.setEnabled(info.isIncrementalBuildEnabled());
    targetIncr.setText(info.getIncrementalBuildTarget());
    targetIncr.setEnabled(info.isIncrementalBuildEnabled());
    cleanButton.setSelection(info.isCleanBuildEnabled());
    cleanVariableButton.setEnabled(info.isCleanBuildEnabled());
    targetClean.setText(info.getCleanBuildTarget());
    targetClean.setEnabled(info.isCleanBuildEnabled());
  }
  /**
   * Enable/selects widgets depending on the group specified.
   *
   * @param group - group to enable.
   */
  private void setKernelEnablements(KernelGroupEnum group) {
    fTracepointsActivateButton.setSelection(group == KernelGroupEnum.TRACEPOINTS);
    fTracepointsViewer.getTree().setEnabled(group == KernelGroupEnum.TRACEPOINTS);

    fSysCallsActivateButton.setSelection(group == KernelGroupEnum.SYSCALLS);

    fProbeActivateButton.setSelection(group == KernelGroupEnum.PROBE);
    fProbeEventNameText.setEnabled(group == KernelGroupEnum.PROBE);
    fProbeText.setEnabled(group == KernelGroupEnum.PROBE);

    fFunctionActivateButton.setSelection(group == KernelGroupEnum.FUNCTION);
    fFunctionEventNameText.setEnabled(group == KernelGroupEnum.FUNCTION);
    fFunctionText.setEnabled(group == KernelGroupEnum.FUNCTION);
  }
 /**
  * {@inheritDoc}
  *
  * @see net.certware.sacm.SACM.Evidence.parts.HasRoleInPropertiesEditionPart#setId(String
  *     newValue)
  */
 public void setId(String newValue) {
   if (newValue != null) {
     id.setText(newValue);
   } else {
     id.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(EvidenceViewsRepository.HasRoleIn.Properties.id);
   if (eefElementEditorReadOnlyState && id.isEnabled()) {
     id.setEnabled(false);
     id.setToolTipText(EvidenceMessages.HasRoleIn_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !id.isEnabled()) {
     id.setEnabled(true);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see net.certware.sacm.SACM.Evidence.parts.MethodPropertiesEditionPart#setContent(String
  *     newValue)
  */
 public void setContent(String newValue) {
   if (newValue != null) {
     content.setText(newValue);
   } else {
     content.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(EvidenceViewsRepository.Method.Properties.content);
   if (eefElementEditorReadOnlyState && content.isEnabled()) {
     content.setEnabled(false);
     content.setToolTipText(EvidenceMessages.Method_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !content.isEnabled()) {
     content.setEnabled(true);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.filters.parts.ConcreteReferenceTargetSample2PropertiesEditionPart#setName(String
  *     newValue)
  */
 public void setName(String newValue) {
   if (newValue != null) {
     name.setText(newValue);
   } else {
     name.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(FiltersViewsRepository.ConcreteReferenceTargetSample2.Properties.name);
   if (eefElementEditorReadOnlyState && name.isEnabled()) {
     name.setEnabled(false);
     name.setToolTipText(FiltersMessages.ConcreteReferenceTargetSample2_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !name.isEnabled()) {
     name.setEnabled(true);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.obeonetwork.dsl.environment.parts.BindingElementPropertiesEditionPart#setBindingExpression(String
  *     newValue)
  */
 public void setBindingExpression(String newValue) {
   if (newValue != null) {
     bindingExpression.setText(newValue);
   } else {
     bindingExpression.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(EnvironmentViewsRepository.BindingElement.Properties.bindingExpression);
   if (eefElementEditorReadOnlyState && bindingExpression.isEnabled()) {
     bindingExpression.setEnabled(false);
     bindingExpression.setToolTipText(EnvironmentMessages.BindingElement_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !bindingExpression.isEnabled()) {
     bindingExpression.setEnabled(true);
   }
 }
  private void handleHoverListSelection() {
    int i = fHoverTable.getSelectionIndex();

    if (i == -1) {
      if (fHoverTable.getSelectionCount() == 0) fModifierEditor.setEnabled(false);
      return;
    }

    boolean enabled = fHoverConfigs[i].fIsEnabled;
    fModifierEditor.setEnabled(enabled);
    fModifierEditor.setText(fHoverConfigs[i].fModifierString);
    String description = getContributedHovers()[i].getDescription();
    if (description == null) description = ""; // $NON-NLS-1$
    fDescription.setText(description);
  }
 /**
  * {@inheritDoc}
  *
  * @see org.obeonetwork.dsl.cinematic.view.parts.ViewElementPropertiesEditionPart#setLabel(String
  *     newValue)
  */
 public void setLabel(String newValue) {
   if (newValue != null) {
     label.setText(newValue);
   } else {
     label.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(ViewViewsRepository.ViewElement.Properties.label);
   if (eefElementEditorReadOnlyState && label.isEnabled()) {
     label.setEnabled(false);
     label.setToolTipText(ViewMessages.ViewElement_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !label.isEnabled()) {
     label.setEnabled(true);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see net.certware.verification.checklist.parts.ItemPropertiesEditionPart#setComment(String
  *     newValue)
  */
 public void setComment(String newValue) {
   if (newValue != null) {
     comment.setText(newValue);
   } else {
     comment.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(ChecklistViewsRepository.Item.Properties.comment);
   if (eefElementEditorReadOnlyState && comment.isEnabled()) {
     comment.setEnabled(false);
     comment.setToolTipText(ChecklistMessages.Item_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !comment.isEnabled()) {
     comment.setEnabled(true);
   }
 }
 private void updateEnablement() {
   if (!enableMonitoring.getSelection()) {
     logFileText.setEnabled(false);
     enableSubmission.setEnabled(false);
     submissionTime.setEnabled(false);
   } else {
     logFileText.setEnabled(true);
     enableSubmission.setEnabled(true);
     if (!enableSubmission.getSelection()) {
       submissionTime.setEnabled(false);
     } else {
       submissionTime.setEnabled(true);
     }
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.obeonetwork.dsl.cinematic.flow.parts.SubflowStatePropertiesEditionPart#setDescription(String
  *     newValue)
  */
 public void setDescription(String newValue) {
   if (newValue != null) {
     description.setText(newValue);
   } else {
     description.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(FlowViewsRepository.SubflowState.Properties.description);
   if (eefElementEditorReadOnlyState && description.isEnabled()) {
     description.setEnabled(false);
     description.setToolTipText(FlowMessages.SubflowState_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !description.isEnabled()) {
     description.setEnabled(true);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see org.obeonetwork.graal.parts.TransitionPropertiesEditionPart#setGuard(String newValue)
  */
 public void setGuard(String newValue) {
   if (newValue != null) {
     guard.setText(newValue);
   } else {
     guard.setText(""); // $NON-NLS-1$
   }
   boolean eefElementEditorReadOnlyState =
       isReadOnly(GraalViewsRepository.Transition.Properties.guard);
   if (eefElementEditorReadOnlyState && guard.isEnabled()) {
     guard.setEnabled(false);
     guard.setToolTipText(GraalMessages.Transition_ReadOnly);
   } else if (!eefElementEditorReadOnlyState && !guard.isEnabled()) {
     guard.setEnabled(true);
   }
 }