Exemplo n.º 1
0
 public static GraphicalEditorInput createInstance(Object c_input) throws PartInitException {
   ModelSpecification_c[] modelSpecs =
       ModelSpecification_c.ModelSpecificationInstances(Ooaofgraphics.getDefaultInstance());
   for (int i = 0; i < modelSpecs.length; i++) {
     if (modelSpecs[i].getRepresents() == c_input.getClass()) {
       final UUID ooa_id = Cl_c.Getooa_idfrominstance(c_input);
       final int modelType = modelSpecs[i].getModel_type();
       String rootName = Cl_c.getModelRootname(c_input);
       if (rootName != null) {
         Ooaofgraphics modelRoot = Ooaofgraphics.getInstance(rootName);
         Model_c canvas =
             Model_c.ModelInstance(
                 modelRoot,
                 new ClassQueryInterface_c() {
                   public boolean evaluate(Object candidate) {
                     Model_c selected = (Model_c) candidate;
                     return selected.getModel_type() == modelType
                         && selected.getOoa_id().equals(ooa_id);
                   }
                 });
         if (canvas != null) {
           CanvasModelListener.setGraphicalRepresents(canvas);
           return new GraphicalEditorInput(canvas, c_input, modelSpecs[i].getBackground());
         }
       }
     }
   }
   return null;
 }