Package org.openbp.core.model

Examples of org.openbp.core.model.ModelObject


      // Single element selected, show it in the property browser.
      Figure figure = (Figure) selection.get(0);

      if (figure instanceof ProcessElementContainer)
      {
        ModelObject mo = ((ProcessElementContainer) figure).getReferredProcessElement();
        Object originalObject = null;

        // Determine the item the figure element references to
        Item referencedItem = null;
        if (mo instanceof SubprocessNode)
        {
          referencedItem = ((SubprocessNode) mo).getSubprocess();
        }

        if (editor() instanceof NodeItemEditorPlugin)
        {
          // We are in the nodeeditor, we need not the process object,
          // but the item behind it
          if (referencedItem != null)
          {
            // Get the reference object for name uniqueness checks
            originalObject = ModelConnector.getInstance().getItemByQualifier(referencedItem.getQualifier(), false);

            // We will edit the referenced item directly
            mo = referencedItem;
          }
        }
        else
        {
          if (mo instanceof MultiSocketNode)
          {
            MultiSocketNode node = (MultiSocketNode) mo;

            // If we edit an activity node, create a configuration bean if not already there
            // in order to be able to edit the settings in the property browser.
            // The bean will be removed if it contains the default values only when saving the activity node again
            // (see plugin_propertybrowser_executesave () in the ModelerEventModule)
            if (node.getConfigurationBean() == null)
            {
              // We create a new configuration bean (if defined by the underlying activity)
              if (referencedItem != null)
              {
                node.setConfigurationBean(referencedItem.createConfigurationBean());
              }
            }
          }
        }

        // Make sure the global reference names are up to date or else we may have trouble
        // saving the object (the ModelObjectValidator will try to rebuild the references from the names)
        mo.maintainReferences(ModelObject.SYNC_GLOBAL_REFNAMES | ModelObject.SYNC_LOCAL_REFNAMES);

        String title = mo.getName();
        String modelObjectTypeName = mo.getModelObjectTypeName();
        if (modelObjectTypeName != null)
        {
          title = title + " (" + modelObjectTypeName + ")";
        }

        // Send the object to the OE
        modeler.fireEvent(new PropertyBrowserSetEvent(modeler, mo, originalObject, false, mo.getDescription(), title, null, false, true));

        // Show object description in info panel
        modeler.fireEvent(new JaspiraEvent(modeler, "plugin.infopanel.setinfotext", mo));
      }
View Full Code Here


    for (int i = 0; i < paths.length; ++i)
    {
      ItemTreeNode node = (ItemTreeNode) paths [i].getLastPathComponent();
      if (node instanceof ModelObjectNode)
      {
        ModelObject object = ((ModelObjectNode) node).getModelObject();
        return object.getOwningModel();
      }
      else if (node instanceof GroupNode)
      {
        return ((ModelNode) node.getParent()).getModel();
      }
View Full Code Here

    for (int i = 0; i < paths.length; ++i)
    {
      ItemTreeNode node = (ItemTreeNode) paths [i].getLastPathComponent();
      if (node instanceof ModelObjectNode)
      {
        ModelObject object = ((ModelObjectNode) node).getModelObject();
        if (isSelectable(object))
        {
          if (list == null)
            list = new ArrayList();
          list.add(object);
View Full Code Here

   */
  public ItemTreeNode findNodeByObject(Object object, ItemTreeNode node)
  {
    if (node instanceof ModelObjectNode)
    {
      ModelObject o = ((ModelObjectNode) node).getModelObject();
      if (o == object)
        return node;
    }

    int n = node.getChildCount();
View Full Code Here

          // Recurse down
          int n = children.size();
          for (int i = 0; i < n; ++i)
          {
            ModelObject child = (ModelObject) children.get(i);

            if (isSupported(child))
            {
              ModelObjectNode objectNode = new ModelObjectNode(child, this);
              addChild(objectNode);
View Full Code Here

    TreePath path = tree.getPathForRow(selectedRow);
    TreeNode node = (TreeNode) path.getLastPathComponent();
    if (node instanceof LeafNode)
    {
      ModelObject mo = (ModelObject) ((LeafNode) node).getLeafData();
      ModelQualifier qualifier = mo.getQualifier();

      if (qualifier.getItemType().equals(ItemTypes.PROCESS))
      {
        // Open the process of select the node/socket/parameter
        ProcessItem process = getProcess(mo);
View Full Code Here

      for (int i = 0; i < flavor.length; i++)
      {
        if (flavor [i].equals(ClientFlavors.MODEL_OBJECT))
        {
          ModelObject mo = (ModelObject) ie.getSafeTransferData(flavor [i]);
          configuratorSupport.addConfiguratorMenuOptions(mo, group);
        }

        if (flavor [i].equals(ModelerFlavors.FIGURE))
        {
View Full Code Here

      }
      else if (((ProcessDrawing) getDrawing()).getProcess().getNodeByName(text) != null)
      {
        for (Iterator it = po.getContainerIterator(); it.hasNext();)
        {
          ModelObject mo = (ModelObject) it.next();
          if (mo.getName().equals(text) && mo != po)
          {
            msg = "An element having this name already exists.";
            break;
          }
        }
View Full Code Here

    for (int i = 0; i < paths.length; ++i)
    {
      ItemTreeNode node = (ItemTreeNode) paths [i].getLastPathComponent();
      if (node instanceof ModelObjectNode)
      {
        ModelObject object = ((ModelObjectNode) node).getModelObject();
        if (isSelectable(object))
        {
          String memberPath = determineNodePath(node);
          if (list == null)
            list = new ArrayList();
View Full Code Here

    while (node != rootNode)
    {
      if (node instanceof ModelObjectNode)
      {
        ModelObject object = ((ModelObjectNode) node).getModelObject();
        String name = object.getName();

        if (sb.length() == 0)
        {
          sb.append(name);
        }
View Full Code Here

TOP

Related Classes of org.openbp.core.model.ModelObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.