|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Provides view snap-ins for the ConsoleOne shell.
Snap-ins must implement this interface to provide views for the associated ObjectType. New view snapins should implement ViewSnapinRev2 as well.
ViewSnapinRev2| Method Summary | |
java.lang.String |
getUniqueID()
Returns the unique name of the view. |
java.awt.Component |
getView(ViewSnapinContext context)
Returns the object derived from Component that will be used as the view in the shell. |
java.lang.String |
getViewMenuName()
Returns the localized name for the view. |
void |
setInactive(java.awt.Component c)
Provides a shell notification that the current view has become inactive. |
| Methods inherited from interface com.novell.application.console.snapin.Snapin |
getSnapinDescription,
getSnapinName,
initSnapin,
shutdownSnapin |
| Method Detail |
public java.awt.Component getView(ViewSnapinContext context)
The Component object returned is associated with the ObjectEntry in the view context passed to the snap-in in the context parameter. The view snap-in developer should construct the return Component in the initSnapin() method, then in getView() the new tree selection should be cleared so that new data can be put in. That is, all Components in the view should be removed and a new set of Components set. The following code snippet provides an example.
// Global variables set up in the initSnapin() method// p -- The panel where the children will be displayed// shell -- A ConsoleOne shell instancepublic Component getView(ViewSnapinContext viewContext){// remove any existing components from the panep.removeAll();// get enumeration of the selected ObjectEntry's childrenObjectEntryEnumeration children = shell.getChildren(viewContext.getObjectEntry());// for each child, add it to the pane and set up a mouse listenerwhile(children.hasMoreElements()){ObjectEntry child = children.next();MyLabel node = new MyLabel(child);node.addMouseListener(new MyMouseListener());p.add(node);};// return the reformatted panereturn p;}
context - The context information passed to the snap-in.ViewSnapinContextpublic java.lang.String getUniqueID()
In a view snap-in the getUniqueID() method is called before the initSnapin() method. Also, if a view is changed by ConsoleOne, the getViewMenuName() method is called before the initSnapin() method. Following is an implementation example.
public String getUniqueID(){return "com.novell.sample.snapins.filesystem.FilesystemListView";}
public void setInactive(java.awt.Component c)
An example implementation of setInactive() is as follows.
public void setInactive(Component c){};
c - The instance of the view passed by the shell.public java.lang.String getViewMenuName()
The getViewMenuName() method returns the language-dependent translated (localized) name that will be used as the text in the view menu. Use the ampersand '&' character to specify a mnemonic character. Following is an implementation example.
public String getViewMenuName(){return "S&le Filesystem List View";};
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||