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
FieldsFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyListener(IPropertyListener listener) Partial implementation of IOPIRuntimevoidclose()static voidcloseAll()Close all open OPIShells.voidcreatePartControl(Composite parent) voiddispose()booleanstatic OPIShellReturn the active shell, which may be null<T> TgetAdapter(Class<T> adapter) Return a copy of the set of open shells.static OPIShellgetOPIShellForShell(Shell target) Search the cache of open OPIShells to find a match for the input Shell object.getPath()getSite()getTitle()booleanvoidRegister 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 voidopenOPIShell(IPath path, MacrosInput macrosInput) This is the only way to create an OPIShell.voidvoidregisterWithView(IViewPart view) In order for the right-click menu to work, this shell must be registered with a view.voidremovePropertyListener(IPropertyListener listener) voidsetFocus()voidsetOPIInput(IEditorInput input) Render a new OPI in the same shell.voidsetWorkbenchPartName(String name) Set workbench part name.static voidshowAll()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:
addPropertyListenerin interfaceIWorkbenchPart
-
createPartControl
- Specified by:
createPartControlin interfaceIWorkbenchPart
-
dispose
public void dispose()- Specified by:
disposein interfaceIWorkbenchPart
-
getSite
- Specified by:
getSitein interfaceIWorkbenchPart
-
getTitle
- Specified by:
getTitlein interfaceIWorkbenchPart
-
getTitleImage
- Specified by:
getTitleImagein interfaceIWorkbenchPart
-
getTitleToolTip
- Specified by:
getTitleToolTipin interfaceIWorkbenchPart
-
removePropertyListener
- Specified by:
removePropertyListenerin interfaceIWorkbenchPart
-
setFocus
public void setFocus()- Specified by:
setFocusin interfaceIWorkbenchPart
-
getAdapter
- Specified by:
getAdapterin interfaceIAdaptable
-
setWorkbenchPartName
Description copied from interface:IOPIRuntimeSet workbench part name. It calls setPartName() from editor or view to make it public visible.- Specified by:
setWorkbenchPartNamein interfaceIOPIRuntime
-
setOPIInput
Render a new OPI in the same shell.- Specified by:
setOPIInputin interfaceIOPIRuntime- Throws:
PartInitException
-
getOPIInput
- Specified by:
getOPIInputin interfaceIOPIRuntime- Returns:
- the OPI input of the runtime.
-
getDisplayModel
- Specified by:
getDisplayModelin interfaceIOPIRuntime- Returns:
- the display model in this runtime.
-
isDisposed
public boolean isDisposed()
-