Introduction to Spoon Perspectives
Spoon Perspectives are a set of functionality so distinct from other areas of Spoon that they've been designed to take over the whole look of the application. The traditional ETL functionality of Spoon is the default perspective and with the release of AGILE_BI_RELEASE_NUM, two additional perspectives have been introduced for Modeling and Visualization of data.
Adding a New Perspective to Spoon
Perspectives are supplied by Spoon Plugins (link to Spoon Plugin Doc). Each Spoon Plugin can provide only one perspective, though several Spoon plugins can be packaged together.
Required API
The following methods must return values for a perspective to be valid
Method | Description |
---|---|
getId | Unique identifier for the perspective |
getUI | SWT Composite to display in the main area when active |
getDisplayName | Localized Name of the persepctive |
getPerspectiveIcon | 16x16 InputStream for the toolbar icon |
Optional API
These methods must be implemented but do not need to return values or necessarily do any work.
Method | Description |
---|---|
setActive | Called when the perspective is loaded or unloaded |
getOverlays | Optional list of Xul overlys to be loaded when the perspective is activated |
getEventHandlers | Optional list of Xul Event Handlers to be registered when the perspective is activated |
addPerspectiveListener | Listeners can be added to be informed when the perspective is activated/deactivated |
getActiveMeta | If the perspective has content that can be saved, this method must return the EngineMeta for the active content |
Interacting with Perspectives
Spoon Perspectives are managed by a central object, SpoonPerspectiveManager. SpoonPerspectiveManager can be called to active a particular perspective or find the currently active perspective.
Method | Description |
---|---|
activatePerspective(SpoonPerspective) | Passing in a Spoon Perspective class literal will cause spoon to unload the current perspective and load the one requested |
getActivePerspective | Returns the active SpoonPerspective object |