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

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.Panel
              extended by com.google.gwt.user.client.ui.SimplePanel
                  extended by org.cruxframework.crux.widgets.client.deviceadaptivegrid.DeviceAdaptiveGrid.GridImpl
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.AcceptsOneWidget, com.google.gwt.user.client.ui.HasOneWidget, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, Iterable<com.google.gwt.user.client.ui.Widget>
Direct Known Subclasses:
DeviceAdaptiveGrid.GridLargeImpl, DeviceAdaptiveGrid.GridSmallImpl
Enclosing class:
DeviceAdaptiveGrid

protected abstract static class DeviceAdaptiveGrid.GridImpl
extends com.google.gwt.user.client.ui.SimplePanel


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
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
 
Field Summary
protected  DeviceAdaptiveGridColumnDefinitions columnDefinitions
           
protected  String detailDialogTitle
           
protected  Grid grid
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
protected DeviceAdaptiveGrid.GridImpl()
           
 
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)
          On scroll event handler
 com.google.gwt.event.shared.HandlerRegistration addShowRowDetailsHandler(ShowRowDetailsHandler handler)
           
 void clear()
           
abstract  com.google.gwt.user.client.ui.Widget getActionWidget(String key)
          Retrieve the widget associated to the grid component
 List<DataRow> getCurrentPageRows()
           
 int getCurrentPageSize()
           
 org.cruxframework.crux.core.client.datasource.PagedDataSource<?> getDataSource()
           
 String getDetailDialogTitle()
           
protected  ColumnDefinitions getGridColumnDefinitionsByDevice()
          Retrieve the columns defined to a Large device
 int getPageCount()
           
 DataRow getRow(com.google.gwt.user.client.ui.Widget w)
           
 RowSelectionModel getRowSelectionModel()
           
 List<DataRow> getSelectedRows()
           
 void goToPage(int 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()
           
 void loadData()
           
 void nextPage()
           
 void previousPage()
           
 void refresh()
           
 void setDataSource(org.cruxframework.crux.core.client.datasource.PagedDataSource<?> dataSource)
           
 void setDataSource(org.cruxframework.crux.core.client.datasource.PagedDataSource<?> dataSource, boolean autoLoadData)
           
 void setDetailDialogTitle(String title)
           
 void setHeight(String height)
           
 void setPager(Pager pager)
           
 void setRowSelectionModel(RowSelectionModel rowSelectionModel)
           
 void setWidth(String width)
           
 
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getContainerElement, getWidget, iterator, remove, setWidget, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, 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, resolvePotentialElement, 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
 

Field Detail

grid

protected Grid grid

columnDefinitions

protected DeviceAdaptiveGridColumnDefinitions columnDefinitions

detailDialogTitle

protected String detailDialogTitle
Constructor Detail

DeviceAdaptiveGrid.GridImpl

protected DeviceAdaptiveGrid.GridImpl()
Method Detail

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

addBeforeSaveRowEditionHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeSaveRowEditionHandler(BeforeSaveRowEditionHandler handler)

addLoadRowDetailsHandler

public com.google.gwt.event.shared.HandlerRegistration addLoadRowDetailsHandler(LoadRowDetailsHandler handler)

addRowEditHandler

public com.google.gwt.event.shared.HandlerRegistration addRowEditHandler(RowEditHandler handler)

addBeforeCancelRowEditionHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeCancelRowEditionHandler(BeforeCancelRowEditionHandler handler)

addCancelRowEditionHandler

public com.google.gwt.event.shared.HandlerRegistration addCancelRowEditionHandler(CancelRowEditionHandler handler)

addBeforeRowEditHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeRowEditHandler(BeforeRowEditHandler handler)

addShowRowDetailsHandler

public com.google.gwt.event.shared.HandlerRegistration addShowRowDetailsHandler(ShowRowDetailsHandler handler)

addBeforeShowRowDetailsHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeShowRowDetailsHandler(BeforeShowRowDetailsHandler handler)

addRowDoubleClickHandler

public com.google.gwt.event.shared.HandlerRegistration addRowDoubleClickHandler(RowDoubleClickHandler handler)

addRowClickHandler

public com.google.gwt.event.shared.HandlerRegistration addRowClickHandler(RowClickHandler handler)

getRowSelectionModel

public RowSelectionModel getRowSelectionModel()

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)

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)

addColumnEditorValidator

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

Parameters:
key -
columnEditorValidator -

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

setDetailDialogTitle

public void setDetailDialogTitle(String title)

getDetailDialogTitle

public String getDetailDialogTitle()

setDataSource

public void setDataSource(org.cruxframework.crux.core.client.datasource.PagedDataSource<?> dataSource)
Parameters:
dataSource -
See Also:
Grid.setDataSource(org.cruxframework.crux.core.client.datasource.PagedDataSource)

setDataSource

public void setDataSource(org.cruxframework.crux.core.client.datasource.PagedDataSource<?> dataSource,
                          boolean autoLoadData)

addScrollHandler

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

Parameters:
handler -

loadData

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

clear

public void clear()
Specified by:
clear in interface com.google.gwt.user.client.ui.HasWidgets
Overrides:
clear in class com.google.gwt.user.client.ui.Panel
See Also:
AbstractGrid.clear()

refresh

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

getSelectedRows

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

getCurrentPageSize

public int getCurrentPageSize()
Returns:
The current page size
See Also:
Grid.getCurrentPageSize()

getDataSource

public org.cruxframework.crux.core.client.datasource.PagedDataSource<?> getDataSource()
Returns:
PagedDataSource
See Also:
Grid.getDataSource()

getCurrentPageRows

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

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)

nextPage

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

previousPage

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

setPager

public void setPager(Pager pager)
Parameters:
pager -
See Also:
Grid.setPager(org.cruxframework.crux.widgets.client.paging.Pager)

goToPage

public void goToPage(int page)
Parameters:
page -
See Also:
Grid.goToPage(int)

getPageCount

public int getPageCount()
Returns:
Page count
See Also:
Grid.getPageCount()

isDataLoaded

public boolean isDataLoaded()
Returns:
Verify if there is any data loaded
See Also:
Grid.isDataLoaded()

addRowRenderHandler

public com.google.gwt.event.shared.HandlerRegistration addRowRenderHandler(RowRenderHandler handler)
Parameters:
handler - Event handler
Returns:
HandlerRegistration
See Also:
AbstractGrid.addRowRenderHandler(org.cruxframework.crux.widgets.client.event.row.RowRenderHandler)

getGridColumnDefinitionsByDevice

protected ColumnDefinitions getGridColumnDefinitionsByDevice()
Retrieve the columns defined to a Large device

Returns:
ColumnDefinitions to a large device

setRowSelectionModel

public void setRowSelectionModel(RowSelectionModel rowSelectionModel)

getActionWidget

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

Parameters:
id -
Returns:
Widget


Copyright © 2015. All rights reserved.