Example #1
0
  private void initializeState() {
    fLaunchConfigCombo.setEnabled(false);
    if (fLaunchConfigCombo.getItemCount() > 0)
      fLaunchConfigCombo.setText(fLaunchConfigCombo.getItem(0));

    if (fModel != null && fModel.getPluginBase().getId() != null) {
      IPluginExtension[] extensions = fModel.getPluginBase().getExtensions();
      for (int i = 0; i < extensions.length; i++) {
        String point = extensions[i].getPoint();
        if ("org.eclipse.core.runtime.products".equals(point)) { // $NON-NLS-1$
          String id = extensions[i].getId();
          if (id != null) {
            String full = fModel.getPluginBase().getId() + "." + id; // $NON-NLS-1$
            if (fProductCombo.indexOf(full) != -1) {
              fProductCombo.setText(full);
              fProductButton.setSelection(true);
              return;
            }
          }
        }
      }
    }

    fBasicButton.setSelection(true);

    fProductCombo.setEnabled(false);
    if (fProductCombo.getItemCount() > 0) fProductCombo.setText(fProductCombo.getItem(0));
  }
 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());
 }
Example #3
0
 /** @since 2.1 */
 protected String getSelectedCoreType() {
   int selectedIndex = fCoreTypeCombo.getSelectionIndex();
   if (fCoreTypeCombo.getItem(selectedIndex).equals(CORE_FILE)) {
     return IGDBLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_CORE_FILE;
   } else if (fCoreTypeCombo.getItem(selectedIndex).equals(TRACE_FILE)) {
     return IGDBLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_TRACE_FILE;
   } else {
     assert false : "Unknown post mortem file type"; // $NON-NLS-1$
     return IGDBLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_CORE_FILE;
   }
 }
 private void initComboFeature() {
   container = sourceFolder != null ? sourceFolder.getFolder(comboFeature.getText()) : null;
   if (featureProject == null) {
     return;
   }
   comboFeature.removeAll();
   for (String s : featureProject.getFeatureModel().getConcreteFeatureNames()) comboFeature.add(s);
   if (feature != null) {
     comboFeature.setText(feature);
   } else {
     if (comboFeature.getItemCount() > 0) comboFeature.select(0);
   }
   Object obj = selection.getFirstElement();
   if (obj instanceof IResource) {
     IResource resource = (IResource) obj;
     boolean found = false;
     while (found == false && resource.getParent() != null) {
       if (resource.getParent().equals(sourceFolder)) {
         for (int i = 0; i < comboFeature.getItemCount(); i++)
           if (comboFeature.getItem(i).equals(resource.getName())) {
             comboFeature.select(i);
             found = true;
             break;
           }
       }
       resource = resource.getParent();
     }
   }
   if (comboFeature.getItemCount() == 1
       || !featureProject.getComposer().createFolderForFeatures()) {
     comboFeature.setEnabled(false);
   } else {
     comboFeature.setEnabled(true);
   }
 }
  private void initializeContextCombo() {
    IContextManager contextManager = getContextManager();
    if (contextsCombo.getItems().length > 0) {
      contextsCombo.removeAll();
    }
    if (contextManager != null) {
      List<IContext> contexts = contextManager.getListContext();
      for (IContext context : contexts) {
        if (!Arrays.asList(contextsCombo.getItems()).contains(context.getName())) {
          contextsCombo.add(context.getName());
        }
      }

      for (int i = 0; i < contextsCombo.getItemCount(); i++) {
        IContext defaultContext = contextManager.getDefaultContext();
        if (defaultContext.getName().equals(contextsCombo.getItem(i))) {
          contextsCombo.select(i);
          break;
        }
      }
    }

    int visibleItemCount = contextsCombo.getItemCount();
    if (visibleItemCount > 20) {
      visibleItemCount = 20;
    }
    contextsCombo.setVisibleItemCount(visibleItemCount);
  }
