Esempio n. 1
0
  private void resetSettings() {
    downloadDirectoryTextField.setText(Groovesquid.getConfig().getDownloadDirectory());
    maxParallelDownloadsSpinner.setValue(Groovesquid.getConfig().getMaxParallelDownloads());
    fileNameSchemeTextField.setText(Groovesquid.getConfig().getFileNameScheme());

    String[] downloadCompleteActions = Config.DownloadComplete.names();
    DefaultComboBoxModel downloadCompleteComboBoxModel = new DefaultComboBoxModel();
    downloadCompletedComboBox.setModel(downloadCompleteComboBoxModel);
    for (String downloadCompleteAction : downloadCompleteActions) {
      downloadCompleteComboBoxModel.addElement(I18n.getLocaleString(downloadCompleteAction));
    }
    downloadCompletedComboBox.setSelectedIndex(Groovesquid.getConfig().getDownloadComplete());

    String[] startTabs = Config.StartTab.names();
    DefaultComboBoxModel startTabComboBoxModel = new DefaultComboBoxModel();
    startTabComboBox.setModel(startTabComboBoxModel);
    for (String startTab : startTabs) {
      startTabComboBoxModel.addElement(I18n.getLocaleString(startTab));
    }
    startTabComboBox.setSelectedIndex(Groovesquid.getConfig().getStartTab());

    String[] fileExistsActions = Config.FileExists.names();
    DefaultComboBoxModel fileExistsComboBoxModel = new DefaultComboBoxModel();
    fileExistsComboBox.setModel(fileExistsComboBoxModel);
    for (String fileExistsAction : fileExistsActions) {
      fileExistsComboBoxModel.addElement(I18n.getLocaleString(fileExistsAction));
    }
    fileExistsComboBox.setSelectedIndex(Groovesquid.getConfig().getFileExists());

    if (Groovesquid.getConfig().getProxyHost() != null
        && Groovesquid.getConfig().getProxyPort() != null) {
      proxyHostTextField.setText(Groovesquid.getConfig().getProxyHost());
      proxyPortTextField.setText(Groovesquid.getConfig().getProxyPort().toString());
    }
  }
  private void fillGUI() {
    Object[] attributes;
    boolean enabled;
    if (context != null) {
      attributes = this.context.getAttributes().toArray();
      enabled = true;
    } else {
      attributes = new Object[] {"No context available"};
      enabled = false;
    }

    sequenceColumnChooser.setModel(new DefaultComboBoxModel(attributes));
    sequenceColumnChooser.setEnabled(enabled);

    timelineColumnChooser.setModel(new DefaultComboBoxModel(attributes));
    timelineColumnChooser.setEnabled(enabled);
    if (context != null) {
      timelineColumnChooser.setSelectedIndex(Math.min(attributes.length - 1, 1));
    }

    calculateValueLists();
    fillSequenceChooser();

    setButtonStates(!enabled);
  }
