com.jmex.bui
Class BTabbedPane

java.lang.Object
  extended by com.jmex.bui.BComponent
      extended by com.jmex.bui.BContainer
          extended by com.jmex.bui.BTabbedPane

public class BTabbedPane
extends BContainer

Displays one of a set of components (tabs) depending on which tab is selected.


Nested Class Summary
protected static class BTabbedPane.Tab
           
 
Nested classes/interfaces inherited from class com.jmex.bui.BContainer
BContainer.ChildOp
 
Field Summary
protected  BContainer _buttons
           
protected  BButton _close
           
protected  ActionListener _closer
           
protected  ActionListener _selector
           
protected  int _selidx
           
protected  ArrayList<BTabbedPane.Tab> _tabs
           
protected  BContainer _top
           
 
Fields inherited from class com.jmex.bui.BContainer
_children, _layout
 
Fields inherited from class com.jmex.bui.BComponent
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES
 
Constructor Summary
BTabbedPane()
          Creates a tabbed pane with left justified buttons.
BTabbedPane(GroupLayout.Justification tabAlign)
          Creates a tabbed pane.
BTabbedPane(GroupLayout.Justification tabAlign, int gap)
          Creates a tabbed pane.
 
Method Summary
 void addTab(String title, BComponent tab)
          Adds a tab to the pane using the specified title with no close button.
 void addTab(String title, BComponent tab, boolean hasClose)
          Adds a tab to the pane using the specified tile.
protected  String getDefaultStyleClass()
          Returns the default stylesheet class to be used for all instances of this component.
 BComponent getSelectedTab()
          Returns the selected tab component.
 int getSelectedTabIndex()
          Returns the index of the selected tab.
 BToggleButton getTabButton(BComponent tab)
          Returns a reference to the tab button for the given tab.
 BToggleButton getTabButton(int idx)
          Returns a reference to the tab button at the given index.
 int getTabCount()
          Returns the number of tabs in this pane.
 int indexOfTab(BComponent tab)
          Returns the index of the given tab.
 void removeAllTabs()
          Removes all tabs.
 void removeTab(BComponent tab)
          Removes the specified tab.
 void removeTab(int tabidx)
          Removes the tab at the specified index.
 void removeTab(int tabidx, boolean btnClose)
          Removes the tab at the specified index.
 void selectTab(BComponent tab)
          Selects the specified tab.
 void selectTab(int tabidx)
          Selects the tab with the specified index.
protected  void tabWasRemoved(BComponent tab, boolean btnClose)
          Called when a tab was removed.
protected  void updateClose(boolean showClose)
          Updates the visibility of the close tab button.
 
Methods inherited from class com.jmex.bui.BContainer
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getHitComponent, getLayoutManager, getNextFocus, getPreviousFocus, layout, remove, remove, removeAll, renderComponent, replace, setAlpha, setEnabled, setLayoutManager, setVisible, validate, wasAdded, wasRemoved
 
Methods inherited from class com.jmex.bui.BComponent
acceptsFocus, addListener, applyDefaultStates, boundsToString, changeCursor, configureStyle, createTooltipComponent, dispatchEvent, emitEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getCursor, getFocusTarget, getHeight, getInsets, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleClass, getTooltipText, getWidth, getWindow, getX, getY, hasFocus, intersectScissorBox, invalidate, isAdded, isEnabled, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeListener, render, renderBackground, renderBorder, requestFocus, restoreScissorState, setBackground, setBounds, setCursor, setLocation, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleClass, setTooltipRelativeToMouse, setTooltipText, stateDidChange, updateCursor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_selector

protected ActionListener _selector

_closer

protected ActionListener _closer

_tabs

protected ArrayList<BTabbedPane.Tab> _tabs

_selidx

protected int _selidx

_top

protected BContainer _top

_buttons

protected BContainer _buttons

_close

protected BButton _close
Constructor Detail

BTabbedPane

public BTabbedPane()
Creates a tabbed pane with left justified buttons.


BTabbedPane

public BTabbedPane(GroupLayout.Justification tabAlign)
Creates a tabbed pane.

Parameters:
tabAlign - the justification for the tab buttons.

BTabbedPane

public BTabbedPane(GroupLayout.Justification tabAlign,
                   int gap)
Creates a tabbed pane.

Parameters:
tabAlign - the justification for the tab buttons.
gap - the number of pixels space between each tab button.
Method Detail

addTab

public void addTab(String title,
                   BComponent tab)
Adds a tab to the pane using the specified title with no close button.


addTab

public void addTab(String title,
                   BComponent tab,
                   boolean hasClose)
Adds a tab to the pane using the specified tile.


removeTab

public void removeTab(BComponent tab)
Removes the specified tab.


removeTab

public void removeTab(int tabidx)
Removes the tab at the specified index.


removeTab

public void removeTab(int tabidx,
                      boolean btnClose)
Removes the tab at the specified index.

Parameters:
btnClose - set to true if the tab was removed by the close button

removeAllTabs

public void removeAllTabs()
Removes all tabs.


getTabCount

public int getTabCount()
Returns the number of tabs in this pane.


selectTab

public void selectTab(BComponent tab)
Selects the specified tab.


selectTab

public void selectTab(int tabidx)
Selects the tab with the specified index.


getSelectedTab

public BComponent getSelectedTab()
Returns the selected tab component.


getSelectedTabIndex

public int getSelectedTabIndex()
Returns the index of the selected tab.


getTabButton

public BToggleButton getTabButton(BComponent tab)
Returns a reference to the tab button for the given tab.


getTabButton

public BToggleButton getTabButton(int idx)
Returns a reference to the tab button at the given index.


indexOfTab

public int indexOfTab(BComponent tab)
Returns the index of the given tab.


updateClose

protected void updateClose(boolean showClose)
Updates the visibility of the close tab button.


tabWasRemoved

protected void tabWasRemoved(BComponent tab,
                             boolean btnClose)
Called when a tab was removed.

Parameters:
btnClose - set to true if the tab was removed by the close button

getDefaultStyleClass

protected String getDefaultStyleClass()
Description copied from class: BComponent
Returns the default stylesheet class to be used for all instances of this component. Derived classes will likely want to override this method and set up a default class for their type of component.

Overrides:
getDefaultStyleClass in class BContainer


Copyright © 2008 Michael Bayne. All Rights Reserved.