com.novell.application.console.snapin
Class AbstractPageSnapin

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--com.novell.application.console.snapin.AbstractPageSnapin
All Implemented Interfaces:
javax.accessibility.Accessible, Help, java.awt.image.ImageObserver, java.awt.MenuContainer, PageSnapin, java.io.Serializable, Snapin

public abstract class AbstractPageSnapin
extends java.awt.Panel
implements PageSnapin

Simplifies creation of Page Host page snap-ins.

Extend this class to get default behavior for page snap-ins.


Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  InitSnapinInfo info
          Reference to InitSnapinInfo that is passed in initSnapin.
protected  boolean isDirty
          Flag indicating the need to save data.
protected  ObjectEntryCollection objectCollection
          ObjectEntries that this page should apply to.
protected  PropertyBook thePropertyBook
          Contains a reference to the Property Book.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
AbstractPageSnapin()
           
 
Method Summary
 boolean canSave()
          Determines whether the page data is ready to be saved.
 java.awt.Frame getFrame()
          Obtains a reference to the shell Frame.
abstract  java.lang.String getMenuName()
          Returns the language dependent translated menu display name for this page if the tab is a multipage tab.
 ObjectEntryCollection getObjectCollection()
          Returns the ObjectEntryCollection for which the Page Host was invoked.
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 getTabID()
          Returns the globally unique language independent object ID of the tab where the current page is to be placed.
abstract  java.lang.String getTabName()
          Returns the language dependent translated display name for the tab.
 boolean hasHelp()
          Determines the state of the Page Host [Help] button.
 boolean initAbstractSnapin(InitSnapinInfo info)
          Initializes the class that extends the AbstractPageSnapin class.
 boolean killActive()
          Determines if the page can lose focus.
 void OnHide()
          Detects when your property page is being hidden.
 void OnShow()
          Detects when your property page is being activated.
 boolean saveData()
          Saves page data to a persistent store.
 void setActive(boolean firstTimeShown)
          Indicates that your page is receiving focus next.
 void setModified(boolean isDirty, PageSnapin thePage)
          Indicates to the PageHost when your snap-in data has been changed.
 void setTitle(java.lang.String title)
          Sets the title of the current property page.
 void showHelp()
          Displays Help information when the hasHelp() method has returned true.
 void shutdownAbstractSnapin()
          Shuts down the participating snap-in that extends the AbstractPageSnapin class.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

thePropertyBook

protected PropertyBook thePropertyBook
Contains a reference to the Property Book.

isDirty

protected boolean isDirty
Flag indicating the need to save data.

info

protected InitSnapinInfo info
Reference to InitSnapinInfo that is passed in initSnapin.

objectCollection

protected ObjectEntryCollection objectCollection
ObjectEntries that this page should apply to.
Constructor Detail

AbstractPageSnapin

public AbstractPageSnapin()
Method Detail

getSnapinName

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

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.

Returns:
The translated string object containing the name of the snap-in.

getSnapinDescription

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

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.

Returns:
The translated string object containing the description of the snap-in.

initAbstractSnapin

public boolean initAbstractSnapin(InitSnapinInfo info)
Initializes the class that extends the AbstractPageSnapin class.

Implement in the extending snap-in if there is anything that needs to be initialized when the snap-in is created.

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:
A boolean set to true if the snap-in is able to successfully complete initialization, or false if initialization fails.
See Also:
Snapin.initSnapin(com.novell.application.console.snapin.InitSnapinInfo)

shutdownAbstractSnapin

public void shutdownAbstractSnapin()
Shuts down the participating snap-in that extends the AbstractPageSnapin class.

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 class's shutdownSnapin() method before it performs any necessary clean up.

See Also:
Snapin.shutdownSnapin()

getObjectCollection

public ObjectEntryCollection getObjectCollection()
Returns the ObjectEntryCollection for which the Page Host was invoked.
Returns:
ObjectEntryCollection of object entries.

getFrame

public java.awt.Frame getFrame()
Obtains a reference to the shell Frame.

