|
|||||||||
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)
Adds given listener to list of registered listeners for Property change events. |
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()
Creates the Swing GUI component to display content in the Structure Pane of the active Browser. |
abstract javax.swing.JComponent |
createViewerComponent()
Creates the Swing GUI component to display content in the ContentView of the active Browser. |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Notifies all registered PropertyChangeListeners that a property has been changed. |
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()
Get the description of this NodeViewer for the ContentView tab tooltip. |
javax.swing.Icon |
getViewerIcon()
Get the icon representing NodeViewer on the ContentView tab. |
void |
releaseViewer()
This method is called when a context being viewed in a Browser has been closed. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes given listener from list of registered listeners for Property change events. |
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 |
Methods inherited from interface com.borland.primetime.ide.NodeViewer |
getViewerTitle |
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.getViewerComponent
in interface NodeViewer
public javax.swing.JComponent getStructureComponent()
createStructureComponent
to create one and caches its value
for the next request.getStructureComponent
in interface NodeViewer
public java.lang.String getViewerDescription()
getViewerDescription
in interface NodeViewer
public javax.swing.Icon getViewerIcon()
getViewerIcon
in interface NodeViewer
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. It is possible for this notification to happen before the viewer has been activated.
viewerNodeChanged
in interface NodeViewer
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.
viewerDeactivating
in interface NodeViewer
VetoException
- if this viewer component is in an invalid state that
cannot be left unresolved.public void viewerDeactivated()
This method is called after a viewer is successfully deactivated. This may be called multiple times in situations where the content management is not sure that a given viewer was notified.
viewerDeactivated
in interface NodeViewer
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.
viewerActivated
in interface NodeViewer
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). This may be called multiple times in situations where the content management is not sure that a given viewer was notified.
browserDeactivated
in interface NodeViewer
public void browserActivated()
This method is called ONLY on the active NodeViewer when the Browser has been activated (the user clicked on another window). This may be called multiple times in situations where the content management is not sure that a given viewer was notified.
browserActivated
in interface NodeViewer
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.
releaseViewer
in interface NodeViewer
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface NodeViewer
listener
- The listener to be registered.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface NodeViewer
listener
- The listener to be unregistered.protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
propertyName
- The name of the property.oldValue
- The old value of the property, may be null.newValue
- The new value of the proeprty, may be null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |