Package org.openbp.guiclient.model.item.itemtree

Examples of org.openbp.guiclient.model.item.itemtree.ItemTreeState


    itemTree.setSupportedObjectClasses(new Class [] { Model.class, ProcessItem.class, InitialNode.class, });

    // Select initial nodes only
    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


    // Display models and data types
    itemTree.setSupportedItemTypes(new String [] { ItemTypes.MODEL, ItemTypes.TYPE, });
    itemTree.setSelectableItemTypes(new String [] { ItemTypes.TYPE, });

    // Set the initial state of the item tree
    ItemTreeState state = new ItemTreeState();

    // Open the tree at the model of the target item
    Model currentModel = getParam().getProcess().getOwningModel();
    state.addExpandedQualifier(currentModel.getQualifier());

    // Select the current data type if present
    if (getExpression() != null)
    {
      // Try to determine the new data type and perform a default configuration
      // of the member according to its new type
      DataTypeItem type = (DataTypeItem) currentModel.resolveItemRef(getExpression(), ItemTypes.TYPE);
      if (type != null)
      {
        state.addSelectedQualifier(type.getQualifier());
      }
      else
      {
        state.addSelectedQualifier(currentModel.getQualifier());
      }
    }

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

          dlg.setSupportedItemTypes(new String [] { ItemTypes.MODEL, ItemTypes.PROCESS });
          dlg.setSelectableItemTypes(new String [] { ItemTypes.PROCESS });
          dlg.setSupportedObjectClasses(new Class [] { Node.class });
          dlg.setSelectableObjectClasses(new Class [] { Node.class });

          ItemTreeState state = new ItemTreeState();
          state.addExpandedQualifier(model.getQualifier());

          // Build the tree, expanding the first level and the currently selected item
          dlg.rebuildTree();
          dlg.expand(1);
          dlg.restoreState(state);
View Full Code Here

      catch (ModelException e)
      {
      }
    }

    ItemTreeState state = new ItemTreeState();

    Model currentModel = null;
    if (object != null)
    {
      // Open the current object
      currentModel = object.getOwningModel();
    }
    else
    {
      // Open the current model
      if (model != null)
      {
        currentModel = model;
      }

      if (openSystemModel)
      {
        // Open the System model
        currentModel = ModelConnector.getInstance().getModelByQualifier(CoreConstants.SYSTEM_MODEL_QUALIFIER);
      }
    }
    if (currentModel != null)
    {
      state.addExpandedQualifier(currentModel.getQualifier());
    }

    // Select the previously selected initial nodes if present
    if (object != null)
    {
      state.addSelectedQualifier(object.getQualifier());
    }
    else if (objectRef != null)
    {
      state.addSelectedQualifier(new ModelQualifier(objectRef));
    }
    else
    {
      if (currentModel != null)
      {
        state.addSelectedQualifier(currentModel.getQualifier());
      }
    }

    // Instantiate the customizer class
    if (customizer == null && customizerClassName != null)
View Full Code Here

TOP

Related Classes of org.openbp.guiclient.model.item.itemtree.ItemTreeState

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.