Class OPIView
- All Implemented Interfaces:
IOPIRuntime
,IAdaptable
,IExecutableExtension
,IPersistable
,IViewPart
,IWorkbenchPart
,IWorkbenchPart2
,IWorkbenchPart3
,IWorkbenchPartOrientation
Similar to an RCP editor it is associated to an 'input', but provides only a view to that *.opi, executing its content.
Being a 'View' allows save/restore within a 'Perspective'.
RCP distinguishes instances via their secondary view ID. Each instances has a memento for storing arbitrary data, which we use for the 'input' (*.opi path and macros).
Secondary view IDs must be unique, they can't simply increment from "1" each time CSS is started because then a view with a previously used secondary ID will show the old content.
RCP only triggers saveState
for views that are currently visible, typically on exit. This view will
write the memento info directly to the underlying E4 model whenever the input changes.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Debug option, see .options file at plugin rootstatic final String
View ID registered in plugin.xml for use as a 'default' view.protected OPIRuntimeDelegate
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createPartControl
(Composite parent) static String
void
void
dispose()
<T> T
getAdapter
(Class<T> adapter) void
static boolean
void
Position the view according to location and size from the model.void
void
setFocus()
static void
setOpenFromPerspective
(boolean openFromPerspective) void
setOPIInput
(IEditorInput input) Set the OPI input.void
setOPIInput
(IEditorInput input, boolean persist) protected void
setTitleToolTip
(String tool_tip) void
setWorkbenchPartName
(String name) Set workbench part name.toString()
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, showBusy
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
Field Details
-
ID
View ID registered in plugin.xml for use as a 'default' view.For views to be displayed in designated OPIRunnerPerspective.Position, that Position.name() is added to the basic ID
- See Also:
-
debug
public static final boolean debugDebug option, see .options file at plugin root -
opiRuntimeDelegate
-
-
Constructor Details
-
OPIView
public OPIView()
-
-
Method Details
-
createSecondaryID
- Returns:
- Unique secondary view ID for this instance of CSS
-
dispose
public void dispose()- Specified by:
dispose
in interfaceIWorkbenchPart
- Overrides:
dispose
in classWorkbenchPart
-
init
- Specified by:
init
in interfaceIViewPart
- Overrides:
init
in classViewPart
- Throws:
PartInitException
-
setOPIInput
- Parameters:
input
- Display file that this view should executepersist
- Persist the input to memento?- Throws:
PartInitException
-
setOPIInput
Description copied from interface:IOPIRuntime
Set the OPI input. The OPI Runtime will reload OPI from the input.- Specified by:
setOPIInput
in interfaceIOPIRuntime
- Parameters:
input
- Display file that this view should execute- Throws:
PartInitException
-
createPartControl
- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Specified by:
createPartControl
in classWorkbenchPart
-
positionFromModel
public void positionFromModel()Position the view according to location and size from the model. If the model location has negative values or is (0, 0), position within the parent window. -
createToolbarButtons
public void createToolbarButtons() -
saveState
-
setFocus
public void setFocus()- Specified by:
setFocus
in interfaceIWorkbenchPart
- Specified by:
setFocus
in classWorkbenchPart
-
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
-
setTitleToolTip
- Overrides:
setTitleToolTip
in classWorkbenchPart
-
getOPIRuntimeDelegate
-
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.
-
getAdapter
- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classWorkbenchPart
-
isOpenFromPerspective
public static boolean isOpenFromPerspective() -
setOpenFromPerspective
public static void setOpenFromPerspective(boolean openFromPerspective) -
toString
-