This reference is useful when displaying dialogs.

Returns:
The shell Frame.

setModified

public void setModified(boolean isDirty,
                        PageSnapin thePage)
Indicates to the PageHost when your snap-in data has been changed.

Call setModified() when you want the OK or Apply Now buttons to be enabled. You should not call setModified() until after successfully returning true from initSnapin().

Parameters:
isDirty - Set to true when data needs to be saved, or false when data has already been saved.
thePage - Reference to the page snap-in. The this value references the current page that has focus.

setTitle

public void setTitle(java.lang.String title)
Sets the title of the current property page.

The setTitle() method allows you to update the title of the current property page.

Parameters:
title - The title if the property page.

hasHelp

public boolean hasHelp()
Determines the state of the Page Host [Help] button.

You should override this method and return true if you wish to provide Help for your snap-in, and have the [Help] button enabled for your page. You should also override the showHelp() method.

Specified by:
hasHelp in interface PageSnapin
Returns:
true if you want the Page Host [Help] button to be enabled for this page, otherwise return false to disable the [Help] button.
See Also:
showHelp()

setActive

public void setActive(boolean firstTimeShown)
Indicates that your page is receiving focus next.

The setActive() method is called when your page is about get the focus (to be shown).

Specified by:
setActive in interface PageSnapin
Parameters:
firstTimeShown - Set to true the first time your page gets focus, then set to false to indicate the page has previously been given focus.
See Also:
killActive()

killActive

public boolean killActive()
Determines if the page can lose focus.

The killActive() method is called when your snap-in page is about to lose focus. You can override this method if you wish to validate snap-in data before losing focus.

Specified by:
killActive in interface PageSnapin
Returns:
true if it is OK to lose focus, otherwise return false to stop the page from losing focus.
See Also:
setActive(boolean)

canSave

public boolean canSave()
Determines whether the page data is ready to be saved.

The canSave() method is called when the user selects either the [OK] button, or the [Apply Now] button. You can override this function to validate page data before saving data to storage.

Specified by:
canSave in interface PageSnapin
Returns:
true if your snap-in data is ready to be saved, otherwise return false.
See Also:
saveData()

saveData

public boolean saveData()
Saves page data to a persistent store.

The saveData() method is called when the user selects either the [OK] button or the [Apply Now] button, and the canSave() method has returned true.

Specified by:
saveData in interface PageSnapin
Returns:
true if the page data has been saved to a persistant store, otherwise return false.
See Also:
canSave()

showHelp

public void showHelp()
Displays Help information when the hasHelp() method has returned true.

The showHelp() method is called when the user presses the Page Host [Help] button. To provide help for your snap-in, you must override the hasHelp() method to return true, then implement the showHelp() method.

Specified by:
showHelp in interface PageSnapin
See Also:
hasHelp()

OnShow

public void OnShow()
Detects when your property page is being activated.

You can override the OnShow() method to detect when your property page is being activated.

See Also:
OnHide()

OnHide

public void OnHide()
Detects when your property page is being hidden.

You can override the OnHide() method to detect when your property page is being hidden.

See Also:
OnShow()

getTabName

public abstract java.lang.String getTabName()
Returns the language dependent translated display name for the tab.

If this tab does not exist, the Page Host will use the string name for the tab name, otherwise it is ignored.

Specified by:
getTabName in interface PageSnapin
Returns:
The translated display name of the tab.

getTabID

public abstract java.lang.String getTabID()
Returns the globally unique language independent object ID of the tab where the current page is to be placed.
Specified by:
getTabID in interface PageSnapin
Returns:
The tab indentification name.

getMenuName

public abstract java.lang.String getMenuName()
Returns the language dependent translated menu display name for this page if the tab is a multipage tab.

You can return null if you are not going to make the tab ID public and thus do not want the tab to be extended.

Specified by:
getMenuName in interface PageSnapin
Returns:
The displayable menu name, or null if the tab ID cannot be extended.


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