コード例 #1
0
ファイル: DGGenerator.java プロジェクト: bmangez/openflexo
 public static String getReference(FlexoModelObject object) {
   String s = "";
   if (object instanceof FlexoProcess) {
     s = "PROCESS-" + ((FlexoProcess) object).getName();
   } else if (object instanceof DMModel) {
     s = "DMMODEL-" + ((DMModel) object).getName();
   } else if (object instanceof DMEOEntity) {
     s = "DMEOENTITY-" + ((DMEOEntity) object).getName();
   } else if (object instanceof AbstractActivityNode) {
     s = "ACTIVITY-" + ((AbstractActivityNode) object).getName() + "-" + object.getFlexoID();
   } else if (object instanceof OperationNode) {
     s = "OPERATION-" + ((OperationNode) object).getName() + "-" + object.getFlexoID();
   } else if (object instanceof DKVModel) {
     s = "DKVMODEL-" + ((DKVModel) object).getName();
   } else if (object instanceof FlexoNavigationMenu) {
     s = "MENU-" + ((FlexoNavigationMenu) object).getName();
   } else if (object instanceof IEPopupComponent) {
     s = "POPUP-" + ((IEPopupComponent) object).getName();
   } else if (object instanceof IETabComponent) {
     s = "TAB-" + ((IETabComponent) object).getName();
   } else if (object instanceof IEPageComponent) {
     s = "PAGE-" + ((IEPageComponent) object).getName();
   } else {
     s = object.getFullyQualifiedName();
   }
   return getValidReference(DocGeneratorConstants.DG_LABEL_PREFIX + s);
 }
コード例 #2
0
 /**
  * Request to supplied SelectionListener of this SelectionManager to be back-synchronized with
  * current selection
  */
 public void fireUpdateSelection(SelectionListener selectionListenerToSynchronize) {
   selectionListenerToSynchronize.fireResetSelection();
   for (Enumeration<FlexoModelObject> e = getSelection().elements(); e.hasMoreElements(); ) {
     FlexoModelObject o = e.nextElement();
     if (!o.isDeleted()) {
       selectionListenerToSynchronize.fireObjectSelected(o);
     }
   }
 }
コード例 #3
0
ファイル: DGGenerator.java プロジェクト: bmangez/openflexo
 public static String screenshotName(FlexoModelObject o) {
   return CGSymbolicDirectory.FIGURES
       + "/"
       + o.getProject()
           .getScreenshotResource(o, true)
           .getFile()
           .getName()
           .substring(0, o.getProject().getScreenshotResource(o).getFile().getName().length() - 4);
 }
コード例 #4
0
 private void updateObservedObjects() {
   for (Enumeration en = _observedObjects.elements(); en.hasMoreElements(); ) {
     FlexoModelObject observed = (FlexoModelObject) en.nextElement();
     observed.deleteObserver(this);
   }
   _observedObjects.clear();
   for (int i = 0; i < getRowCount(); i++) {
     D observed = elementAt(i);
     _observedObjects.add(observed);
     observed.addObserver(this);
   }
 }
コード例 #5
0
 protected boolean isInspectable(InspectableObject object) {
   if (!(object instanceof FlexoModelObject)) {
     return true;
   }
   FlexoModelObject obj = (FlexoModelObject) object;
   if (obj.getContext() != null) {
     if (obj.getContext() instanceof PalettePanel) {
       return (((PalettePanel) obj.getContext()).isEdited());
     }
   }
   return true;
 }
コード例 #6
0
 protected boolean isSelectable(FlexoModelObject object) {
   if (object == null) {
     return false;
   }
   if (object.isDeleted()) {
     return false;
   }
   if (object.getContext() != null) {
     if (object.getContext() instanceof PalettePanel) {
       return (((PalettePanel) object.getContext()).isEdited());
     }
   }
   return true;
 }
コード例 #7
0
 @Override
 public String toString() {
   String returned = super.toString() + "\n";
   for (Enumeration<FlexoModelObject> en = _selection.elements(); en.hasMoreElements(); ) {
     FlexoModelObject o = en.nextElement();
     StringTokenizer st = new StringTokenizer(o.getClass().getName(), ".");
     String className = "";
     while (st.hasMoreTokens()) {
       className = st.nextToken();
     }
     returned += "> " + className + ":" + o + "\n";
   }
   return returned;
 }
コード例 #8
0
  @Override
  protected void initializeFIBComponent() {
    super.initializeFIBComponent();
    FIBBrowser browser = retrieveFIBBrowser(getFIBComponent());
    if (browser == null) {
      logger.warning("Could not retrieve FIBBrowser for component " + getFIBComponent());
      return;
    }
    if (!browser.getClickAction().isSet() || !browser.getClickAction().isValid()) {
      browser.setClickAction(
          new DataBinding("controller.singleClick(" + browser.getName() + ".selected)"));
    }
    if (!browser.getDoubleClickAction().isSet() || !browser.getDoubleClickAction().isValid()) {
      browser.setDoubleClickAction(
          new DataBinding("controller.doubleClick(" + browser.getName() + ".selected)"));
    }
    if (!browser.getRightClickAction().isSet() || !browser.getRightClickAction().isValid()) {
      browser.setRightClickAction(
          new DataBinding("controller.rightClick(" + browser.getName() + ".selected,event)"));
    }

    for (FIBBrowserElement el : browser.getElements()) {
      if (el.getDataClass() != null) {
        if (FlexoModelObject.class.isAssignableFrom(el.getDataClass())) {
          List<FlexoActionType> actionList = FlexoModelObject.getActionList(el.getDataClass());
          for (FlexoActionType actionType : actionList) {
            el.addToActions(new FIBBrowserActionAdapter(actionType));
          }
        }
      }
    }
  }
