org.cruxframework.crux.widgets.client.deviceadaptivegrid
Class DeviceAdaptiveGrid

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.cruxframework.crux.widgets.client.deviceadaptivegrid.DeviceAdaptiveGrid
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, HasDataSource<PagedDataSource<?>>, Pageable

public class DeviceAdaptiveGrid
extends com.google.gwt.user.client.ui.Composite
implements Pageable, HasDataSource<PagedDataSource<?>>

Author:
wesley.diniz

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DeviceAdaptiveGrid()
           
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addBeforeCancelRowEditionHandler(BeforeCancelRowEditionHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addBeforeRowEditHandler(BeforeRowEditHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addBeforeSaveRowEditionHandler(BeforeSaveRowEditionHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addBeforeShowRowDetailsHandler(BeforeShowRowDetailsHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addCancelRowEditionHandler(CancelRowEditionHandler handler)
           
 void addColumnEditorValidator(String key, ColumnEditorValidator columnEditorValidator)
          Add a validator to a editable column
 com.google.gwt.event.shared.HandlerRegistration addLoadRowDetailsHandler(LoadRowDetailsHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addRowClickHandler(RowClickHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addRowDoubleClickHandler(RowDoubleClickHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addRowEditHandler(RowEditHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addRowRenderHandler(RowRenderHandler handler)
           
 void addScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler)
           
 com.google.gwt.event.shared.HandlerRegistration addShowRowDetailsHandler(ShowRowDetailsHandler handler)
           
 void clear()
           
 com.google.gwt.user.client.ui.Widget getActionWidget(String key)
          Retrieve the widget associated to the grid component
 List<DataRow> getCurrentPageRows()
           
 int getCurrentPageSize()
           
 PagedDataSource<?> getDataSource()
           
 String getDetailDialogTitle()
           
 ColumnDefinitions getGridColumnDefinitionsByDevice()
           
 String getHeight()
           
 int getPageCount()
          Return the total number of pages
 DataRow getRow(com.google.gwt.user.client.ui.Widget w)
           
 List<DataRow> getSelectedRows()
           
 void goToPage(int page)
          Moves the pageable's cursor to an arbitrary page
 void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType)
          Initialize grid component
 void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows)
          Initialize grid component
 void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons)
           
 void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons, boolean freezeHeaders)
           
 void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons, boolean freezeHeaders, String detailDialogTitle)
           
 boolean isDataLoaded()
          Checks if pageable data is already available
 void loadData()
           
 void nextPage()
          Moves the pageable's cursor to the next page
 void previousPage()
          Moves the pageable's cursor to the previous page
 void refresh()
           
 void setDataSource(PagedDataSource<?> dataSource)
           
 void setDataSource(PagedDataSource<?> dataSource, boolean autoLoadData)
           
 void setDetailDialogTitle(String detailDialogTitle)
           
 void setHeight(String height)
           
 void setPager(Pager pager)
          Sets the pager for call back
 void setWidth(String width)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeviceAdaptiveGrid

public DeviceAdaptiveGrid()
Method Detail

getDetailDialogTitle

public String getDetailDialogTitle()

setDetailDialogTitle

public void setDetailDialogTitle(String detailDialogTitle)

getHeight

public String getHeight()

setDataSource

public void setDataSource(PagedDataSource<?> dataSource)
Parameters:
dataSource - The datasource used to fill the grid

setDataSource

public void setDataSource(PagedDataSource<?> dataSource,
                          boolean autoLoadData)
Specified by:
setDataSource in interface HasDataSource<PagedDataSource<?>>

addColumnEditorValidator

public void addColumnEditorValidator(String key,
                                     ColumnEditorValidator columnEditorValidator)
Add a validator to a editable column

Parameters:
key -
columnEditorValidator -

loadData

public void loadData()
See Also:
Grid.loadData()

clear

public void clear()
See Also:
AbstractGrid.clear()

getGridColumnDefinitionsByDevice

public ColumnDefinitions getGridColumnDefinitionsByDevice()
Returns:

addScrollHandler

public void addScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler)

addRowClickHandler

public com.google.gwt.event.shared.HandlerRegistration addRowClickHandler(RowClickHandler handler)
See Also:
HasRowClickHandlers.addRowClickHandler(org.cruxframework.crux.widgets.client.event.row.RowClickHandler)

addRowDoubleClickHandler

public com.google.gwt.event.shared.HandlerRegistration addRowDoubleClickHandler(RowDoubleClickHandler handler)
See Also:
HasRowDoubleClickHandlers.addRowDoubleClickHandler(org.cruxframework.crux.widgets.client.event.row.RowDoubleClickHandler)

addRowRenderHandler

public com.google.gwt.event.shared.HandlerRegistration addRowRenderHandler(RowRenderHandler handler)
See Also:
HasRowRenderHandlers.addRowRenderHandler(org.cruxframework.crux.widgets.client.event.row.RowRenderHandler)

addBeforeShowRowDetailsHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeShowRowDetailsHandler(BeforeShowRowDetailsHandler handler)
See Also:
br.com.sysmap.crux.widgets.client.event.row.HasBeforeShowDetailsHandlers#addBeforeShowRowDetailsHandler(br.com.sysmap.crux.widgets.client.event.row.BeforeShowDetailsHandler)

addShowRowDetailsHandler

public com.google.gwt.event.shared.HandlerRegistration addShowRowDetailsHandler(ShowRowDetailsHandler handler)
See Also:
br.com.sysmap.crux.widgets.client.event.row.HasShowRowDetailsHandlers#addShowRowDetailsHandler(br.com.sysmap.crux.widgets.client.event.row.ShowRowDetailsHandler)

addBeforeRowEditHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeRowEditHandler(BeforeRowEditHandler handler)
See Also:
HasBeforeRowEditHandlers.addBeforeRowEditHandler(org.cruxframework.crux.widgets.client.event.row.BeforeRowEditHandler)

addCancelRowEditionHandler

public com.google.gwt.event.shared.HandlerRegistration addCancelRowEditionHandler(CancelRowEditionHandler handler)
See Also:
HasCancelRowEditionHandler.addCancelRowEditionHandler(org.cruxframework.crux.widgets.client.event.row.CancelRowEditionHandler)

addBeforeCancelRowEditionHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeCancelRowEditionHandler(BeforeCancelRowEditionHandler handler)
See Also:
HasBeforeCancelRowEditionHandler.addBeforeCancelRowEditionHandler(org.cruxframework.crux.widgets.client.event.row.BeforeCancelRowEditionHandler)

addRowEditHandler

public com.google.gwt.event.shared.HandlerRegistration addRowEditHandler(RowEditHandler handler)
See Also:
HasRowEditHandlers.addRowEditHandler(org.cruxframework.crux.widgets.client.event.row.RowEditHandler)

addLoadRowDetailsHandler

public com.google.gwt.event.shared.HandlerRegistration addLoadRowDetailsHandler(LoadRowDetailsHandler handler)
See Also:
br.com.sysmap.crux.widgets.client.event.row.HasLoadRowDetailsHandlers#addLoadRowDetailsHandler(br.com.sysmap.crux.widgets.client.event.row.LoadRowDetailsHandler)

addBeforeSaveRowEditionHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeSaveRowEditionHandler(BeforeSaveRowEditionHandler handler)
See Also:
HasBeforeSaveRowEditionHandler.addBeforeSaveRowEditionHandler(org.cruxframework.crux.widgets.client.event.row.BeforeSaveRowEditionHandler)

getCurrentPageSize

public int getCurrentPageSize()
Returns:
page number
See Also:
Grid.getCurrentPageSize()

getDataSource

public PagedDataSource<?> getDataSource()
Specified by:
getDataSource in interface HasDataSource<PagedDataSource<?>>
Returns:
PagedDataSource object
See Also:
Grid.getDataSource()

getCurrentPageRows

public List<DataRow> getCurrentPageRows()
Returns:
List of the rows in current page
See Also:
Grid.getCurrentPageRows()

refresh

public void refresh()
See Also:
AbstractGrid.refresh()

getSelectedRows

public List<DataRow> getSelectedRows()
Returns:
A list with selected rows
See Also:
Grid.getSelectedRows()

nextPage

public void nextPage()
Description copied from interface: Pageable
Moves the pageable's cursor to the next page

Specified by:
nextPage in interface Pageable
See Also:
Grid.nextPage()

previousPage

public void previousPage()
Description copied from interface: Pageable
Moves the pageable's cursor to the previous page

Specified by:
previousPage in interface Pageable
See Also:
Grid.previousPage()

setPager

public void setPager(Pager pager)
Description copied from interface: Pageable
Sets the pager for call back

Specified by:
setPager in interface Pageable
Parameters:
pager -
See Also:
Grid.setPager(org.cruxframework.crux.widgets.client.paging.Pager)

goToPage

public void goToPage(int page)
Description copied from interface: Pageable
Moves the pageable's cursor to an arbitrary page

Specified by:
goToPage in interface Pageable
Parameters:
page - The page of the requested index
See Also:
Grid.goToPage(int)

getRow

public DataRow getRow(com.google.gwt.user.client.ui.Widget w)
Parameters:
w -
Returns:
The datarow that contains the informed widget
See Also:
Grid.getRow(com.google.gwt.user.client.ui.Widget)

getPageCount

public int getPageCount()
Description copied from interface: Pageable
Return the total number of pages

Specified by:
getPageCount in interface Pageable
Returns:
Page count
See Also:
Grid.getPageCount()

isDataLoaded

public boolean isDataLoaded()
Description copied from interface: Pageable
Checks if pageable data is already available

Specified by:
isDataLoaded in interface Pageable
Returns:
Verify if there is any data loaded
See Also:
Grid.isDataLoaded()

getActionWidget

public com.google.gwt.user.client.ui.Widget getActionWidget(String key)
Retrieve the widget associated to the grid component

Parameters:
id -
Returns:
Widget

initGrid

public void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions,
                     int pageSize,
                     RowSelectionModel rowSelection,
                     int cellSpacing,
                     boolean autoLoadData,
                     boolean stretchColumns,
                     boolean highlightRowOnMouseOver,
                     String emptyDataFilling,
                     boolean fixedCellSize,
                     String defaultSortingColumn,
                     Grid.SortingType defaultSortingType,
                     boolean keepEditorOnClickDisabledRows,
                     boolean showEditorButtons,
                     boolean freezeHeaders,
                     String detailDialogTitle)

