com.sas.visuals
Class TabbedView

com.sas.visuals.TabbedView
All Implemented Interfaces:
CompositeInterface, ContainerInterface, com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.collection.ContentsChangedListener, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.idesupport.DesignTimeEventInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, ValidatorInterface, com.sas.ViewDefaultModelInterface, com.sas.ViewInterface, MultipleValueEventSourceInterface, java.awt.event.ContainerListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.beans.VetoableChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class TabbedView
implements com.sas.DesignTimeDropTargetInterface, java.awt.ItemSelectable, java.awt.event.ItemListener, java.awt.event.ContainerListener, com.sas.collection.ContentsChangedListener, java.beans.PropertyChangeListener, java.beans.VetoableChangeListener, com.sas.idesupport.DesignTimeEventInterface, com.sas.ViewDefaultModelInterface

The TabbedView is a container that allows multiple views to be defined in the same area and viewed exclusively. The TabbedView is made up of two basic components: a TabBarInterface object and a Container object. The TabBarInterface object manages the placement of the tabs associated with individual views. The TabBarInterface contains TabButtonInterface objects that are members of a SelectionGroup, allowing only one tab to be selected at a time. The Container object manages showing and hiding the view associated with the selected tab. The views can be switched by selecting the tab associated with the view to be displayed.

Creating a TabbedView Component

A valid instance is created by instantiating an object of TabbedView followed by calling its public initialize method as shown below. This is necessary in order to initialize internal values and components required by a TabbedView object. Failure to do so may cause unexpected behavior.

 TabbedView tabbedView1 = new TabbedView();
 tabbedView1.initialize(); 
 

By default the TabbedView orientation is com.sas.geometry.Orientations.TOP and the style is TabBarInterface.SCROLLABLE. TabbedView also supports two other constructors to set either the orientation or the orientation and the style of the TabbedView:

 // set orientation
 TabbedView1 tabbedView1 = new TabbedView( Orientations.BOTTOM ); 
 tabbedView1.initialize();
 
 // set orientation and style
 TabbedView1 tabbedView1 = new TabbedView( com.sas.geometry.Orientations.BOTTOM, TabBarInterface.MULTIGROUP ); 
 tabbedView1.initialize();
 
Usage

The components that can be added and removed from the TabbedView are tabs and views. The view components must be derived from java.awt.Container and the tabs must implement the com.sas.visuals.TabButtonInterface.

Example View and Tab classes:

 com.sas.awt.Container      view1 = new com.sas.awt.Container          // View class
 com.sas.visuals.TabButton  tabButton1 = new com.sas.visuals.TabButton // Tab class
 

Setting up a Model

The TabbedView requires the StaticOrderedCollectionInterface for use as a model. The model elements should all be made up of the same type of objects. The model can be of Type OrderedCollection if it will be modifiable. The different types that are supported are TabButtonInterface objects(used as the tabs), java.awt.Container objects(used as the views), and item objects( used as the items of the tabs ). The model can also be of type AssociationListInterface. If the model supports this, the key values should be either TabButtonInterface objects or items to be set on the tabs, and the element values should be java.awt.Container types to be used as the views. If a model is not static and an add is called on the tabbedView then the appropriate type object will be added to the model.

Adding Views

Views can be added to the TabbedView in several different ways:

Some adds can also be modified by using constraints for the Integer value of the group index(zero-based) and the int value of the overall index(zero-based). The group value determines if the tab is placed on a different group if the style is TabBarInterface.MULTIGROUP. The overall index can be used to reference the tab and view components. Check the appropriate add or inherited add to see if it is possible.

Removing Views

Views can also be removed from the TabbedView in several different ways:

Selecting a View

To select a specific view any of the following can be called:

 tabbedView1.setSelectedIndex(0);  // based on view index.
 tabbedView1.setSelectedItem("Tab 1");  // based on the item from the tab component
 tabbedView1.select( tab1 ); // based on the reference to the tab component
 tabbedView1.select( view1 ); // based on the reference to the view component
 
You can also move between tabs by calling next() and previous() which move to the next or the previous tab by the overall index.
 tabbedView1.next();
 tabbedView1.previous();
 

Handling Events

The TabbedView sends out several types of events: ItemEvents, ActionEvents, PropertyChangedEvents, and VetoableChangeEvents.

Customizing the TabbedView

The TabbedView can be customized by changing the orientation or style properties and by changing the properties of the TabBarInterface and TabButtonInterface objects that are contained in it.

The orientation is the placement of the tabs relative to the View area. It can be either the TOP, BOTTOM, RIGHT, or LEFT values from the com.sas.geometry.Orientations class. The style determines if the TabBar displays the tabs in multiple rows or on one row with a SpinButton to display tabs not shown when it is first displayed. It can be either the MULTIGROUP or SCROLLABLE values of the TabBarInterface class. The TabBarInterface object is an instance of com.sas.visuals.TabBar by default. The TabBar can be referenced by getTabBar() to change its properties. Each individual TabButtonInterface object is an instance of com.sas.visuals.TabButton by default and can be referenced by any of the getTab() methods.