Esempio n. 3
0
  // atualiza os dados gerias do automato
  protected void refresh() {
    // modelo de combobox para os estados existentes
    DefaultComboBoxModel<Estado> modelcb = new DefaultComboBoxModel<>();
    // modelo para a tabela de estados
    Object[][] o = new Object[a.getEstados().size()][2];
    int i = 0; // variavel para indicar a posi__o da linha na matriz
    for (Estado e : a.getEstados()) {
      modelcb.addElement(e);
      // se for incinicial aparece ->, se for final aparece (F), se for ambos, (F)->
      o[i][0] = (e.isFinal() ? "(f)" : "") + "" + (e.equals(a.getInicial()) ? "->" : "");
      o[i][1] = e.getNome();
      i++;
    }
    cbEstadosDestinos.setModel(modelcb);
    tblEstados.setModel(new DefaultTableModel(o, new String[] {"", ""}));

    // modelo para combox de simbolos do alfabeto
    DefaultComboBoxModel modelsim = new DefaultComboBoxModel();
    modelsim.addElement('E');
    for (char c : a.getAlfabeto()) {
      modelsim.addElement(c);
    }
    cbAlfabeto.setModel(modelsim);

    // atualiza o modelo texto do automato
    textArea.setText(a.toString());
    // atualiza o modelo gr_fico do automato
    painelView.repaint();
  }
 /*-------------------------------------------------------------------------*/
 public void initForeignKeys() {
   Vector<String> vec = new Vector<String>(Database.getInstance().getBodyParts().keySet());
   Collections.sort(vec);
   head.setModel(new DefaultComboBoxModel(vec));
   torso.setModel(new DefaultComboBoxModel(vec));
   leg.setModel(new DefaultComboBoxModel(vec));
   hand.setModel(new DefaultComboBoxModel(vec));
   foot.setModel(new DefaultComboBoxModel(vec));
 }
 public void loadTable() {
   fromUnit.removeAllItems();
   toUnit.removeAllItems();
   fromUnit.setModel(
       new DefaultComboBoxModel<String>(
           viewModel.unitList.toArray(new String[viewModel.unitList.size()])));
   toUnit.setModel(
       new DefaultComboBoxModel<String>(
           viewModel.unitList.toArray(new String[viewModel.unitList.size()])));
 }
  private void lookupViewComboAction(ActionEvent e) {
    ObjEntityView fieldLookupView = objEntityViewField.getLookup().getLookupObjEntityView();
    ObjEntityView selectedLookupView = (ObjEntityView) lookupViewCombo.getSelectedItem();

    if (selectedLookupView != fieldLookupView) {
      objEntityViewField.getLookup().setLookupObjEntityView(selectedLookupView);

      dataViewTreeModel.fieldChanged(objEntityViewField);
      dataMapTreeModel.fieldChanged(objEntityViewField);
      fieldsTableModel.fireTableCellUpdated(
          objEntityViewField.getObjEntityView().getIndexOfObjEntityViewField(objEntityViewField),
          4);
    }

    if (selectedLookupView != null) {
      ObjEntityViewField nullField = null;
      java.util.List lookupFields = new ArrayList();
      lookupFields.add(nullField);
      lookupFields.addAll(selectedLookupView.getObjEntityViewFields());

      DefaultComboBoxModel lookupFieldsDefaultModel =
          new DefaultComboBoxModel(lookupFields.toArray());
      lookupFieldCombo.setModel(lookupFieldsDefaultModel);
      ObjEntityViewField fieldLookupField = objEntityViewField.getLookup().getLookupField();
      if (fieldLookupField != null) {
        boolean flagSetSelectedItem = false;
        for (Iterator itr = lookupFields.iterator(); itr.hasNext(); ) {
          ObjEntityViewField field = (ObjEntityViewField) itr.next();
          if ((field != null) && (fieldLookupField.getName().equals(field.getName()))) {
            lookupFieldCombo.setSelectedItem(fieldLookupField);
            flagSetSelectedItem = true;
            break;
          }
        }
        if (!flagSetSelectedItem) {
          lookupFieldCombo.setSelectedIndex(0);
        }
      } else {
        lookupFieldCombo.setSelectedIndex(0);
      }
    } else {
      ObjEntityViewField nullField = null;
      ObjEntityViewField[] fields = new ObjEntityViewField[] {nullField};

      DefaultComboBoxModel fieldsModel = new DefaultComboBoxModel(fields);
      lookupFieldCombo.setModel(fieldsModel);
      lookupFieldCombo.setSelectedIndex(0);
    }
  }
 /*
  * (non-Javadoc)
  *
  * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
  */
 @Override
 public void update(Observable o, Object arg) {
   if (o instanceof qcevolutionbackend) {
     if (null != backend.getCurrentse()) {
       backend.getCurrentse().addObserver(this);
     }
   } else if (o instanceof ProblemManager) {
     Set<String> probs = backend.getProbmanager().getAvailableProblems();
     String[] options = new String[probs.size() + 1];
     options[0] = "Please Select Problem";
     int index = 1;
     Iterator<String> iter = probs.iterator();
     while (iter.hasNext()) {
       options[index++] = iter.next();
     }
     selection_model = new DefaultComboBoxModel(options);
     if (backend.getQproblem() != null) {
       String key = backend.getQproblem().getName();
       selection_model.setSelectedItem(key);
       description.setText(backend.getProbmanager().getSearchEngineDesc(key));
     }
     selection.setModel(selection_model);
   } else {
     if (backend.getCurrentse() != null) {
       if (backend.getCurrentse().getState() == SearchEngineState.Searching) {
         selection.setEnabled(false);
       } else {
         selection.setEnabled(true);
       }
       validate();
     }
   }
 }
