/*
   * (non-Javadoc)
   * @see org.eclipse.jface.dialogs.Dialog#okPressed()
   */
  protected void okPressed() {
    // TODO: move to preference manager
    IEclipsePreferences prefs = new InstanceScope().getNode(PHPDebugEPLPlugin.PLUGIN_ID);

    // general
    prefs.put(XDebugPreferenceMgr.XDEBUG_PREF_PORT, portTextBox.getText());
    prefs.putBoolean(XDebugPreferenceMgr.XDEBUG_PREF_SHOWSUPERGLOBALS, showGlobals.getSelection());
    prefs.putInt(XDebugPreferenceMgr.XDEBUG_PREF_ARRAYDEPTH, variableDepth.getSelection());
    prefs.putInt(XDebugPreferenceMgr.XDEBUG_PREF_CHILDREN, maxChildren.getSelection());
    prefs.putBoolean(XDebugPreferenceMgr.XDEBUG_PREF_MULTISESSION, useMultiSession.getSelection());
    prefs.putInt(
        XDebugPreferenceMgr.XDEBUG_PREF_REMOTESESSION, acceptRemoteSession.getSelectionIndex());

    // capture output
    prefs.putInt(XDebugPreferenceMgr.XDEBUG_PREF_CAPTURESTDOUT, captureStdout.getSelectionIndex());
    prefs.putInt(XDebugPreferenceMgr.XDEBUG_PREF_CAPTURESTDERR, captureStderr.getSelectionIndex());

    // proxy
    prefs.putBoolean(XDebugPreferenceMgr.XDEBUG_PREF_USEPROXY, useProxy.getSelection());
    prefs.put(XDebugPreferenceMgr.XDEBUG_PREF_IDEKEY, idekeyTextBox.getText());
    prefs.put(XDebugPreferenceMgr.XDEBUG_PREF_PROXY, proxyTextBox.getText());
    DBGpProxyHandler.instance.configure();

    try {
      prefs.flush();
    } catch (BackingStoreException e) {
      PHPDebugEPLPlugin.logError(e);
    }
    super.okPressed();
  }
