コード例 #1
0
ファイル: DataPanel.java プロジェクト: benb/beast-mcmc
    public Component getTableCellEditorComponent(
        JTable table, Object value, boolean isSelected, int row, int column) {

      ((JComboBox) editorComponent).removeAllItems();
      if (options.containTrait(table.getValueAt(row, 0).toString())) {
        if (column == 5) {
          for (Object ob : options.getPartitionTraitsSubstitutionModels()) {
            ((JComboBox) editorComponent).addItem(ob);
          }
        } else if (column == 6) {
          for (Object ob : options.getPartitionTraitsClockModels()) {
            ((JComboBox) editorComponent).addItem(ob);
          }
        }
      } else {
        if (column == 5) {
          for (Object ob : options.getPartitionNonTraitsSubstitutionModels()) {
            ((JComboBox) editorComponent).addItem(ob);
          }
        } else if (column == 6) {
          for (Object ob : options.getPartitionNonTraitsClockModels()) {
            ((JComboBox) editorComponent).addItem(ob);
          }
        }
      }

      //            if (((JComboBox) editorComponent).contains(value)) // todo need validate whether
      // value in the editorComponent

      ((JComboBox) editorComponent).setSelectedItem(value);
      delegate.setValue(value);

      return editorComponent;
    }
コード例 #2
0
ファイル: TracePanel.java プロジェクト: yuezixin/zorka
  public void setData(TraceDataSet dataSet) {
    this.dataSet = dataSet;
    this.errorsOnly = false;
    this.traceLabel = null;
    this.minTraceTime = 0;

    btnFilterErrors.setSelected(false);
    txtMinTime.setText("");

    tbmTraces.setDataSet(dataSet, null);

    List<String> traceNames = new ArrayList<String>();

    for (ViewerTraceRecord rec : dataSet.getRecords()) {
      String traceName = rec.getTraceName();
      if (traceName != null && !traceNames.contains(traceName)) {
        traceNames.add(traceName);
      }
    }

    Collections.sort(traceNames);
    cmbTraceType.removeAllItems();
    cmbTraceType.addItem("*");

    for (String traceName : traceNames) {
      cmbTraceType.addItem(traceName);
    }
  }
コード例 #3
0
  public void setIndexer(LibrariesIndexer indexer) {
    this.indexer = indexer;

    DropdownItem<DownloadableContribution> previouslySelectedCategory = (DropdownItem<DownloadableContribution>) categoryChooser.getSelectedItem();
    DropdownItem<DownloadableContribution> previouslySelectedType = (DropdownItem<DownloadableContribution>) typeChooser.getSelectedItem();

    categoryChooser.removeActionListener(categoryChooserActionListener);
    typeChooser.removeActionListener(typeChooserActionListener);

    // TODO: Remove setIndexer and make getContribModel 
    // return a FilteredAbstractTableModel
    getContribModel().setIndexer(indexer);

    categoryFilter = null;
    categoryChooser.removeAllItems();

    // Load categories
    categoryChooser.addItem(new DropdownAllItem());
    Collection<String> categories = indexer.getIndex().getCategories();
    for (String category : categories) {
      categoryChooser.addItem(new DropdownLibraryOfCategoryItem(category));
    }

    categoryChooser.setEnabled(categoryChooser.getItemCount() > 1);

    categoryChooser.addActionListener(categoryChooserActionListener);
    if (previouslySelectedCategory != null) {
      categoryChooser.setSelectedItem(previouslySelectedCategory);
    } else {
      categoryChooser.setSelectedIndex(0);
    }

    typeFilter = null;
    typeChooser.removeAllItems();
    typeChooser.addItem(new DropdownAllItem());
    typeChooser.addItem(new DropdownInstalledLibraryItem(indexer.getIndex()));
    java.util.List<String> types = new LinkedList<String>(indexer.getIndex().getTypes());
    Collections.sort(types, new LibraryTypeComparator());
    for (String type : types) {
      typeChooser.addItem(new DropdownLibraryOfTypeItem(type));
    }
    typeChooser.setEnabled(typeChooser.getItemCount() > 1);
    typeChooser.addActionListener(typeChooserActionListener);
    if (previouslySelectedType != null) {
      typeChooser.setSelectedItem(previouslySelectedType);
    } else {
      typeChooser.setSelectedIndex(0);
    }

    filterField.setEnabled(contribModel.getRowCount() > 0);

    // Create LibrariesInstaller tied with the provided index
    installer = new LibraryInstaller(indexer, platform) {
      @Override
      public void onProgress(Progress progress) {
        setProgress(progress);
      }
    };
  }
