org.drools.guvnor.client.widgets.decoratedgrid
Class DecoratedGridHeaderWidget<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.decoratedgrid.DecoratedGridHeaderWidget<T>
Type Parameters:
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.HasHandlers, com.google.gwt.user.client.EventListener, 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>, HasColumnResizeHandlers
Direct Known Subclasses:
TemplateDataHeaderWidget, VerticalDecisionTableHeaderWidget

public abstract class DecoratedGridHeaderWidget<T>
extends com.google.gwt.user.client.ui.CellPanel
implements com.google.gwt.event.logical.shared.HasResizeHandlers, HasColumnResizeHandlers

An abstract "Header" widget to decorate a DecoratedGridWidget


Nested Class Summary
 class DecoratedGridHeaderWidget.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 static Constants constants
           
protected  DecoratedGridWidget<T> grid
           
protected  com.google.gwt.user.client.ui.Panel panel
           
protected static DecisionTableResources resource
           
protected static DecisionTableResources.DecisionTableStyle style
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DecoratedGridHeaderWidget(DecoratedGridWidget<T> grid)
          Construct a "Header" for the provided DecoratedGridWidget
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addColumnResizeHandler(ColumnResizeHandler handler)
          Adds a ColumnResizeEvent handler.
 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  DecoratedGridHeaderWidget.ResizerInformation getResizerInformation(int mx)
          Given the X-coordinate check whether resizing of any column should be enabled.
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)
           
 
Methods inherited from class com.google.gwt.user.client.ui.CellPanel
getBody, getSpacing, getTable, setBorderWidth, setCellHeight, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, 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, 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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, 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
 

Field Detail

panel

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

grid

protected DecoratedGridWidget<T> grid

resource

protected static final DecisionTableResources resource

style

protected static final DecisionTableResources.DecisionTableStyle style

constants

protected static final Constants constants
Constructor Detail

DecoratedGridHeaderWidget

public DecoratedGridHeaderWidget(DecoratedGridWidget<T> grid)
Construct a "Header" for the provided DecoratedGridWidget

Parameters:
grid -
Method Detail

addColumnResizeHandler

public com.google.gwt.event.shared.HandlerRegistration addColumnResizeHandler(ColumnResizeHandler handler)
Description copied from interface: HasColumnResizeHandlers
Adds a ColumnResizeEvent handler.

Specified by:
addColumnResizeHandler in interface HasColumnResizeHandlers
Parameters:
handler - the handler
Returns:
the handler registration

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 DecoratedGridHeaderWidget.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 -


Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.