Class CCloseAction


@EclipseTabDockAction public class CCloseAction extends CDropDownItem<CCloseAction.Action>
An action that can close any CDockable by calling CDockable.setVisible(boolean). Clients can either create one CCloseAction for each CDockable or use one action for many CDockables at the same time.
Author:
Benjamin Sigg
  • Constructor Details

    • CCloseAction

      public CCloseAction(CControl control)
      Creates a new action
      Parameters:
      control - the control for which this action will be used
  • Method Details

    • createAction

      protected CCloseAction.Action createAction()
      Creates the action that is used for CDecorateableAction.intern().
      Returns:
      the internal representation of this action
    • close

      public void close(CDockable dockable)
      Closes dockable now. This method is always called when this action is triggered, so this is the optimal method to be overridden and extended with new features like a JOptionPane asking whether dockable should really be closed.
      Note: Consider using the CVetoClosingListener instead, it can handle all kind of closing events.
      Parameters:
      dockable - the element to close