Package net.minheur.potoflux.screen.tabs
Class BaseTab<T extends javafx.scene.Parent>
java.lang.Object
net.minheur.potoflux.screen.tabs.BaseTab<T>
- Type Parameters:
T- type ofPaneadded to the tab
- Direct Known Subclasses:
BaseHTab,BaseVTab,TerminalTab
The base tab, overridden to create your own tabs.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseTab()Constructor for the tab.
It will do the preset if enabled, and execute (or invokeLater) thesetPanel()method, to add data to thePANEL. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoPreset()Handles if the preset should be executed.
True by default.javafx.scene.control.Tabprotected @Nullable javafx.scene.NodegetIcon()Sets the graphic displayed in the tab listabstract StringgetName()The name of the tab in the list displayedprotected StringgetTitle()Used to set the title.protected abstract voidYou need to instantiatePANEL.protected javafx.scene.control.LabelmkTitle()Creates the title, from the text given viagetTitle().protected abstract voidsetPanel()This is the actual method to set the panel.
The overriding class will have to use this to add content to thePANEL.
-
Field Details
-
PANEL
The actualPane, that will be added to the tabbed pane.
-
-
Constructor Details
-
BaseTab
public BaseTab()Constructor for the tab.
It will do the preset if enabled, and execute (or invokeLater) thesetPanel()method, to add data to thePANEL.
-
-
Method Details
-
getBuiltTab
public javafx.scene.control.Tab getBuiltTab() -
instantiate
protected abstract void instantiate()You need to instantiatePANEL. -
setPanel
protected abstract void setPanel()This is the actual method to set the panel.
The overriding class will have to use this to add content to thePANEL. -
getTitle
Used to set the title.- Returns:
- the title of the tab.
-
getName
The name of the tab in the list displayed- Returns:
- the tab's name
-
getIcon
@Nullable protected @Nullable javafx.scene.Node getIcon()Sets the graphic displayed in the tab list- Returns:
- the tab's icon
-
doPreset
protected boolean doPreset()Handles if the preset should be executed.
True by default.- Returns:
- if the preset should be executed
-
mkTitle
protected javafx.scene.control.Label mkTitle()Creates the title, from the text given viagetTitle().
-