SPT Core API

com.sptci.epng
Class ContentPane

java.lang.Object
  extended by nextapp.echo2.app.Component
      extended by nextapp.echo2.app.ContentPane
          extended by com.sptci.epng.ContentPane
All Implemented Interfaces:
View, Serializable, Pane, PaneContainer, RenderIdSupport
Direct Known Subclasses:
LoginView

public class ContentPane
extends ContentPane
implements View

A standard ContentPane for use with applications. Displays the Header and contains space for a MenuBar component. This content pane may be used to create applications that follow the standard SPT layout for an application.

The only child of this component is a SplitPane that may be styled through a style name com.sptci.epng.ContentPane.splitPane. A default style is enforced through the ContentPaneSplitPane class in StyleSheet.addSplitPaneStyles() method.

The Header and MenuBar components displayed in the top part of the SplitPane are contained within a Column component. The column may be styled using a com.sptci.epng.ContentPane.top name. A default style is enforced through the ContentPaneTopColumn class.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: ContentPane.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2008-04-12
See Also:
Serialized Form

Field Summary
protected  Component content
          The main view component that fills the main content area of this content pane.
protected  MenuBar menuBar
          The menu bar for the content pane (application)
 
Fields inherited from class nextapp.echo2.app.ContentPane
PROPERTY_BACKGROUND_IMAGE, PROPERTY_HORIZONTAL_SCROLL, PROPERTY_INSETS, PROPERTY_VERTICAL_SCROLL
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
ContentPane()
           
 
Method Summary
 void add(Component component)
          Over-ridden to replace content with the new component specified.
 void add(Component component, int index)
          Over-ridden to add the specified component to content container.
protected  Component createTop()
          Create the container component used to display the Header and menuBar.
 Component getContent()
          Return the main content component displayed in this pane.
 MenuBar getMenuBar()
          Return the menu bar contained in this content pane.
 void init()
          Life-cycle method invoked when the component is added for the first time to the component hierarchy.
 void removeAll()
          Over-ridden to remove only the children of content from the view.
 void setContent(Component content)
          Set the primary content to be displayed in this pane.
 void setMenuBar(MenuBar menuBar)
          Set the menu bar to be contained in this content pane.
 
Methods inherited from class nextapp.echo2.app.ContentPane
getBackgroundImage, getHorizontalScroll, getInsets, getVerticalScroll, isValidChild, isValidParent, processInput, setBackgroundImage, setHorizontalScroll, setInsets, setVerticalScroll
 
Methods inherited from class nextapp.echo2.app.Component
addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isVisible, remove, remove, removePropertyChangeListener, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menuBar

protected MenuBar menuBar
The menu bar for the content pane (application)


content

protected Component content
The main view component that fills the main content area of this content pane. This component fills the entire bottom part of the SplitPane used to layout the components.

Constructor Detail

ContentPane

public ContentPane()
Method Detail

init

public void init()
Life-cycle method invoked when the component is added for the first time to the component hierarchy. Performs all the child initialisation. It is essential that sub-classes invoke super.init unless they wish to perform all the initialisation work.

Overrides:
init in class Component

createTop

protected Component createTop()
Create the container component used to display the Header and menuBar. The menuBar is contained within a Row component, so it is possible to add components adjacent to the menu bar if so desired (by invoking getMenuBar().getParent()).

Returns:
The container that displays the header and menu bar.

getMenuBar

public MenuBar getMenuBar()
Return the menu bar contained in this content pane.

Returns:
Returns menuBar.

setMenuBar

public void setMenuBar(MenuBar menuBar)
Set the menu bar to be contained in this content pane.

Parameters:
menuBar - The component to set as the menu bar.

getContent

public Component getContent()
Return the main content component displayed in this pane.

Returns:
The main content displayed in this pane.

setContent

public void setContent(Component content)
Set the primary content to be displayed in this pane.

Parameters:
content - The content to display.

removeAll

public void removeAll()
Over-ridden to remove only the children of content from the view. In addition it removes any FloatingPane components that have been added to this content pane.

Overrides:
removeAll in class Component

add

public void add(Component component)
Over-ridden to replace content with the new component specified. In keeping with the contract of a ContentPane, this allows only one child content. Unlike the super-class this class does not throw an exception, just replaces content with the new component specified.

Overrides:
add in class Component
Parameters:
component - The content to add to this component.

add

public void add(Component component,
                int index)
Over-ridden to add the specified component to content container. If the specified component is an instance of FloatingPane, then delegates to the super class Component.add(nextapp.echo2.app.Component) method.

Overrides:
add in class Component
Parameters:
component - The content to add to this component.
index - The index at which this child component is to be added.

SPT Core API