org.weda.tapestry.component
Class BaseEditor

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.BaseComponent
              extended by org.weda.tapestry.component.EditorGroupComponent
                  extended by org.weda.tapestry.component.AbstractEditor
                      extended by org.weda.tapestry.component.BaseEditor
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, org.apache.tapestry.IComponent, org.apache.tapestry.IRender, org.apache.tapestry.ITemplateComponent, ActionContainer, ActionContainerProvider, StateableObject

@ComponentClass(allowBody=false,
                allowInformalParameters=false)
public abstract class BaseEditor
extends AbstractEditor
implements ActionContainer, ActionContainerProvider

Author:
Mikhail Titov

Constructor Summary
BaseEditor()
           
 
Method Summary
 ExecutedActionInfo executeAction(ActionExecutionContext context)
          Метод выполненяет действие
 java.lang.String getActionContainerName()
          Метод возвращает уникальное имя контейнера.
 java.util.List<ActionContainer> getActionContainers()
           
abstract  ActionRegistry getActionRegistry()
           
 java.util.List<ActionState> getActionsStates()
          Метод возвращает текущее состояние действий доступных для данного контейнера.
abstract  CacheManager getCacheManager()
           
abstract  int getCols()
           
 java.util.Set<java.lang.Class> getDisabledActions()
          Метод возвращает множество классов действий (action class) которые необходимо запретить для выполнения в данном контейнере.
 java.lang.String getEditorClass()
           
 java.lang.Object getModelValue()
          Метод возвращает значение претиндента на значение модели если он установлен, иначе значение модели.
abstract  int getRows()
           
 java.util.Map getState()
           
abstract  java.lang.String getValue()
           
 java.lang.String getValueAsString()
           
abstract  java.lang.String getValueEditorPageName()
           
 int getValueListIndex()
           
 boolean getValueSelection(int index)
           
 boolean hasRegisteredActions()
          Метод вернет TRUE если есть действия зарегистрированные для данного контейнера.
abstract  boolean isDirectValueSet()
           
 boolean isSelectValueFromList()
           
 void makeUpdate()
          Данный метод должен производить изменения в модели данных и вернуть NULL если изменения прошли успешно или сообщение указывающее на то почему изменения провести не удалось.
protected  void prepareForRender(org.apache.tapestry.IRequestCycle cycle)
           
 void resetState(java.util.Map state)
           
 void restoreState(java.util.Map state)
           
 void setValueAsString(java.lang.String value)
           
 void setValueListIndex(int valueListIndex)
           
 void setValueSelection(int index, boolean value)
           
 
Methods inherited from class org.weda.tapestry.component.AbstractEditor
getConverterService
 
Methods inherited from class org.weda.tapestry.component.EditorGroupComponent
getBindingFactory, getEditorGroup, getModel, getModelName, getStyle, setModelName
 
Methods inherited from class org.apache.tapestry.BaseComponent
addOuter, finishLoad, renderComponent
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

BaseEditor

public BaseEditor()
Method Detail

getActionRegistry

@InjectObject(value="service:org.weda.action.ActionRegistry")
public abstract ActionRegistry getActionRegistry()

getCacheManager

@InjectObject(value="service:org.weda.cache.CacheManager")
public abstract CacheManager getCacheManager()

getCols

@Parameter(required=false,
           defaultValue="ognl:10")
public abstract int getCols()

getRows

@Parameter(required=false,
           defaultValue="ognl:1")
public abstract int getRows()

getValue

@Parameter(required=false)
public abstract java.lang.String getValue()

getValueEditorPageName

@Parameter(required=false,
           defaultValue="ognl:null")
public abstract java.lang.String getValueEditorPageName()

isDirectValueSet

@Parameter(required=false,
           defaultValue="ognl:false")
public abstract boolean isDirectValueSet()

getEditorClass

public java.lang.String getEditorClass()

isSelectValueFromList

public boolean isSelectValueFromList()
                              throws java.lang.Exception
Throws:
java.lang.Exception

getValueSelection

public boolean getValueSelection(int index)
                          throws java.lang.Exception
Throws:
java.lang.Exception

setValueSelection

public void setValueSelection(int index,
                              boolean value)
                       throws java.lang.Exception
Throws:
java.lang.Exception

makeUpdate

public void makeUpdate()
                throws java.lang.Exception
Description copied from class: AbstractEditor
Данный метод должен производить изменения в модели данных и вернуть NULL если изменения прошли успешно или сообщение указывающее на то почему изменения провести не удалось.

Specified by:
makeUpdate in class AbstractEditor
Throws:
java.lang.Exception

getValueAsString

public java.lang.String getValueAsString()

setValueAsString

public void setValueAsString(java.lang.String value)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getActionContainers

public java.util.List<ActionContainer> getActionContainers()
                                                    throws java.lang.Exception
Specified by:
getActionContainers in interface ActionContainerProvider
Throws:
java.lang.Exception

getModelValue

public java.lang.Object getModelValue()
Description copied from class: AbstractEditor
Метод возвращает значение претиндента на значение модели если он установлен, иначе значение модели.

Overrides:
getModelValue in class AbstractEditor

getValueListIndex

public int getValueListIndex()

setValueListIndex

public void setValueListIndex(int valueListIndex)

executeAction

public ExecutedActionInfo executeAction(ActionExecutionContext context)
                                 throws ActionRegistryException
Description copied from interface: ActionContainer
Метод выполненяет действие

Specified by:
executeAction in interface ActionContainer
Throws:
ActionRegistryException

hasRegisteredActions

public boolean hasRegisteredActions()
Description copied from interface: ActionContainer
Метод вернет TRUE если есть действия зарегистрированные для данного контейнера. Если контейнер реализует интерфейс GlobalActionsProvider тогда метод вернет TRUE если в реестре действий есть хотя бы одно глобальное действие.

Specified by:
hasRegisteredActions in interface ActionContainer
See Also:
ActionRegistry#hasRegisteredActions(Class)

getDisabledActions

public java.util.Set<java.lang.Class> getDisabledActions()
Description copied from interface: ActionContainer
Метод возвращает множество классов действий (action class) которые необходимо запретить для выполнения в данном контейнере.

Specified by:
getDisabledActions in interface ActionContainer

getActionsStates

public java.util.List<ActionState> getActionsStates()
                                             throws ActionRegistryException
Description copied from interface: ActionContainer
Метод возвращает текущее состояние действий доступных для данного контейнера. Т.е. значение свойства ActionState.isAvailable() true. Состояния глобальных действий будут присутствовать в списке в том и только том случае если данный контейнер реализует интерфейс GlobalActionsProvider.

Specified by:
getActionsStates in interface ActionContainer
Throws:
ActionRegistryException
See Also:
ActionRegistry#getActionsStates(ActionContainer)

getActionContainerName

public java.lang.String getActionContainerName()
Description copied from interface: ActionContainer
Метод возвращает уникальное имя контейнера.

Specified by:
getActionContainerName in interface ActionContainer

prepareForRender

protected void prepareForRender(org.apache.tapestry.IRequestCycle cycle)
Overrides:
prepareForRender in class EditorGroupComponent

getState

public java.util.Map getState()
Specified by:
getState in interface StateableObject
Overrides:
getState in class EditorGroupComponent

restoreState

public void restoreState(java.util.Map state)
Specified by:
restoreState in interface StateableObject
Overrides:
restoreState in class EditorGroupComponent

resetState

public void resetState(java.util.Map state)
Specified by:
resetState in interface StateableObject
Overrides:
resetState in class EditorGroupComponent


Copyright © 2005-2006 . All Rights Reserved.