public class GralHorizontalSelector<UserData> extends GralWidget
GralWidget.setActionChange(GralUserAction)
is called with the associated
UserData of the tab is third parameter of GralUserAction.exec(int, GralWidget_ifc, Object...)
with KeyCode.activated
.
That can focus, show or select some widgets, panels etc. With them a tab-panel is able to build,
but in a more possibilities than usual implementations of such tab-panels.
GralUserAction.exec(int, GralWidget_ifc, Object...)
will be called a last time for the barely known UserData the last time with KeyCode.removed
.
If the current selected tab will be removed, the tab left of them or the next if it was the first
will be activated with calling of GralUserAction.exec(int, GralWidget_ifc, Object...)
for the yet current selected tab if there is any one yet.
Modifier and Type | Class and Description |
---|---|
static class |
GralHorizontalSelector.GraphicImplAccess<UserData>
This class is not intent to use from an application, it is the super class for the implementation layer
to access all necessary data and methods with protected access rights.
|
static class |
GralHorizontalSelector.Item<UserData> |
GralWidget.ActionChangeSelect, GralWidget.ConfigData, GralWidget.DynamicData, GralWidget.ImplAccess
GralWidget_ifc.ActionChange, GralWidget_ifc.ActionChangeWhen
Modifier and Type | Field and Description |
---|---|
(package private) GralUserAction |
actionRemoveTab |
protected GralHorizontalSelector.Item<UserData> |
actItem |
GralColor |
colorBack |
GralColor |
colorLine |
GralColor |
colorSelect |
GralColor |
colorText |
protected java.util.List<GralHorizontalSelector.Item<UserData>> |
items |
protected int |
ixActItem
The item (index in
items which is the current or actual used one. |
protected int |
ixDstItem
The item which is selected while the mouse button is pressed and hold, not released yet.
|
protected int |
ixLeftItem
The item which is shown as left in the graphic.
|
protected int |
minSize |
static int |
version
Version, history and copyright/copyleft.
|
_wdgImpl, bEditable, bHasFocus, bShouldInitialize, buildMng, bVisibleState, cfg, contextMenu, dateUser, dyda, htmlHelp, itsMng, name, repaintDelay, repaintDelayMax, sCmd, sFormat, sToolTip, sVersion, whatIs
Constructor and Description |
---|
GralHorizontalSelector(java.lang.String name,
GralUserAction actionOnSelect)
The constructor creates the instance but does nothing with the graphic appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(java.lang.String text,
int position,
UserData data)
Adds a item to show.
|
void |
removeItem(java.lang.String text)
Remove a item.
|
protected void |
removeTab()
Called on mouse action in context menu.
|
boolean |
setActItem(java.lang.String name) |
protected void |
setDstToActItem() |
chgPos, clearShowParam, createImplWidget_Gthread, getActionChange, getActionChangeStrict, getActionDrag, getActionDrop, getActionFocused, getActionShow, getBackColor, getCfgElement, getCmd, getCmd, getContentIdent, getContentInfo, getContextMenu, getData, getDataIx, getDataPath, getDataPath, getFloatValue, getFormat, getGralWidget, getHtmlHelp, getImpl, getItsPanel, getLongValue, getName, getShowMethod, getShowParam, getsToolTip, getText, getValue, getVariable, getVariableFromContentInfo, gralMng, isChanged, isEditable, isGraphicDisposed, isInFocus, isNotEditableOrShouldInitialize, isVisible, pos, refreshFromVariable, refreshFromVariable, remove, repaint, repaint, requestNewValueForVariable, setActionChange, setActionFocused, setActionMouse, setActionShow, setBackColor, setBackgroundColor, setBoundsPixel, setCfgElement, setCmd, setContentIdent, setContentInfo, setData, setDataIx, setDataPath, setDragEnable, setDropEnable, setEditable, setFocus, setFocus, setForegroundColor, setFormat, setHtmlHelp, setLineColor, setLongValue, setMinMax, setPanelMng, setPrimaryWidgetOfPanel, setText, setTextColor, setToolTip, setToPanel, setValue, setValue, setValue, setValue, setVisible, setVisibleState, setVisibleStateWidget, specifyActionChange, specifyContextMenu, toString, XXXgetPixelPositionSize, XXXgetWidgetImplementation, XXXremoveWidgetImplementation, XXXrepaintGthread, XXXsetFocusGThread, XXXsetVisibleGThread
public static final int version
protected java.util.List<GralHorizontalSelector.Item<UserData>> items
protected GralHorizontalSelector.Item<UserData> actItem
protected int ixActItem
items
which is the current or actual used one.protected int ixDstItem
protected int ixLeftItem
protected int minSize
public GralColor colorSelect
GralUserAction actionRemoveTab
public GralHorizontalSelector(java.lang.String name, GralUserAction actionOnSelect)
name
- mng
- public void addItem(java.lang.String text, int position, UserData data)
text
- position
- data
- public boolean setActItem(java.lang.String name)
public void removeItem(java.lang.String text)
text
- protected void setDstToActItem()
protected void removeTab()