public class GridPanel extends com.google.gwt.user.client.ui.VerticalPanel implements AdvancedWidget, Resizable
It also helps to displayActive an editable grid with pagers and toolbars. Use it to construct the grid and displayActive it.
Modifier and Type | Class and Description |
---|---|
protected class |
GridPanel.WindowResizeHandler
This handler is invoked every time when anything makes the window to be resized.
|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
com.google.gwt.user.client.ui.HasHorizontalAlignment.AutoHorizontalAlignmentConstant, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant
com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant
Constructor and Description |
---|
GridPanel()
Constructs a new GridPanel.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addChildGridPanel(GridPanel child)
This method adds a child grid panel.
|
void |
addGridListener(GridListener listener)
This method adds a new grid listener to be invoked on grid events.
|
void |
addPagerListener(PagerListener pagerListener)
This method adds a new pager listener.
|
void |
addSelectRowListener(SelectRowListener listener)
This method adds a new listener that is invoked on row selection.
|
void |
addToolbarListener(GridToolbarListener gridToolbarListener)
This method adds a toolbar listener to the toolbars.
|
protected void |
adjust()
Makes the widget take as much space as possible inside a parent element and resizes
the nested grid.
|
EditableGrid |
createEditableGrid(String[] headers,
Class[] columnWidgetClasses,
Editable model)
Creates and adds a new editable grid into the panel.
|
EditableGrid |
createEditableGrid(String[] headers,
Class[] columnWidgetClasses,
Editable model,
boolean resizable)
Creates and adds a new editable grid into the panel.
|
void |
display()
This method displays the panel and adds nested widgets.
|
Pager |
getBottomPager()
Getter for property 'bottomPager'.
|
com.google.gwt.user.client.ui.Panel |
getBottomPanel()
Getter for property 'bottomPanel'.
|
GridToolbar |
getBottomToolbar()
Getter for property 'bottomToolbar'.
|
List<GridPanel> |
getChildGridPanels()
This method returns a list of child grid panels.
|
int |
getCurrentRow()
Gets a currently selected row number.
|
protected com.google.gwt.user.client.ui.FocusPanel |
getFocusPanel()
Getter for property 'focusPanel'.
|
EditableGrid |
getGrid()
Getter for property 'grid'.
|
GridEventManager |
getGridEventManager()
Getter for property 'gridEventManager'.
|
protected LockingPanel |
getLockingPanel()
Getter for property 'lockingPanel'.
|
EventMediator |
getMediator()
Getter for property 'mediator'.
|
protected List<PagerListener> |
getPagerListeners()
Getter for property 'pagerListeners'.
|
protected GridPanel |
getParentGridPanel()
Getter for property 'parentGridPanel'.
|
protected com.google.gwt.event.logical.shared.ResizeHandler |
getResizeHandler()
Getter for property 'resizeHandler'.
|
protected List<GridToolbarListener> |
getToolbarListeners()
Getter for property 'toolbarListeners'.
|
Pager |
getTopPager()
Getter for property 'topPager'.
|
com.google.gwt.user.client.ui.Panel |
getTopPanel()
Getter for property 'topPanel'.
|
GridToolbar |
getTopToolbar()
Getter for property 'topToolbar'.
|
boolean |
isArrowsVisible()
Getter for property 'arrowsVisible'.
|
boolean |
isAscending(int column)
Checks whether the column is sorted ascending.
|
boolean |
isBottomPagerVisible()
Getter for property 'bottomPagerVisible'.
|
boolean |
isBottomToolbarVisible()
Getter for property 'bottomToolbarVisible'.
|
boolean |
isResizable()
Gets a flag that is responsible for column resisability.
|
boolean |
isSortable(int column)
Checks whether th column in the grid is sortable.
|
boolean |
isTopPagerVisible()
Getter for property 'topPagerVisible'.
|
boolean |
isTopToolbarVisible()
Getter for property 'topToolbarVisible'.
|
void |
lock()
This method locks the widget and refuses any user activities.
|
protected void |
packBottomPanel()
This method displays a bottom panel and adds a bottom pager and toolbar into it.
|
protected void |
packGrid()
This method adds a grid into the panel.
|
protected void |
packTopPanel()
This method displays a top panel and adds top pager and toolbar into it.
|
protected Pager |
preparePager(Pager pager,
com.google.gwt.user.client.ui.Panel panel)
This method initializes a pager with common values.
|
protected GridToolbar |
prepareToolbar(GridToolbar toolbar,
com.google.gwt.user.client.ui.Panel panel)
This method initializes a toolbar with common values.
|
protected void |
removeChildGridPanel(GridPanel child)
This method removes a child grid panel.
|
void |
removeGridListener(GridListener listener)
This method removes the specified grid listener.
|
void |
removeSelectRowListener(SelectRowListener listener)
This method removes the specified row selection listener.
|
void |
resize()
This method resizes nested components to make them fix as much space as possible.
|
void |
setArrowsVisible(boolean visible)
Setter for property 'arrowsVisible'.
|
void |
setAscending(boolean ascending)
Sets the acsending / descending order of sorting.
|
protected void |
setBottomPager(Pager bottomPager)
Setter for property 'bottomPager'.
|
void |
setBottomPagerVisible(boolean bottomPagerVisible)
Setter for property 'bottomPagerVisible'.
|
protected void |
setBottomPanel(com.google.gwt.user.client.ui.Panel bottomPanel)
Setter for property 'bottomPanel'.
|
protected void |
setBottomToolbar(GridToolbar bottomToolbar)
Setter for property 'bottomToolbar'.
|
void |
setBottomToolbarVisible(boolean bottomToolbarVisible)
Setter for property 'bottomToolbarVisible'.
|
protected void |
setGrid(EditableGrid grid)
Setter for property 'grid'.
|
void |
setGridEventManager(GridEventManager gridEventManager)
Setter for property 'gridEventManager'.
|
void |
setGridFocus(boolean focus)
This method sets focus to the grid.
|
void |
setInvisibleColumn(int column,
boolean invisible)
This method sets the specified column
|
void |
setMultiRowModeEnabled(boolean enabled)
Enables or disables the multi-row selection mode.
|
void |
setPageNumberBoxDisplayed(boolean value)
Sets the page number boxes visible.
|
void |
setParent(GridPanel panel)
Setter for property 'parent'.
|
void |
setReadonlyColumn(int column,
boolean readonly)
Makes the specified column to be readonly.
|
void |
setResizable(boolean resizable)
Sets a flag value that means whether the grid columns will be resizable.
|
void |
setSortableColumn(int column,
boolean sortable)
Makes the specified column to be sortable.
|
void |
setSortColumn(int column)
Sets the sort column.
|
protected void |
setTopPager(Pager topPager)
Setter for property 'topPager'.
|
void |
setTopPagerVisible(boolean topPagerVisible)
Setter for property 'topPagerVisible'.
|
protected void |
setTopPanel(com.google.gwt.user.client.ui.Panel topPanel)
Setter for property 'topPanel'.
|
protected void |
setTopToolbar(GridToolbar topToolbar)
Setter for property 'topToolbar'.
|
void |
setTopToolbarVisible(boolean topToolbarVisible)
Setter for property 'topToolbarVisible'.
|
void |
setTotalCountDisplayed(boolean value)
Sets the page count label visible.
|
void |
unlock()
This method unlocks the widget and repaints it.
|
void |
unlock(TreeGridRow parent)
This method unlocks the subtree and repaints it.
|
add, getHorizontalAlignment, getVerticalAlignment, insert, insert, onEnsureDebugId, remove, setHorizontalAlignment, setVerticalAlignment
getBody, getSpacing, getTable, setBorderWidth, setCellHeight, setCellHeight, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellWidth, setCellWidth, setSpacing
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public EditableGrid createEditableGrid(String[] headers, Class[] columnWidgetClasses, Editable model)
Use this method before display()
.
headers
- is a list of heder labels.columnWidgetClasses
- is a list of column widget classes.model
- is a data model to be applied in the grid.public EditableGrid createEditableGrid(String[] headers, Class[] columnWidgetClasses, Editable model, boolean resizable)
Use this method before display()
. It automatically detects a type of the new grid by the type of
the model.
headers
- is a list of heder labels.columnWidgetClasses
- is a list of column widget classes.model
- is a data model to be applied in the grid.resizable
- is a columns resizability flag value.public void setReadonlyColumn(int column, boolean readonly)
Use this method before display()
.
column
- is a column number.readonly
- is a readonly attribute value.public void setSortableColumn(int column, boolean sortable)
Use this method before display()
.
column
- is a column number.sortable
- is a sortable attribute value.public void setInvisibleColumn(int column, boolean invisible)
column
- is a column number.invisible
- is a flag to switch the column to invisible state.public void setArrowsVisible(boolean visible)
visible
- Value to set for property 'arrowsVisible'.public void setPageNumberBoxDisplayed(boolean value)
value
- is a flag value.public void setTotalCountDisplayed(boolean value)
value
- is a value to be set.public void display()
display
in interface AdvancedWidget
public void lock()
public void unlock()
public void unlock(TreeGridRow parent)
TreeDataModelCallbackHandler.synchronize(
org.gwt.advanced.client.datamodel.LazyTreeGridRow, Composite
)
method has been invoked. Otherwise use the unlock()
method instead.parent
- is a parent row of the subtree.public EventMediator getMediator()
public boolean isTopPagerVisible()
public void setTopPagerVisible(boolean topPagerVisible)
topPagerVisible
- Value to set for property 'topPagerVisible'.public boolean isBottomPagerVisible()
public void setBottomPagerVisible(boolean bottomPagerVisible)
bottomPagerVisible
- Value to set for property 'bottomPagerVisible'.public boolean isTopToolbarVisible()
public void setTopToolbarVisible(boolean topToolbarVisible)
topToolbarVisible
- Value to set for property 'topToolbarVisible'.public boolean isBottomToolbarVisible()
public void setBottomToolbarVisible(boolean bottomToolbarVisible)
bottomToolbarVisible
- Value to set for property 'bottomToolbarVisible'.public boolean isArrowsVisible()
public EditableGrid getGrid()
public Pager getTopPager()
public GridToolbar getTopToolbar()
public Pager getBottomPager()
public GridToolbar getBottomToolbar()
public com.google.gwt.user.client.ui.Panel getTopPanel()
public com.google.gwt.user.client.ui.Panel getBottomPanel()
public void setParent(GridPanel panel)
panel
- Value to set for property 'parent'.public boolean isSortable(int column)
column
- is a column to check.public boolean isAscending(int column)
column
- is a column number.public void setAscending(boolean ascending)
ascending
- is an order of sorting. true
means ascending.public void setSortColumn(int column)
column
- is a column number.public int getCurrentRow()
public boolean isResizable()
true
means that columns of the grid must be resizable.public void setResizable(boolean resizable)
resizable
- is a flag value.public GridEventManager getGridEventManager()
public void setGridEventManager(GridEventManager gridEventManager)
gridEventManager
- Value to set for property 'gridEventManager'.public void resize()
public void addSelectRowListener(SelectRowListener listener)
listener
- is a listener to be invoked.public void removeSelectRowListener(SelectRowListener listener)
listener
- is a listener to remove.public void setMultiRowModeEnabled(boolean enabled)
enabled
- true
means that this grid will allow multiple row selection.public void addGridListener(GridListener listener)
listener
- is a listener to add.public void removeGridListener(GridListener listener)
listener
- is a listener to remove.protected void adjust()
protected com.google.gwt.event.logical.shared.ResizeHandler getResizeHandler()
protected void packTopPanel()
protected void packGrid()
protected void packBottomPanel()
protected GridToolbar prepareToolbar(GridToolbar toolbar, com.google.gwt.user.client.ui.Panel panel)
toolbar
- is a toolbar to be initialized.panel
- is a top or bottom panel.protected Pager preparePager(Pager pager, com.google.gwt.user.client.ui.Panel panel)
pager
- is a pager to be initialized.panel
- is a top or bottom panel.protected void setBottomPanel(com.google.gwt.user.client.ui.Panel bottomPanel)
bottomPanel
- Value to set for property 'bottomPanel'.protected void setTopPanel(com.google.gwt.user.client.ui.Panel topPanel)
topPanel
- Value to set for property 'topPanel'.protected void setTopPager(Pager topPager)
topPager
- Value to set for property 'topPager'.protected void setGrid(EditableGrid grid)
grid
- Value to set for property 'grid'.protected void setTopToolbar(GridToolbar topToolbar)
topToolbar
- Value to set for property 'topToolbar'.protected void setBottomPager(Pager bottomPager)
bottomPager
- Value to set for property 'bottomPager'.protected void setBottomToolbar(GridToolbar bottomToolbar)
bottomToolbar
- Value to set for property 'bottomToolbar'.protected List<GridToolbarListener> getToolbarListeners()
protected List<PagerListener> getPagerListeners()
public void addToolbarListener(GridToolbarListener gridToolbarListener)
gridToolbarListener
- is a toolbar listener.public void addPagerListener(PagerListener pagerListener)
pagerListener
- is a pager listener.public void setGridFocus(boolean focus)
focus
- is a focus flag value.protected LockingPanel getLockingPanel()
protected GridPanel getParentGridPanel()
public List<GridPanel> getChildGridPanels()
protected com.google.gwt.user.client.ui.FocusPanel getFocusPanel()
protected void addChildGridPanel(GridPanel child)
child
- is a child panel.protected void removeChildGridPanel(GridPanel child)
child
- a child grid panel.Copyright © 2008–2013. All rights reserved.