org.drools.guvnor.client.widgets.drools.decoratedgrid
Class AbstractDecoratedGridHeaderWidget<M,T>

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.ComplexPanel
                  extended by com.google.gwt.user.client.ui.CellPanel
                      extended by org.drools.guvnor.client.widgets.drools.decoratedgrid.AbstractDecoratedGridHeaderWidget<M,T>
Type Parameters:
M - The domain model represented by the Header
T - The type of domain columns represented by the Header
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasResizeHandlers, com.google.gwt.event.shared.EventHandler, 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.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, Iterable<com.google.gwt.user.client.ui.Widget>, DeleteColumnEvent.Handler, InsertInternalColumnEvent.Handler<T>, MoveColumnsEvent.Handler, SetColumnVisibilityEvent.Handler, SetInternalModelEvent.Handler<M,T>, UpdateColumnDefinitionEvent.Handler
Direct Known Subclasses:
TemplateDataHeaderWidget, VerticalDecisionTableHeaderWidget

public abstract class AbstractDecoratedGridHeaderWidget<M,T>
extends com.google.gwt.user.client.ui.CellPanel
implements com.google.gwt.event.logical.shared.HasResizeHandlers, SetInternalModelEvent.Handler<M,T>, DeleteColumnEvent.Handler, InsertInternalColumnEvent.Handler<T>, SetColumnVisibilityEvent.Handler, UpdateColumnDefinitionEvent.Handler, MoveColumnsEvent.Handler

An abstract "Header" widget to decorate a DecoratedGridWidget


Nested Class Summary
 class AbstractDecoratedGridHeaderWidget.ResizerInformation
          Container class for information relating to re-size operations
 
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.IndexedPanel
com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
 
Field Summary
protected  com.google.gwt.event.shared.EventBus eventBus
           
protected  boolean isReadOnly
           
protected  M model
           
protected  com.google.gwt.user.client.ui.Panel panel
           
protected  ResourcesProvider<T> resources
           
protected  List<DynamicColumn<T>> sortableColumns
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
AbstractDecoratedGridHeaderWidget(ResourcesProvider<T> resources, boolean isReadOnly, com.google.gwt.event.shared.EventBus eventBus)
          Construct a "Header" for the provided DecoratedGridWidget
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
           
protected abstract  com.google.gwt.user.client.ui.Widget getHeaderWidget()
          Get the Widget that should be wrapped by the scroll panel and resize handlers.
protected abstract  AbstractDecoratedGridHeaderWidget.ResizerInformation getResizerInformation(int mx)
          Given the X-coordinate check whether resizing of any column should be enabled.
protected  List<SortConfiguration> getSortConfiguration()
          Get the column sorting configuration.
 void onDeleteColumn(DeleteColumnEvent event)
           
 void onInsertInternalColumn(InsertInternalColumnEvent<T> event)
           
 void onMoveColumns(MoveColumnsEvent event)
           
 void onSetColumnVisibility(SetColumnVisibilityEvent event)
           
 void onUpdateColumnDefinition(UpdateColumnDefinitionEvent event)
           
abstract  void redraw()
          Redraw entire header
protected abstract  void resizeColumn(DynamicColumn<T> resizeColumn, int resizeColumnWidth)
          Resize the Header column
abstract  void setScrollPosition(int position)
          Set scroll position to enable some degree of synchronisation between DecisionTable and DecisionTableHeader
 void setWidth(String width)
           
protected  void updateSortOrder(DynamicColumn<T> column)
          Update sort order.
 
Methods inherited from class com.google.gwt.user.client.ui.CellPanel
getBody, getSpacing, getTable, setBorderWidth, setCellHeight, setCellHeight, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellWidth, setCellWidth, setSpacing
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, add, adopt, adopt, clear, disown, 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
 
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, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface org.drools.guvnor.client.widgets.drools.decoratedgrid.events.SetInternalModelEvent.Handler
onSetInternalModel
 

Field Detail

panel

protected com.google.gwt.user.client.ui.Panel panel

model

protected M model

sortableColumns

protected List<DynamicColumn<T>> sortableColumns

isReadOnly

protected final boolean isReadOnly

resources

protected ResourcesProvider<T> resources

eventBus

protected com.google.gwt.event.shared.EventBus eventBus
Constructor Detail

AbstractDecoratedGridHeaderWidget

public AbstractDecoratedGridHeaderWidget(ResourcesProvider<T> resources,
                                         boolean isReadOnly,
                                         com.google.gwt.event.shared.EventBus eventBus)
Construct a "Header" for the provided DecoratedGridWidget

Parameters:
resources -
eventBus -
Method Detail

addResizeHandler

public com.google.gwt.event.shared.HandlerRegistration addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
Specified by:
addResizeHandler in interface com.google.gwt.event.logical.shared.HasResizeHandlers

redraw

public abstract void redraw()
Redraw entire header


setScrollPosition

public abstract void setScrollPosition(int position)
Set scroll position to enable some degree of synchronisation between DecisionTable and DecisionTableHeader

Parameters:
position -

setWidth

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

getHeaderWidget

protected abstract com.google.gwt.user.client.ui.Widget getHeaderWidget()
Get the Widget that should be wrapped by the scroll panel and resize handlers. The widget renders the actual "header" embedded within the decorations provided by this class: scroll-bars and resizing support.

Returns:

getResizerInformation

protected abstract AbstractDecoratedGridHeaderWidget.ResizerInformation getResizerInformation(int mx)
Given the X-coordinate check whether resizing of any column should be enabled. The ResizerInformation return value contains necessary information for this decorating class to perform column-resizing.

Parameters:
mx - the MouseMoveEvent.event.getClientX() coordinate
Returns:

resizeColumn

protected abstract void resizeColumn(DynamicColumn<T> resizeColumn,
                                     int resizeColumnWidth)
Resize the Header column

Parameters:
resizeColumn -
resizeColumnWidth -

updateSortOrder

protected void updateSortOrder(DynamicColumn<T> column)
Update sort order. The column clicked becomes the primary sort column. and the other, previously sorted, columns degrade in priority

Parameters:
column -

getSortConfiguration

protected List<SortConfiguration> getSortConfiguration()
Get the column sorting configuration. The list contains an entry for each column on which the data should be sorted.

Returns:

onDeleteColumn

public void onDeleteColumn(DeleteColumnEvent event)
Specified by:
onDeleteColumn in interface DeleteColumnEvent.Handler

onInsertInternalColumn

public void onInsertInternalColumn(InsertInternalColumnEvent<T> event)
Specified by:
onInsertInternalColumn in interface InsertInternalColumnEvent.Handler<T>

onSetColumnVisibility

public void onSetColumnVisibility(SetColumnVisibilityEvent event)
Specified by:
onSetColumnVisibility in interface SetColumnVisibilityEvent.Handler

onUpdateColumnDefinition

public void onUpdateColumnDefinition(UpdateColumnDefinitionEvent event)
Specified by:
onUpdateColumnDefinition in interface UpdateColumnDefinitionEvent.Handler

onMoveColumns

public void onMoveColumns(MoveColumnsEvent event)
Specified by:
onMoveColumns in interface MoveColumnsEvent.Handler


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.