Esempio n. 8
0
  public static void isiCombo() {
    // data dimasukkan ke dalam class model
    DefaultComboBoxModel model = new DefaultComboBoxModel(dfrMhs.toArray());

    // pasang model di combo
    cmbMhs.setModel(model);
  }
Esempio n. 9
0
  public static void bindModelToView(ArrayList fieldsToBind, DomainObject model) {

    BeanAdapter adapter = new BeanAdapter(model, true);
    ValueModel valueModel = null;
    Object field = null;
    ATFieldInfo fieldInfo;
    String fieldName = "";
    ComboBoxAdapter comboBoxAdapter = null;

    for (int i = 0; i < fieldsToBind.size(); i++) {
      field = fieldsToBind.get(i);
      fieldName = ((JComponent) field).getName();
      valueModel = adapter.getValueModel(fieldName);
      if (!ignoreArray.contains(fieldName)) {
        if (field instanceof JFormattedTextField) {
          Bindings.bind((JFormattedTextField) field, valueModel);
        } else if (field instanceof JTextComponent) {
          //						Bindings.bind((JTextComponent) field, valueModel);
        } else if (field instanceof JCheckBox) {
          Bindings.bind((JCheckBox) field, valueModel);
        } else if (field instanceof JComboBox) {
          fieldInfo = ATFieldInfo.getFieldInfo(model.getClass().getName() + "." + fieldName);
          if (fieldInfo != null) {
            Vector<String> values = LookupListUtils.getLookupListValues(fieldInfo.getLookupList());
            if (values != null) {
              comboBoxAdapter = new ComboBoxAdapter(values, valueModel);
              ((JComboBox) field).setModel(comboBoxAdapter);
            }
          }
        } else {
          System.out.println(fieldName + " not bound");
        }
      }
    }
  }
Esempio n. 10
0
 public void setSelectedDisplayOption(MatrixType[] options, boolean control) {
   if (control) {
     MatrixType originalMatrixType = (MatrixType) displayOptionComboBox.getSelectedItem();
     displayOptionComboBox.setModel(new DefaultComboBoxModel<MatrixType>(options));
     int indx = 0;
     for (int i = 0; i < displayOptionComboBox.getItemCount(); i++) {
       if (originalMatrixType.equals(displayOptionComboBox.getItemAt(i))) {
         indx = i;
         break;
       }
     }
     displayOptionComboBox.setSelectedIndex(indx);
   } else {
     displayOptionComboBox.setModel(new DefaultComboBoxModel<MatrixType>(options));
     displayOptionComboBox.setSelectedIndex(0);
   }
 }
Esempio n. 11
0
 private void _setUpResources() {
   DefaultComboBoxModel dlm = new DefaultComboBoxModel();
   Set<String> keys = HEADING_LIST.keySet();
   for (String key : keys) {
     dlm.addElement(key);
   }
   mHeadingComboBox.setModel(dlm);
 }
Esempio n. 12
0
  /**
   * Chromosome "0" is whole genome
   *
   * @param chromosomes list of chromosomes
   */
  void setChromosomes(List<Chromosome> chromosomes) {
    int[] chromosomeBoundaries = new int[chromosomes.size() - 1];
    long bound = 0;
    for (int i = 1; i < chromosomes.size(); i++) {
      Chromosome c = chromosomes.get(i);
      bound += (c.getLength() / 1000);
      chromosomeBoundaries[i - 1] = (int) bound;
    }
    heatmapPanel.setChromosomeBoundaries(chromosomeBoundaries);

    chrBox1.setModel(
        new DefaultComboBoxModel<Chromosome>(
            chromosomes.toArray(new Chromosome[chromosomes.size()])));
    chrBox2.setModel(
        new DefaultComboBoxModel<Chromosome>(
            chromosomes.toArray(new Chromosome[chromosomes.size()])));
  }
