Package org.csstudio.opibuilder.runmode
Class OPIShell
java.lang.Object
org.csstudio.opibuilder.runmode.OPIShell
- All Implemented Interfaces:
IOPIRuntime
,IAdaptable
,IWorkbenchPart
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 Summary
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyListener
(IPropertyListener listener) Partial implementation of IOPIRuntimevoid
close()
static void
closeAll()
Close all open OPIShells.void
createPartControl
(Composite parent) void
dispose()
boolean
static OPIShell
Return the active shell, which may be null<T> T
getAdapter
(Class<T> adapter) Return a copy of the set of open shells.static OPIShell
getOPIShellForShell
(Shell target) Search the cache of open OPIShells to find a match for the input Shell object.getPath()
getSite()
getTitle()
boolean
void
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 failstatic void
openOPIShell
(IPath path, MacrosInput macrosInput) This is the only way to create an OPIShell.void
void
registerWithView
(IViewPart view) In order for the right-click menu to work, this shell must be registered with a view.void
removePropertyListener
(IPropertyListener listener) void
setFocus()
void
setOPIInput
(IEditorInput input) Render a new OPI in the same shell.void
setWorkbenchPartName
(String name) Set workbench part name.static void
showAll()
Show all open OPIShells.
-
Field Details
-
OPI_SHELLS_CHANGED_ID
- See Also:
-
-
Method Details
-
registerWithView
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
-
getPath
-
raiseToTop
public void raiseToTop() -
equals
-
close
public void close() -
openOPIShell
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
Search the cache of open OPIShells to find a match for the input Shell object. Return associated OPIShell or Null if none found -
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
Return the active shell, which may be null- Returns:
- the active OPIShell
-
addPropertyListener
Partial implementation of IOPIRuntime- Specified by:
addPropertyListener
in interfaceIWorkbenchPart
-
createPartControl
- Specified by:
createPartControl
in interfaceIWorkbenchPart
-
dispose
public void dispose()- Specified by:
dispose
in interfaceIWorkbenchPart
-
getSite
- Specified by:
getSite
in interfaceIWorkbenchPart
-
getTitle
- Specified by:
getTitle
in interfaceIWorkbenchPart
-
getTitleImage
- Specified by:
getTitleImage
in interfaceIWorkbenchPart
-
getTitleToolTip
- Specified by:
getTitleToolTip
in interfaceIWorkbenchPart
-
removePropertyListener
- Specified by:
removePropertyListener
in interfaceIWorkbenchPart
-
setFocus
public void setFocus()- Specified by:
setFocus
in interfaceIWorkbenchPart
-
getAdapter
- Specified by:
getAdapter
in interfaceIAdaptable
-
setWorkbenchPartName
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 interfaceIOPIRuntime
-
setOPIInput
Render a new OPI in the same shell.- Specified by:
setOPIInput
in interfaceIOPIRuntime
- Throws:
PartInitException
-
getOPIInput
- Specified by:
getOPIInput
in interfaceIOPIRuntime
- Returns:
- the OPI input of the runtime.
-
getDisplayModel
- Specified by:
getDisplayModel
in interfaceIOPIRuntime
- Returns:
- the display model in this runtime.
-
isDisposed
public boolean isDisposed()
-