コード例 #9
0
 @Override
 public FlexoProject getProject() {
   if (_rootObject != null) {
     return _rootObject.getProject();
   }
   return null;
 }
コード例 #10
0
 @Override
 public ValidationIssue<RequiredBindingValidationRule<T>, T> applyValidation(final T object) {
   final FlexoModelObject validatedObject = object;
   BindingDefinition bd = (BindingDefinition) validatedObject.objectForKey(bindingDefinition);
   AbstractBinding bv = (AbstractBinding) validatedObject.objectForKey(bindingName);
   if (bd == null) {
     logger.warning(
         "Object of type "
             + object.getClass().getName()
             + " does not define any '"
             + bindingDefinition
             + "' binding definition");
     return null;
   } else if (bd.getIsMandatory()) {
     if ((bv == null) || (!bv.isBindingValid())) {
       ValidationError<RequiredBindingValidationRule<T>, T> error;
       if (bv == null) {
         error =
             new ValidationError<RequiredBindingValidationRule<T>, T>(this, object, null) {
               @Override
               public String getLocalizedMessage() {
                 return getLocalizedErrorMessageForUndefinedValue();
               }
             };
       } else { // !bv.isBindingValid()
         error =
             new ValidationError<RequiredBindingValidationRule<T>, T>(this, object, null) {
               @Override
               public String getLocalizedMessage() {
                 return getLocalizedErrorMessageForInvalidValue();
               }
             };
       }
       if (object instanceof IEWidget) {
         error.addToFixProposals(new AddEntryToComponentAndSetBinding(bindingName, bd));
       }
       Vector allAvailableBV = bd.searchMatchingBindingValue((Bindable) validatedObject, 2);
       for (int i = 0; i < allAvailableBV.size(); i++) {
         BindingValue proposal = (BindingValue) allAvailableBV.elementAt(i);
         error.addToFixProposals(new SetBinding(proposal));
       }
       return error;
     }
     return null;
   }
   return null;
 }
コード例 #11
0
ファイル: DGGenerator.java プロジェクト: bmangez/openflexo
 public static Icon screenshot(FlexoModelObject o, ProjectDocGenerator pdg) {
   FlexoCopiedResource r = pdg.getScreenshot(o);
   if (r != null) {
     if (r.getFile().exists()) {
       return new ImageIcon(r.getFile().getAbsolutePath());
     } else {
       if (r.getResourceToCopy() != null) {
         return new ImageIcon(r.getResourceToCopy().getFile().getAbsolutePath());
       }
     }
   }
   return new ImageIcon(o.getProject().getScreenshotResource(o, true).getFile().getAbsolutePath());
 }
コード例 #12
0
 @Override
 public void notifyObjectCreated(FlexoModelObject object) {
   if (logger.isLoggable(Level.FINE)) {
     logger.fine("notifyObjectCreated: " + object);
   }
   if (_currentlyPerformedActionStack.isEmpty()
       && _currentlyUndoneActionStack.isEmpty()
       && _currentlyRedoneActionStack.isEmpty()
       && WARN_MODEL_MODIFICATIONS_OUTSIDE_FLEXO_ACTION_LAYER) {
     logger.warning("FlexoModelObject " + object + " created outside of FlexoAction context !!!");
   } else if (!_currentlyPerformedActionStack.isEmpty()) {
     _createdAndNotNotifiedObjects.get(_currentlyPerformedActionStack.peek()).add(object);
   }
   object.setDocFormat(FlexoDocFormat.HTML, false);
 }
コード例 #13
0
 static {
   FlexoModelObject.addActionForClass(RefreshHistory.actionType, CGObject.class);
 }
コード例 #14
0
 static {
   FlexoModelObject.addActionForClass(actionType, DMModel.class);
   FlexoModelObject.addActionForClass(actionType, PersistantDataRepositoryFolder.class);
 }
コード例 #15
0
ファイル: SaveCVSFile.java プロジェクト: agilebirds/openflexo
 static {
   FlexoModelObject.addActionForClass(SaveCVSFile.actionType, CVSFile.class);
 }
コード例 #16
0
 static {
   FlexoModelObject.addActionForClass(GenerateSourceCode.actionType, CGObject.class);
 }
コード例 #17
0
 static {
   FlexoModelObject.addActionForClass(actionType, FlexoPostCondition.class);
 }
コード例 #18
0
 static {
   FlexoModelObject.addActionForClass(actionType, ViewObject.class);
 }
コード例 #19
0
 static {
   FlexoModelObject.addActionForClass(actionType, DMModel.class);
   FlexoModelObject.addActionForClass(actionType, DMPackage.class);
   FlexoModelObject.addActionForClass(actionType, LoadableDMEntity.class);
 }
コード例 #20
0
 static {
   FlexoModelObject.addActionForClass(MakeFlexoProcessContextFree.actionType, FlexoProcess.class);
 }
コード例 #21
0
 static {
   FlexoModelObject.addActionForClass(
       DeclareConnectorInEditionPattern.actionType, ExampleDrawingConnector.class);
 }
コード例 #22
0
 static {
   FlexoModelObject.addActionForClass(
       AddExampleDrawingShape.actionType, ExampleDrawingShema.class);
   FlexoModelObject.addActionForClass(
       AddExampleDrawingShape.actionType, ExampleDrawingShape.class);
 }
コード例 #23
0
 static {
   FlexoModelObject.addActionForClass(actionType, FlexoWorkflow.class);
 }