Esempio n. 13
0
 public void setEnabledForNormalization(String[] normalizationOptions, boolean status) {
   if (normalizationOptions.length == 1) {
     normalizationComboBox.setEnabled(false);
   } else {
     normalizationComboBox.setModel(new DefaultComboBoxModel<String>(normalizationOptions));
     normalizationComboBox.setSelectedIndex(0);
     normalizationComboBox.setEnabled(status && !isWholeGenome());
   }
 }
Esempio n. 14
0
  @SuppressWarnings({"unchecked"})
  public SimulationPanel(final MainFrame frame, final PartitionDataList dataList) {

    this.frame = frame;
    this.dataList = dataList;

    optionPanel = new OptionsPanel(12, 12, SwingConstants.CENTER);

    simulationsNumberField = new WholeNumberField(1, Integer.MAX_VALUE);
    simulationsNumberField.setColumns(10);
    simulationsNumberField.setValue(dataList.simulationsCount);
    optionPanel.addComponentWithLabel("Number of simulations:", simulationsNumberField);

    setSeed = new JCheckBox();
    setSeed.addItemListener(new SetSeedCheckBoxListener());
    setSeed.setSelected(dataList.setSeed);
    optionPanel.addComponentWithLabel("Set seed:", setSeed);

    startingSeedNumberField = new WholeNumberField(1, Long.MAX_VALUE);
    startingSeedNumberField.setColumns(10);
    startingSeedNumberField.setValue(dataList.startingSeed);
    startingSeedNumberField.setEnabled(dataList.setSeed);
    optionPanel.addComponentWithLabel("Starting seed:", startingSeedNumberField);

    outputFormat = new JComboBox();
    optionPanel.addComponentWithLabel("Output format:", outputFormat);
    outputFormatModel = new DefaultComboBoxModel(SimpleAlignment.OutputType.values());
    outputFormat.setModel(outputFormatModel);

    outputAncestralSequences = new JCheckBox();
    outputAncestralSequences.addItemListener(new outputAncestralSequencesCheckBoxListener());
    outputAncestralSequences.setSelected(dataList.useParallel);
    optionPanel.addComponentWithLabel("Output ancestral sequences:", outputAncestralSequences);

    useParallel = new JCheckBox();
    useParallel.addItemListener(new UseParallelCheckBoxListener());
    useParallel.setSelected(dataList.useParallel);
    optionPanel.addComponentWithLabel("Use parallel implementation:", useParallel);

    // Buttons holder
    JPanel buttonsHolder = new JPanel();
    buttonsHolder.setOpaque(false);

    // simulate button
    simulate = new JButton("Simulate", Utils.createImageIcon(Utils.BIOHAZARD_ICON));
    simulate.addActionListener(new ListenSimulate());
    buttonsHolder.add(simulate);

    generateXML = new JButton("Generate XML", Utils.createImageIcon(Utils.HAMMER_ICON));
    generateXML.addActionListener(new ListenGenerateXML());
    buttonsHolder.add(generateXML);

    setOpaque(false);
    setLayout(new BorderLayout());
    add(optionPanel, BorderLayout.NORTH);
    add(buttonsHolder, BorderLayout.SOUTH);
  } // END: SimulationPanel