Example #6
0
  /** Stores it current configuration in the dialog store. */
  private void writeConfiguration() {
    IDialogSettings s = getDialogSettings();
    s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive);
    s.put(STORE_IS_REG_EX_SEARCH, fIsRegExSearch);
    s.put(STORE_SEARCH_DERIVED, fSearchDerived);

    int historySize = Math.min(fPreviousSearchPatterns.size(), HISTORY_SIZE);
    s.put(STORE_HISTORY_SIZE, historySize);
    for (int i = 0; i < historySize; i++) {
      IDialogSettings histSettings = s.addNewSection(STORE_HISTORY + i);
      SearchPatternData data = fPreviousSearchPatterns.get(i);
      data.store(histSettings);
    }

    IDialogSettings extensionsSettings = s.addNewSection(STORE_EXTENSIONS);
    extensionsSettings.put(Integer.toString(0), fExtensions.getText());
    Set<String> extensions = new HashSet<String>(HISTORY_SIZE);
    extensions.add(fExtensions.getText());
    int length = Math.min(fExtensions.getItemCount(), HISTORY_SIZE - 1);
    int j = 1;
    for (int i = 0; i < length; i++) {
      String extension = fExtensions.getItem(i);
      if (extensions.add(extension)) {
        extensionsSettings.put(Integer.toString(j++), extension);
      }
    }
  }
  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);
    }
  }
  protected void onSave() {
    try {
      int channelInt = Integer.parseInt(channelName.getText());
      if (channelInt < 0 || channelInt > 256) {
        throw new Exception();
      }
      String key = getKey(String.valueOf(channelInt));
      raptorPreferenceStore.setValue(key, colorSelector.getColorValue());

      boolean channelsHasSelection = false;
      for (int i = 0; i < channels.getItemCount(); i++) {
        if (channels.getItem(i).equals(String.valueOf(channelInt))) {
          channelsHasSelection = true;
          break;
        }
      }

      if (!channelsHasSelection) {
        channels.add(String.valueOf(channelInt));
      }
    } catch (Throwable t) {
      MessageDialog.openInformation(
          Raptor.getInstance().getWindow().getShell(),
          local.getString("alert"),
          local.getString("chatConColP3"));
    }
  }
Example #9
0
 private void initializeValues() {
   int index = sdmBackendCombo.getSelectionIndex();
   if (index >= 0) {
     String backend = sdmBackendCombo.getItem(index);
     sdmBackendPathText.setText(SDMDebugCorePlugin.getDefault().getDebuggerBackendPath(backend));
     sdmPathText.setText(SDMDebugCorePlugin.getDefault().getDebuggerSDMPath(backend));
   }
 }
 private void setInputPortType(int index) {
   if (index == -1) {
     inputPortType = null;
   } else {
     String elementName = comboInput.getItem(index);
     inputPortType = getEClassFromName(elementName);
   }
 }
 @Override
 public void doit(PropertyChangeEvent evt, Display display) {
   if (!displayType.isDisposed()) {
     String type = displayType.getItem(displayType.getSelectionIndex());
     chartFrame.setChart(createChart(type));
     chartFrame.redraw();
   }
 }
Example #12
0
  @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();
  }