コード例 #4
0
 /** {@inheritDoc} */
 public Component getTableCellEditorComponent(
     JTable table, Object value, boolean isSelected, int row, int column) {
   BranchDescriptor d = myBranches.get(row);
   myComboBox.removeAllItems();
   for (String s : d.referencesToSelect) {
     myComboBox.addItem(s);
   }
   myComboBox.setSelectedItem(d.referenceToCheckout);
   return myPanel;
 }
コード例 #5
0
  // Вид формы при изменении сотрудника
  public void sotrDiaUpdate(Sotrudnik s) {
    label_id_hidden.setText(Integer.toString(s.getId_sotrudnika()));
    textField_familiya.setText(s.getFamiliya());
    textField_imya.setText(s.getImya());
    textField_otchestvo.setText(s.getOtchestvo());
    textField_phone.setText(s.getPhone());
    textField_date.setText(s.getData_priema().toString());
    comboBox_doljnost.removeAllItems();
    comboBox_kvalification.removeAllItems();

    try {
      DBClass db = new DBClass();
      ArrayList<Doljnost> d = db.doljnostFromDB();
      DBClass db2 = new DBClass();
      Doljnost dd = db2.doljnostFromDB(s);
      for (int i = 0; i < d.size(); i++) {
        comboBox_doljnost.addItem(d.get(i));
        Doljnost ddd = (Doljnost) comboBox_doljnost.getItemAt(i);
        if (dd.getNazvanie_doljnosti().equals(ddd.getNazvanie_doljnosti())) dd = ddd;
      }
      comboBox_doljnost.setSelectedItem(dd);

      DBClass db3 = new DBClass();
      ArrayList<Kvalification> k = db3.kvalificationFromDB();
      DBClass db4 = new DBClass();
      Kvalification kk = db4.kvalificationFromDB(s);
      for (int i = 0; i < k.size(); i++) {
        comboBox_kvalification.addItem(k.get(i));
        Kvalification kkk = (Kvalification) comboBox_kvalification.getItemAt(i);
        if (kk.getNazvanie_kvalification().equals(kkk.getNazvanie_kvalification())) kk = kkk;
      }

      comboBox_kvalification.setSelectedItem(kk);

    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(panelException, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(panelException, ee.getMessage());
    }
  }
コード例 #6
0
ファイル: LlamaChat.java プロジェクト: raulgq1/LlamaChat
 /** cleans up a connection by removing all user from all maintained lists */
 public void close() {
   error("Connection to server was lost");
   admin = false;
   users.clear();
   afks.clear();
   ignores.clear();
   admins.clear();
   channels.clear();
   cboChannels.removeAllItems();
   updateList();
 }
コード例 #7
0
  // Вид формы при добавлении нового сотрудника
  public void sotrDiaInsert() {
    label_id_hidden.setText("Новый сотрудник");
    textField_familiya.setText("");
    textField_imya.setText("");
    textField_otchestvo.setText("");
    textField_phone.setText("");
    comboBox_doljnost.removeAllItems();
    comboBox_kvalification.removeAllItems();

    Calendar calend = Calendar.getInstance();
    if (calend.get(Calendar.MONTH) <= 9) {
      textField_date.setText(
          String.valueOf(
              (calend.get(Calendar.YEAR) + "-" + ("0" + (1 + calend.get(Calendar.MONTH))) + "-")
                  + (calend.get(Calendar.DATE))));
    } else
      textField_date.setText(
          String.valueOf(
              ((calend.get(Calendar.YEAR)) + "-" + (1 + calend.get(Calendar.MONTH)) + "-")
                  + (calend.get(Calendar.DATE))));
    textField_date.setEnabled(false);

    try {
      DBClass db = new DBClass();
      ArrayList<Doljnost> d = db.doljnostFromDB();
      for (int i = 0; i < d.size(); i++) {
        comboBox_doljnost.addItem(d.get(i));
      }
      DBClass db2 = new DBClass();
      ArrayList<Kvalification> k = db2.kvalificationFromDB();
      for (int i = 0; i < k.size(); i++) {
        comboBox_kvalification.addItem(k.get(i));
      }
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(panelException, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(panelException, ee.getMessage());
    }
  }
コード例 #8
0
 private void addPainter(myjava.gui.syntax.Painter painter) {
   EntryListPanel newPanel = new EntryListPanel(painter);
   listPanelSet.add(newPanel);
   centerPanel.add(newPanel, painter.getName());
   painterComboBox.removeItemListener(painterChangeListener);
   painterComboBox.removeAllItems();
   for (EntryListPanel p : listPanelSet) {
     painterComboBox.addItem(p.getPainter());
   }
   removedPainters.remove(painter);
   painterComboBox.addItemListener(painterChangeListener);
 }
コード例 #9
0
  // WTF: this does not update packs!!
  // only updating info for selected pack. pulldown menus and info area!
  void updatePacks() {
    for (int i = 0; i < packPanels.size(); i++) {
      if (selectedPack == i && getIndex() >= 0) {
        ModPack pack = ModPack.getPackArray().get(getIndex());
        if (pack != null) {
          String mods = "";
          if (pack.getMods() != null) {
            mods += "<p>This pack contains the following mods by default:</p><ul>";
            for (String name : pack.getMods()) {
              mods += "<li>" + name + "</li>";
            }
            mods += "</ul>";
          }
          packPanels.get(i).setBackground(UIManager.getColor("control").darker().darker());
          packPanels.get(i).setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
          File tempDir =
              new File(
                  OSUtils.getCacheStorageLocation(), "ModPacks" + File.separator + pack.getDir());
          packInfo.setText(
              "<html><img src='file:///"
                  + tempDir.getPath()
                  + File.separator
                  + pack.getImageName()
                  + "' width=400 height=200></img> <br>"
                  + pack.getInfo()
                  + mods);
          packInfo.setCaretPosition(0);

          if (ModPack.getSelectedPack(isFTB()).getServerUrl().equals("")
              || ModPack.getSelectedPack(isFTB()).getServerUrl() == null) {
            server.setEnabled(false);
          } else {
            server.setEnabled(true);
          }
          String tempVer = Settings.getSettings().getPackVer(pack.getDir());
          version.removeActionListener(al);
          version.removeAllItems();
          version.addItem("Recommended");
          if (pack.getOldVersions() != null) {
            for (String s : pack.getOldVersions()) {
              version.addItem(s);
            }
            version.setSelectedItem(tempVer);
          }
          version.addActionListener(al);
        }
      } else {
        packPanels.get(i).setBackground(UIManager.getColor("control"));
        packPanels.get(i).setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
      }
    }
  }
コード例 #10
0
ファイル: FramesPanel.java プロジェクト: jexp/idea2
  /*invoked in swing thread*/
  protected void rebuild(final boolean updateOnly) {
    if (!updateOnly) {
      myThreadsCombo.removeAllItems();
      synchronized (myFramesList) {
        myFramesList.clear();
      }
    }

    final DebugProcessImpl process = getContext().getDebugProcess();
    if (process != null) {
      process
          .getManagerThread()
          .schedule(new RefreshFramePanelCommand(updateOnly && myThreadsCombo.getItemCount() != 0));
    }
  }
コード例 #11
0
  public static void updateKvalification() {
    try {

      DBClass db2 = new DBClass();
      ArrayList<Kvalification> k = db2.kvalificationFromDB();
      comboBox_kvalification.removeAllItems();
      for (int i = 0; i < k.size(); i++) {
        comboBox_kvalification.addItem(k.get(i));
      }
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(null, ee.getMessage());
    }
  }
コード例 #12
0
  public static void updateDoljnost() {
    try {
      DBClass db = new DBClass();
      ArrayList<Doljnost> d = db.doljnostFromDB();
      comboBox_doljnost.removeAllItems();
      for (int i = 0; i < d.size(); i++) {
        comboBox_doljnost.addItem(d.get(i));
      }

    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(null, ee.getMessage());
    }
  }
コード例 #13
0
  private void affectLibelle() {
    setTitle(ConcoursJeunes.ajrLibelle.getResourceString("criterion.titre"));

    jlCode.setText(ConcoursJeunes.ajrLibelle.getResourceString("criterion.code"));
    jlLibelle.setText(ConcoursJeunes.ajrLibelle.getResourceString("criterion.libelle"));
    jlSortOrder.setText(ConcoursJeunes.ajrLibelle.getResourceString("criterion.ordretri"));
    jcbSortOrder.removeAllItems();
    jcbSortOrder.addItem(ConcoursJeunes.ajrLibelle.getResourceString("criterion.ordretri.asc"));
    jcbSortOrder.addItem(ConcoursJeunes.ajrLibelle.getResourceString("criterion.ordretri.desc"));
    jcbPlacementCriterion.setText(
        ConcoursJeunes.ajrLibelle.getResourceString("criterion.placement"));
    jcbClassementCriterion.setText(
        ConcoursJeunes.ajrLibelle.getResourceString("criterion.classement"));

    jbValider.setText(ConcoursJeunes.ajrLibelle.getResourceString("bouton.valider"));
    jbAnnuler.setText(ConcoursJeunes.ajrLibelle.getResourceString("bouton.annuler"));
  }
コード例 #14
0
  private void updateParams(EDPCellData data) {
    paramComboBox.removeAllItems();
    paramKeys = data.getPlugin().getPrintfDescrs(!m_isCrawlRuleEditor);
    if (!m_isCrawlRuleEditor) {
      paramComboBox.addItem(STRING_LITERAL);
    }

    for (Iterator it = paramKeys.values().iterator(); it.hasNext(); ) {
      ConfigParamDescr descr = (ConfigParamDescr) it.next();
      int type = descr.getType();
      if (!m_isCrawlRuleEditor
          && (type == ConfigParamDescr.TYPE_SET || type == ConfigParamDescr.TYPE_RANGE)) continue;
      paramComboBox.addItem(descr);
    }
    paramComboBox.setEnabled(true);
    paramComboBox.setSelectedIndex(0);
    paramComboBox.setToolTipText("Select a parameter to insert into the format string");
    insertButton.setEnabled(true);
  }
コード例 #15
0
 public void updateProperty() {
   propertydisplay.removeAllItems();
   for (String x : getPropertyName()) {
     propertydisplay.addItem(x);
   }
 }
コード例 #16
0
ファイル: StartupFrame.java プロジェクト: rusefi/rusefi
 private void addPortSelection(List<String> ports) {
   comboPorts.removeAllItems();
   for (final String port : ports) comboPorts.addItem(port);
   String defaultPort = getConfig().getRoot().getProperty(Launcher.PORT_KEY);
   comboPorts.setSelectedItem(defaultPort);
 }
コード例 #17
0
  public void reset() {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
    UISettings uiSettings = UISettings.getInstance();
    VcsApplicationSettings vcsSettings = VcsApplicationSettings.getInstance();

    // Display

    myCbSmoothScrolling.setSelected(editorSettings.isSmoothScrolling());

    // Brace highlighting

    myCbHighlightBraces.setSelected(codeInsightSettings.HIGHLIGHT_BRACES);
    myCbHighlightScope.setSelected(codeInsightSettings.HIGHLIGHT_SCOPE);
    myCbHighlightIdentifierUnderCaret.setSelected(
        codeInsightSettings.HIGHLIGHT_IDENTIFIER_UNDER_CARET);

    // Virtual space

    myCbUseSoftWrapsAtEditor.setSelected(
        editorSettings.isUseSoftWraps(SoftWrapAppliancePlaces.MAIN_EDITOR));
    myCbUseCustomSoftWrapIndent.setSelected(editorSettings.isUseCustomSoftWrapIndent());
    myCustomSoftWrapIndent.setText(Integer.toString(editorSettings.getCustomSoftWrapIndent()));
    myCbShowSoftWrapsOnlyOnCaretLine.setSelected(!editorSettings.isAllSoftWrapsShown());
    updateSoftWrapSettingsRepresentation();

    myCbVirtualSpace.setSelected(editorSettings.isVirtualSpace());
    myCbCaretInsideTabs.setSelected(editorSettings.isCaretInsideTabs());
    myCbVirtualPageAtBottom.setSelected(editorSettings.isAdditionalPageAtBottom());

    // Limits
    myClipboardContentLimitTextField.setText(Integer.toString(uiSettings.MAX_CLIPBOARD_CONTENTS));

    // Strip trailing spaces on save

    String stripTrailingSpaces = editorSettings.getStripTrailingSpaces();
    if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE.equals(stripTrailingSpaces)) {
      myStripTrailingSpacesCombo.setSelectedItem(STRIP_NONE);
    } else if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED.equals(
        stripTrailingSpaces)) {
      myStripTrailingSpacesCombo.setSelectedItem(STRIP_CHANGED);
    } else if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_WHOLE.equals(
        stripTrailingSpaces)) {
      myStripTrailingSpacesCombo.setSelectedItem(STRIP_ALL);
    }
    explainTrailingSpaces(stripTrailingSpaces);

    myCbEnsureBlankLineBeforeCheckBox.setSelected(editorSettings.isEnsureNewLineAtEOF());
    myCbShowQuickDocOnMouseMove.setSelected(editorSettings.isShowQuickDocOnMouseOverElement());
    myQuickDocDelayTextField.setText(
        Long.toString(editorSettings.getQuickDocOnMouseOverElementDelayMillis()));
    myQuickDocDelayTextField.setEnabled(editorSettings.isShowQuickDocOnMouseOverElement());
    myQuickDocDelayLabel.setEnabled(editorSettings.isShowQuickDocOnMouseOverElement());

    // Advanced mouse
    myCbEnableDnD.setSelected(editorSettings.isDndEnabled());
    myCbEnableWheelFontChange.setSelected(editorSettings.isWheelFontChangeEnabled());
    myCbHonorCamelHumpsWhenSelectingByClicking.setSelected(
        editorSettings.isMouseClickSelectionHonorsCamelWords());

    myRbPreferMovingCaret.setSelected(editorSettings.isRefrainFromScrolling());
    myRbPreferScrolling.setSelected(!editorSettings.isRefrainFromScrolling());

    myRecentFilesLimitField.setText(Integer.toString(uiSettings.RECENT_FILES_LIMIT));

    myCbRenameLocalVariablesInplace.setSelected(editorSettings.isVariableInplaceRenameEnabled());
    myPreselectCheckBox.setSelected(editorSettings.isPreselectRename());
    myShowInlineDialogForCheckBox.setSelected(editorSettings.isShowInlineLocalDialog());

    myShowNotificationAfterReformatCodeCheckBox.setSelected(
        editorSettings.getOptions().SHOW_NOTIFICATION_AFTER_REFORMAT_CODE_ACTION);
    myShowNotificationAfterOptimizeImportsCheckBox.setSelected(
        editorSettings.getOptions().SHOW_NOTIFICATION_AFTER_OPTIMIZE_IMPORTS_ACTION);

    myShowLSTInGutterCheckBox.setSelected(vcsSettings.SHOW_LST_GUTTER_MARKERS);
    myShowWhitespacesModificationsInLSTGutterCheckBox.setSelected(
        vcsSettings.SHOW_WHITESPACES_IN_LST);
    myShowWhitespacesModificationsInLSTGutterCheckBox.setEnabled(
        myShowLSTInGutterCheckBox.isSelected());

    myErrorHighlightingPanel.reset();

    RichCopySettings settings = RichCopySettings.getInstance();
    myCbEnableRichCopyByDefault.setSelected(settings.isEnabled());
    myRichCopyColorSchemeComboBox.removeAllItems();
    EditorColorsScheme[] schemes = EditorColorsManager.getInstance().getAllSchemes();
    myRichCopyColorSchemeComboBox.addItem(RichCopySettings.ACTIVE_GLOBAL_SCHEME_MARKER);
    for (EditorColorsScheme scheme : schemes) {
      myRichCopyColorSchemeComboBox.addItem(scheme.getName());
    }
    String toSelect = settings.getSchemeName();
    if (!StringUtil.isEmpty(toSelect)) {
      myRichCopyColorSchemeComboBox.setSelectedItem(toSelect);
    }
  }