Esempio n. 15
0
 @Override
 public void setMultiConfValues(String[] multiConfValues) {
   multiConfValuesModel = new DefaultComboBoxModel(multiConfValues);
   multiConfValuesBox = new JComboBox();
   multiConfValuesBox.setModel(multiConfValuesModel);
   if (!Configuration.getInstance().isEuMode()) {
     multiConfValuesBox.setEditable(true);
   }
 }
  private void objRelationshipComboAction(ActionEvent e) {
    ObjRelationship selectedObjRelationship =
        (ObjRelationship) objRelationshipCombo.getSelectedItem();
    ObjRelationship fieldObjRelationship = objEntityViewField.getObjRelationship();

    if (selectedObjRelationship != fieldObjRelationship) {
      objEntityViewField.setObjRelationship(selectedObjRelationship);
    }

    if (selectedObjRelationship != null) {
      ObjEntity targetObjEntity = selectedObjRelationship.getTargetObjEntity();

      ObjEntityView nullView = null;
      java.util.List lookupViews = new ArrayList();
      lookupViews.add(nullView);
      lookupViews.addAll(targetObjEntity.getObjEntityViews());

      DefaultComboBoxModel lookupViewModel = new DefaultComboBoxModel(lookupViews.toArray());
      lookupViewCombo.setModel(lookupViewModel);
      ObjEntityView fieldLookupView = objEntityViewField.getLookup().getLookupObjEntityView();
      if (fieldLookupView != null) {
        boolean flagSetSelectedItem = false;
        for (Iterator itr = lookupViews.iterator(); itr.hasNext(); ) {
          ObjEntityView view = (ObjEntityView) itr.next();
          if (fieldLookupView == view) {
            lookupViewCombo.setSelectedItem(fieldLookupView);
            flagSetSelectedItem = true;
            break;
          }
        }
        if (!flagSetSelectedItem) {
          lookupViewCombo.setSelectedIndex(0);
        }
      } else {
        lookupViewCombo.setSelectedIndex(0);
      }
    } else {
      ObjEntityView nullView = null;
      ObjEntityView[] views = new ObjEntityView[] {nullView};
      DefaultComboBoxModel viewsModel = new DefaultComboBoxModel(views);
      lookupViewCombo.setModel(viewsModel);
      lookupViewCombo.setSelectedIndex(0);
    }
  }
 private JComboBox getCeleBodyBox() {
   if (celeBodyBox == null) {
     ComboBoxModel celeBodyBoxModel = new DefaultComboBoxModel(CelestrialBody.values());
     celeBodyBox = new JComboBox();
     celeBodyBox.setModel(celeBodyBoxModel);
     celeBodyBox.setBounds(325, 95, 133, 21);
     celeBodyBox.setAction(getCeleBodyAction());
   }
   return celeBodyBox;
 }
  private void updateLibrariesList() {
    LibraryId id = getCompilerLibraryId();

    LibraryDescriptor[] items =
        (LibraryDescriptor[]) LibraryDescriptor.compilersFor(myEditorContext.getProject());
    DefaultComboBoxModel model = new DefaultComboBoxModel(items);
    model.insertElementAt(null, 0);
    myCompilerLibrary.setModel(model);
    myLibraryRenderer.setPrefixLength(lastIndexOfProperItemIn(items) + 1);

    setCompilerLibraryById(id);
  }
Esempio n. 19
0
 private void setStudentsComboBox() {
   // call to get Students
   // studentList = ReportGenerator.staticList;
   // studentList = Arrays.asList();
   DefaultComboBoxModel model = new DefaultComboBoxModel(studentList.toArray());
   if (model.getSize() == 0) {
     model.addElement("No items");
   } else {
     model.setSelectedItem(studentList.get(0));
   }
   studentsComboBox.setModel(model);
   studentsComboBox.updateUI();
 }
  public Component getRoot(final Project project) {
    dataModel = new IssueTableModel();
    statusFilter.setModel(new DefaultComboBoxModel(StatusFilter.values()));
    userFilter.setModel(new DefaultComboBoxModel(UserFilter.values()));

    table1.setModel(dataModel);
    update.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            IssueViewer.this.updateIssues(project);
          }
        });
    table1.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            Point p = e.getPoint();
            int row = table1.rowAtPoint(p);
            if (e.getClickCount() == 2 && issues != null && 0 <= row && row < issues.size()) {
              Issue issue = issues.get(row);
              String resource_uri = issue.getResource_uri();
              // replace使うのはまずいけど面倒なので今はこれで対応
              String substring =
                  resource_uri
                      .substring("/1.0/repositories/".length(), resource_uri.length())
                      .replace("issues", "issue");
              try {
                Desktop.getDesktop().browse(new URL("https://bitbucket.org/" + substring).toURI());
              } catch (IOException e1) {
                e1.printStackTrace();
              } catch (URISyntaxException e1) {
                e1.printStackTrace();
              }
            }
          }
        });
    return panel1;
  }
Esempio n. 21
0
 private void revisarCombo() {
   librosCombo.setModel(new DefaultComboBoxModel<Libro>(libros));
   if (librosCombo.getItemCount() == 0) {
     limpiarCampos();
     librosCombo.setEnabled(false);
     eliminarBoton.setEnabled(false);
   } else {
     librosCombo.setSelectedIndex(0);
     librosCombo.setEnabled(true);
     eliminarBoton.setEnabled(true);
     mostrarLibro();
   }
 }
Esempio n. 22
0
    @Override
    public Component getTableCellEditorComponent(
        JTable table, Object value, boolean isSelected, int row, int column) {
      MyTableModel tableModel = (MyTableModel) table.getModel();
      DefaultComboBoxModel comboModel = new DefaultComboBoxModel();

      for (ValidationResult.Option each : tableModel.getOptions(row)) {
        comboModel.addElement(each);
      }
      ((JComboBox) editorComponent).setModel(comboModel);

      return super.getTableCellEditorComponent(table, value, isSelected, row, column);
    }
 public void updateLists(List<? extends ChangeList> lists) {
   //noinspection unchecked
   myChooser.setModel(new DefaultComboBoxModel(lists.toArray()));
   myChooser.setEnabled(lists.size() > 1);
   if (lists.contains(mySelectedChangeList)) {
     myChooser.setSelectedItem(mySelectedChangeList);
   } else {
     if (myChooser.getItemCount() > 0) {
       myChooser.setSelectedIndex(0);
     }
   }
   mySelectedChangeList = (ChangeList) myChooser.getSelectedItem();
 }
 private void initCompilerTypeCmb() {
   myIncrementalTypeCmb.setModel(new ListComboBoxModel<String>(mySettings.INCREMENTAL_TYPES));
   myIncrementalTypeCmb.setSelectedItem(mySettings.INCREMENTAL_TYPE);
   myIncrementalTypeCmb.setRenderer(
       new ListCellRendererWrapper<String>() {
         @Override
         public void customize(
             JList list, String value, int index, boolean selected, boolean hasFocus) {
           if (value.equals("SBT")) setText("SBT incremental compiler");
           if (value.equals("IDEA")) setText("IntelliJ IDEA");
         }
       });
   myIncrementalTypeCmb.setToolTipText("Rebuild is required after change");
 }
 private void initCompileOrderCmb() {
   myCompileOrderCmb.setModel(new ListComboBoxModel<String>(mySettings.COMPILE_ORDERS));
   myCompileOrderCmb.setSelectedItem(mySettings.COMPILE_ORDER);
   myCompileOrderCmb.setRenderer(
       new ListCellRendererWrapper<String>() {
         @Override
         public void customize(
             JList list, String value, int index, boolean selected, boolean hasFocus) {
           if (value.equals("Mixed")) setText("Mixed");
           if (value.equals("JavaThenScala")) setText("Java then Scala");
           if (value.equals("ScalaThenJava")) setText("Scala then Java");
         }
       });
 }
Esempio n. 26
0
    protected CompileCppDialog(
        Project _project, CompileHandler compilerHandler, CompileCppOptions options) {
      super(_project, false);

      project = _project;
      setModal(true);

      doRun.addItemListener(
          new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
              final boolean b = doRun.isSelected();
              executableFileName.setEnabled(b);
              executableFileName.setEditable(b);
            }
          });

      executableFileName.getEditor().setItem(options != null ? options.getOutputFileName() : "");
      doRun.setSelected(lastRunStatus);

      final CppSupportLoader loader = CppSupportLoader.getInstance(project);
      final String compileParameters = loader.getAdditionalCompileParameters();

      compileProperties.setText(
          (compileParameters != null && compileParameters.length() > 0
                  ? compileParameters + " "
                  : "")
              + CompileHandler.MARKER);

      setTitle(CppBundle.message("compile.cpp.file.dialog.title"));

      compilerSelector.setModel(
          new DefaultComboBoxModel(CppSupportSettings.CompilerSelectOptions.values()));
      compilerSelector.setSelectedItem(getCurrentCompilerOption(project));

      setSelectedProjectCompile();

      includeProjectCompileParametersCheckBox.addItemListener(
          new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
              setSelectedProjectCompile();
            }
          });

      includeProjectCompileParametersCheckBox.setSelected(loader.isIncludeProjectSettings());
      final String compileParametersText = compilerHandler.buildProjectCompileOptions(project);
      projectCompileParameters.setText(compileParametersText != null ? compileParametersText : "");

      init();
    }