Example #13
0
 @Nullable
 public static String getComboSelection(Combo combo) {
   int selectionIndex = combo.getSelectionIndex();
   if (selectionIndex < 0) {
     return null;
   }
   return combo.getItem(selectionIndex);
 }
 /** change ui locale */
 private void changeUILocale() {
   Object objLanguage = comboLanguage.getData(comboLanguage.getText());
   if (objLanguage == null) {
     changeUILocale(comboLanguage.getItem(0));
   } else {
     changeUILocale(comboLanguage.getText());
   }
 }
 public ModelType getSelectedModelType() {
   int selectionIndex = modelTypesCombo.getSelectionIndex();
   ModelType modelType = null;
   if (selectionIndex >= 0) {
     String modelTypeName = modelTypesCombo.getItem(selectionIndex);
     modelType = (ModelType) modelTypeMap.get(modelTypeName);
   }
   return modelType;
 }
  public void createTags(ITagRegistry tagRegistry) {
    TagGen tagGen = null;
    String selectedTagGen = generationCombo.getItem(generationCombo.getSelectionIndex());
    String selectedTagType = tagTypeCombo.getItem(tagTypeCombo.getSelectionIndex());
    String prefix = tagPrefixText.getText();
    int number = tagNrSpinner.getSelection();
    if (selectedTagGen.equals("GEN2")) tagGen = TagGen.GEN2;
    if (selectedTagGen.equals("GEN1")) tagGen = TagGen.GEN1;

    TagCreationPattern pattern = new TagCreationPattern();
    pattern.setNumberOfTags(number);
    pattern.setTagGeneration(tagGen);
    pattern.setTagType(TagType.valueOf(selectedTagType));
    pattern.setPrefix(prefix);
    tagRegistry.createTags(pattern);

    logger.debug("Wizard created " + tagRegistry.getTags().size() + " tags.");
  }
  /** Should be called after a successful print or save. */
  private void updateSavePreferences() {

    perferenceStore.setValue(PreferenceConstants.LOGO_FILE_LOCATION, logoText.getText());
    perferenceStore.setValue(PreferenceConstants.PROJECT_TITLE, projectTitleText.getText());

    if (templateCombo.getSelectionIndex() >= 0)
      perferenceStore.setValue(
          PreferenceConstants.TEMPLATE_NAME,
          templateCombo.getItem(templateCombo.getSelectionIndex()));

    if (printerCombo.getSelectionIndex() >= 0)
      perferenceStore.setValue(
          PreferenceConstants.PRINTER_NAME, printerCombo.getItem(printerCombo.getSelectionIndex()));

    perferenceStore.setValue(
        PreferenceConstants.LABEL_CHECKBOX_1, customField1Checkbox.getSelection());
    perferenceStore.setValue(
        PreferenceConstants.LABEL_CHECKBOX_2, customField2Checkbox.getSelection());
    perferenceStore.setValue(
        PreferenceConstants.LABEL_CHECKBOX_3, customField3Checkbox.getSelection());

    perferenceStore.setValue(PreferenceConstants.LABEL_TEXT_1, customField1Text.getText());
    perferenceStore.setValue(PreferenceConstants.LABEL_TEXT_2, customField2Text.getText());
    perferenceStore.setValue(PreferenceConstants.LABEL_TEXT_3, customField3Text.getText());

    perferenceStore.setValue(
        PreferenceConstants.VALUE_CHECKBOX_1, customValue1Checkbox.getSelection());
    perferenceStore.setValue(
        PreferenceConstants.VALUE_CHECKBOX_2, customValue2Checkbox.getSelection());
    perferenceStore.setValue(
        PreferenceConstants.VALUE_CHECKBOX_3, customValue3Checkbox.getSelection());

    perferenceStore.setValue(
        PreferenceConstants.BARCODE_CHECKBOX_1, printBarcode1Checkbox.getSelection());
    perferenceStore.setValue(
        PreferenceConstants.BARCODE_CHECKBOX_2, printBarcode2Checkbox.getSelection());
    perferenceStore.setValue(
        PreferenceConstants.BARCODE_CHECKBOX_3, printBarcode3Checkbox.getSelection());

    perferenceStore.setValue(
        PreferenceConstants.SPECIMEN_TYPE_CHECKBOX, labelCustomFieldTypeCheckbox.getSelection());
    perferenceStore.setValue(
        PreferenceConstants.SPECIMEN_TYPE_TEXT, labelCustomTextField.getText());
  }
 /** @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);
 }
Example #19
0
 private void updateValues() {
   IPreferenceStore store = getPreferenceStore();
   int idx = sdmBackendCombo.getSelectionIndex();
   if (idx >= 0) {
     String backend = sdmBackendCombo.getItem(idx);
     sdmPathText.setText(store.getString(SDMPreferenceConstants.PREFS_SDM_PATH + backend));
     sdmBackendPathText.setText(
         store.getString(SDMPreferenceConstants.PREFS_SDM_BACKEND_PATH + backend));
   }
 }
  @Override
  public void init() {

    if (oldUserDB != null) {

      selGroupName = oldUserDB.getGroup_name();
      preDBInfo.setTextDisplayName(oldUserDB.getDisplay_name());
      preDBInfo
          .getComboOperationType()
          .setText(
              PublicTadpoleDefine.DBOperationType.valueOf(oldUserDB.getOperation_type())
                  .getTypeName());

      textHost.setText(oldUserDB.getHost());
      textPort.setText(oldUserDB.getPort());
      textDatabase.setText(oldUserDB.getDb());
      textUser.setText(oldUserDB.getUsers());
      textPassword.setText(oldUserDB.getPasswd());

      textJDBCOptions.setText(oldUserDB.getUrl_user_parameter());

    } else if (ApplicationArgumentUtils.isTestMode() || ApplicationArgumentUtils.isTestDBMode()) {

      preDBInfo.setTextDisplayName(getDisplayName());

      textHost.setText("127.0.0.1");
      textPort.setText("10002");
      textDatabase.setText("default");
      textUser.setText("");
      textPassword.setText("");

    } else {
      textPort.setText("10002");
    }

    Combo comboGroup = preDBInfo.getComboGroup();
    if (comboGroup.getItems().length == 0) {
      comboGroup.add(strOtherGroupName);
      comboGroup.select(0);
    } else {
      if ("".equals(selGroupName)) {
        comboGroup.setText(strOtherGroupName);
      } else {
        // 콤보 선택
        for (int i = 0; i < comboGroup.getItemCount(); i++) {
          if (selGroupName.equals(comboGroup.getItem(i))) comboGroup.select(i);
        }
      }
    }

    // Initialize otherConnectionComposite
    othersConnectionInfo.callBackUIInit(textHost.getText());

    textHost.setFocus();
  }
 public void updateValue() {
   if (noChangeButton.getSelection()) {
     value.mappingType = -1;
     value.mappingValue = "";
   } else if (staticValueButton.getSelection()) {
     value.mappingType = 0;
     value.mappingValue = staticValueField.getText();
   } else {
     value.mappingType = 1;
     value.mappingValue = databaseColumnCombo.getItem(databaseColumnCombo.getSelectionIndex());
   }
 }
 private void setOutputPortType(int index) {
   if (index == -1) {
     outputPortType = null;
   } else {
     String elementName = comboOutput.getItem(index);
     if (elementName.equals("String")) {
       outputPortType = elementName;
     } else {
       outputPortType = getEClassFromName(elementName);
     }
   }
 }
  /* (non-Javadoc)
   * @see com.aptana.ide.ui.io.IPropertiesEditor#savePropertiesTo(java.lang.Object)
   */
  public boolean savePropertiesTo(Object element) {
    Assert.isLegal(element instanceof ISFTPConnectionPoint);
    boolean updated = false;
    ISFTPConnectionPoint sftpConnectionPoint = (ISFTPConnectionPoint) element;

    String compression = compressionCombo.getItem(compressionCombo.getSelectionIndex());
    if (!sftpConnectionPoint.getCompression().equals(compression)) {
      sftpConnectionPoint.setCompression(compression);
      updated = true;
    }
    int port = Integer.parseInt(portText.getText());
    if (sftpConnectionPoint.getPort() != port) {
      sftpConnectionPoint.setPort(port);
      updated = true;
    }
    String encoding = encodingCombo.getItem(encodingCombo.getSelectionIndex());
    if (!sftpConnectionPoint.getEncoding().equals(encoding)) {
      sftpConnectionPoint.setEncoding(encoding);
      updated = true;
    }
    return updated;
  }