Use in webAF

The TabbedView supports Drag and Drop in webAF but only in the following manner at this time:

Drop a TabbedView on a Frame in webAF. This will create a TabbedView with 2 default tabs and views. Views can be added by either dropping java.awt.Container derived components onto the TabBar portion of the TabbedView or using the customizer to add new tab items. To populate the individual views, select the tab associated with the view to be populated and drag and drop all the components for that view on to the view portion of the TabbedView. The components will be added to the currently displayed view.

Summary Example

Here is a sample TabbedView with five views added to it:

 import com.sas.visuals.TabbedView;
 import com.sas.visuals.TabFolder;
 
public void createTabbedView() { TabbedView tabbedView1 = new TabbedView(); tabbedView1.initialize();
TabFolder tabFolder1 = new TabFolder("Tab 1"); tabbedView1.add( tabFolder1 ); tabFolder1.add( new java.awt.Label("TabFolder View - 1") );
TabFolder tabFolder2 = new TabFolder("Tab 2"); tabbedView1.add( tabFolder2 ); tabFolder2.add( new java.awt.Label("TabFolder View - 2") );
TabFolder tabFolder3 = new TabFolder("Tab 3"); tabbedView1.add( tabFolder3 ); tabFolder3.add( new java.awt.Label("TabFolder View - 3") );
TabFolder tabFolder4 = new TabFolder("Tab 4"); tabbedView1.add( tabFolder4 ); tabFolder4.add( new java.awt.Label("TabFolder View - 4") );
TabFolder tabFolder5 = new TabFolder("Tab 5"); tabbedView1.add( tabFolder5 ); tabFolder5.add( new java.awt.Label("TabFolder View - 5") ); }

Events
 o java.awt.events.ActionEvent
 o java.awt.events.ItemEvent
Required Interfaces
 o StaticOrderedCollectionInterface
 o Event: PropertyChanged items
 o Method: refresh

See Also:
TabBar, TabBarInterface, TabButton, TabButtonInterface, TabFolder, TabFolderInterface, Serialized Form

Field Summary
protected  boolean internalAdd
           
protected  boolean internalRemove
           
static java.lang.String RB_KEY
           
 
Constructor Summary
TabbedView()
          Default Constructor.
TabbedView(int orientation)
          Constructor that sets the orientation of the TabBar.
TabbedView(int orientation, int style)
          Constructor that sets the orientation and the style of the TabBar.
 
Method Summary
 void add(java.awt.Container newView, java.lang.Object item, java.lang.Integer grpIndex)
          Add a View(container) and create an associated Tab, using the item, on the specified group(row) in the TabbedView.
 void add(java.awt.Container newView, java.lang.Object item, java.lang.Integer grpIndex, int index)
          Add a View(container) and create an associated Tab, using the item, on the specified group(row) and at the specified index in the TabbedView.
 void add(TabButtonInterface tab, java.awt.Container newView, java.lang.Integer grpIndex)
          Add a View(container) to the TabbedView with an associated tab on the specified group(row) grpIndex and added at the end of the component list.
 void add(TabButtonInterface tab, java.awt.Container newView, java.lang.Integer grpIndex, int index)
          Add a View(container) to the TabbedView with an associated tab on the specified group(row) grpIndex and inserted at index.
 void addActionListener(java.awt.event.ActionListener listener)
          Adds the specified action listener to receive action events from this TabbedView
protected  void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
          Adds the specified component to this container at the specified index with the given constraints.
protected  void addInternal(java.awt.Component tab, java.awt.Component view, java.lang.Integer grpIndex, int index)
          Add the tab to the tabBar and the view to the view container.
 void addItem(java.lang.Object item)
          Add a View to the TabbedView by constructing a View(container) using the view class name and an associated Tab using the item.
 void addItem(java.lang.Object item, int index)
          Add a View to the TabbedView by constructing a View(container) using the view class name and an associated Tab using the item.
 void addItemListener(java.awt.event.ItemListener listener)
          Adds the specified item listener to receive item events from this TabbedView.
 void componentAdded(java.awt.event.ContainerEvent e)
           
 void componentRemoved(java.awt.event.ContainerEvent e)
           
 void contentsChanged(com.sas.collection.ContentsChangedEvent evt)
          Called when the contents of the model have changed.
 void detachModel(com.sas.ModelInterface model)
          Detach the specified model from the TabbedView.
 int dragOver(java.awt.Point point, int representation, int keyState, java.util.Vector data)
          Used to support Drag and Drop in webAF at design time.
 com.sas.DesignTimeDropResult drop(java.awt.Point point, int representation, int keyState, java.util.Vector data)
          Used to support Drag and Drop in webAF at design time.
static int getDefaultHeight()
           
static int getDefaultWidth()
           
 java.lang.Object getDesignTimeEventHandler(java.awt.AWTEvent event)
          Get the event handler when the TabbedView is run at designTime.
 com.sas.util.transforms.TransformInterface getDisplayTransform()
          Get the transform used by the TabButtonInterface to display the item object.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 int getIndex(java.awt.Container view)
          Get the index of the specified View(container).
 int getInitialSelectedIndex()
          Get the initial selected tab based on its index.
 com.sas.util.transforms.TransformInterface getInputTransform()
          Get the transform used by any methods that use the TabButtonInterface item property as an input parameter.
 java.lang.Object getItem(java.awt.Container view)
          Get the Item object associated with the specified container
 java.lang.Object getItem(int index)
          Get the item property of the tab at the specified index.
 int getModelType()
          Deprecated.  
 int getOrientation()
          Get the orientation of the TabBar on the TabbedView.
 com.sas.util.transforms.TransformInterface getOutputTransform()
          Get the transform used by any methods that use the TabButtonInterface item property as an return value.
 java.util.Vector getRequiredInterfaces()
          Returns the required interfaces Vector for this component.
 int getSelectedIndex()
          Get the index of the selected tab.
 java.lang.Object getSelectedItem()
          Get the item property of the selected tab.
 java.lang.Object[] getSelectedObjects()
          Get the selected item or null if no item is selected.
 SelectionGroupInterface getSelectionGroup()
           
 int getStyle()
          Get the style of the RowLayout.
 TabButtonInterface getTab(java.awt.Container view)
          Get the TabButtonInterface object associated with the specified View(container).
 TabButtonInterface getTab(int index)
          Get the TabButtonInterface object at the specified index.
 TabButtonInterface getTab(java.lang.Object item)
          Get the TabButtonInterface object with the specified item property.
 TabBarInterface getTabBar()
          Get the TabBarInterface object that the TabButtonInterface objects are added to.
 java.awt.LayoutManager getTabBarLayout()
          Get the LayoutManager of the TabBarInterface object.
 java.lang.Class getTabButtonClass()
          Get the class of the default tabs created when an addItem() method is called.
 int getTabCount()
          Get the number of tabs on the TabbedView.
 java.awt.Container getView(int index)
          Get the View(container) at the specified index.
 java.awt.Container getView(java.lang.Object item)
          Get the View( container ) associated with the tab with the specified item property.
 java.awt.Container getView(TabButtonInterface tab)
          Get the View(container) associated with the specified tab.
 BorderInterface getViewBorder()
          Get the Border object drawn around the view containers.
 java.lang.Class getViewClass()
          Get the view container class created by default when an addItem(item) or add(TabButton) is called.
 void initialize()
          Initialize the defaultModel.
 boolean isDefaultModelAttached()
          Returns if the component is using a default internal model.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Invoked when an item's state has been changed in the selectionGroup.
 void next()
          Select the next tab and display the next view in the overall index from the currently displayed tab and view.
 void paint(java.awt.Graphics g)
          Paint the TabbedView.
 void previous()
          Select the previous tab and display the previous view in the overall index from the currently displayed tab and view.
protected  void processActionEvent(java.awt.event.ActionEvent e)
          Processes action events occurring on the TabbedView.
protected  void processEvent(java.awt.AWTEvent e)
          Processes events occurring on the TabbedView.
protected  void processItemEvent(java.awt.event.ItemEvent e)
          Processes item events occurring on the TabbedView.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Invoked when a property change occurs.
 void refresh(com.sas.ModelInterface model)
          Refresh the TabbedView with the specified model.
 void refreshOrderedCollection(com.sas.collection.StaticOrderedCollectionInterface orderedModel)
          Refresh the TabbedView with the orderedCollectionModel.
 void remove(java.awt.Component comp)
          Remove the specified component from this container.
 void remove(int index)
          Remove the tab and view at the specified index.
 void removeActionListener(java.awt.event.ActionListener listener)
          Remove the specified action listener so it no longer receives action events from this TabbedView.
 void removeAll()
          Remove all tabs and views.
 void removeItem(java.lang.Object item)
          Remove the View and TabButtonInterface object associated with the specified item.
 void removeItemListener(java.awt.event.ItemListener listener)
          Remove the specified item listener so it no longer receives item events from this TabbedView.
 void select(java.awt.Component component)
          Select the view to be displayed in the view area.
 void setBackground(java.awt.Color background)
          Set the background color of the TabbedView.
static void setDefaultHeight(int newHeight)
           
 void setDefaultValues()
          Set the Default values for all TabbedView attributes, called by initializeComponent()
static void setDefaultWidth(int newWidth)
           
 void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
          Set the displayTransform for the TabBarInterface.
 void setEnabled(boolean enabled)
          Set the enabled state of the TabbedView.
 void setForeground(java.awt.Color foreground)
          Set the foreground color of the TabbedView.
 void setInitialSelectedIndex(int initIndex)
          Set the initial selected tab based on its index.
 void setInputTransform(com.sas.util.transforms.TransformInterface transform)
          Set the transform used by any methods that use the TabButtonInterface item property as an input parameter.
 void setOrientation(int orient)
          Set the orientation of the TabBar on the TabbedView.
 void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
          Set the transform used by any methods that use the TabButtonInterface item property as an return value.
 void setSelectedIndex(int index)
          Select a View(container) based on the specified index.
 void setSelectedItem(java.lang.Object item)
          Select a View(container) based on the specified item property.
 void setStyle(int s)
          Set the style of the RowLayout.
 void setTabBar(TabBarInterface newTabBar)
          Set the TabBar, removes all panels and associated tabs in previous TabBar.
 void setTabButtonClass(java.lang.Class tClass)
          Set the TabButtonInterface class to be created by default when an item add is done to the TabbedView.
 void setTabEnabled(boolean enabled, int index)
          Enable/Disable the tab at the specified index.
 void setTabEnabled(boolean enabled, java.lang.Object item)
          Enable/Disable the tab with the specified item object
 void setTabVisible(boolean visible, int index)
          Show/Hide the tab at the specified index.
 void setTabVisible(boolean visible, java.lang.Object item)
          Show/Hide the tab with the specified item object
 void setViewBorder(BorderInterface newBorder)
          Set the Border object used for the view area and the rows of the TabBar.
 void setViewClass(java.lang.Class vClass)
          Set the view container class created by default when an item add is done to the TabbedView.
 void validateObject()
           
 void vetoableChange(java.beans.PropertyChangeEvent evt)
          Forward the vetoableChangeEvent to allow the selection of another tab to be vetoed.
 
Methods inherited from class com.sas.awt.PanelContainerComponent
addNotify, clone, dragEnter, dragLeave, getContainerInterfaceSupportInfo, getErrorHandler, getInsets, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues
 
Methods inherited from class com.sas.awt.PanelVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, computePreferredSize, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getMinimumSize, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, print, printFinalize, printInitialize, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setBounds, setComponentDescription, setComponentSupportInfo, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update
 
Methods inherited from interface com.sas.awt.ContainerInterface
getComponents, getLayout, invalidate, setLayout, validate
 
Methods inherited from interface com.sas.awt.VisualInterface
computePreferredSize, getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getMinimumSize, getPreferredSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBackgroundColor, setBorder, setBounds, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setPreferredSize, setPrePainter, setTransparent, setVerticalPosition, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

internalAdd

protected transient boolean internalAdd

internalRemove

protected transient boolean internalRemove
Constructor Detail

TabbedView

public TabbedView()
Default Constructor. Creates a TabbedView with a TOP orientation and a SCROLLABLE style.


TabbedView

public TabbedView(int orientation)
Constructor that sets the orientation of the TabBar.


TabbedView

public TabbedView(int orientation,
                  int style)
Constructor that sets the orientation and the style of the TabBar.

Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

getDefaultHeight

public static int getDefaultHeight()

getDefaultWidth

public static int getDefaultWidth()

setDefaultHeight

public static void setDefaultHeight(int newHeight)

setDefaultWidth

public static void setDefaultWidth(int newWidth)

add

public void add(TabButtonInterface tab,
                java.awt.Container newView,
                java.lang.Integer grpIndex)
Add a View(container) to the TabbedView with an associated tab on the specified group(row) grpIndex and added at the end of the component list.

Parameters:
tab - the TabButtonInterface object associated with the added view
newView - the View(container) to be added
grpIndex - the index of the group(row) where the tab is added

add

public void add(TabButtonInterface tab,
                java.awt.Container newView,
                java.lang.Integer grpIndex,
                int index)
Add a View(container) to the TabbedView with an associated tab on the specified group(row) grpIndex and inserted at index.

Parameters:
tab - the TabButtonInterface object associated with the added view
newView - the View(container) to be added
grpIndex - the index of the group(row) where the tab is added
index - the position in the TabbedView's list at which to insert the component. -1 means insert at the end.

add

public void add(java.awt.Container newView,
                java.lang.Object item,
                java.lang.Integer grpIndex)
Add a View(container) and create an associated Tab, using the item, on the specified group(row) in the TabbedView.

Parameters:
newView - the View(container) to be added to the TabbedView
item - the item to initialize the TabButtonInterface object associated with the added View
grpIndex - the index of the group(row) in which to add the Tab

add

public void add(java.awt.Container newView,
                java.lang.Object item,
                java.lang.Integer grpIndex,
                int index)
Add a View(container) and create an associated Tab, using the item, on the specified group(row) and at the specified index in the TabbedView.

Parameters:
newView - the View(container) to be added to the TabbedView
item - the item to initialize the TabButtonInterface object associated with the added View
grpIndex - the index of the group(row) in which to add the Tab
index - the position in the container's list at which to insert the component. -1 means insert at the end.

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener to receive action events from this TabbedView

Parameters:
listener - the actionListener

addInternal

protected void addInternal(java.awt.Component tab,
                           java.awt.Component view,
                           java.lang.Integer grpIndex,
                           int index)
Add the tab to the tabBar and the view to the view container. These adds do not affect the model.

Parameters:
tab - the tab to add to the tabBar
view - the view to add the the view container
grpIndex - the index of the group to add the tab to
index - the index position to add the tab at, -1 adds the tab at the end of the component list

addImpl

protected void addImpl(java.awt.Component comp,
                       java.lang.Object constraints,
                       int index)
Adds the specified component to this container at the specified index with the given constraints. This method limits the inherited add calls to:
  add( TabButtonInterface tab )
  add( TabButtonInterface tab, java.awt.Container view )
  add( TabButtonInterface tab, Integer groupIndex )
  add( TabButtonInterface tab, java.awt.Container view, int index )
  add( TabButtonInterface tab, Integer groupIndex, int index )

  add( java.awt.Container view )
  add( java.awt.Container view, Object tabItem )
  add( java.awt.Container view, TabButtonInterface tab )
  add( java.awt.Container view, Object tabItem, int index )
  add( java.awt.Container view, TabButtonInterface tab, int index )

  add( TabFolderInterface folder )
  add( TabFolderInterface folder, Integer groupIndex )
  add( TabFolderInterface folder, Integer groupIndex, int index )
 
Where the tab is also an instance of java.awt.Component and the folder is also an instance of java.awt.Container. This is the method to override if you want to track every add request to a container. An overriding method should usually include a call to super.addImpl(comp, constraints, index).

Overrides:
addImpl in class java.awt.Container

addItem

public void addItem(java.lang.Object item)
Add a View to the TabbedView by constructing a View(container) using the view class name and an associated Tab using the item.

Parameters:
item - the item to initialize the TabButtonInterface object associated with the added View

addItem

public void addItem(java.lang.Object item,
                    int index)
Add a View to the TabbedView by constructing a View(container) using the view class name and an associated Tab using the item. The tab will be added at the index position.

Parameters:
item - the item to initialize the TabButtonInterface object associated with the added View
index - the index position to add the tab at, -1 adds the tab at the end of the component list.

addItemListener

public void addItemListener(java.awt.event.ItemListener listener)
Adds the specified item listener to receive item events from this TabbedView.

Specified by:
addItemListener in interface java.awt.ItemSelectable
Parameters:
listener - the ItemListener

contentsChanged

public void contentsChanged(com.sas.collection.ContentsChangedEvent evt)
Called when the contents of the model have changed.

Specified by:
contentsChanged in interface com.sas.collection.ContentsChangedListener
Parameters:
evt - the ContentsChangedEvent from the model that changed.

detachModel

public void detachModel(com.sas.ModelInterface model)
Detach the specified model from the TabbedView. If the model is now null, the defaultModel will be attached.

Specified by:
detachModel in interface com.sas.ViewInterface
Overrides:
detachModel in class PanelVisualComponent
Parameters:
model - Model to detach
See Also:
ViewInterface.detachModel(com.sas.ModelInterface)

dragOver

public int dragOver(java.awt.Point point,
                    int representation,
                    int keyState,
                    java.util.Vector data)
Used to support Drag and Drop in webAF at design time.

Specified by:
dragOver in interface ContainerInterface
Specified by:
dragOver in interface com.sas.DesignTimeDropTargetInterface
Overrides:
dragOver in class PanelContainerComponent
Parameters:
point - The x/y coordinates of the mouse cursor inside the component.
representation - One of com.sas.DesignTimeDropResult.{representationComponent,representationModel,representationAttribute,representationViewer}
keyState - Unused.
data - A Vector containing information about the drag.
Returns:
One of com.sas.DesignTimeDropResult.{dragIndeterminate,dragMove,dragCopy,dragLink,dragNone}
See Also:
DesignTimeDropTargetInterface.dragOver(java.awt.Point, int, int, java.util.Vector)

drop

public com.sas.DesignTimeDropResult drop(java.awt.Point point,
                                         int representation,
                                         int keyState,
                                         java.util.Vector data)
Used to support Drag and Drop in webAF at design time.

Specified by:
drop in interface ContainerInterface
Specified by:
drop in interface com.sas.DesignTimeDropTargetInterface
Overrides:
drop in class PanelContainerComponent
Parameters:
point - The x/y coordinates of the mouse cursor inside the component.
representation - One of com.sas.DesignTimeDropResult.{representationComponent,representationModel,representationAttribute,representationViewer}
keyState - Unused.
data - A Vector containing information about the drag.
Returns:
An instance of com.sas.DesignTimeDropResult or null to indicate that a drop was refused.
See Also:
DesignTimeDropTargetInterface.drop(java.awt.Point, int, int, java.util.Vector)

getDesignTimeEventHandler

public java.lang.Object getDesignTimeEventHandler(java.awt.AWTEvent event)
Get the event handler when the TabbedView is run at designTime.

Specified by:
getDesignTimeEventHandler in interface com.sas.idesupport.DesignTimeEventInterface
Parameters:
event - The event for the component to determine if is wishes to handle.
Returns:
true if the event is a java.awt.event.MouseEvent that occurs on the TabBar component of the TabbedView.
See Also:
DesignTimeEventInterface

getDisplayTransform

public com.sas.util.transforms.TransformInterface getDisplayTransform()
Get the transform used by the TabButtonInterface to display the item object.

Returns:
the displayTransform

getIndex

public int getIndex(java.awt.Container view)
Get the index of the specified View(container).

Parameters:
the - view to find the index of
Returns:
the index of the view or -1 if it isn't found.

