Class PaginatorGUIPane
java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.pane.GUIPane
de.placeblock.betterinventories.content.pane.impl.BaseHorizontalSplitGUIPane
de.placeblock.betterinventories.content.pane.impl.paginator.PaginatorGUIPane
- All Implemented Interfaces:
ItemAddable<PaginatorGUIPane>,Sizeable
public class PaginatorGUIPane
extends BaseHorizontalSplitGUIPane
implements ItemAddable<PaginatorGUIPane>
A Paginator is a
GUIPane that can contain items. If there are too many items you can switch pages to see all items.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class de.placeblock.betterinventories.content.GUISection
maxSize, minSize -
Constructor Summary
ConstructorsConstructorDescriptionPaginatorGUIPane(GUI gui, Vector2d minSize, Vector2d maxSize, boolean repeat, int startPage, PaginatorControlsPosition defaultControlsPosition, List<GUIItem> items) Deprecated, for removal: This API element is subject to removal in a future version.PaginatorGUIPane(GUI gui, Vector2d minSize, Vector2d maxSize, boolean repeat, int startPage, Function<PaginatorGUIPane, PaginatorControlsPane> defaultControls, List<GUIItem> items) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionClears all Items in this PaginatorintgetPages()nextPage()Skips to the next page.voidIs called whenever Items are added to the Paginator.Returns to the previous page.setCurrentPage(int index) Sets the current page<I extends GUIItem>
PaginatorGUIPaneSets all Items in the Paginator.voidupdateSize(Sizeable parent) Updates the size of the Paginator based on how many Items are added.voidupdateSizeRecursive(Sizeable parent) Is called to recursively update the size of allGUIPanesMethods inherited from class de.placeblock.betterinventories.content.pane.impl.BaseHorizontalSplitGUIPane
getChildren, getLowerPanePos, onItemProvide, render, searchMethods inherited from class de.placeblock.betterinventories.content.pane.GUIPane
onItemAdd, onItemAmount, onItemClick, onItemRemove, onSizeChange, provideItem, renderOnList, setHeight, setSize, setWidth, updateChildrenRecursiveMethods inherited from class de.placeblock.betterinventories.content.GUISection
getEmptyContentList, getHeight, getSlots, getWidth, slotToVector, vectorToSlotMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.placeblock.betterinventories.content.pane.impl.paginator.ItemAddable
addItem, addItems, addItems, addItems, addItems, getItemsMethods inherited from interface de.placeblock.betterinventories.Sizeable
clampSize, getMaxSize, getMinSize, getSize
-
Constructor Details
-
PaginatorGUIPane
@Deprecated public PaginatorGUIPane(GUI gui, Vector2d minSize, Vector2d maxSize, boolean repeat, int startPage, Function<PaginatorGUIPane, PaginatorControlsPane> defaultControls, List<GUIItem> items) Deprecated.Creates a new PaginatorGUIPane- Parameters:
gui- The GUIminSize- The minimum size of the PanemaxSize- The minimum size of the Panerepeat- Whether to jump back to the first page when reaching the last page (and via versa)startPage- The start pagedefaultControls- The default controls automatically appear if there is not enough space for all items. Set to null if you don't want automatic controls, or you want to handle them yourself.items- The items to place in this paginator by default
-
PaginatorGUIPane
@Deprecated(forRemoval=true) public PaginatorGUIPane(GUI gui, Vector2d minSize, Vector2d maxSize, boolean repeat, int startPage, PaginatorControlsPosition defaultControlsPosition, List<GUIItem> items) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new PaginatorGUIPane- Parameters:
gui- The GUIminSize- The minimum size of the PanemaxSize- The minimum size of the Panerepeat- Whether to jump back to the first page when reaching the last page (and via versa)startPage- The start pagedefaultControlsPosition- The default controls automatically appear if there is not enough space for all items. Set to null if you don't want automatic controls, or you want to handle them yourself. To add custom controls you can instantiate thePaginatorControlsPaneitems- The items to place in this paginator by default
-
-
Method Details
-
updateSize
Updates the size of the Paginator based on how many Items are added.- Overrides:
updateSizein classBaseHorizontalSplitGUIPane- Parameters:
parent- The parent Pane or GUI (Sizeable)
-
updateSizeRecursive
Is called to recursively update the size of allGUIPanes- Overrides:
updateSizeRecursivein classBaseHorizontalSplitGUIPane- Parameters:
parent- The parent Pane or GUI (Sizeable)
-
setItems
Sets all Items in the Paginator.- Type Parameters:
I- The type of the items- Parameters:
items- The new Items- Returns:
- this
-
onItemAdd
public void onItemAdd()Is called whenever Items are added to the Paginator. Resets Items in the content-pane- Specified by:
onItemAddin interfaceItemAddable<PaginatorGUIPane>
-
clearItems
Clears all Items in this Paginator- Returns:
- this
-
nextPage
Skips to the next page.- Returns:
- this
-
previousPage
Returns to the previous page.- Returns:
- this
-
setCurrentPage
Sets the current page- Parameters:
index- The current page- Returns:
- this
-
getPages
public int getPages()- Returns:
- the amount of pages
-
getContentPaneSize
- Returns:
- The size of the content-pane according to the size of the Paginator
-