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
GralWidgetBase.GralWidgComposite, GralWidgetBase.TimeOrderCreateImplWidget
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 java.lang.String |
version
Version, history and copyright/copyleft.
|
_wdgImpl, bEditable, bShouldInitialize, cfg, contextMenu, dateUser, dyda, htmlHelp, redrawDelayMax, redrawtDelay, sCmd, sFormat, sToolTip, sVersion, whatIs, XXXbuildMng
_cdata, _wdgPos, bVisibleState, gralMng, name, pixSize
Constructor and Description |
---|
GralHorizontalSelector(GralPos currPos,
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,
boolean removable)
Adds a item to show.
|
GralHorizontalSelector.Item<UserData> |
getActItem()
Quest the current selected tab independent of its visibility.
|
UserData |
getCurrItem()
Quest the current selected tab independent of its visibility.
|
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()
This is called on changing the tab, the #ixActItem is the current (last) tab.
|
protected void |
setDstToActItem(GralHorizontalSelector.Item<UserData> lastItem)
Sets the #ixActItem to the #ixDstItem, the new current item.
|
clearShowParam, createImplWidget_Gthread, getActionChange, getActionChangeStrict, getActionDrag, getActionDrop, getActionFocused, getActionShow, getBackColor, getCfgElement, getCmd, getCmd, getContentIdent, getContentInfo, getContextMenu, getData, getDataIx, getDataPath, getDataPath, getFloatValue, getFocusedWidget, getFormat, getGralWidget, getHtmlHelp, getImplAccess, getImplWidget, getItsPanel, getLongValue, getName, getShowMethod, getShowParam, getsToolTip, getText, getValue, getVariable, getVariableFromContentInfo, isChanged, isEditable, isGraphicDisposed, isInFocus, isNotEditableOrShouldInitialize, isVisible, redraw, redraw, redraw, redraw1, redrawOnlyDynamics, refreshFromVariable, refreshFromVariable, removeImplWidget_Gthread, requestNewValueForVariable, setActionChange, setActionFocused, setActionMouse, setActionShow, setBackColor, setBackgroundColor, setBoundsPixel, setCfgElement, setCmd, setContentIdent, setContentInfo, setData, setDataIx, setDataPath, setDragEnable, setDropEnable, setEditable, setFocus, setFocus, setFocusedWidget, setForegroundColor, setFormat, setHtmlHelp, setLineColor, setLongValue, setMinMax, setPrimaryWidgetOfPanel, setText, setTextColor, setToolTip, setToPanel, setValue, setValue, setValue, setValue, setVariable, setVisible, specifyActionChange, specifyContextMenu, toString, toString, XXXgetWidgetImplementation, XXXremoveWidgetImplementation, XXXrepaintGthread, XXXsetFocusGThread
checkImplWidgetCreation, createImplWidget, gralMng, hasFocus, pos, remove, resizePostPreparation, setFocused
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
gralMng, pos, setFocused
public static final java.lang.String version
GralPanelContent
.
GralFileSelector
.
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 colorText
public GralColor colorSelect
public GralColor colorBack
public GralColor colorLine
GralUserAction actionRemoveTab
public GralHorizontalSelector(GralPos currPos, java.lang.String name, GralUserAction actionOnSelect)
name
- gralMng
- public void addItem(java.lang.String text, int position, UserData data, boolean removable)
text
- The text of the tab.position
- insert position, -1: on enddata
- The data of type removable
- only if true this item is removable.public GralHorizontalSelector.Item<UserData> getActItem()
#addItem(String, int, Object)
for the current selected item or null.public UserData getCurrItem()
#addItem(String, int, Object)
for the current selected item or null.public boolean setActItem(java.lang.String name)
public void removeItem(java.lang.String text)
text
- protected void setDstToActItem(GralHorizontalSelector.Item<UserData> lastItem)
lastItem
- the last selected.protected void setDstToActItem()
protected void removeTab()