Esempio n. 27
0
 public void setComboBoxAnrede(JComboBox<Anrede> comboBoxAnrede) {
   this.comboBoxAnrede = comboBoxAnrede;
   comboBoxAnrede.setModel(new DefaultComboBoxModel<>(Anrede.values()));
   comboBoxAnrede.addActionListener(
       new ActionListener() {
         @Override
         public void actionPerformed(ActionEvent e) {
           onAnredeSelected();
         }
       });
   // Anrede: KEINE nicht anzeigen:
   comboBoxAnrede.removeItem(Anrede.KEINE);
   // Leeren ComboBox-Wert anzeigen
   comboBoxAnrede.setSelectedItem(null);
 }
 private void initializeDeviceCombo() {
   myDevicesComboBox.setModel(myComboBoxModel);
   myDevicesComboBox.addActionListener(
       new ActionListener() {
         @Override
         public void actionPerformed(ActionEvent e) {
           Object sel = myDevicesComboBox.getSelectedItem();
           IDevice device = (sel instanceof IDevice) ? (IDevice) sel : null;
           updateClientsForDevice(device);
           myDeviceContext.fireDeviceSelected(device);
           myDeviceContext.fireClientSelected(null);
         }
       });
   myDevicesComboBox.setRenderer(new DeviceRenderer.DeviceComboBoxRenderer());
 }
  public FeaturesConfigurationTab(
      final OfbizFacetConfiguration originalConfiguration, final FacetEditorContext editorContext) {
    this.originalConfiguration = originalConfiguration;

    disablePropertiesKeys.setSelected(originalConfiguration.isPropertiesKeysDisabled());

    final Module module = editorContext.getModule();
    // final String version = OfbizVersionDetector.detectStrutsVersion(module);
    final String version = "11.04";
    if (version != null) {
      versionComboBox.setModel(new DefaultComboBoxModel(new String[] {version}));
      versionComboBox.getModel().setSelectedItem(version);
      versionComboBox.setEnabled(false);
      return;
    }
  }
 @Override
 protected void init() {
   setTitle(waEndpt == null ? message("adRolEndPtTitle") : message("endptEditTitle"));
   comboType.setModel(new DefaultComboBoxModel(WindowsAzureEndpointType.values()));
   comboType.addItemListener(createComboTypeListener());
   lblName.setPreferredSize(lblPrivatePort.getPreferredSize());
   // Edit Endpoint scenario
   if (waEndpt != null) {
     txtName.setText(waEndpt.getName());
     // type
     WindowsAzureEndpointType type = null;
     try {
       type = waEndpt.getEndPointType();
       comboType.setSelectedItem(type);
     } catch (WindowsAzureInvalidProjectOperationException e) {
       PluginUtil.displayErrorDialog(message("dlgDbgEndPtErrTtl"), message("endPtTypeErr"));
     }
     // private port
     String prvPort = waEndpt.getPrivatePort();
     if (prvPort == null && !type.equals(WindowsAzureEndpointType.InstanceInput)) {
       txtPrivatePort.setText(AUTO);
     } else {
       String[] prvPortRange = prvPort.split("-");
       txtPrivatePort.setText(prvPortRange[0]);
       if (prvPortRange.length > 1) {
         txtPrivatePortRangeEnd.setText(prvPortRange[1]);
       }
     }
     // Public port
     String[] portRange = waEndpt.getPort().split("-");
     txtPublicPort.setText(portRange[0]);
     if (portRange.length > 1) {
       txtPublicPortRangeEnd.setText(portRange[1]);
     }
   } else {
     /*
      * Add Endpoint scenario.
      * Endpoint type is Internal for the first time.
      */
     txtPrivatePort.setText(AUTO);
   }
   enableControlsDependingOnEnpointType((WindowsAzureEndpointType) comboType.getSelectedItem());
   txtPrivatePort.addFocusListener(createPortFocusListener());
   txtPrivatePortRangeEnd.addFocusListener(createPortFocusListener());
   super.init();
 }