Package org.openbp.core.model.item

Examples of org.openbp.core.model.item.Item


   * @param qualifier Qualified name of the item
   * @return The item or null if the item was not found
   */
  private Item checkItemRef(ModelQualifier qualifier)
  {
    Item item = null;
    try
    {
      String itemType = qualifier.getItemType();
      if (itemType == null || itemType.equals(ItemTypes.MODEL))
      {
View Full Code Here


    {
      itemName = name;
      childName = null;
    }

    Item item = resolveItemRef(itemName, itemType);

    if (childName == null)
      return item;

    List children = item.getChildren();

    ModelObject object = (ModelObject) NamedObjectCollectionUtil.getByName(children, childName);

    if (object == null)
      // Cannot resolve the child
View Full Code Here

        return EVENT_IGNORED;
      }

      if (ie.isDataFlavorSupported(ClientFlavors.ITEM))
      {
        final Item item = (Item) ie.getSafeTransferData(ClientFlavors.ITEM);

        if (!(item instanceof Model))
        {
          // Add the 'Add to toolbox' action
          JaspiraAction action = new JaspiraAction(UserToolBoxPlugin.this, "toolbox.add")
          {
            public void actionPerformed(ActionEvent ae)
            {
              addToolBoxItem(new ToolBoxItem(item.getDisplayText(), ItemIconMgr.getInstance().getIcon(item, FlexibleSize.MEDIUM), item.getDescriptionText(), new ItemTransferable(item)));
              refreshContent();

              // Bring the toolbox to the front, but don't switch pages
              showPlugin(false);
            }
View Full Code Here

   * @param editedItemStatus Status of the item
   * @return The edited item or null if the user cancelled the wizard
   */
  public Item openItem(Item item, int editedItemStatus)
  {
    Item ret = super.openItem(item, editedItemStatus);

    disposeEditorJaspiraPage(editorWizardPage.getContentPanel());

    return ret;
  }
View Full Code Here

    try
    {
      clearPages();

      Item item = context.getItem();

      // Add the generator selection page only if the item does not contain generator info
      if (context.getSelectedGenerator() == null)
      {
        // Check if there are any generators defined for this item type that operate on items of this type
        List list = GeneratorMgr.getInstance().getGenerators(item.getItemType(), true);
        if (list != null)
        {
          // Create the selection page displaying all available
          // generators and add it to the wizard
          int n = list.size();
View Full Code Here

        // when leaving the settings page
        if (context.isEmptyItem())
        {
          // The item was not edited visually yet, customize it

          Item item = context.getItem();

          if (item instanceof ActivityItem)
          {
            // Update the geometry (i. e. the size) of the item node according to the default skin
            FigureUtil.updateItemGeometry(null, item);
View Full Code Here

     *
     * @param event Event to handle
     */
    public void handleWizardEvent(WizardEvent event)
    {
      Item item = context.getItem();

      if (event.eventType == WizardEvent.SHOW)
      {
        // This may take some time, so display the wait cursor
        ApplicationUtil.waitCursorOn();

        try
        {
          if (editorJaspiraPage == null)
          {
            createEditorJaspiraPage(getContentPanel());
          }

          // Convert the item to its respective node and add it to a dummy process
          ProcessItem dummyProcess = new ProcessItemImpl();
          dummyProcess.setName(NODEEDITOR_PROCESS_NAME);
          dummyProcess.setModel(item.getModel());

          // Determine which skin the process should use and initialize some process properties from the skin settings
          Skin processSkin = FigureUtil.determineProcessSkin(dummyProcess);
          processSkin.initalizeNewProcess(dummyProcess);

View Full Code Here

        {
          try
          {
            Object o = data.getTransferData(ClientFlavors.ITEM);

            Item item = null;

            if (o instanceof Item)
            {
              item = (Item) o;

              addToolBoxItem(new ToolBoxItem(item.getDisplayText(), ItemIconMgr.getInstance().getIcon(item, FlexibleSize.MEDIUM), item
                .getDescriptionText(), new BasicTransferable(item)));
              refreshContent();
            }
          }
          catch (UnsupportedFlavorException e)
View Full Code Here

   */
  protected Item readItemDescriptor(Model model, ItemTypeDescriptor itd, Resource itemDescriptorResource)
  {
    XMLDriver driver = XMLDriver.getInstance();

    Item item = null;

    // Deserialize item descriptor file
    try
    {
      if (itd.isContainedItem())
      {
        // Item is wrapped by a container class in its xml file
        ItemContainer container = (ItemContainer) driver.deserializeResource(ItemContainer.class, itemDescriptorResource);
        item = container.getItem();
      }
      else
      {
        item = (Item) driver.deserializeResource(itd.getItemClass(), itemDescriptorResource);
      }
    }
    catch (XMLDriverException pe)
    {
      getMsgContainer().addMsg(model, "Error reading component descriptor file $0 in model manager $1.", new Object[]
      {
        itemDescriptorResource.getDescription(), getClass().getName(), pe
      });
      return null;
    }

    // Explicitely make this item an item of the specified type
    item.setItemType(itd.getItemType());

    return item;
  }
View Full Code Here

      itItems = model.getItems(null);
    }

    while (itItems.hasNext())
    {
      Item item = (Item) itItems.next();

      String group = item.getFunctionalGroup();
      if (group != null)
      {
        map.put(group, group);
      }
    }
View Full Code Here

TOP

Related Classes of org.openbp.core.model.item.Item

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.