Examples of ItemSelectionDialog


Examples of org.gvt.inspector.ItemSelectionDialog

    else
    {
      pathways = new ArrayList<String>();
      pathways.addAll(main.getOpenTabNames());

      ItemSelectionDialog dialog = new ItemSelectionDialog(main.getShell(),
        500,
        "Pathway Selection Dialog",
        "Select pathways to view",
        allNames, pathways, true, true, null);

      dialog.open();

      if (dialog.isCancelled())
      {
        pathways = null;
        return;
      }
View Full Code Here

Examples of org.gvt.inspector.ItemSelectionDialog

        allEntityNames.add(name);
      }

      List<String> userSelection = new ArrayList<String>();

      ItemSelectionDialog dialog = new ItemSelectionDialog(main.getShell(), 350,
        "Entity Selection Dialog",
        "Select entities whose neighborhood is to be found",
        allEntityNames,
        userSelection,
        true, true, null);

      dialog.setMinValidSelect(1);
      dialog.setDoSort(true);
      dialog.open();

      if (!dialog.isCancelled())
      {
        for (String s : userSelection)
        {
          entities.add(nametoEntityMap.get(s));
        }
View Full Code Here

Examples of org.gvt.inspector.ItemSelectionDialog

      {
        type = types.iterator().next();
      }
      else
      {
        ItemSelectionDialog dialog = new ItemSelectionDialog(main.getShell(),
          200,
          "Experiment Type Selection Dialog",
          "Select experiment type",
          new ArrayList<String>(types),
          new ArrayList<String>(),
          false,
          true,
          null);

        dialog.setMinValidSelect(1);
        type = dialog.open();

        if (dialog.isCancelled()) type = null;
      }
    }

    if (type != null)
    {
      ExperimentDataManagementDialog dialog = new ExperimentDataManagementDialog(
        main, main.getExperimentDataManager(type));

      dialog.open();

      // We do not want to remember this the next time
      type = null;
    }
  }
View Full Code Here

