Пример #1
0
 /*
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 public void actionPerformed(ActionEvent ae) {
   super.actionPerformed(ae);
   Project p = ProjectManager.getManager().getCurrentProject();
   int numPacks = p.getUserDefinedModelList().size();
   String nameStr = "package_" + (numPacks + 1);
   Object model = Model.getModelManagementFactory().createModel();
   Model.getCoreHelper().setName(model, nameStr);
   p.addMember(model);
   super.actionPerformed(ae);
   new ActionClassDiagram().actionPerformed(ae);
 }
  /*
   * @see org.argouml.uml.ui.UMLComboBoxModel2#buildModelList()
   */
  protected void buildModelList() {
    Set<Object> elements = new TreeSet<Object>(new PathComparator());
    Project p = ProjectManager.getManager().getCurrentProject();
    for (Object model : p.getUserDefinedModelList()) {
      elements.addAll(
          Model.getModelManagementHelper()
              .getAllModelElementsOfKind(model, Model.getMetaTypes().getClassifier()));
    }

    elements.addAll(
        p.getProfileConfiguration().findByMetaType(Model.getMetaTypes().getClassifier()));
    removeAllElements();
    addAll(elements);
  }