com.google.gwt.widgetideas.table.client
Class InlineCellEditor<R>

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 com.google.gwt.user.client.ui.DecoratorPanel
                      extended by com.google.gwt.user.client.ui.PopupPanel
                          extended by com.google.gwt.widgetideas.table.client.InlineCellEditor<R>
Type Parameters:
R - the type of the row value associated with the editor
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, com.google.gwt.user.client.EventPreview, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.SourcesPopupEvents, AbstractCellEditor<R>
Direct Known Subclasses:
ListCellEditor, RadioCellEditor, TextCellEditor

public abstract class InlineCellEditor<R>
extends com.google.gwt.user.client.ui.PopupPanel
implements AbstractCellEditor<R>

An abstract representation of an editor used to edit the contents of a cell.

CSS Style Rules


Nested Class Summary
static interface InlineCellEditor.InlineCellEditorImages
          An ImageBundle that provides images for InlineCellEditor.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
 
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.widgetideas.table.client.AbstractCellEditor
AbstractCellEditor.Callback<R>, AbstractCellEditor.CellEditInfo<R>
 
Field Summary
static java.lang.String DEFAULT_STYLENAME
          Default style name.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
protected InlineCellEditor(com.google.gwt.user.client.ui.Widget content)
          Constructor.
protected InlineCellEditor(com.google.gwt.user.client.ui.Widget content, InlineCellEditor.InlineCellEditorImages images)
          Constructor.
 
Method Summary
protected  void accept()
          Save the value in the cell editor to the actual cell.
protected  void cancel()
          Cancel the cell edit.
 void editCell(AbstractCellEditor.CellEditInfo<R> cellEditInfo, AbstractCellEditor.Callback<R> callback)
          Handle a request from the table to edit a cell.
protected  com.google.gwt.user.client.ui.Widget getAcceptWidget()
           
protected  com.google.gwt.user.client.ui.Widget getCancelWidget()
           
protected  com.google.gwt.user.client.ui.Widget getContentWidget()
           
 java.lang.String getLabel()
           
protected abstract  java.lang.Object getValue()
          Get the value from the editor to put into the cell.
protected  boolean onAccept()
          Called before an accept takes place.
protected  boolean onCancel()
          Called before a cancel takes place.
protected  void setAcceptWidget(com.google.gwt.user.client.ui.Widget w)
          Set the Widget that is used to accept the current value.
protected  void setCancelWidget(com.google.gwt.user.client.ui.Widget w)
          Set the Widget that is used to cancel editing.
 void setLabel(java.lang.String label)
          Set the label for this cell editor.
protected abstract  void setValue(java.lang.Object value)
          Set the value in the editor based on the value in the cell.
 
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addPopupListener, center, getContainerElement, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getTitle, hide, isAnimationEnabled, onDetach, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, removePopupListener, setAnimationEnabled, setAnimationType, setHeight, setPopupPosition, setPopupPositionAndShow, setTitle, setVisible, setWidget, setWidth, show
 
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getWidget, iterator, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onAttach, onBrowserEvent, removeFromParent, setElement
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_STYLENAME

public static final java.lang.String DEFAULT_STYLENAME
Default style name.

See Also:
Constant Field Values
Constructor Detail

InlineCellEditor

protected InlineCellEditor(com.google.gwt.user.client.ui.Widget content)
Constructor.

Parameters:
content - the Widget used to edit

InlineCellEditor

protected InlineCellEditor(com.google.gwt.user.client.ui.Widget content,
                           InlineCellEditor.InlineCellEditorImages images)
Constructor.

Parameters:
content - the Widget used to edit
images - the images to use for the accept/cancel buttons
Method Detail

editCell

public void editCell(AbstractCellEditor.CellEditInfo<R> cellEditInfo,
                     AbstractCellEditor.Callback<R> callback)
Description copied from interface: AbstractCellEditor
Handle a request from the table to edit a cell.

Specified by:
editCell in interface AbstractCellEditor<R>
Parameters:
cellEditInfo - information about the source of the edit request
callback - callback used when editing is complete
See Also:
AbstractCellEditor.editCell(CellEditInfo, Callback)

getLabel

public java.lang.String getLabel()
Returns:
the label text

setLabel

public void setLabel(java.lang.String label)
Set the label for this cell editor.

Parameters:
label - the new label

accept

protected void accept()
Save the value in the cell editor to the actual cell.


cancel

protected void cancel()
Cancel the cell edit.


getAcceptWidget

protected com.google.gwt.user.client.ui.Widget getAcceptWidget()
Returns:
the Widget that is used to accept the current value.

getCancelWidget

protected com.google.gwt.user.client.ui.Widget getCancelWidget()
Returns:
the Widget that is used to cancel editing.

getContentWidget

protected com.google.gwt.user.client.ui.Widget getContentWidget()
Returns:
the content widget

getValue

protected abstract java.lang.Object getValue()
Get the value from the editor to put into the cell. If the value is a Widget, it will be set as a Widget in the table. If it is not a Widget, it will be set as an HTML string.

Returns:
the new value to put into the cell

onAccept

protected boolean onAccept()
Called before an accept takes place.

Returns:
true to allow the accept, false to prevent it

onCancel

protected boolean onCancel()
Called before a cancel takes place.

Returns:
true to allow the cancel, false to prevent it

setAcceptWidget

protected void setAcceptWidget(com.google.gwt.user.client.ui.Widget w)
Set the Widget that is used to accept the current value.

Parameters:
w - the widget

setCancelWidget

protected void setCancelWidget(com.google.gwt.user.client.ui.Widget w)
Set the Widget that is used to cancel editing.

Parameters:
w - the widget

setValue

protected abstract void setValue(java.lang.Object value)
Set the value in the editor based on the value in the cell.

Parameters:
value - the value in the cell, either a Widget or HTML string