Package org.openbp.core.model

Examples of org.openbp.core.model.Model


    itemTree.setSelectableObjectClasses(new Class [] { InitialNode.class, });

    ItemTreeState state = new ItemTreeState();

    Item item = wizard.getContext().getItem();
    Model currentModel = item.getOwningModel();

    if (item instanceof ProcessItem)
    {
      // Open the tree at the target item
      state.addExpandedQualifier(item.getQualifier());
    }
    else
    {
      // Open the tree at the model of the target item
      state.addExpandedQualifier(currentModel.getQualifier());
    }

    // Select the previously selected initial nodes if present
    ProcessEntrySettings settings = (ProcessEntrySettings) getGeneratorSettings();
    List entries = settings.getEntryList();
    if (entries != null)
    {
      int n = entries.size();
      for (int i = 0; i < n; ++i)
      {
        ProcessEntry entry = (ProcessEntry) entries.get(i);

        InitialNode initialNode = entry.getInitialNode();
        if (initialNode != null)
        {
          state.addSelectedQualifier(initialNode.getQualifier());
        }
      }
    }
    else
    {
      state.addSelectedQualifier(currentModel.getQualifier());
    }

    itemTree.rebuildTree();
    itemTree.expand(1);
    itemTree.restoreState(state);
View Full Code Here


    {
      // Perform template-based generation step

      // Search the template file in the chosen template set directory and backwards
      Item item = context.getItem();
      Model model = item.getOwningModel();
      String modelPath = model.getModelPath();

      context.setProperty("modelPath", modelPath);
      context.setProperty("model", model);
      context.setProperty("item", item);
      context.setProperty("overwriteMode", context.getOverwriteMode());
View Full Code Here

    /**
     * Adds the child objects of this model object.
     */
    protected void addChildObjects()
    {
      Model model = getModel();
      if (model == null)
      {
        addModels();
      }
      else
View Full Code Here

        // Recurse down
        int n = models.size();
        for (int i = 0; i < n; ++i)
        {
          Model subModel = (Model) models.get(i);

          ModelNode modelNode = new ModelNode(subModel, this);
          addChild(modelNode);

          modelNode.addChildObjects();
View Full Code Here

   * @param jae Event
   * @return The event status code
   */
  public JaspiraEventHandlerCode publish(JaspiraActionEvent jae)
  {
    Model model = itemBrowser.getSelectedModel(0);
    if (model == null)
      return EVENT_IGNORED;

    // Fire the event that starts the publisher wizard
    itemBrowser.fireEvent("plugin.publisher.publish", model);
View Full Code Here

   * @return The suffix ("1", "2", ... according to names like "name", "name2", ...)
   * or null if the supplied name is already unique
   */
  public String determineUniqueSuffix(final Item item, final String name)
  {
    Model model = item.getModel();
    String itemType = item.getItemType();

    Iterator itemIterator = model.getItems(itemType);
    List items = new ArrayList();
    CollectionUtil.addAll(items, itemIterator);

    String result = NamedObjectCollectionUtil.createUniqueId(items, name);
    if (result.equals(name))
View Full Code Here

      try
      {
        // Try to load the model. If it can be loaded, then store it
        // in the node. This makes it possible to toggle between the
        // display name and the name
        Model model = ModelConnector.getInstance().getModelByQualifier(modelQualifier);
        modelNode.setNodeMapper(displayMapper);
        modelNode.setPropertyData(model);
      }
      catch (OpenBPException e)
      {
View Full Code Here

   *
   * @param item Current item or null
   */
  private void updateActionStatus(Item item)
  {
    Model model = item != null ? item.getOwningModel() : null;

    if (removeAction != null)
    {
      removeAction.setEnabled(item != null && model.isModifiable());
    }

    if (runAction != null)
    {
      runAction.setEnabled(model != null);
View Full Code Here

   *
   * @return The selected model or the model of the selected item or null
   */
  public Model getSelectedModel(int flag)
  {
    Model ret = null;

    if ((flag & ItemBrowserPlugin.GUESS_MODEL) != 0)
    {
      ret = itemTree.determineSelectedModel();
      if (ret != null)
View Full Code Here

  }

  public boolean canPaste(Transferable transferable)
  {
    // We can paste if there is an item on the clipboard
    Model model = getSelectedModel(ItemBrowserPlugin.GUESS_MODEL | ItemBrowserPlugin.USE_CURRENT_MODEL);
    if (model != null && model.isModifiable() && transferable != null && transferable.isDataFlavorSupported(ClientFlavors.ITEM))
      return true;
    return false;
  }
View Full Code Here

TOP

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

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.