|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.novell.application.console.snapin.AbstractStatusBarSnapin
Provides a simplified method of creating status bar snap-ins.
The AbstractStatusBarSnapin class is a simple implementation of the StatusBarSnapin interface. When extended it will create a snap-in to be placed in the shell's status bar. The AbstractStatusBarSnapin class implements methods from the StatusBarSnapin interface, allowing you to derive methods from this abstract class to create a status bar item with dynamic text within a 3-D border. All you have to do is return a text string in the getStatusBarText() method.
StatusBarSnapin| Field Summary | |
protected java.awt.Component |
component
The Component that will be placed in the status bar. |
protected Shell |
shell
Shell instance used to interact with the ConsoleOne shell. |
| Constructor Summary | |
AbstractStatusBarSnapin()
|
|
| Method Summary | |
abstract java.lang.String |
getSnapinDescription()
Returns the description of the snap-in. |
abstract java.lang.String |
getSnapinName()
Returns the localized name of the snap-in. |
abstract java.lang.String |
getStatusBarText()
Returns the text to be placed in the status bar item. |
boolean |
initAbstractSnapin(InitSnapinInfo info)
Initializes the class that extends the AbstractStatusBarSnapin class. |
void |
refresh()
Refreshes the status bar item's text by calling getStatusBarText and then redrawing the status bar item. |
void |
setStatusBarWidth(int width)
Sets the width, in characters, of the status bar item. |
void |
shutdownAbstractSnapin()
Shuts down the participating snap-in that extends the AbstractStatusBarSnapin class. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.awt.Component component
This Component is handled by the AbstractStatusBarSnapin class. Snap-ins do not have to create it or interact with it themselves, unless they desire.
protected Shell shell
The shell instance is set in initSnapin(). Subclasses should use this variable to make shell calls.
| Constructor Detail |
public AbstractStatusBarSnapin()
| Method Detail |
public abstract java.lang.String getSnapinName()
The getSnapinName() method returns the name for the selected snap-in. The shell displays the name you provide together with all the snap-ins of a given type. The user is then allowed to select which snap-ins should be set as active in the current configuration.
Snapin.getSnapinName()public abstract java.lang.String getSnapinDescription()
The getSnapinDescription() method returns the description of the selected snap-in. The shell displays the description you provide in the configurator's description area. The description should be kept brief and concise.
Snapin.getSnapinDescription()public boolean initAbstractSnapin(InitSnapinInfo info)
Implement in the extending snap-in if there is anything that needs to be initialized when the snap-in is created.
info - Contains data the snap-in may use for initialization,
such as references to the shell and the snap-in type,
and may contain a reference to snap-in context data.Snapin.initSnapin(com.novell.application.console.snapin.InitSnapinInfo)public void shutdownAbstractSnapin()
Implement in the extending snap-in if there is anything that needs to be cleaned up when the snap-in is destroyed. It will be called from this classes shutdownSnapin() method before it performs any necessary clean up.
Snapin.shutdownSnapin()public abstract java.lang.String getStatusBarText()
You should return the dynamic text that will appear within the 3D border of the status bar item. When the snap-in is first shown and every time refresh() is called getStatusBarItem will be called by the shell. For example, to display the size of a file named File in the status bar item:
public String getStatusBarText(){String statusBarText = "File length: ";statusBarText += file.length();return statusBarText;}
public void refresh()
Snap-ins can call refresh() at any time to change the text displayed in this status bar item. For example, to refresh the status bar item whenever a new item in the tree is selected, implement the ShellSelectionListener interface, add the class to the shell as a listener, then implement the treeSelectionChanged() method. The refresh() method is called as follows:
public void treeSelectionChanged(ShellEvent event){refresh();}
public void setStatusBarWidth(int width)
Snap-ins should call this method to set the width, in characters, of the status bar item.
width - The width of the status bar item in characters.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||