getInitialSelectedIndex

public int getInitialSelectedIndex()
Get the initial selected tab based on its index. Only used when a TabbedView object is deserialized.

Returns:
the index of the initially selected tab

getInputTransform

public com.sas.util.transforms.TransformInterface getInputTransform()
Get the transform used by any methods that use the TabButtonInterface item property as an input parameter.

Returns:
the inputTransform
See Also:
setInputTransform(com.sas.util.transforms.TransformInterface)

getItem

public java.lang.Object getItem(java.awt.Container view)
Get the Item object associated with the specified container

Parameters:
view - the container associated with the item to get.
Returns:
the item associated with the view
Throws:
NoSuchElementException - if the view is not added to the TabbedView

getItem

public java.lang.Object getItem(int index)
Get the item property of the tab at the specified index.

Parameters:
index - the index of the tab to get the item property of.
Returns:
the item property of the tab at the index position.

getTabCount

public int getTabCount()
Get the number of tabs on the TabbedView.

Returns:
the number of tabs on the TabbedView.

getModelType

public int getModelType()
Deprecated. 


getOrientation

public int getOrientation()
Get the orientation of the TabBar on the TabbedView.

Returns:
an orientation value: TOP, BOTTOM, RIGHT, or LEFT
See Also:
Orientations, TabBarInterface, setOrientation(int)

getOutputTransform

public com.sas.util.transforms.TransformInterface getOutputTransform()
Get the transform used by any methods that use the TabButtonInterface item property as an return value.

Returns:
the outputTransform
See Also:
setOutputTransform(com.sas.util.transforms.TransformInterface)

getRequiredInterfaces

public java.util.Vector getRequiredInterfaces()
Returns the required interfaces Vector for this component.

Specified by:
getRequiredInterfaces in interface com.sas.ViewInterface
Overrides:
getRequiredInterfaces in class PanelVisualComponent
Returns:
the required interfaces Vector for this component.
See Also:
ViewInterface.getRequiredInterfaces()

getSelectedIndex

public int getSelectedIndex()
Get the index of the selected tab.

Returns:
the index of the selected tab.
See Also:
setSelectedIndex(int)

getSelectedItem

public java.lang.Object getSelectedItem()
Get the item property of the selected tab.

Returns:
the item property of the selected tab
See Also:
setSelectedItem(java.lang.Object)

getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Get the selected item or null if no item is selected.

Specified by:
getSelectedObjects in interface java.awt.ItemSelectable
Returns:
the selected item from the selected tab
See Also:
ItemSelectable

getSelectionGroup

public SelectionGroupInterface getSelectionGroup()

getStyle

public int getStyle()
Get the style of the RowLayout. The SCROLLABLE style draws the tabs on one row with a SpinButton to access tabs that are not visible. The MULTIGROUP style draws the tabs in multiple rows so that all tabs are visible at the same time.

Returns:
a style value: SCROLLABLE or MULTIGROUP
See Also:
setStyle(int)

getTab

public TabButtonInterface getTab(java.awt.Container view)
Get the TabButtonInterface object associated with the specified View(container).

Parameters:
view - the view to find the tab for
Returns:
the tab associated with the view container
Throws:
NoSuchElementException - if the view is not added to the TabbedView

getTab

public TabButtonInterface getTab(int index)
Get the TabButtonInterface object at the specified index.

Parameters:
index - the index of the tab object to return
the - tab at the index position

getTab

public TabButtonInterface getTab(java.lang.Object item)
Get the TabButtonInterface object with the specified item property. The item will be transformed using the inputTransform before being compared.

Parameters:
item - the item property of the tab to find
Returns:
the tab with the given item property

getTabBar

public TabBarInterface getTabBar()
Get the TabBarInterface object that the TabButtonInterface objects are added to.

Returns:
the TabBarInterface object containing the tabs of the TabbedView
See Also:
setTabBar(com.sas.visuals.TabBarInterface)

getTabBarLayout

public java.awt.LayoutManager getTabBarLayout()
Get the LayoutManager of the TabBarInterface object.

Returns:
the LayoutManager used to position the tabs in the TabBarInterface container.

getTabButtonClass

public java.lang.Class getTabButtonClass()
Get the class of the default tabs created when an addItem() method is called.

Returns:
the class of the tab to create by default
See Also:
setTabButtonClass(java.lang.Class)

getView

public java.awt.Container getView(java.lang.Object item)
Get the View( container ) associated with the tab with the specified item property.

Parameters:
item - the item property of the tab associated with the container to return
Returns:
the container associated with the tab with the specified item property

getView

public java.awt.Container getView(TabButtonInterface tab)
Get the View(container) associated with the specified tab.

Parameters:
tab - the tab associated with the container to return
Returns:
the container associated with the specified tab object

getView

public java.awt.Container getView(int index)
Get the View(container) at the specified index.

Parameters:
index - the index of the container to return
Returns:
the container at the specified index

getViewBorder

public BorderInterface getViewBorder()
Get the Border object drawn around the view containers.

