public abstract class UIExtension extends Object
A base class for user interface extensions to the CleanSheets application. Subclasses should override the accessor methods for the components that they provide, and add components as selection listeners whenever required.
A user interface extension should only create one instance of each type of component, and therefore always return the same component when a given method is called.
SelectionListener
Modifier and Type | Field and Description |
---|---|
protected Extension |
extension
The name of the extension
|
protected Properties |
props
The application's user properties
|
protected UIController |
uiController
The user interface controller
|
Constructor and Description |
---|
UIExtension(Extension extension,
UIController uiController)
Creates a new user interface extension..
|
Modifier and Type | Method and Description |
---|---|
CellDecorator |
getCellDecorator()
Returns a cell decorator that visualizes the data added by the extension.
|
Boolean |
getEnabledProperty(String propKey)
Returns the enabled property corresponding to the given component key.
|
Extension |
getExtension()
Returns the extension for which this UI extension provides components.
|
Icon |
getIcon()
Returns an icon to display with the extension's name.
|
JMenu |
getMenu()
Returns a menu component that gives access to extension-specific
functionality.
|
JComponent |
getSideBar()
Returns a side bar that gives access to extension-specific
functionality.
|
TableDecorator |
getTableDecorator()
Returns a table decorator that visualizes the data added by the extension.
|
JToolBar |
getToolBar()
Returns a toolbar that gives access to extension-specific
functionality.
|
void |
setEnabledProperty(String propKey,
boolean enabled)
Sets the enabled property corresponding to the given component key.
|
protected final UIController uiController
protected final Properties props
public UIExtension(Extension extension, UIController uiController)
extension
- the extension for which components are provideduiController
- the user interface controllerpublic final Extension getExtension()
public final Boolean getEnabledProperty(String propKey)
propKey
- the property key of the relevant componentpublic final void setEnabledProperty(String propKey, boolean enabled)
propKey
- the property key of the relevant componentenabled
- whether the component should be enabled or notpublic Icon getIcon()
public CellDecorator getCellDecorator()
public TableDecorator getTableDecorator()
public JMenu getMenu()
public JToolBar getToolBar()
public JComponent getSideBar()