initGrid

public void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions,
                     int pageSize,
                     RowSelectionModel rowSelection,
                     int cellSpacing,
                     boolean autoLoadData,
                     boolean stretchColumns,
                     boolean highlightRowOnMouseOver,
                     String emptyDataFilling,
                     boolean fixedCellSize,
                     String defaultSortingColumn,
                     Grid.SortingType defaultSortingType)
Initialize grid component

Parameters:
columnDefinitions - The definition of grid`s columns
pageSize - The maximum size of a page
rowSelection - Row selection mode
cellSpacing - Space between cells
autoLoadData - Load data automatically
stretchColumns - Stretch columns to content, if needed
highlightRowOnMouseOver - Highlight row when the mouse cursor is over it
emptyDataFilling -
fixedCellSize - Fix the size of all cells
defaultSortingColumn - The default column used to sort data
defaultSortingType - Sorting type

initGrid

public void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions,
                     int pageSize,
                     RowSelectionModel rowSelection,
                     int cellSpacing,
                     boolean autoLoadData,
                     boolean stretchColumns,
                     boolean highlightRowOnMouseOver,
                     String emptyDataFilling,
                     boolean fixedCellSize,
                     String defaultSortingColumn,
                     Grid.SortingType defaultSortingType,
                     boolean keepEditorOnClickDisabledRows)
Initialize grid component

Parameters:
columnDefinitions - The definition of grid`s columns
pageSize - The maximum size of a page
rowSelection - Row selection mode
cellSpacing - Space between cells
autoLoadData - Load data automatically
stretchColumns - Stretch columns to content, if needed
highlightRowOnMouseOver - Highlight row when the mouse cursor is over it
emptyDataFilling -
fixedCellSize - Fix the size of all cells
defaultSortingColumn - The default column used to sort data
defaultSortingType - Sorting type
keepEditorOnClickDisabledRows - Keep row's editor opened even when clicking on a disabled datarow