예제 #2
0
  protected void buttonPressed(int buttonId) {
    if (buttonId == RESET_ID) {
      usernameField.setText(""); // $NON-NLS-1$
      passwordField.setText(""); // $NON-NLS-1$
    } else {
      if (buttonId == Window.OK) {
        if (!workspaceCombo.getEnabled()) {
          portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace);
          return;
        }
        if (workspaceCombo.getSelectionIndex() == -1) {
          portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace);
          return;
        }

        try {
          String success =
              uploadPPK(
                  url, uname, pwd, workspaceCombo.getItem(workspaceCombo.getSelectionIndex()), ppk);
          if (success.indexOf(Messages.TAUPortalUploadDialog_Error) >= 0) {
            portalStatus.setText(success);
            return;
          }
        } catch (Exception e) {
          e.printStackTrace();
          portalStatus.setText(Messages.TAUPortalUploadDialog_UploadError);
          return;
        }
      }
      super.buttonPressed(buttonId);
    }
  }
        @Override
        public void widgetSelected(SelectionEvent e) {

          final StringBuilder sb = new StringBuilder();

          if (attribute.getSelectionIndex() != -1) {
            sb.append(attribute.getText());
            attribute.deselectAll();
          }

          if (operation.getSelectionIndex() != -1) {
            if (sb.length() > 0) {
              sb.append(" "); // $NON-NLS-1$
            }
            sb.append(operation.getText());
            operation.deselectAll();
          }

          if (value.getSelectionIndex() != -1) {
            if (sb.length() > 0) {
              sb.append(" "); // $NON-NLS-1$
            }
            sb.append(value.getText());
            value.deselectAll();
          }

          if (sb.length() > 0) {
            changed();
            text.insert(sb.toString());
            text.setFocus();
          }
        }
        @Override
        public void widgetSelected(SelectionEvent e) {
          if (attribute.isFocusControl() && attribute.getSelectionIndex() != -1) {
            String selectedAttribute = attribute.getText();
            text.insert(selectedAttribute);

            attribute.clearSelection();
            changed();
            text.setFocus();
            return;
          }

          if (operation.isFocusControl() && operation.getSelectionIndex() != -1) {
            String selectedOperation = operation.getText();
            text.insert(selectedOperation);

            operation.clearSelection();

            changed();
            text.setFocus();
            return;
          }

          if (value.isFocusControl() && value.getSelectionIndex() != -1) {
            String selectedValue = value.getText();
            text.insert(selectedValue);

            value.clearSelection();

            changed();
            text.setFocus();
            return;
          }
        }
  /**
   * Method declared on IPreferencePage.
   *
   * @return performOK
   */
  public boolean performOk() {
    // read preferences from widgets
    boolean showCount = m_showContainerCount.getSelection();

    // set preferences in store
    getPreferenceStore().setValue(Constants.SHOWCHILDCOUNT_KEY, showCount);
    getPreferenceStore()
        .setValue(
            Constants.MAPPING_MOD_KEY,
            InputCodeHelper.getInstance().getModifier()[m_mappingModifier.getSelectionIndex()]);
    getPreferenceStore()
        .setValue(
            Constants.MAPPING_WITH_PARENTS_MOD_KEY,
            InputCodeHelper.getInstance()
                .getModifier()[m_mappingWithParentsModifier.getSelectionIndex()]);

    InputComboUtil.setPrefCode(m_mappingKey, getPreferenceStore(), Constants.MAPPING_TRIGGER_KEY);
    InputComboUtil.setPrefType(
        m_mappingKey, getPreferenceStore(), Constants.MAPPING_TRIGGER_TYPE_KEY);

    InputComboUtil.setPrefCode(
        m_mappingWithParentsKey, getPreferenceStore(), Constants.MAPPING_WITH_PARENTS_TRIGGER_KEY);
    InputComboUtil.setPrefType(
        m_mappingWithParentsKey,
        getPreferenceStore(),
        Constants.MAPPING_WITH_PARENTS_TRIGGER_TYPE_KEY);
    return super.performOk();
  }
 /** called everytime a combo's or textfield's input changes */
 private void dialogChanged() {
   if (tagTypeCombo.getSelectionIndex() > -1) {
     generationCombo.setEnabled(true);
     if (generationCombo.getSelectionIndex() > -1) {
       tagNrSpinner.setEnabled(true);
       if (tagNrSpinner.getSelection() > 0) {
         if (tagTypeCombo.getText().equals(TagType.CustomEPC96.toString())) {
           tagPrefixText.setEnabled(true);
           if (tagPrefixText.getText().length() < 24) {
             String errorString = hexValidator.isValid(tagPrefixText.getText());
             if (errorString == null) {
               setErrorMessage(null);
               setPageComplete(true);
             } else {
               setErrorMessage(errorString);
               setPageComplete(false);
             }
           }
         } else {
           setPageComplete(true);
         }
       }
     }
   }
 }