Examples of org.gvt.inspector.ItemSelectionDialog

    if (!pathIDs.isEmpty())
    {
      // Open a dialog so that user selected the specific path to visualize

      ItemSelectionDialog dialog = new ItemSelectionDialog(main.getShell(),
        250,
        "Path Selection Dialog",
        "Select path to visualize",
        pathIDs, new ArrayList<String>(), false, false, new Runner());

      dialog.setUpdateUponSelection(true);
      String lastItem = dialog.open();

      // Below lines are responsible for clearing any highlighting after closing the dialog.
      // But we do not want it to disappear. So this is disabled.
//      if (!lastItem.equals(ItemSelectionDialog.NONE))
//      {
View Full Code Here

Examples of org.gvt.inspector.ItemSelectionDialog

       
        if (!resultPathways.isEmpty())
        {
          ArrayList<String> selectedItems = new ArrayList<String>();

          ItemSelectionDialog dialog = new ItemSelectionDialog(main.getShell(),
            500,
            "Pathway Selection Dialog",
            "Select pathways to retrieve",
            resultPathways, selectedItems,
            true, true, null);

          dialog.setMinValidSelect(1);
          dialog.open();

          List<String> idList = new ArrayList<String>();

          if (!dialog.isCancelled())
          {
            for (String item : selectedItems)
            {
              idList.add(pathToID.get(item));
            }
View Full Code Here

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

          }
        }
        else if (choice == JMsgBox.TYPE_NO)
        {
          // Yes means reference an existing process
          ItemSelectionDialog dlg = new ItemSelectionDialog(ApplicationUtil.getActiveWindow(), true);

          String dlgTitle = res.getRequiredString("placeholder.referencedialog.select");
          dlg.setTitle(dlgTitle);

          // We may select a single object only
          dlg.setSelectionMode(ItemTree.SELECTION_SINGLE);
          dlg.setShowGroups(false);

          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);

          // Show the dialog
          dlg.setVisible(true);

          List selection = dlg.getSelectedObjects();
          if (selection != null)
          {
            ModelObject selectedObject = (ModelObject) selection.get(0);
            assignPlaceholderReference(selectedObject);
          }
View Full Code Here

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

    // Try to get the current model from the edited object
    Object o = getObject();
    final Model model = (o instanceof ModelObject) ? ((ModelObject) o).getOwningModel() : null;

    // Initialize the item selection dialog
    final ItemSelectionDialog dlg = new ItemSelectionDialog(ApplicationUtil.getActiveWindow(), true);
    dlg.setTitle(title);

    // We may select a single object only
    dlg.setSelectionMode(ItemTree.SELECTION_SINGLE);
    dlg.setShowGroups(false);

    // Determine the types of displayed and selectable objects from the editor parameters
    String [] supportedItemTypes = null;
    String [] selectableItemTypes = null;
    Class [] supportedObjectClasses = null;
    Class [] selectableObjectClasses = null;

    if (itemType != null)
    {
      if (supportedItemTypeList == null)
      {
        supportedItemTypeList = new ArrayList();
        supportedItemTypeList.add(ItemTypes.MODEL);
        if (!itemType.equals(ItemTypes.MODEL))
        {
          supportedItemTypeList.add(itemType);
        }
      }

      if (selectableItemTypeList == null)
      {
        selectableItemTypeList = new ArrayList();
        selectableItemTypeList.add(itemType);
      }
    }

    if (supportedItemTypeList != null)
      supportedItemTypes = CollectionUtil.toStringArray(supportedItemTypeList);
    if (selectableItemTypeList != null)
      selectableItemTypes = CollectionUtil.toStringArray(selectableItemTypeList);
    if (supportedObjectClassList != null)
      supportedObjectClasses = (Class []) CollectionUtil.toArray(supportedObjectClassList, Class.class);
    if (selectableObjectClassList != null)
      selectableObjectClasses = (Class []) CollectionUtil.toArray(selectableObjectClassList, Class.class);

    dlg.setSupportedItemTypes(supportedItemTypes);
    dlg.setSelectableItemTypes(selectableItemTypes);
    dlg.setSupportedObjectClasses(supportedObjectClasses);
    dlg.setSelectableObjectClasses(selectableObjectClasses);

    // Determine the current object from the value of the property (i. e. the object name)
    String objectRef = (String) value;
    ModelObject object = null;

    if (objectRef != null && itemType != null)
    {
      try
      {
        if (model != null)
        {
          object = model.resolveObjectRef(objectRef, itemType);
        }
        else
        {
          ModelQualifier qualifier = new ModelQualifier(objectRef);
          qualifier.setItemType(itemType);
          object = ModelConnector.getInstance().getItemByQualifier(qualifier, false);
        }
      }
      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)
    {
      try
      {
        customizer = (ComponentSelectionEditorCustomizer) ReflectUtil.instantiate(customizerClassName, ComponentSelectionEditorCustomizer.class, "component selection editor customizer class");
      }
      catch (Exception e)
      {
        ExceptionUtil.printTrace(e);
      }
    }

    if (customizer != null)
    {
      if (!customizer.initializeDialog(this, dlg))
        return;
    }

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

    dlg.addWindowListener(new WindowAdapter()
    {
      public void windowClosed(WindowEvent we)
      {
        List selection = dlg.getSelectedObjects();
        if (selection != null)
        {
          ModelObject selectedObject = (ModelObject) selection.get(0);

          if (customizer != null)
          {
            if (!customizer.dialogClosed(ComponentSelectionEditor.this, dlg, selectedObject))
              return;
          }

          String objectRef = null;
          if (model != null)
          {
            if (!(selectedObject instanceof ComplexTypeItem))
            {
              objectRef = model.determineObjectRef(selectedObject);
            }
          }

          if (objectRef == null)
          {
            objectRef = selectedObject.getQualifier().toString();
          }

          textField.setText(objectRef);
          textField.requestFocus();

          propertyChanged();
        }
        else
        {
          if (customizer != null)
          {
            customizer.dialogClosed(ComponentSelectionEditor.this, dlg, null);
          }
        }
      }
    });

    if (customizer != null)
    {
      if (!customizer.dialogInitialized(this, dlg))
        return;
    }

    // Show the dialog
    dlg.setVisible(true);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.