initGrid

public void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions,
                     int pageSize,
                     RowSelectionModel rowSelection,
                     int cellSpacing,
                     boolean autoLoadData,
                     boolean stretchColumns,
                     boolean highlightRowOnMouseOver,
                     String emptyDataFilling,
                     boolean fixedCellSize,
                     String defaultSortingColumn,
                     Grid.SortingType defaultSortingType,
                     boolean keepEditorOnClickDisabledRows,
                     boolean showEditorButtons)

initGrid

public void initGrid(DeviceAdaptiveGridColumnDefinitions columnDefinitions,
                     int pageSize,
                     RowSelectionModel rowSelection,
                     int cellSpacing,
                     boolean autoLoadData,
                     boolean stretchColumns,
                     boolean highlightRowOnMouseOver,
                     String emptyDataFilling,
                     boolean fixedCellSize,
                     String defaultSortingColumn,
                     Grid.SortingType defaultSortingType,
                     boolean keepEditorOnClickDisabledRows,
                     boolean showEditorButtons,
                     boolean freezeHeaders)

setHeight

public void setHeight(String height)
Overrides:
setHeight in class com.google.gwt.user.client.ui.UIObject

setWidth

public void setWidth(String width)
Overrides:
setWidth in class com.google.gwt.user.client.ui.UIObject


Copyright © 2014. All rights reserved.