com.extjs.gxt.ui.client.widget.grid
Class RowEditor<M extends ModelData>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<T>
                      extended by com.extjs.gxt.ui.client.widget.ScrollContainer<Component>
                          extended by com.extjs.gxt.ui.client.widget.LayoutContainer
                              extended by com.extjs.gxt.ui.client.widget.ContentPanel
                                  extended by com.extjs.gxt.ui.client.widget.grid.RowEditor<M>
Type Parameters:
M - the model type
All Implemented Interfaces:
Observable, ComponentPlugin, IconSupport, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener

public class RowEditor<M extends ModelData>
extends ContentPanel
implements ComponentPlugin

This RowEditor should be used as a plugin to Grid. It displays an editor for all cells in a row.

Events:
BeforeEdit : RowEditorEvent(rowEditor, rowIndex)
Fires before row editing is triggered. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
ValidateEdit : RowEditorEvent(rowEditor, rowIndex, changes)
Fires right before the model is updated. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
AfterEdit : RowEditorEvent(rowEditor, rowIndex, changes)
Fires after a row has been edited.


Nested Class Summary
 class RowEditor.RowEditorMessages
           
 
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
RowEditor()
           
 
Method Summary
 EditorGrid.ClicksToEdit getClicksToEdit()
          Returns the clicks to edit.
 RowEditor.RowEditorMessages getMessages()
          Returns the roweditors's messages.
 int getMonitorPoll()
          Returns the interval in ms in that the roweditor is validated
 void init(Component component)
          Initializes the plugin when the component is created.
 boolean isErrorSummary()
          Returns true if a tooltip with an error summary is shown.
 boolean isMonitorValid()
          Returns true if this roweditor is monitored.
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
 void setClicksToEdit(EditorGrid.ClicksToEdit clicksToEdit)
          Sets the number of clicks to edit (defaults to ONE).
 void setErrorSummary(boolean errorSummary)
          True to show a tooltip with an errorsummary (defaults to true)
 void setMessages(RowEditor.RowEditorMessages messages)
          Sets the roweditors's messages.
 void setMonitorPoll(int monitorPoll)
          Sets the polling interval in ms in that the roweditor validation is done (defaults to 200)
 void setMonitorValid(boolean monitorValid)
          True to monitor the valid status of this roweditor (defaults to true)
 void startEditing(int rowIndex, boolean doFocus)
          Start editing of a specific row.
 void stopEditing(boolean saveChanges)
          Stops editing.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.ContentPanel
addButton, collapse, expand, getAnimCollapse, getBody, getBodyBorder, getBodyStyle, getBottomComponent, getButtonAlign, getButtonBar, getCollapseBtn, getCollapsible, getElement, getFrame, getFrameHeight, getFrameWidth, getHeader, getHeading, getIcon, getInnerHeight, getInnerWidth, getLayoutTarget, getMinButtonWidth, getTitleCollapse, getTitleText, getTopComponent, isCollapsed, isExpanded, isFooter, isHeaderVisible, isHideCollapseTool, setAnimCollapse, setBodyBorder, setBodyStyle, setBodyStyleName, setBottomComponent, setButtonAlign, setCollapsible, setExpanded, setFooter, setFrame, setHeaderVisible, setHeading, setHideCollapseTool, setIcon, setIconStyle, setInsetBorder, setMinButtonWidth, setTitleCollapse, setTopComponent, setUrl
 
Methods inherited from class com.extjs.gxt.ui.client.widget.LayoutContainer
add, add, addText, findComponent, getLayout, getWindowResizeDelay, insert, insert, isLayoutOnChange, isMonitorWindowResize, layout, layout, remove, removeAll, setLayout, setLayoutData, setLayoutOnChange, setMonitorWindowResize, setWindowResizeDelay
 
Methods inherited from class com.extjs.gxt.ui.client.widget.ScrollContainer
addScrollListener, getHScrollPosition, getScrollMode, getVScrollPosition, removeScrollListener, scrollIntoView, setHScrollPosition, setScrollMode, setVScrollPosition
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Container
disable, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, scrollIntoView
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, clearState, disableEvents, disableTextSelection, el, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getContextMenu, getData, getElement, getHideMode, getId, getItemId, getListeners, getModel, getState, getStateId, getToolTip, hasListeners, hasListeners, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isStateful, isVisible, mask, mask, mask, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setBorders, setContextMenu, setData, setElement, setEnabled, setHideMode, setId, setIntStyleAttribute, setItemId, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RowEditor

public RowEditor()
Method Detail

init

public void init(Component component)
Description copied from interface: ComponentPlugin
Initializes the plugin when the component is created.

Specified by:
init in interface ComponentPlugin
Parameters:
component - the source component

getClicksToEdit

public EditorGrid.ClicksToEdit getClicksToEdit()
Returns the clicks to edit.

Returns:
the clicks to edit

getMonitorPoll

public int getMonitorPoll()
Returns the interval in ms in that the roweditor is validated

Returns:
the interval in ms in that the roweditor is validated

isErrorSummary

public boolean isErrorSummary()
Returns true if a tooltip with an error summary is shown.

Returns:
true if a tooltip with an error summary is shown

getMessages

public RowEditor.RowEditorMessages getMessages()
Returns the roweditors's messages.

Returns:
the messages

isMonitorValid

public boolean isMonitorValid()
Returns true if this roweditor is monitored.

Returns:
true if the roweditor is monitored

onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Description copied from class: Component
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The Component.onBrowserEvent(com.google.gwt.user.client.Event) method should not be overridden or modified.

Overrides:
onComponentEvent in class ContentPanel
Parameters:
ce - the base event

setClicksToEdit

public void setClicksToEdit(EditorGrid.ClicksToEdit clicksToEdit)
Sets the number of clicks to edit (defaults to ONE).

Parameters:
clicksToEdit - the clicks to edit

setErrorSummary

public void setErrorSummary(boolean errorSummary)
True to show a tooltip with an errorsummary (defaults to true)

Parameters:
errorSummary - true to show an error summary.

setMessages

public void setMessages(RowEditor.RowEditorMessages messages)
Sets the roweditors's messages.

Parameters:
messages - the messages

setMonitorValid

public void setMonitorValid(boolean monitorValid)
True to monitor the valid status of this roweditor (defaults to true)

Parameters:
monitorValid - true to monitor this roweditor

setMonitorPoll

public void setMonitorPoll(int monitorPoll)
Sets the polling interval in ms in that the roweditor validation is done (defaults to 200)

Parameters:
monitorPoll - the polling interval in ms in that validation is done

startEditing

public void startEditing(int rowIndex,
                         boolean doFocus)
Start editing of a specific row.

Parameters:
rowIndex - the index of the row to edit.
doFocus - true to focus the field

stopEditing

public void stopEditing(boolean saveChanges)
Stops editing.

Parameters:
saveChanges - true to save the changes. false to ignore them.