Class OPIShell

java.lang.Object
org.csstudio.opibuilder.runmode.OPIShell
All Implemented Interfaces:
IOPIRuntime, IAdaptable, IWorkbenchPart

public final class OPIShell extends Object implements IOPIRuntime
An OPIShell is a CS-Studio OPI presented in an SWT shell, which allows more free integration with the host operating system. In most ways it behaves like an OPIView. All OPIShells are maintained in a static set within this class. To maintain a cache of all shells, construction is limited to a static method. The private constructor means that this class cannot be extended. In order for the OPIShell to be integrated with Eclipse functionality, in particular the right-click context menu, it needs to be registered against an existing IViewPart.
  • Field Details

  • Method Details

    • registerWithView

      public void registerWithView(IViewPart view)
      In order for the right-click menu to work, this shell must be registered with a view. Register the context menu against the view. Make the view the default.
      Parameters:
      view -
    • notifyParentViewClosed

      public void notifyParentViewClosed()
      Register that the parent view has been disposed so need to re-register this shell with a new view if available, otherwise the context menu will fail
    • getMacrosInput

      public MacrosInput getMacrosInput()
    • getPath

      public IPath getPath()
    • raiseToTop

      public void raiseToTop()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • close

      public void close()
    • openOPIShell

      public static void openOPIShell(IPath path, MacrosInput macrosInput)
      This is the only way to create an OPIShell. Logs an error and cleans up if path is null.
    • closeAll

      public static void closeAll()
      Close all open OPIShells. Use getAllShells() for a copy of the set, to avoid removing items during iteration.
    • showAll

      public static void showAll()
      Show all open OPIShells.
    • getOPIShellForShell

      public static OPIShell getOPIShellForShell(Shell target)
      Search the cache of open OPIShells to find a match for the input Shell object. Return associated OPIShell or Null if none found
    • getAllShells

      public static Set<OPIShell> getAllShells()
      Return a copy of the set of open shells. Returning the same instance may lead to problems when closing shells.
      Returns:
      a copy of the set of open shells.
    • getActiveShell

      public static OPIShell getActiveShell()
      Return the active shell, which may be null
      Returns:
      the active OPIShell
    • addPropertyListener

      public void addPropertyListener(IPropertyListener listener)
      Partial implementation of IOPIRuntime
      Specified by:
      addPropertyListener in interface IWorkbenchPart
    • createPartControl

      public void createPartControl(Composite parent)
      Specified by:
      createPartControl in interface IWorkbenchPart
    • dispose

      public void dispose()
      Specified by:
      dispose in interface IWorkbenchPart
    • getSite

      public IWorkbenchPartSite getSite()
      Specified by:
      getSite in interface IWorkbenchPart
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface IWorkbenchPart
    • getTitleImage

      public Image getTitleImage()
      Specified by:
      getTitleImage in interface IWorkbenchPart
    • getTitleToolTip

      public String getTitleToolTip()
      Specified by:
      getTitleToolTip in interface IWorkbenchPart
    • removePropertyListener

      public void removePropertyListener(IPropertyListener listener)
      Specified by:
      removePropertyListener in interface IWorkbenchPart
    • setFocus

      public void setFocus()
      Specified by:
      setFocus in interface IWorkbenchPart
    • getAdapter

      public <T> T getAdapter(Class<T> adapter)
      Specified by:
      getAdapter in interface IAdaptable
    • setWorkbenchPartName

      public void setWorkbenchPartName(String name)
      Description copied from interface: IOPIRuntime
      Set workbench part name. It calls setPartName() from editor or view to make it public visible.
      Specified by:
      setWorkbenchPartName in interface IOPIRuntime
    • setOPIInput

      public void setOPIInput(IEditorInput input) throws PartInitException
      Render a new OPI in the same shell.
      Specified by:
      setOPIInput in interface IOPIRuntime
      Throws:
      PartInitException
    • getOPIInput

      public IEditorInput getOPIInput()
      Specified by:
      getOPIInput in interface IOPIRuntime
      Returns:
      the OPI input of the runtime.
    • getDisplayModel

      public DisplayModel getDisplayModel()
      Specified by:
      getDisplayModel in interface IOPIRuntime
      Returns:
      the display model in this runtime.
    • isDisposed

      public boolean isDisposed()