예제 #7
0
  /* Set up item for fromCombo and toCombo */
  void setItemFromComboToCombo() {
    if (filterByCombo.getSelectionIndex() == 0) {
      String[] itemList = new String[Analyze.mParser.getListNodes().size() + 1];
      if (Analyze.mParser.getListNodes().size() > 0) {
        itemList[0] = "All nodes";
        for (int i = 0; i < Analyze.mParser.getListNodes().size(); i++) {
          NodeTrace node = Analyze.mParser.getListNodes().get(i);
          itemList[i + 1] = Integer.toString(node.id);
        }
        fromCombo.setItems(itemList);
        toCombo.setItems(itemList);
      }
    }
    if (filterByCombo.getSelectionIndex() == 1) {
      super.refreshLayoutComposite();
      fromCombo.setItems(new String[] {});
      toCombo.setItems(new String[] {});

      ySeries = new double[Analyze.mParser.getListNodes().size()];
      xSeries = new double[Analyze.mParser.getListNodes().size()];
      for (int i = 0; i < Analyze.mParser.getListNodes().size(); i++) {
        NodeTrace node = Analyze.mParser.getListNodes().get(i);
        xSeries[i] = node.x;
        ySeries[i] = node.y;
      }
      chartAllNode = new ChartAllNode(xSeries, ySeries);
      chartAllNode.addObserver(this);
      chartAllNode.createChart(layoutComposite);
    }
  }
  private boolean checkStatus() {
    String container = getContainerName();
    if (CoreStringUtil.isEmpty(container)) {
      currentStatus = STATUS_NO_LOCATION;
      return false;
    }
    IProject project = getTargetProject();
    if (project == null) {
      currentStatus = STATUS_NO_LOCATION;
      return false;
    } else if (!project.isOpen()) {
      currentStatus = STATUS_CLOSED_PROJECT;
      return false;
    } else {
      try {
        if (project.getNature(PluginConstants.MODEL_PROJECT_NATURE_ID) == null) {
          currentStatus = STATUS_NO_PROJECT_NATURE;
          return false;
        }
      } catch (CoreException ex) {
        currentStatus = STATUS_NO_PROJECT_NATURE;
        return false;
      }
    }

    String fileText = getFileText();
    if (fileText.length() == 0) {
      currentStatus = STATUS_NO_FILENAME;
      return false;
    }
    fileNameMessage = ModelUtilities.validateModelName(fileText, fileExtension);
    if (fileNameMessage != null) {
      currentStatus = STATUS_BAD_FILENAME;
      return false;
    }
    String fileName = getFileName();
    filePath = new Path(container).append(fileName);
    if (ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
      currentStatus = STATUS_FILE_EXISTS;
      return false;
    }
    if (metamodelCombo.getSelectionIndex() < 1) {
      currentStatus = STATUS_NO_METAMODEL;
      return false;
    }
    if (modelTypesCombo.getSelectionIndex() < 1) {
      currentStatus = STATUS_NO_TYPE;
      return false;
    }

    if (metamodelCombo.getSelectionIndex() == 6) {
      // WARN USER OF EXTENSION MODEL DEPRECATION
      currentStatus = STATUS_DEPRECATED_EXTENSION_METAMODEL;
      return true;
    }
    currentStatus = STATUS_OK;
    return true;
  }
 protected void enableFileSelection() {
   userTemplate = false;
   if (reportTypes[comboReportType.getSelectionIndex()].getReportFile() == null
       || reportTypes[comboReportType.getSelectionIndex()].getReportFile().equals("")) {
     userTemplate = true;
   }
   textReportTemplateFile.setEnabled(userTemplate);
   openReportButton.setEnabled(userTemplate);
 }
 private void storePreferences() {
   setColourMapChoicePreference(cmbColourMap.getItem(cmbColourMap.getSelectionIndex()));
   setAutoContrastLoPreference(spnAutoLoThreshold.getSelection());
   setAutoContrastHiPreference(spnAutoHiThreshold.getSelection());
   setTimeDelayPreference(spnWaitTime.getSelection());
   setPlaybackViewPreference(cmbDisplayViews.getItem(cmbDisplayViews.getSelectionIndex()));
   setPlaybackRatePreference(spnSkipImages.getSelection());
   setImageSizePreference(spnImageSize.getSelection());
 }
  @Override
  protected void okPressed() {
    if (textFile.getText().length() == 0 || scopeCombo.getSelectionIndex() < 0) {
      MessageDialog.openWarning(
          getShell(), Messages.GenerateReportDialog_5, Messages.GenerateReportDialog_6);
      return;
    }
    List<Integer> rootElements = new ArrayList<Integer>(0);
    rootElements.add(getRootElement());
    if (getRootElements() != null) rootElements.addAll(Arrays.asList(getRootElements()));
    IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
    boolean dontShow =
        preferenceStore.getBoolean(PreferenceConstants.SHOW_REPORT_VALIDATION_WARNING);
    IValidationService vService = ServiceFactory.lookupValidationService();
    boolean validationsExistant = false;
    for (Integer scopeId : rootElements) {
      if (vService.getValidations(scopeId, (Integer) null).size() > 0) {
        validationsExistant = true;
        break;
      }
    }

    if (!dontShow && validationsExistant) {
      MessageDialogWithToggle dialog =
          MessageDialogWithToggle.openYesNoQuestion(
              getParentShell(),
              Messages.GenerateReportDialog_5,
              Messages.GenerateReportDialog_21,
              Messages.GenerateReportDialog_23,
              dontShow,
              preferenceStore,
              PreferenceConstants.SHOW_REPORT_VALIDATION_WARNING);
      preferenceStore.setValue(
          PreferenceConstants.SHOW_REPORT_VALIDATION_WARNING, dialog.getToggleState());

      if (!(dialog.getReturnCode() == IDialogConstants.OK_ID
          || dialog.getReturnCode() == IDialogConstants.YES_ID)) {
        return;
      }
    }

    String f = textFile.getText();
    chosenReportType = reportTypes[comboReportType.getSelectionIndex()];
    chosenOutputFormat = chosenReportType.getOutputFormats()[comboOutputFormat.getSelectionIndex()];

    chosenReportType.setReportFile(textReportTemplateFile.getText());

    // This just appends the chosen report's extension if the existing
    // suffix does not match. Could be enhanced.
    if (!f.endsWith(chosenOutputFormat.getFileSuffix())) {
      f += "." + chosenOutputFormat.getFileSuffix(); // $NON-NLS-1$
    }

    outputFile = new File(f);
    resetScopeCombo();
    super.okPressed();
  }
 /** @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent) */
 private void handleWidgetDefaultSelected(final SelectionEvent event) {
   if (diagram != null) {
     if (combo.getSelectionIndex() >= 0) {
       setCurrentConcern(combo.getItem(combo.getSelectionIndex()));
     } else {
       setCurrentConcern(combo.getText());
     }
   }
   refresh(false);
 }
 private void setupComboOutputFormatContent() {
   comboOutputFormat.removeAll();
   for (IOutputFormat of : reportTypes[comboReportType.getSelectionIndex()].getOutputFormats()) {
     comboOutputFormat.add(of.getLabel());
   }
   ;
   comboOutputFormat.select(0);
   if (chosenReportType != null) {
     chosenOutputFormat =
         chosenReportType.getOutputFormats()[comboOutputFormat.getSelectionIndex()];
   }
 }
 /**
  * Helper method to select the current type in the type dropdown
  *
  * @param type The TypeInfo matching the radio button to selected or null to deselect them all.
  */
 private void selectType(TypeInfo type) {
   mInternalTypeUpdate = true;
   mValues.type = type;
   if (type == null) {
     if (mTypeCombo.getSelectionIndex() != -1) {
       mTypeCombo.deselect(mTypeCombo.getSelectionIndex());
     }
   } else {
     setSelectedType(type);
   }
   updateRootCombo(type);
   mInternalTypeUpdate = false;
 }
  /** Validates the content of the fields in this page */
  protected boolean validatePage() {
    boolean valid = true;
    if (advancedComposite != null && !advancedComposite.isDisposed()) {
      if (-1 == priorityCombo.getSelectionIndex()) {
        setErrorMessage(Messages.Local_Palette_Error_Priority);
        valid = false;
      }
      if ("".equals(getEditorID())) {
        setErrorMessage(Messages.Local_Palette_Error_EditorId);
        valid = false;
      }

      if ("".equals(getPaletteID())) {
        setErrorMessage(Messages.Local_Palette_Error_PaletteId);
        valid = false;
      }
    }

    if ("".equals(getPaletteName())) {
      setErrorMessage(Messages.Local_Palette_Error_Name);
      valid = false;
    }

    if (valid) {
      setMessage(null);
      setErrorMessage(null);
    }
    return valid;
  }
 /* (non-Javadoc)
  * @see org.eclipse.vtp.desktop.editors.core.elements.PrimitivePropertiesPanel#save()
  */
 public void save() {
   getElement().setName(nameText.getText());
   BeginInformationProvider ip =
       (BeginInformationProvider) ((PrimitiveElement) getElement()).getInformationProvider();
   ip.setDeclarations(declarations);
   ip.setDefaultBrand(brands.get(defaultBrandCombo.getSelectionIndex()).getId());
 }
  @Override
  public void okPressed() {
    // Eingaben pruefen
    Date d = datum.getDate();
    if (d == null || d.compareTo(new Date()) > 0) {
      setMessage("Es muss ein Datum ausgewählt werden. Darf nicht in " + "der Zukunft liegen.");
      return;
    }
    TimeTool tt;
    try {
      String sZeit = zeit.getText();
      validateTime(sZeit);
      tt = new TimeTool(sZeit);
    } catch (TimeFormatException tfe) {
      setMessage("Es muss eine gültige Startzeit (hh:mm) eingegeben " + "werden.");
      return;
    }

    // Neue kons anlegen falls noetig
    if (kons == null) {
      kons = fall.neueKonsultation();
      data = new KonsData(kons);
      ElexisEventDispatcher.fireSelectionEvent(kons);
    }

    // Eingaben speichern
    data.setKonsBeginn(tt.getTimeInMillis());
    kons.setDatum(new TimeTool(d.getTime()).toString(TimeTool.DATE_GER), false);
    data.setKonsTyp(typenI[typ.getSelectionIndex()]);
    close();
  }
 private void attributeValueModified() {
   if (listEObjects.isEmpty()) {
     attributeValueText = CurrentPreferenceHelper.getDefaultAttributeValue(comboValue.getText());
   } else {
     EObject[] tabEObjects = listEObjects.toArray(new EObject[listEObjects.size()]);
     try {
       if (comboValue.getSelectionIndex() == -1) {
         attributeValueEObject = null;
       } else {
         attributeValueEObject = tabEObjects[comboValue.getSelectionIndex()];
       }
     } catch (ArrayIndexOutOfBoundsException e) {
       RequirementCorePlugin.log(e);
     }
   }
 }
