Class McbsEditor
java.lang.Object
com.thecsdev.betterstats.api.mcbs.controller.McbsEditor
This
Class functions as the central controller in the MVC architecture,
overseeing the complete editor interface. It coordinates and manages all
McbsEditorTab instances contained within the editor, effectively
representing the entire graphical user interface (GUI).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final McbsEditorMainMcbsEditorinstance used byBetterStatsScreen. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidIncrementing thegetEditCount()value.final booleanaddTab(@NotNull McbsEditorTab tab, boolean setAsCurrent) Attempts to add the specifiedMcbsEditorTabwithin this editor.final booleanfinal @NotNull McbsEditorTabReturns the currentMcbsEditorTabbeing edited by thisMcbsEditor.final longReturns the total number of edits made viaMcbsEditor.final Collection<McbsEditorTab> Returns an unmodifiableCollectioncontaining all theMcbsEditorTabinstances that are currently open within this editor.final inthashCode()final booleanremoveTab(@NotNull McbsEditorTab tab) Attempts to remove the specifiedMcbsEditorTabfrom this editor.final voidsetCurrentTab(@Nullable McbsEditorTab tab) Sets the currentMcbsEditorTabbeing edited by thisMcbsEditor.
-
Field Details
-
INSTANCE
MainMcbsEditorinstance used byBetterStatsScreen.
-
-
Constructor Details
-
McbsEditor
public McbsEditor()
-
-
Method Details
-
hashCode
-
equals
-
getEditCount
public final long getEditCount()Returns the total number of edits made viaMcbsEditor. This value increments each time a change occurs within this editor, such as adding/removing tabs or modifying tab content.This can be used to track changes and determine if this editor's state has been modified since it was last checked.
-
addEditCount
public final void addEditCount()Incrementing thegetEditCount()value.This method is automatically invoked whenever a modification occurs within this editor. It is generally not necessary to call this method manually unless you have made a direct change that was not performed through this
McbsEditorinterface.- See Also:
-
getTabsReadOnly
Returns an unmodifiableCollectioncontaining all theMcbsEditorTabinstances that are currently open within this editor.To add or remove
McbsEditorTabs, please refer to "See Also".- See Also:
-
addTab
public final boolean addTab(@NotNull @NotNull McbsEditorTab tab, boolean setAsCurrent) throws NullPointerException Attempts to add the specifiedMcbsEditorTabwithin this editor.- Parameters:
tab- TheMcbsEditorTabto be opened.setAsCurrent- Iftrue, the newly added tab will be set as the current tab.- Returns:
trueif the tab was successfully opened;falseif the tab could not be added.- Throws:
NullPointerException- If the argument isnull.
-
removeTab
Attempts to remove the specifiedMcbsEditorTabfrom this editor.- Parameters:
tab- TheMcbsEditorTabto be removed.- Returns:
trueif the tab was successfully removed;falseif the tab could not be removed.- Throws:
NullPointerException- If the argument isnull.
-
getCurrentTab
Returns the currentMcbsEditorTabbeing edited by thisMcbsEditor. -
setCurrentTab
Sets the currentMcbsEditorTabbeing edited by thisMcbsEditor.- Parameters:
tab- TheMcbsEditorTabto set as the current tab. Must be contained bygetTabsReadOnly().
-