Returns:
the border drawn around the view containers.
See Also:
setViewBorder(com.sas.visuals.BorderInterface)

getViewClass

public java.lang.Class getViewClass()
Get the view container class created by default when an addItem(item) or add(TabButton) is called.

Returns:
the default view container class created
See Also:
setViewClass(java.lang.Class)

initialize

public void initialize()
Initialize the defaultModel. If at designTime then add "Tab 1" and "Tab 2" to the defaultModel.

Specified by:
initialize in interface com.sas.ComponentInterface
Overrides:
initialize in class PanelVisualComponent
See Also:
ComponentInterface.initialize()

isDefaultModelAttached

public boolean isDefaultModelAttached()
Returns if the component is using a default internal model.

Specified by:
isDefaultModelAttached in interface com.sas.ViewDefaultModelInterface
Returns:
true if is the component is using a default internal model, false otherwise.

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Invoked when an item's state has been changed in the selectionGroup. Handles the showing and hiding of the Views(containers)

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

next

public void next()
Select the next tab and display the next view in the overall index from the currently displayed tab and view. If the current tab is the last tab, this method will do nothing.

See Also:
previous()

paint

public void paint(java.awt.Graphics g)
Paint the TabbedView. Specifically in the order of MainContainer first, then the TabBar.

Overrides:
paint in class PanelVisualComponent
Parameters:
g - the Graphics context
See Also:
VisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)

processEvent

protected void processEvent(java.awt.AWTEvent e)
Processes events occurring on the TabbedView.

Overrides:
processEvent in class java.awt.Container

processActionEvent

protected void processActionEvent(java.awt.event.ActionEvent e)
Processes action events occurring on the TabbedView.


processItemEvent

protected void processItemEvent(java.awt.event.ItemEvent e)
Processes item events occurring on the TabbedView.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Invoked when a property change occurs.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class PanelVisualComponent
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

previous

public void previous()
Select the previous tab and display the previous view in the overall index from the currently displayed tab and view. If the current tab is the first tab, this method will do nothing.

See Also:
next()

validateObject

public void validateObject()
Specified by:
validateObject in interface java.io.ObjectInputValidation
Overrides:
validateObject in class PanelVisualComponent
See Also:
ComponentInterfaceSupport.validateObject(com.sas.ComponentInterface)

componentAdded

public void componentAdded(java.awt.event.ContainerEvent e)
Specified by:
componentAdded in interface java.awt.event.ContainerListener

componentRemoved

public void componentRemoved(java.awt.event.ContainerEvent e)
Specified by:
componentRemoved in interface java.awt.event.ContainerListener

refresh

public void refresh(com.sas.ModelInterface model)
Refresh the TabbedView with the specified model.

Specified by:
refresh in interface com.sas.ViewInterface
Overrides:
refresh in class PanelVisualComponent
Parameters:
model - the model to refresh the TabbedView with.
See Also:
ViewInterface.refresh(com.sas.ModelInterface)

refreshOrderedCollection

public void refreshOrderedCollection(com.sas.collection.StaticOrderedCollectionInterface orderedModel)
Refresh the TabbedView with the orderedCollectionModel.


remove

public void remove(java.awt.Component comp)
Remove the specified component from this container. The following removes are allowed:
 remove( TabButtonInterface tab )
 remove( java.awt.Container view )
 
These allow removes to occur if either a tab or a view is removed.

Overrides:
remove in class Panel
Parameters:
comp - the component to remove

remove

public void remove(int index)
Remove the tab and view at the specified index.

Overrides:
remove in class Panel
Parameters:
index - the index of the tab and view to remove from the TabbedView

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Remove the specified action listener so it no longer receives action events from this TabbedView.

Parameters:
listener - the action listener

removeAll

public void removeAll()
Remove all tabs and views.

Overrides:
removeAll in class Panel

removeItem

public void removeItem(java.lang.Object item)
Remove the View and TabButtonInterface object associated with the specified item.

Parameters:
item - the item associatied with the view and tab to be removed

removeItemListener

public void removeItemListener(java.awt.event.ItemListener listener)
Remove the specified item listener so it no longer receives item events from this TabbedView.

Specified by:
removeItemListener in interface java.awt.ItemSelectable
Parameters:
listener - the item listener

select

public void select(java.awt.Component component)
Select the view to be displayed in the view area. Either the view component or the tab component are accepted.

Parameters:
component - The view component to be displayed or the tab associated with the view to be displayed.

setBackground

public void setBackground(java.awt.Color background)
Set the background color of the TabbedView. This will also set the background color of all of the views and tabs to null which will cause them to inherit their background color from the TabbedView.

Overrides:
setBackground in class java.awt.Component
Parameters:
background - the background set on all of the components.

setForeground

public void setForeground(java.awt.Color foreground)
Set the foreground color of the TabbedView. This will also set the foreground color of all of the views and tabs to null which will cause them to inherit their foreground color from the TabbedView.

Overrides:
setForeground in class java.awt.Component
Parameters:
foreground - the foreground set on all of the components.

setDefaultValues

public void setDefaultValues()
Set the Default values for all TabbedView attributes, called by initializeComponent()

