Package net.minheur.potoflux.screen.tabs
Class BaseTab
java.lang.Object
net.minheur.potoflux.screen.tabs.BaseTab
- Direct Known Subclasses:
AccountTab,HomeTab,SettingsTab,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 voidprotected booleandoPreset()Handles if the preset should be executed.
True by default.getPanel()Getter for thePANEL.protected StringgetTitle()Used to set the title.protected booleanDeprecated.protected voidpreset()The preset, that is by default enabled.
It sets the layout and add the title.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 actualJPanel, 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
-
preset
protected void preset()The preset, that is by default enabled.
It sets the layout and add the title. -
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.
-
getPanel
Getter for thePANEL.- Returns:
- the
PANEL
-
doPreset
protected boolean doPreset()Handles if the preset should be executed.
True by default.- Returns:
- if the preset should be executed
-
invokeLater
Deprecated.Handles if the creation should be added to the swing EDT, otherwise it will be executed on the tab creation.- Returns:
- if the app should be
SwingUtilities.invokeLater(Runnable).
-
createTitle
protected void createTitle()
-