Example #24
0
 public static boolean setComboSelection(Combo combo, String value) {
   if (value == null) {
     return false;
   }
   int count = combo.getItemCount();
   for (int i = 0; i < count; i++) {
     if (value.equals(combo.getItem(i))) {
       combo.select(i);
       return true;
     }
   }
   return false;
 }
  public void widgetSelected(SelectionEvent e) {
    Object source = e.getSource();
    if (source.equals(sizeAttributecombo) || source.equals(sizeSpinner)) {
      boolean comboIsNone = comboIsNone(sizeAttributecombo);
      if (comboIsNone) {
        int sizeInt = sizeSpinner.getSelection();
        String size = String.valueOf(sizeInt);
        notifyListeners(size, false, STYLEEVENTTYPE.SIZE);
      } else {
        int index = sizeAttributecombo.getSelectionIndex();
        String field = sizeAttributecombo.getItem(index);
        if (field.length() == 0) {
          return;
        }
        notifyListeners(field, true, STYLEEVENTTYPE.SIZE);
      }
    } else if (source.equals(rotationSpinner) || source.equals(rotationAttributecombo)) {
      boolean comboIsNone = comboIsNone(rotationAttributecombo);
      if (comboIsNone) {
        int rotationInt = rotationSpinner.getSelection();
        String rotation = String.valueOf(rotationInt);
        notifyListeners(rotation, false, STYLEEVENTTYPE.ROTATION);
      } else {
        int index = rotationAttributecombo.getSelectionIndex();
        String field = rotationAttributecombo.getItem(index);
        if (field.length() == 0) {
          return;
        }
        notifyListeners(field, true, STYLEEVENTTYPE.ROTATION);
      }
    } else if (source.equals(xOffsetSpinner) || source.equals(yOffsetSpinner)) {
      double x = Utilities.getDoubleSpinnerSelection(xOffsetSpinner);
      double y = Utilities.getDoubleSpinnerSelection(yOffsetSpinner);

      String offsetStr = x + "," + y; // $NON-NLS-1$
      notifyListeners(offsetStr, false, STYLEEVENTTYPE.OFFSET);
    }
    checkEnablements();
  }
