public class BasicTemplate extends java.lang.Object implements ActiveTemplate
Note: To conform to ui standards and create a consistent user interface a specific template implementation from this package should be used in preference to creating a custom template.
The template also contains a basic action listener framework. Templates can close their hovers by firing ACTION_CLOSE_CMD, or can fire custom actions.
| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.JComponent |
content |
ACTION_CLOSE_INFOTIP_CMD, ACTION_REMOVE_TEMPLATE_CMD, ACTION_SIZE_CHANGED_CMD| Constructor and Description |
|---|
BasicTemplate(javax.swing.JComponent content)
Create a template with custom content.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(java.awt.event.ActionListener l)
Add an actionListener to receive actions such as close from the Template.
|
protected void |
fireActionPerformed(java.lang.String command)
Notifies all listeners that an action has occurred.
|
javax.swing.JComponent |
getContent() |
void |
removeActionListener(java.awt.event.ActionListener l)
Remove previously added ActionListener.
|
public BasicTemplate(javax.swing.JComponent content)
content - public javax.swing.JComponent getContent()
getContent in interface Templatepublic void addActionListener(java.awt.event.ActionListener l)
ActiveTemplateaddActionListener in interface ActiveTemplatepublic void removeActionListener(java.awt.event.ActionListener l)
ActiveTemplateremoveActionListener in interface ActiveTemplateprotected void fireActionPerformed(java.lang.String command)
command - the cmd string to notify listeners (e.g. Closeable.ACTION_CLOSE_CMD to close the hover).