예제 #19
0
  private void updateRecognizeText(final Combo assertKind) {
    if (assertKind.getSelectionIndex() == TYPE_IMAGE_TEXT_CONTAINS) {
      AutLaunch launch = assertPanelWindow.getAut();
      Recognize recognize = TeslaFactory.eINSTANCE.createRecognize();
      // Extract image part
      Rectangle selection = getSelection();
      recognize.setX(selection.x);
      recognize.setY(selection.y);
      recognize.setWidth(selection.width);
      recognize.setHeight(selection.height);
      recognize.setImage(image);

      try {
        Object object = launch.execute(recognize);
        if (object instanceof RecognizeResponse) {
          RecognizeResponse resp = (RecognizeResponse) object;
          if (resp != null) {
            if (resp.getText() != null) {
              text.setText(resp.getText());
            } else {
              text.setText(""); // $NON-NLS-1$
            }
          }
        }
      } catch (Throwable e) {
        Q7UIPlugin.log(e);
      }
    }
  }
  private void refresh(boolean fromText) {
    String loc = comboDataBase.getText();
    int index = -1;
    for (int i = 0; i < recent.size(); ++i)
      if (recent.get(i).getValue1().equals(loc)) {
        index = i;
        break;
      }
    int lang;
    if (index >= 0 && fromText) {
      lang = recent.get(index).getValue2();
      comboLanguage.select(lang);
    } else {
      lang = comboLanguage.getSelectionIndex();
      if (lang < 0) return;
    }

    text.setText(_text[lang]);
    labelDataBase.setText(_database[lang]);
    buttonBrowse.setText(_browse[lang]);
    labelLanguage.setText(_language[lang]);
    buttonOk.setText(_ok[lang]);
    buttonCancel.setText(_cancel[lang]);
    getDialogPanel().layout(true, true);
    resize();
  }
