Class DockingManager

java.lang.Object
org.jppf.ui.options.docking.DockingManager

public final class DockingManager extends Object
This class handles the docking / undocking of of the tabs in all tabbed views.
Author:
Laurent Cohen
  • Field Details

    • VIEW_PREFIX

      public static final String VIEW_PREFIX
      Prefix for the name of each view.
    • INITIAL_VIEW

      public static final String INITIAL_VIEW
      Name of the initial / main view.
  • Method Details

    • getInstance

      public static DockingManager getInstance()
      Get the docking manager for the JVM.
      Returns:
      an instance of DockingManager.
    • setMainView

      public void setMainView(Frame frame, OptionContainer container)
      Set the main view for the application.
      Parameters:
      frame - the Frame to set as the main view.
      container - the option container for the view.
    • register

      public void register(OptionElement element, Component listenerComponent)
      Add a new component to the map of detachable components.
      Parameters:
      element - the component to add.
      listenerComponent - the UI component which has the mouse listener.
    • update

      public void update(OptionElement element, Component listenerComponent)
      Add a new component to the map of detachable components.
      Parameters:
      element - the component to add.
      listenerComponent - the UI component which has the mouse listener.
    • isRegistered

      public boolean isRegistered(OptionElement element)
      Add a new component to the map of detachable components.
      Parameters:
      element - the component to add.
      Returns:
      true if the component is already registered, false otherwise.
    • attach

      public void attach(OptionElement element, String viewId)
      Attach a new component to the specvified view.
      Parameters:
      element - the component to qttqch to the viez.
      viewId - the id of the viez to zhcih to attach the co;ponent.
    • createView

      public String createView()
      Create a new view.
      Returns:
      the id of the view.
    • getView

      public ViewDescriptor getView(String viewId)
      Get the view with the specified id.
      Parameters:
      viewId - the id of the view to find.
      Returns:
      a ViewDescriptor object.
    • getComponent

      public DetachableComponentDescriptor getComponent(Component comp)
      Get the detachable component for the specified AWT component.
      Parameters:
      comp - the component for which to find a descriptor.
      Returns:
      a DetachableComponentDescriptor object.
    • getComponentFromListenerComp

      public DetachableComponentDescriptor getComponentFromListenerComp(Component comp)
      Get the detachable component for the specified AWT component on which the mouse listener is registered.
      Parameters:
      comp - the component for which to find a descriptor.
      Returns:
      a DetachableComponentDescriptor object.
    • getViewIdForContainer

      public String getViewIdForContainer(OptionContainer container)
      Get the id of the view that contains the specified container.
      Parameters:
      container - the container tolook for.
      Returns:
      the id of the view which has the container as main container.
    • getMouseAdapter

      public org.jppf.ui.options.docking.DockingMouseAdapter getMouseAdapter()
      Get the mouse listener for the popup menu on right-click.
      Returns:
      an DockingMouseAdapter object.
    • dockToInitialContainer

      public void dockToInitialContainer(Component comp)
      Dock a component to its initial container.
      Parameters:
      comp - the component to move.
    • getViewMap

      public Map<String,ViewDescriptor> getViewMap()
      Get the Mapping of view ids to the corresponding UI frame.
      Returns:
      a map of string ids to ViewDescriptor instances.
    • findFirstElementWithName

      public OptionElement findFirstElementWithName(String name)
      Search all esiting views for an eklement with the specified name.
      Parameters:
      name - the name of the element to find.
      Returns:
      an OptionElement instance representing the element.