コード例 #18
0
  @Override
  public void actionPerformed(ActionEvent event) {

    if (event.getSource().getClass() == JButton.class) {
      if (event.getSource() == exit) {
        fentreCard.show("Menu");
      }
      if (event.getSource() == valider) {
        try {

          try {
            String at1, re1, at2, re2, at3, re3;
            re1 = recherche1.getText();
            re2 = recherche2.getText();
            re3 = recherche3.getText();
            try {
              at1 = result1.getSelectedItem().toString();
            } catch (Exception e) {
              at1 = "";
            }
            try {
              at2 = result2.getSelectedItem().toString();
            } catch (Exception e) {
              at2 = "";
            }
            try {
              at3 = result3.getSelectedItem().toString();
            } catch (Exception e) {
              at3 = "";
            }

            switch (switchcherche) {
              case 1:
                RechercheTab r1 =
                    new RechercheTab(JobDocteur.FindResult(at1, re1, at2, re2, at3, re3), 1);
                break;
              case 2:
                RechercheTab r2 =
                    new RechercheTab(JobMalade.FindResult(at1, re1, at2, re2, at3, re3), 2);
                break;
              case 3:
                RechercheTab r3 =
                    new RechercheTab(JobInfirmier.FindResult(at1, re1, at2, re2, at3, re3), 3);
                break;
              case 4:
                RechercheTab r4 =
                    new RechercheTab(JobEmploye.FindResult(at1, re1, at2, re2, at3, re3), 4);
                break;
              case 5:
                RechercheTab r5 =
                    new RechercheTab(
                        JobHospitalisation.FindResult(at1, re1, at2, re2, at3, re3), 5);
                break;
              case 6:
                RechercheTab r6 =
                    new RechercheTab(JobChambre.FindResult(at1, re1, at2, re2, at3, re3), 6);
                break;
              case 7:
                RechercheTab r7 =
                    new RechercheTab(JobService.FindResult(at1, re1, at2, re2, at3, re3), 7);
                break;
              case 8:
                RechercheTab r8 =
                    new RechercheTab(JobSoigne.FindResult(at1, re1, at2, re2, at3, re3), 8);
                break;
              default:
                break;
            }
          } catch (SQLException ex) {
            Logger.getLogger(Recherche.class.getName()).log(Level.SEVERE, null, ex);
          }
        } catch (IOException ex) {
          Logger.getLogger(Recherche.class.getName()).log(Level.SEVERE, null, ex);
        }
        fentreCard.show("RechercheTab");
      }
    } else if (event.getSource().getClass() == JComboBox.class) {

      if ("Docteur".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] DocteurRecherche = {
          "Numero", "Nom", "Prenom", "Adresse", "Telephone", "Specialite"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 1;
        for (int i = 0; i < DocteurRecherche.length; i++) {
          result1.insertItemAt(DocteurRecherche[i], i);
          result2.insertItemAt(DocteurRecherche[i], i);
          result3.insertItemAt(DocteurRecherche[i], i);
        }
      } else if ("Malade".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] MaladeRecherche = {"Numero", "Nom", "Prenom", "Telephone", "Adresse", "Mutuelle"};
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 2;
        for (int i = 0; i < MaladeRecherche.length; i++) {
          result1.insertItemAt(MaladeRecherche[i], i);
          result2.insertItemAt(MaladeRecherche[i], i);
          result3.insertItemAt(MaladeRecherche[i], i);
        }
      } else if ("Infirmier".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] InfirmierRecherche = {
          "Numero", "Nom", "Prenom", "Nom Service", "Telephone", "Adresse", "Rotation"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 3;
        for (int i = 0; i < InfirmierRecherche.length; i++) {
          result1.insertItemAt(InfirmierRecherche[i], i);
          result2.insertItemAt(InfirmierRecherche[i], i);
          result3.insertItemAt(InfirmierRecherche[i], i);
        }
      } else if ("Employe".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] EmployeRecherche = {"Numero", "Nom", "Prenom", "Telephone", "Adresse"};
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 4;
        for (int i = 0; i < EmployeRecherche.length; i++) {
          result1.insertItemAt(EmployeRecherche[i], i);
          result2.insertItemAt(EmployeRecherche[i], i);
          result3.insertItemAt(EmployeRecherche[i], i);
        }
      } else if ("Hospitalisation"
          .equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] HospitalisationRecherche = {
          "Numero du Malade",
          "Nom du Malade",
          "Numero du Service",
          "Nom du Service",
          "Chambre",
          "Numero du lit"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 5;
        for (int i = 0; i < HospitalisationRecherche.length; i++) {
          result1.insertItemAt(HospitalisationRecherche[i], i);
          result2.insertItemAt(HospitalisationRecherche[i], i);
          result3.insertItemAt(HospitalisationRecherche[i], i);
        }
      } else if ("Chambre".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] ChambreRecherche = {
          "Numero Chambre", "Surveillant", "Nom Service", "Nombres de lits"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 6;
        for (int i = 0; i < ChambreRecherche.length; i++) {
          result1.insertItemAt(ChambreRecherche[i], i);
          result2.insertItemAt(ChambreRecherche[i], i);
          result3.insertItemAt(ChambreRecherche[i], i);
        }
      } else if ("Service".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] ServiceRecherche = {"Code du Service", "Nom Service", "Batiment", "Directeur"};
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 7;
        for (int i = 0; i < ServiceRecherche.length; i++) {
          result1.insertItemAt(ServiceRecherche[i], i);
          result2.insertItemAt(ServiceRecherche[i], i);
          result3.insertItemAt(ServiceRecherche[i], i);
        }

      } else if ("Soigne".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] SoigneRecherche = {
          "Numero du Docteur",
          "Nom Docteur",
          "Specialite du Docteur",
          "Numero du Malade",
          "Nom du Malade",
          "Mutuelle"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 8;
        for (int i = 0; i < SoigneRecherche.length; i++) {
          result1.insertItemAt(SoigneRecherche[i], i);
          result2.insertItemAt(SoigneRecherche[i], i);
          result3.insertItemAt(SoigneRecherche[i], i);
        }
      }
    }
  }
コード例 #19
0
ファイル: ClientWindow.java プロジェクト: AntonKiselyov/BTB
 // Закрыть форму создания заказа
 private void closeClientOrderForm() {
   TypeComboBox.removeAllItems();
   TypeComboBox.revalidate();
   FormOrderPanel.setVisible(false);
   productItemMap.clear();
 }