예제 #21
0
  /**
   * ************************************************************************* Callback for radio
   * buttons or combo (selection list)
   *
   * @param e Selection event
   *     ************************************************************************
   */
  public void widgetSelected(SelectionEvent e) {
    if (e.widget instanceof Button || e.widget instanceof Combo) {
      if (e.widget == m_commitButton) {
        if (m_promptData != null) // Prompt mode
        {
          handlePromptAnswer();
        } else {
          handleCommand();
        }
      } else if (e.widget == m_resetButton) {

        m_textInput.reset();
        m_textInput.promptStart();

        if (m_promptData != null) {
          resetOptions();
        }
        updateButtons();
      } else {
        if (e.widget instanceof Combo) {
          m_selectedOption = m_optionsCombo.getSelectionIndex();
        } else {
          Button b = (Button) e.widget;
          m_selectedOption = (Integer) b.getData("ID");
        }
        // Update the text on the textual input
        m_textInput.setValue(m_promptData.getExpected().elementAt(m_selectedOption));
        updateButtons();
      }
    }
  }
 private void createDropWidget(final Composite parent) {
   parent.setLayout(new FormLayout());
   Combo combo = new Combo(parent, SWT.READ_ONLY);
   combo.setItems(
       new String[] {
         "Toggle Button",
         "Radio Button",
         "Checkbox",
         "Canvas",
         "Label",
         "List",
         "Table",
         "Tree",
         "Text"
       });
   combo.select(LABEL);
   dropControlType = combo.getSelectionIndex();
   dropControl = createWidget(dropControlType, parent, "Drop Target");
   combo.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           Object data = dropControl.getLayoutData();
           Composite parent = dropControl.getParent();
           dropControl.dispose();
           Combo c = (Combo) e.widget;
           dropControlType = c.getSelectionIndex();
           dropControl = createWidget(dropControlType, parent, "Drop Target");
           dropControl.setLayoutData(data);
           updateDropTarget();
           parent.layout();
         }
       });
   Button b = new Button(parent, SWT.CHECK);
   b.setText("DropTarget");
   b.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           dropEnabled = ((Button) e.widget).getSelection();
           updateDropTarget();
         }
       });
   b.setSelection(dropEnabled);
   FormData data = new FormData();
   data.top = new FormAttachment(0, 10);
   data.bottom = new FormAttachment(combo, -10);
   data.left = new FormAttachment(0, 10);
   data.right = new FormAttachment(100, -10);
   dropControl.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(0, 10);
   combo.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(combo, 10);
   b.setLayoutData(data);
   updateDropTarget();
 }
