public class TabbedPanel extends MultiCardPanelAdapter implements MultiCardPanel
mTabbedPanels generate a DataChange event when their selected item is changed.
Modifier and Type | Field and Description |
---|---|
boolean |
alwaysCloseToLeft
If true, closing the selected will select the tab to the left.
|
boolean |
closeInTabs
If true, there will be a close button in every tab.
|
protected Control |
closeTabButton |
boolean |
dontExpandTabs
If this is true, then the tabs are not expanded to show both the icon AND the text when selected.
|
boolean |
dontFocusOnNextSelect
Deprecated.
use modifyCardOptions(OPTION_DONT_FOCUS_ON_NEXT_SELECT,0) instead;
|
Control |
extraControlsLeft
This is initially null.
|
Control |
extraControlsRight
This is initially null.
|
boolean |
focusOnControlsAfterTabHotKey
Deprecated.
use modifyCardOptions(OPTION_FOCUS_ON_CONTROLS_AFTER_SELECTION_HOT_KEY,0) instead;
|
boolean |
hideSingleTab
If this is true, then if a single Tab is present, the Tab area will be hidden completely.
|
boolean |
keepExtraControls
Used when hideSingleTab is true.
|
protected Button |
left |
int |
maxTabTextWidth |
int |
minTabHeight
This can be set to specify a minimum tab height.
|
protected int |
myOptions
These hold the MultiCardPanel options.
|
boolean |
noScrollButtons
This is false by default - set it true so that the left/right scroll buttons are never seen.
|
protected Button |
right |
Color |
selectedTabColor |
int |
tabLocation
This should be NORTH/SOUTH/EAST/WEST (but only NORTH/SOUTH are currently supported)
|
protected eve.ui.TabsPanel |
tabs |
protected CellPanel |
top |
boolean |
useLeftRightButtons |
cardPanel, selectedCards
autoSpan, layout, mySplitter, nextSplitter, quickRecalculate
all, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, equalHeights, equalWidths, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
isFullScrollClient, origin, scrollPercent, virtualSize
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocus
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
ADD_OPTION_DONT_SHOW_TEXT_WITH_ICON, EXTRA_CONTROL_BOTTOM, EXTRA_CONTROL_EXTREME, EXTRA_CONTROL_LEFT, EXTRA_CONTROL_RIGHT, EXTRA_CONTROL_TOP, OPTION_AUTO_SCROLL, OPTION_DONT_FOCUS_ON_ANY_SELECT, OPTION_DONT_FOCUS_ON_NEXT_SELECT, OPTION_FOCUS_ON_CONTROLS_AFTER_SELECTION_HOT_KEY, OPTION_ITEM_SELECTOR_ALWAYS_ENABLED, OPTION_SWIPABLE_HORIZONTALLY, OPTION_SWIPABLE_VERTICALLY, OPTION_SWIPE_USING_CONTROL, OPTION_VERTICAL_SCROLLER
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
TabbedPanel()
Create a TabbedPanel that has the OPTION_AUTO_SCROLL true by default.
|
TabbedPanel(boolean autoScroll)
Create a TabbedPanel with autoScroll on or off.
|
TabbedPanel(CardPanel cardPanelToUse,
int cardOptionsToSet,
int cardOptionsToClear)
Create a TabbedPanel using a particular CardPanel for the actual
Control switching.
|
Modifier and Type | Method and Description |
---|---|
Control |
addCloseTabButton()
Add a default button in the default location that will be used to close tabs that can be closed.
|
Control |
addCloseTabButton(Control button,
boolean toLeft)
Add a button that will be used to close tabs that can be closed.
|
protected void |
addedNewCard(Card c)
This is called when a new card is added.
|
protected void |
addedNewItem(Control item) |
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control.
|
void |
checkLeftRight() |
void |
checkLeftRight(boolean dontAutoShift) |
boolean |
closeCurrentTab()
This closes the currently selected tab unconditionally.
|
boolean |
closeTab(Card c)
Close a particular tab.
|
boolean |
closeTab(int which)
Close a particular tab.
|
protected boolean |
doHotKey(Control from,
KeyEvent ev)
This method checks to see if a KeyEvent should be considered the Control's hot-key.
|
void |
doPaint(Graphics g,
Rect r)
This is the main method to override when doing custom Control painting.
|
static Object[] |
getExpandingTabbedPanel(boolean above)
Use this to create a self-expanding mTabbedPanel.
|
CellPanel |
getExtraControlArea(int whichArea)
If this MultiCardPanel supports an extra area for placing controls
which are not within the dynamic display area, then this will return
a CellPanel that you can add controls to which will be displayed in
that area.
|
CellPanel |
getExtraControls(boolean isLeft)
This gets a container to put extra controls in.
|
CellPanel |
getExtremeControls(boolean isLeft)
This gets a CellPanel to put extra controls in that will be further left or right
of the container provided by getExtraControls().
|
protected Control |
getFirstFocus() |
protected Menu |
getMoreTabsMenu() |
Control |
getNextKeyFocus(Control sourceChild,
boolean forwards)
Determine which sub-control should receive the keyboard focus.
|
protected Color |
getTabColor(boolean isSelected) |
Control |
getTabsPanel() |
void |
gotFocus(int how)
This can only get focus explicitly - via focusOnContainer, or via selectNextTab().
|
void |
lostFocus(int how)
This is called when the Control loses the focus.
|
void |
make(boolean remake)
This is used to "make" the control before being displayed.
|
int |
modifyCardOptions(int toSet,
int toClear)
Set and/or clear card options - or return the current options (if
optionsToSet and optionsToClear are zero).
|
void |
newSelection() |
protected void |
newSelection(Card c)
This is called when a new Card has been selected.
|
void |
onControlEvent(ControlEvent ev) |
void |
onKeyEvent(KeyEvent ev) |
void |
repaintTabs() |
void |
resizeTo(int width,
int height)
This is called to change the width and height values.
|
void |
select(Control item)
This selects for display one of the previously added Controls.
|
void |
select(int index)
This selects for display one of the previously added Controls, given the
index of the item.
|
void |
select(String tabName)
This selects for display one of the previously added Controls, given the
short (tab) name for the item.
|
void |
selectAndExpand(int which) |
void |
selectNextTab(boolean forwards,
boolean focusOnTab)
Select the next tab.
|
void |
setAutoExpand(SplittablePanel splittablePanel)
Call this AFTER setting the tabLocation to be NORTH or SOUTH (it is NORTH by default), but before
doing a make().
|
protected boolean |
tabCanClose(Card c,
int index)
This is called when a Tab is about to be closed.
|
protected void |
tabClosed(Card closed,
int index)
This is called if a Tab is closed via the closeTab() method or Close Tab button.
|
boolean |
tabsAreDisplayed() |
void |
updateCard(Card card)
This can be called explicitly if a change has been made to the Card.
|
void |
updateTabs()
Call this if you have made an update to the Cards or any other change
that does not automatically update the Tabs.
|
addCard, addCard, addCard, addItem, getCardPanel, getItem, getItem, getItemCount, getSelectedItem, modifyAndSaveCardOptions, removeCardAt, restoreCardOptions, select
getFloatingControls, getSubControls, hasFloatingControls, makeLayoutGrid, onEvent, relayoutMe, removeAll, reShow, resize
add, addChildListener, addDirectly, addLast, addLast, addLast, addNext, addNext, addNext, addNext, calculatedSizes, doBorder, endRow, getControlTag, getPreferredSize, insertRow, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setAsBelowSip, setText
canGo, canScreenScroll, checkScrolls, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMyHeight, getMySize, getMyWidth, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
add, completeAddPopupControl, containerHasFocus, dismantle, dismantle, findChild, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, grayOut, hide, relayout, removePopupControl, repaintDataNow, setHidden, startAddPopupControl, takeFocus, takePromptControl, unhide
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, formClosing, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onLabelPenEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, shown, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addCard, addCard, addCard, getCardPanel, getItem, getItem, modifyAndSaveCardOptions, restoreCardOptions, select
addItem, getItemCount, getSelectedItem
getServer, setServer
public boolean closeInTabs
public boolean alwaysCloseToLeft
public int tabLocation
public Control extraControlsLeft
public Control extraControlsRight
public boolean noScrollButtons
protected Control closeTabButton
protected eve.ui.TabsPanel tabs
protected CellPanel top
protected Button left
protected Button right
public boolean useLeftRightButtons
public Color selectedTabColor
public int minTabHeight
public boolean dontExpandTabs
public boolean hideSingleTab
public boolean keepExtraControls
public int maxTabTextWidth
public boolean dontFocusOnNextSelect
public boolean focusOnControlsAfterTabHotKey
protected int myOptions
public TabbedPanel(boolean autoScroll)
autoScroll
- true to enable auto scrolling, false to not enable auto scrolling.public TabbedPanel()
public TabbedPanel(CardPanel cardPanelToUse, int cardOptionsToSet, int cardOptionsToClear)
cardPanelToUse
- the CardPanel to use. If it is null a default
CardPanel is used.cardOptionsToSet
- optional MultiCardPanel.OPTION_XXX values to set.cardOptionsToClear
- optional MultiCardPanel.OPTION_XXX values to clear.public void updateCard(Card card)
MultiCardPanel
updateCard
in interface MultiCardPanel
updateCard
in class MultiCardPanelAdapter
protected Color getTabColor(boolean isSelected)
public Control getTabsPanel()
public Control addCloseTabButton()
public Control addCloseTabButton(Control button, boolean toLeft)
button
- a Control to be used. If this is null then a new
one is created and returned.toLeft
- true to add to the left, false to add to the right.protected void addedNewCard(Card c)
MultiCardPanelAdapter
addedNewCard
in class MultiCardPanelAdapter
c
- the Card that was added.protected void addedNewItem(Control item)
public void updateTabs()
public int modifyCardOptions(int toSet, int toClear)
MultiCardPanel
modifyCardOptions
in interface MultiCardPanel
modifyCardOptions
in class MultiCardPanelAdapter
toSet
- the option bits to set - any of the OPTION_XXX values, but none that are included in options to clear.toClear
- the option bits to clear - any of the OPTION_XXX values, but none that are included in options to set.public void select(Control item)
MultiPanel
select
in interface MultiPanel
select
in class MultiCardPanelAdapter
public void select(String tabName)
MultiPanel
select
in interface MultiPanel
select
in class MultiCardPanelAdapter
public void select(int index)
MultiPanel
select
in interface MultiPanel
select
in class MultiCardPanelAdapter
protected Control getFirstFocus()
getFirstFocus
in class Container
public CellPanel getExtremeControls(boolean isLeft)
isLeft
- If the container goes on the left or right.public CellPanel getExtraControlArea(int whichArea)
MultiCardPanel
getExtraControlArea
in interface MultiCardPanel
getExtraControlArea
in class MultiCardPanelAdapter
whichArea
- one of the EXTRA_CONTROL_XXX values possibly OR'ed with
the EXTRA_CONTROL_EXTREME option.public CellPanel getExtraControls(boolean isLeft)
public void setAutoExpand(SplittablePanel splittablePanel)
splittablePanel
- The SplittablePanel that contains the TabbedPanel.public void make(boolean remake)
Container
protected Menu getMoreTabsMenu()
public void doPaint(Graphics g, Rect r)
Control
public void checkLeftRight()
public void checkLeftRight(boolean dontAutoShift)
public void selectAndExpand(int which)
public void repaintTabs()
public boolean tabsAreDisplayed()
protected void newSelection(Card c)
MultiCardPanelAdapter
newSelection
in class MultiCardPanelAdapter
public void newSelection()
protected void tabClosed(Card closed, int index)
closed
- the Card that was closed.index
- the index of the Card when it was closed.public boolean closeCurrentTab()
public boolean closeTab(Card c)
c
- the Card of the tab to close.protected boolean tabCanClose(Card c, int index)
c
- The Card of the Tab being closed.index
- The index of the Card being closed.public boolean closeTab(int which)
which
- the index of the tab to close.public void onControlEvent(ControlEvent ev)
onControlEvent
in class MultiCardPanelAdapter
public void gotFocus(int how)
public void lostFocus(int how)
Control
public void selectNextTab(boolean forwards, boolean focusOnTab)
forwards
- true to move to the next tab, false to move to the previous one.focusOnTab
- true to move or keep the focus on the tabs.public void onKeyEvent(KeyEvent ev)
onKeyEvent
in class Control
public Control getNextKeyFocus(Control sourceChild, boolean forwards)
Container
getNextKeyFocus
in class Container
sourceChild
- the child control from which the call came from, or null if the call
came from the parent of this control, or this control itself.forwards
- true if the user wants to go to the next control, false if the user wants
to go to the previous one.protected boolean doHotKey(Control from, KeyEvent ev)
Control
protected void calculateSizes()
Control
calculateSizes
in class CellPanel
public static Object[] getExpandingTabbedPanel(boolean above)
above
- set this to true if the mTabbedPanel should be above the CellPanel data, false
if it should be below.