|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.viewer.AbstractNodeViewer
AbstractNodeViewer provides a reasonable default implementation of the
NodeViewer interface. Subclasses need only provide a constructor that
invokes super(context)
and override the abstract methods
getViewerTitle
, createViewerComponent
,
createStructureComponent
to have a functional viewer.
Field Summary | |
protected Context |
context
The context for which this viewer was constructed. |
protected javax.swing.JComponent |
structureComponent
The cached structure component, or null if no component has been requested or no structure component is available. |
protected javax.swing.JComponent |
viewerComponent
The cached viewer component, or null if no component has been requested for this viewer. |
Fields inherited from interface com.borland.primetime.ide.NodeViewer |
EMPTY_ARRAY,
PROP_DESCRIPTION,
PROP_ICON,
PROP_STRUCTURE_COMPONENT,
PROP_TITLE,
PROP_VIEWER_COMPONENT |
Constructor Summary | |
AbstractNodeViewer(Context context)
Creates a new AbstractNodeViewer for the specified context. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener events are used to broadcast changes to the NodeViewer's title, icon, and description as well as the associated viewer and structure components. |
void |
browserActivated()
This method is called ONLY on the active NodeViewer when the Browser has been activated (the user clicked on another window). |
void |
browserDeactivated()
This method is called ONLY on the active NodeViewer when the Browser has been deactivated (the user clicked on another window). |
abstract javax.swing.JComponent |
createStructureComponent()
|
abstract javax.swing.JComponent |
createViewerComponent()
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
Context |
getContext()
Returns the context for which this AbstractNodeViewer was created. |
javax.swing.JComponent |
getStructureComponent()
Returns the cached structure component if one has already been created. |
javax.swing.JComponent |
getViewerComponent()
Returns the cached viewer component if one has already been created. |
java.lang.String |
getViewerDescription()
Returns a short description of this NodeViewer. |
javax.swing.Icon |
getViewerIcon()
Returns a display icon for this NodeViewer's tab. |
void |
releaseViewer()
This method is called when a context being viewed in a Browser has been closed. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
viewerActivated(boolean requestFocus)
This method is called after getViewerComponent(...) has returned a Component that has been placed in the correct location in the Browser, getStructureComponent(...) has returned a Component that has been placed in the correct location in the Browser, and the tab has switched to view the new viewer. |
void |
viewerDeactivated()
This method is called after a viewer is successfully deactivated. |
void |
viewerDeactivating()
This method is called when a viewer is about to be deactivated (user clicked on a different tab). |
void |
viewerNodeChanged()
This method is called when the Node associated with this viewer has been altered. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Context context
protected javax.swing.JComponent viewerComponent
protected javax.swing.JComponent structureComponent
Constructor Detail |
public AbstractNodeViewer(Context context)
context
- The unique combination of Browser and Node for which this
NodeViewer is needed.Method Detail |
public Context getContext()
public abstract javax.swing.JComponent createViewerComponent()
public abstract javax.swing.JComponent createStructureComponent()
public javax.swing.JComponent getViewerComponent()
createViewerComponent
to
create one and caches its value for the next request.public javax.swing.JComponent getStructureComponent()
createStructureComponent
to create one and caches its value
for the next request.public java.lang.String getViewerDescription()
Returns a short description of this NodeViewer. This is the text found in the tooltip as the user mouses over the tabs of the ContentView. This value should be resourced.
public javax.swing.Icon getViewerIcon()
Returns a display icon for this NodeViewer's tab.
Typically, null is returned and no Icon is used in the ContentView tabs, but the option to display one is available for 'special' cases. None of the JBuilder NodeViewers display icons.
public void viewerNodeChanged()
This method is called when the Node associated with this viewer has been altered. Typically this indicates that the node has been renamed or moved in the project hierarchy. This is an opporitunity for the NodeViewer to update anything that displays the Node's name, description, etc.
public void viewerDeactivating() throws VetoException
This method is called when a viewer is about to be deactivated (user clicked on a different tab). This is an opporitunity for the NodeViewer to check the current state of any 'edits' that a user might have made, and if a critical problem exists, throw a VetoException, and the viewer will not be deactivated.
Typically, this method does nothing. Only in cases where switching Nodes, or changing views which put the node in an indeterminate state should the jarring effect of 'sticking' the viewer be used. This *could* make the user think that JBuilder is locked-up if no UI clues indicate that there is a problem.
public void viewerDeactivated()
This method is called after a viewer is successfully deactivated.
public void viewerActivated(boolean requestFocus)
This method is called after getViewerComponent(...) has returned a Component that has been placed in the correct location in the Browser, getStructureComponent(...) has returned a Component that has been placed in the correct location in the Browser, and the tab has switched to view the new viewer.
requestFocus
- True if the viewer component should requestFocus at
this point.public void browserDeactivated()
This method is called ONLY on the active NodeViewer when the Browser has been deactivated (the user clicked on another window).
public void browserActivated()
This method is called ONLY on the active NodeViewer when the Browser has been activated (the user clicked on another window).
public void releaseViewer()
This method is called when a context being viewed in a Browser has been closed. This is an opporitunity for the NodeViewer to relase any resources that it wants - now that this viewer is no longer needed.
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |