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
FieldsModifier and TypeFieldDescriptionstatic final booleanDebug option, see .options file at plugin rootstatic final StringView ID registered in plugin.xml for use as a 'default' view.protected OPIRuntimeDelegateFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePartControl(Composite parent) static Stringvoidvoiddispose()<T> TgetAdapter(Class<T> adapter) voidstatic booleanvoidPosition the view according to location and size from the model.voidvoidsetFocus()static voidsetOpenFromPerspective(boolean openFromPerspective) voidsetOPIInput(IEditorInput input) Set the OPI input.voidsetOPIInput(IEditorInput input, boolean persist) protected voidsetTitleToolTip(String tool_tip) voidsetWorkbenchPartName(String name) Set workbench part name.toString()Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartNameMethods 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, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
disposein interfaceIWorkbenchPart- Overrides:
disposein classWorkbenchPart
-
init
- Specified by:
initin interfaceIViewPart- Overrides:
initin 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:IOPIRuntimeSet the OPI input. The OPI Runtime will reload OPI from the input.- Specified by:
setOPIInputin interfaceIOPIRuntime- Parameters:
input- Display file that this view should execute- Throws:
PartInitException
-
createPartControl
- Specified by:
createPartControlin interfaceIWorkbenchPart- Specified by:
createPartControlin 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:
setFocusin interfaceIWorkbenchPart- Specified by:
setFocusin classWorkbenchPart
-
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
-
setTitleToolTip
- Overrides:
setTitleToolTipin classWorkbenchPart
-
getOPIRuntimeDelegate
-
getOPIInput
- Specified by:
getOPIInputin interfaceIOPIRuntime- Returns:
- the OPI input of the runtime.
-
getDisplayModel
- Specified by:
getDisplayModelin interfaceIOPIRuntime- Returns:
- the display model in this runtime.
-
getAdapter
- Specified by:
getAdapterin interfaceIAdaptable- Overrides:
getAdapterin classWorkbenchPart
-
isOpenFromPerspective
public static boolean isOpenFromPerspective() -
setOpenFromPerspective
public static void setOpenFromPerspective(boolean openFromPerspective) -
toString
-