Exemple #1
0
  public SolverViewFrame(Frame frame) {
    identifierChooser = new JComboBoxEx();
    for (CharacterFacade pcf : CharacterManager.getCharacters()) {
      String pcname = pcf.getNameRef().get();
      CharID id = pcf.getCharID();
      identifierChooser.addItem(new PCRef(pcname, id));
    }
    identifierChooser.addActionListener(new IdentifierActionListener());

    objectChooser = new JComboBoxEx();
    objectChooser.addActionListener(new ObjectActionListener());

    scopeChooser = new JComboBoxEx();
    scopeChooser.addActionListener(new ScopeActionListener());

    identifierChooser.setSelectedItem(identifierChooser.getItemAt(0));
    scopeChooser.setSelectedItem(scopeChooser.getItemAt(0));

    varName = new JTextField();
    varName.setText(varNameText);
    varName.getDocument().addDocumentListener(new VarNameListener());

    initialize();
    objectChooser.setSelectedItem(objectChooser.getItemAt(0));
  }
Exemple #2
0
 private void updateObjects() {
   if (activeIdentifier != null) {
     Collection<VarScoped> objects = scopeFacet.getObjectsWithVariables(activeIdentifier);
     objectChooser.removeAllItems();
     String scopeName = selectedScope.getName();
     for (VarScoped cdo : objects) {
       if (cdo.getLocalScopeName().equals(scopeName)) {
         if (scopeFacet.get(activeIdentifier, selectedScope, cdo) != null) {
           objectChooser.addItem(new ObjectNameDisplayer(cdo));
         }
       }
     }
     if (objectChooser.getItemCount() != 0) {
       objectChooser.setSelectedIndex(0);
     }
   }
 }