Overview | Package | Class | Tree | Deprecated | Index | Help
| Protégé-OWL 3.5 alpha
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.stanford.smi.protegex.owl.ui.resourceselection
Class ResourceSelectionAction

    java.lang.Object
      javax.swing.AbstractAction
          edu.stanford.smi.protegex.owl.ui.resourceselection.ResourceSelectionAction

All Implemented Interfaces:
  ResourceSelectionListener, ActionListener, Serializable, Cloneable, EventListener, Action

Direct Known Subclasses:
  AddClassToDomainAction, AddIndividualAction, AddNamedClassAction, AddPropertyAction, AddPropertyFormComponentAction, AddPropertyWidgetToFormAction, AddResourceAction, AddResourceAction, CreateValueAction, ExistentialAction, RemovePropertyWidgetFromFormAction, SetResourceAction

    public abstract class ResourceSelectionAction

extends AbstractAction
implements ResourceSelectionListener

An Action that requires the selection of an RDFResource from a List. This Action generalizes this behavior and separates selection from action, so that the selection can be made either through a conventional resource picking dialog or through a ResourceSelectionComboBox.

Author:
  Holger Knublauch
See Also:
  Serialized Form

Field Summary
`static boolean` | `activated` A ugly global flag that can be used to deactivate the right-click popup when working with huge ontologies (such as in database backend) for performance reasons.

Fields inherited from class javax.swing.AbstractAction
`changeSupport, enabled`

Fields inherited from interface javax.swing.Action
`ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON`

Constructor Summary
`ResourceSelectionAction(String name, Icon icon)` Constructs a new ResourceSelectionAction.
`ResourceSelectionAction(String name, Icon icon, boolean multipleSelection)` Constructs a new ResourceSelectionAction.

Method Summary
`void` | `actionPerformed(ActionEvent e)` Shows the frame picker dialog from `pickFrame` and then calls `resourceSelected` on the selected Frame.
`void` | `activateComboBox(JButton button)` Activates the right mouse click on a given JButton.
`ListCellRenderer` | `getRenderer()`
`abstract Collection` | `getSelectableResources()`
`boolean` | `getShowHiddenResources()`
`RDFResource` | `pickResource()` This method is used when single selection is allowed for this Action.
`Collection` | `pickResources()` This method is only used when multiple selection is allowed for this Action.
`static void` | `setActivated(boolean value)`
`void` | `setShowHiddenResources(boolean value)`

Methods inherited from class javax.swing.AbstractAction
`addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface edu.stanford.smi.protegex.owl.ui.resourceselection.ResourceSelectionListener
`resourceSelected`

Field Detail

### activated

    public static boolean activated

  A ugly global flag that can be used to deactivate the right-click popup when working with huge ontologies (such as in database backend) for performance reasons.

Constructor Detail

### ResourceSelectionAction

    public ResourceSelectionAction(String name,
                                   Icon icon)

  Constructs a new ResourceSelectionAction.

  Parameters:
    `name` - the name of the Action
    `icon` - the Icon

### ResourceSelectionAction

    public ResourceSelectionAction(String name,
                                   Icon icon,
                                   boolean multipleSelection)

  Constructs a new ResourceSelectionAction.

  Parameters:
    `name` - the name of the Action
    `icon` - the Icon
    `multipleSelection` - true to allow multiple selection of Frames

Method Detail

### actionPerformed

    public void actionPerformed(ActionEvent e)

  Shows the frame picker dialog from `pickFrame` and then calls `resourceSelected` on the selected Frame.

  Specified by:
    `actionPerformed` in interface `ActionListener`
  Parameters:
    `e` - ignored

### activateComboBox

    public void activateComboBox(JButton button)

  Activates the right mouse click on a given JButton. This installs a MouseListener to the JButton so that whenever the button is clicked with the right mouse button, a combobox will appear that provides the selection.

  Parameters:
    `button` -

### getRenderer

    public ListCellRenderer getRenderer()

### getSelectableResources

    public abstract Collection getSelectableResources()

### getShowHiddenResources

    public boolean getShowHiddenResources()

### pickResource

    public RDFResource pickResource()

  This method is used when single selection is allowed for this Action.

  Returns:
    the selected Frame

### pickResources

    public Collection pickResources()

  This method is only used when multiple selection is allowed for this Action. By default, it will call `pickFrame`.

  Returns:
    the Frame

### setActivated

    public static void setActivated(boolean value)

### setShowHiddenResources

    public void setShowHiddenResources(boolean value)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Protégé-OWL 3.5 alpha
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug report or feature request
Copyright (c) 1998-2012 Stanford University.