Specified by:
setDefaultValues in interface ContainerInterface
Specified by:
setDefaultValues in interface VisualInterface
Specified by:
setDefaultValues in interface com.sas.ComponentInterface
Overrides:
setDefaultValues in class CompositePanel
See Also:
ContainerInterface.setDefaultValues()

setDisplayTransform

public void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
Set the displayTransform for the TabBarInterface. Transforms all item properties into display form. Default null does an IdentityTransform.

Parameters:
transform - the displayTransform
See Also:
getDisplayTransform()

setInitialSelectedIndex

public void setInitialSelectedIndex(int initIndex)
Set the initial selected tab based on its index. Only used when a TabbedView object is deserialized.

Parameters:
initIndex - the index of the initially selected tab

setInputTransform

public void setInputTransform(com.sas.util.transforms.TransformInterface transform)
Set the transform used by any methods that use the TabButtonInterface item property as an input parameter. Default null does an IdentityTransform.

Parameters:
transform - the inputTransform
See Also:
getInputTransform()

setOrientation

public void setOrientation(int orient)
Set the orientation of the TabBar on the TabbedView.

Parameters:
orient - an orientation value: TOP, BOTTOM, LEFT, or RIGHT
See Also:
getOrientation()

setOutputTransform

public void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
Set the transform used by any methods that use the TabButtonInterface item property as an return value. Default null does an IdentityTransform.

Parameters:
transform - the outputTransform
See Also:
getOutputTransform()

setSelectedIndex

public void setSelectedIndex(int index)
Select a View(container) based on the specified index.

Parameters:
index - the index of the view to select and display
See Also:
getSelectedIndex()

setSelectedItem

public void setSelectedItem(java.lang.Object item)
Select a View(container) based on the specified item property.

Parameters:
item - the item property of the tab to select and view to display
See Also:
getSelectedItem()

setStyle

public void setStyle(int s)
Set the style of the RowLayout. The SCROLLABLE style draws the tabs on one row with a SpinButton to access tabs that are not visible. The MULTIGROUP style draws the tabs in multiple rows so that all tabs are visible at the same time.

Parameters:
s - a style value: SCROLLABLE or MULTIGROUP
See Also:
getStyle()

setTabBar

public void setTabBar(TabBarInterface newTabBar)
Set the TabBar, removes all panels and associated tabs in previous TabBar. Does not add views for any existing tab in the new TabBar.

Parameters:
newTabBar - the new TabBar to contain all tabs
See Also:
getTabBar()

setTabButtonClass

public void setTabButtonClass(java.lang.Class tClass)
Set the TabButtonInterface class to be created by default when an item add is done to the TabbedView. If the class is able to be created and is an instance of java.awt.Component, the property is set to the new class.

Parameters:
tClass - the class of the used to create default tabs
See Also:
getTabButtonClass()

setEnabled

public void setEnabled(boolean enabled)
Set the enabled state of the TabbedView.

Specified by:
setEnabled in interface VisualInterface
Overrides:
setEnabled in class PanelVisualComponent
Parameters:
enabled - the enabled state of the TabbedView
See Also:
VisualInterface.setEnabled(boolean)

setTabEnabled

public void setTabEnabled(boolean enabled,
                          java.lang.Object item)
Enable/Disable the tab with the specified item object

Parameters:
enabled - the new enabled state of the tab
item - the item object of the tab to setEnabled on.

setTabEnabled

public void setTabEnabled(boolean enabled,
                          int index)
Enable/Disable the tab at the specified index.

Parameters:
enabled - the new enabled state of the tab
index - the index of the tab to setEnabled on.

setTabVisible

public void setTabVisible(boolean visible,
                          java.lang.Object item)
Show/Hide the tab with the specified item object

Parameters:
enabled - the new visible state of the tab
item - the item object of the tab to setVisible on.

setTabVisible

public void setTabVisible(boolean visible,
                          int index)
Show/Hide the tab at the specified index.

Parameters:
enabled - the new visible state of the tab
index - the index of the tab to setVisible on.

setViewBorder

public void setViewBorder(BorderInterface newBorder)
Set the Border object used for the view area and the rows of the TabBar.

Parameters:
newBorder - the border drawn around the view area and on the rows of tabs.

setViewClass

public void setViewClass(java.lang.Class vClass)
Set the view container class created by default when an item add is done to the TabbedView. If class is able to be created and is an instance of java.awt.Component, the property will be set to the new class.

Parameters:
vClass - the class of the used to create default views
See Also:
getViewClass()

vetoableChange

public void vetoableChange(java.beans.PropertyChangeEvent evt)
                    throws java.beans.PropertyVetoException
Forward the vetoableChangeEvent to allow the selection of another tab to be vetoed.

Specified by:
vetoableChange in interface java.beans.VetoableChangeListener
Parameters:
evt - the vetoableChangeEvent sent when the tab selection changes.
Throws:
java.beans.PropertyVetoException - when the property event is vetoed.
See Also:
SelectionGroup



Copyright © 2009 SAS Institute Inc. All Rights Reserved.