예제 #23
0
 protected IProject getSelectedProject() {
   final int idx = projectDropDown.getSelectionIndex();
   if (idx == -1) return null;
   String projN = getProjectNames().get(idx);
   IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(projN);
   return proj;
 }
예제 #24
0
  void showActionComposite() throws CoreException {
    // Find the selected extension
    int selectedTypeIndex = combo.getSelectionIndex();
    lastSelectedActionTypeIndex = selectedTypeIndex;
    tracepointAction = tracepointActions.get(selectedTypeIndex);

    actionPage = actionPages[selectedTypeIndex];
    if (actionPage == null) {
      actionPages[selectedTypeIndex] = getActionPage(tracepointActions.get(selectedTypeIndex));
      actionPage = actionPages[selectedTypeIndex];
      if (actionPage instanceof WhileSteppingActionPage) {
        ((WhileSteppingActionPage) actionPage).setParentGlobalList(parentGlobalList);
      }
    }
    if (actionComposites[selectedTypeIndex] == null) {
      Composite actionComposite =
          actionPages[selectedTypeIndex].createComposite(tracepointAction, actionArea, SWT.NONE);
      actionComposites[selectedTypeIndex] = actionComposite;
    }
    actionName = tracepointAction.getName();

    actionNameTextWidget.setText(actionName);
    StackLayout stacklayout = (StackLayout) actionArea.getLayout();
    stacklayout.topControl = actionComposites[selectedTypeIndex];
    actionArea.layout();
  }
  /*
   * @see IPreferencePage#performOk()
   */
  @Override
  public boolean performOk() {
    IPreferenceStore store = getPreferenceStore();
    for (int i = 0; i < fCheckBoxes.size(); i++) {
      Button button = fCheckBoxes.get(i);
      String key = (String) button.getData();
      store.setValue(key, button.getSelection());
    }
    for (int i = 0; i < fRadioButtons.size(); i++) {
      Button button = fRadioButtons.get(i);
      if (button.getSelection()) {
        String[] info = (String[]) button.getData();
        store.setValue(info[0], info[1]);
      }
    }
    for (int i = 0; i < fTextControls.size(); i++) {
      Text text = fTextControls.get(i);
      String key = (String) text.getData();
      store.setValue(key, text.getText());
    }

    if (fJRECombo != null) {
      store.setValue(CLASSPATH_JRELIBRARY_INDEX, fJRECombo.getSelectionIndex());
    }

    JavaPlugin.flushInstanceScope();
    return super.performOk();
  }
  public void createProjectControls(Composite parent, int nColumns) {

    Label locationLabel = new Label(parent, SWT.NONE);
    locationLabel.setText("Project:");
    locationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));

    projectCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
    GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    data.horizontalSpan = 2;
    projectCombo.setLayoutData(data);
    projectCombo.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            projectText = projectCombo.getText();
            projectChanged();
          }
        });
    gwtProjects = Util.getGwtProjects();
    for (int i = 0; i < gwtProjects.length; i++) {
      IJavaProject gwtProject = gwtProjects[i];
      String name = gwtProject.getProject().getName();
      projectCombo.add(name);
      if (name.equals(selectedProject)) projectCombo.select(i);
    }
    if (projectCombo.getSelectionIndex() == -1) projectCombo.select(0);

    new Label(parent, SWT.NONE);
  }
