public class SeparatingMenuPiece extends MenuPiece
| Constructor and Description |
|---|
SeparatingMenuPiece()
Creates a new piece
|
SeparatingMenuPiece(boolean topSeparator,
boolean emptySeparator,
boolean bottomSeparator)
Creates a new piece
|
SeparatingMenuPiece(MenuPiece piece)
Creates a new piece
|
SeparatingMenuPiece(MenuPiece piece,
boolean topSeparator,
boolean emptySeparator,
boolean bottomSeparator)
Creates a new piece
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind()
This method is called if there is a possibility for the user to see this menu.
|
void |
fill(List<Component> items)
Inserts all items of this piece into
items. |
int |
getItemCount()
|
MenuPiece |
getPiece()
Gets the piece which is embraced by separators.
|
protected int |
getSeparatorCount()
Gets the number of separators which were added by this piece.
|
boolean |
isBottomSeparator()
Tells whether there is a separator below this piece.
|
boolean |
isEmptySeparator()
Tells whether there should be a single separator shown when this
piece is empty.
|
boolean |
isTopSeparator()
Tells whether there is a separator shown above the content of this
piece.
|
void |
setBottomSeparator(boolean bottomSeparator)
Sets whether there should be a separator added to the menu after
the contents described in this piece.
|
void |
setEmptySeparator(boolean emptySeparator)
Sets whether there should be a separator shown when this piece
is empty.
|
void |
setPiece(MenuPiece piece)
Sets the piece which will be embraced by separators.
|
void |
setTopSeparator(boolean topSeparator)
Sets whether there should be a separator shown above the content of
this piece.
|
void |
unbind()
This method is called if the user has no longer any possibility to see this menu.
|
addListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParentpublic SeparatingMenuPiece()
public SeparatingMenuPiece(boolean topSeparator,
boolean emptySeparator,
boolean bottomSeparator)
topSeparator - whether to show a separator at the topemptySeparator - whether to show a separator if piece is emptybottomSeparator - whether to show a separator at the bottompublic SeparatingMenuPiece(MenuPiece piece)
piece - the piece which might be covered by separatorspublic SeparatingMenuPiece(MenuPiece piece, boolean topSeparator, boolean emptySeparator, boolean bottomSeparator)
piece - the piece which might be covered by separatorstopSeparator - whether to show a separator at the topemptySeparator - whether to show a separator if piece is emptybottomSeparator - whether to show a separator at the bottompublic MenuPiece getPiece()
public void bind()
MenuPiecebind in class MenuPieceMenuPiece.unbind()public void unbind()
MenuPieceunbind in class MenuPieceMenuPiece.bind()public void setPiece(MenuPiece piece)
piece - the child of this piecepublic int getItemCount()
MenuPiecegetItemCount in class MenuPiecepublic void fill(List<Component> items)
MenuPieceitems.protected int getSeparatorCount()
public boolean isBottomSeparator()
true if there is a separatorsetBottomSeparator(boolean)public void setBottomSeparator(boolean bottomSeparator)
bottomSeparator - true if there should be a separatorpublic boolean isEmptySeparator()
true if there is a separatorpublic void setEmptySeparator(boolean emptySeparator)
emptySeparator - true if a separator should be
made visiblepublic boolean isTopSeparator()
true if there is a separatorpublic void setTopSeparator(boolean topSeparator)
topSeparator - true if the separator should be shownCopyright © 2018. All rights reserved.