Example #26
0
 private void fontSizeNumberInputConfim() {
   String comboText = combo_font_size.getText();
   if (StyleCommonPropertyValue.matchesNumber(comboText)) {
     int num = Integer.valueOf(comboText);
     if (!combo_font_sizeUnit.getEnabled()) {
       combo_font_sizeUnit.setEnabled(true);
     }
     slider_font_size.setSelection(StyleCommonPropertyValue.SLIDER_SUBTRACTION_VALUE - num);
     String fontSizeValue =
         comboText + combo_font_sizeUnit.getItem(combo_font_sizeUnit.getSelectionIndex());
     styleDialog.setPropertyValue(pageName, "font-size", fontSizeValue);
     styleDialog.rePaintText("font-size", fontSizeValue, true);
   }
 }
Example #27
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.ptp.ui.preferences.AbstractPreferencePage#storeValues()
  */
 @Override
 protected void storeValues() {
   IPreferenceStore store = getPreferenceStore();
   store.setValue(SDMPreferenceConstants.SDM_DEBUG_ENABLED, debugEnabled);
   store.setValue(SDMPreferenceConstants.SDM_DEBUG_LEVEL, debugLevel);
   int index = sdmBackendCombo.getSelectionIndex();
   if (index >= 0) {
     String backend = sdmBackendCombo.getItem(index);
     store.setValue(SDMPreferenceConstants.PREFS_SDM_BACKEND, backend);
     store.setValue(
         SDMPreferenceConstants.PREFS_SDM_BACKEND_PATH + backend, sdmBackendPathText.getText());
     store.setValue(SDMPreferenceConstants.PREFS_SDM_PATH + backend, sdmPathText.getText());
   }
 }
 private void updateUi() {
   m_xmlSuite.setName(m_suiteText.getText());
   m_xmlSuite.getTests().get(0).setName(m_testText.getText());
   m_xmlSuite.setParallel(m_parallelCombo.getItem(m_parallelCombo.getSelectionIndex()));
   Integer threadCount = null;
   try {
     threadCount = Integer.parseInt(m_threadCountText.getText());
     m_xmlSuite.setThreadCount(threadCount);
   } catch (NumberFormatException ex) {
     m_xmlSuite.setThreadCount(XmlSuite.DEFAULT_THREAD_COUNT);
   }
   updateXmlSuite(m_xmlSuite);
   m_previewText.setText(m_xmlSuite.toXml());
 }
 private void onAddClicked() {
   int selectionIndex = availableConfigsCombo.getSelectionIndex();
   if (selectionIndex < 0) {
     return;
   }
   String selectedItem = availableConfigsCombo.getItem(selectionIndex);
   int response = ask("It's about to add [" + selectedItem + "]?", "Add lauch configuration");
   if (response != SWT.YES) {
     return;
   }
   selectedConfigsList.add(selectedItem);
   availableConfigsCombo.remove(selectionIndex);
   updateButtonsState();
   updateLaunchConfigurationDialog();
 }
Example #30
0
  /**
   * Returns a {@link Map} that maps an existing {@link VertexType} to a new one. If the new type is
   * not specified (i.e. left blank by the user), no mapping is inserted.
   *
   * @return A {@link Map} that maps an existing {@link VertexType} to a new one.
   */
  private Map<ObjectType, ObjectType> fillVertexTypes() {
    Map<ObjectType, ObjectType> vertexTypes = new HashMap<ObjectType, ObjectType>();
    int i = 0;
    for (ObjectType type : originalVertexTypes) {
      Combo combo = vertexComboList.get(i);
      i++;
      int index = combo.getSelectionIndex();
      if (index != -1) {
        String name = combo.getItem(index);
        ObjectType newType = newConfiguration.getVertexType(name);
        vertexTypes.put(type, newType);
      }
    }

    return vertexTypes;
  }