예제 #27
0
  protected void guardar() {

    try {
      validar();

      Concepto c;
      if (concepto == null) c = new Concepto();
      else c = concepto;
      c.setConcepto(txConcepto.getText());
      c.setCosto(rubros.get(cbRubro.getSelectionIndex()));

      // Guardar el concepto

      contable.guardarConcepto(c);

      result = c;
      shlEditarConcepto.close();

    } catch (Exception e) {
      // TODO Capturar la excepción de duplicado y enviarlo en un mensaje
      // adecuado
      MessageBox mb = new MessageBox(shlEditarConcepto, SWT.ICON_WARNING);
      mb.setMessage(e.getMessage());
      mb.open();
    }
  }
예제 #28
0
파일: LoginDialog.java 프로젝트: oeli/yafra
  @Override
  protected void okPressed() {

    if (combo.getItem(combo.getSelectionIndex()).length() != 0)
      server = combo.getItem(combo.getSelectionIndex());
    else server = new String("localhost"); // fallback to localhost
    pwd = Ipassword.getText();
    if (pwd.equals("")) {
      MessageDialog.openError(getShell(), "Invalid password", "Password field must not be blank.");
      return;
    }
    if (server.equals("")) {
      MessageDialog.openError(getShell(), "Invalid Server", "Server field must not be blank.");
      return;
    }
    super.okPressed();
  }
예제 #29
0
 private Target createTarget() {
   Target result = null;
   int selection = targetCombo.getSelectionIndex();
   if (selection > -1) {
     result = (Target) targets.get(selection);
   }
   return result;
 }
예제 #30
0
파일: UIUtils.java 프로젝트: ralic/dbeaver
 @Nullable
 public static String getComboSelection(Combo combo) {
   int selectionIndex = combo.getSelectionIndex();
   if (selectionIndex < 0) {
     return null;
   }
   return combo.getItem(selectionIndex);
 }