com.novell.application.console.snapin
Interface Snapin

All Known Subinterfaces:
CreatorSnapin, DisplayIconSnapin, DisplayNameSnapin, DisplayNameSnapinRev2, DynamicSnapin, ExtendedViewSnapin, ExternalCreatorSnapin, FSNamespace, InitializationSnapin, MapObjectEntrySnapin, MenuSnapin, NamespaceSnapin, NWFSNamespace, PageSnapin, PopupMenuSnapin, ResultModifierSnapin, ServiceSnapin, StatusBarSnapin, ToolBarSnapin, ViewSnapin

public interface Snapin

Provides the base interface from which all snap-ins extend.

Every snap-in written for ConsoleOne (namespace, view, property pages, menus, toolbars, status bars, etc.) derive from the Snapin interface. Therefore, the four methods defined in the Snapin interface must be implemented in each snap-in's interface.


Method Summary
 java.lang.String getSnapinDescription()
          Returns the localized description of the snap-in.
 java.lang.String getSnapinName()
          Returns the localized name of the snap-in.
 boolean initSnapin(InitSnapinInfo info)
          Called by the shell to allow the snap-in to be initialized.
 void shutdownSnapin()
          Called by the shell when the snap-in is being shut down.
 

Method Detail

getSnapinName

public java.lang.String getSnapinName()
Returns the localized name of the snap-in.

The getSnapinName() method will be called before initSnapin(). This method allows the shell to provide a translated descriptive name for your snap-in.

Following is an example of the getSnapinName() implementation:


       public String getSnapinName()
       {
            ResourceBundle resources = 
                      ResourceBundle.getBundle("com.test.resource");
            String name = 
                       resources.getString("TestNamespaceName");
            return name;
       }
 
Returns:
The translated string object containing the name of the snap-in.

getSnapinDescription

public java.lang.String getSnapinDescription()
Returns the localized description of the snap-in.

The getSnapinDescription() method will be called before initSnapin(). This method returns the description of the selected snap-in.

Following is an example of the getSnapinDescription() implementation:


       public String getSnapinDescription()
       {
            ResourceBundle resources = 
                      ResourceBundle.getBundle("com.test.resource");
            String description = 
                       resources.getString("TestNamespace_Description");
            return description;
       }
 
Returns:
The translated string object containing the description of the snap-in.

initSnapin

public boolean initSnapin(InitSnapinInfo info)
Called by the shell to allow the snap-in to be initialized.

The initSnapin() method is called by the shell to allow each snap-in to perform any necessary initialization; for example adding itself as an event listener. The snap-in is initialized by passing a reference to the InitSnapinInfo class. The getSnapinName() and getSnapinDescription() methods will be called before initSnapin().

Following is an example of the initSnapin() implementation:


       public boolean initSnapin( InitSnapinInfo info )
       {
          ...
          shell = info.getShell();
          mytype = info.getSnapinType();
          ...
          return true;
       }

 
Parameters:
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.
Returns:
If the snap-in is able to successfully complete initialization, true is returned, or if initialization fails, false is returned and the snap-in will be disabled.
See Also:
shutdownSnapin(), InitSnapinInfo, SnapinContext

shutdownSnapin

public void shutdownSnapin()
Called by the shell when the snap-in is being shut down.

Called by the shell for each snap-in when it is no longer required. This allows the snap-in to perform any necessary cleanup; for example removing itself as an event listener.

See Also:
initSnapin(com.novell.application.console.snapin.InitSnapinInfo)


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.