Class AbstractAttributeEditor<T>
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Composite
-
- cn.mapway.ui.client.widget.CommonEventComposite
-
- cn.mapway.ui.client.mvc.attribute.editor.common.AbstractAttributeEditor<T>
-
- All Implemented Interfaces:
IEventHandler,IAttributeEditor,HasAttributeStateChangeHandler,IAttributesProvider,IAttributeValuesUpdator,IAttributeInit,IPageTip,IEnabled,IErrorMessage,IProvideSize,ISelectable,Id,IData,HasCommonHandlers,com.google.gwt.event.logical.shared.HasAttachHandlers,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.IsRenderable,com.google.gwt.user.client.ui.IsWidget
- Direct Known Subclasses:
CheckBoxAttributeEditor,ColorBoxAttributeEditor,DateTimeAttributeEditor,DropdownAttributeEditor,EditorSelectAttributeEditor,IconAttributeEditor,ImageUploadAttributeEditor,LabelAttributeEditor,PaddingBoxAttributeEditor,SliderAttributeEditor,TextAreaAttributeEditor,TextboxAttributeEditor
public abstract class AbstractAttributeEditor<T> extends CommonEventComposite implements IAttributeEditor
抽象的属性编辑器基类 继承类实现 setValue getValue 提供 popupWidget 会提供一个 button进行选择 提供 DisplayWidget 会显示widget 没有 会使用缺省的 TextBox如何自定义个一个属性编辑器 参考 TextBoxAttributeEditor 1.继承此类 2.提供一个属性编辑器的CODE 3.重载 setAttribute getDisplayWidget getPopupWidget
-
-
Field Summary
-
Fields inherited from class cn.mapway.ui.client.widget.CommonEventComposite
TRUE
-
Fields inherited from interface cn.mapway.ui.client.mvc.attribute.editor.IAttributeEditor
CATALOG_BUSINESS, CATALOG_DESIGN, CATALOG_RUNTIME, CATALOG_SYSTEM, CATALOG_UNKNOWN
-
Fields inherited from interface cn.mapway.ui.client.mvc.window.IEnabled
ENABLED_ATTRIBUTE
-
Fields inherited from interface cn.mapway.ui.client.mvc.window.ISelectable
SELECT_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description AbstractAttributeEditor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringcastToString(Object obj)ObjectcastToValue(String value)根据 DataType 将字符串转化为对象voideditAttribute(ParameterValues runtimeParameters, IAttribute attribute)设置组件编辑器的内容 通过组件工厂 AttributeEditorFactory 创建一个编辑器组件实例后 子组件必须首先调用此方法 处理一些基础数据 参见下拉框编辑器的设计 DropdownAttributeEditorvoidexpandExtraWidget(com.google.gwt.user.client.ui.Widget widget, boolean appendOrRemove)扩展属性编辑器编辑框abstract voidfromUI()从UI获取数据到 对象实体中IAttributegetAttribute()获取编辑器对应的属性定义ObjectgetData()List<ParameterValue>getRuntimeParameters()获取编辑器选项 这个选项一定不为空 并且融合了 设计期和运行期 的所有编辑器参数选项SizegetSize()返回编辑器弹出窗的缺省大小voidnotifyValueChanged()通知监听器 属性发生了变化voidonEditorOptionChanged(String key)某个编辑属性改变了值<T> Toption(String name, T defaultValue)首先从运行时中寻找参数 然后从 设计时中寻找参数ObjectreadAttributeValue(ParameterValue attribute, Object defaultValue)读取attribute的值 如果为空 返回缺省值voidsetData(Object obj)voidsetEditorNotifyHandler(IAttributeEditorNotifyHandler notifyHandler)voidsetValueChangedHandler(IAttributeEditorValueChangedHandler handler)属性变化通知事件voidupdateAllEditorOption()更新所有的编辑器选项voidupdateEditorOption(String key, Object value)更新编辑器的某个选项-
Methods inherited from class cn.mapway.ui.client.widget.CommonEventComposite
addAttributeReadyCallback, addAttributeStateChangeHandler, addCommonHandler, addTipDataHtml, addTipDataUrl, addTipDataWidget, clearBusEvent, clearTipData, commit, findAttributeByName, fireMessage, flatten, getAttributes, getAttributeSummary, getAttributeTitle, getComponentName, getEnabled, getId, getTipDataList, getTipVersion, getTitle, initAttributes, isAssign, isElementSelect, isSelected, isValidate, message, notifyAttributeReady, onEvent, onLoad, onUnload, processResult, processServiceCode, registerBusEvent, removeAttributeReadyCallback, removeHandler, requireDefaultSize, setAllResource, setAllRole, setAttr, setComponentName, setElementSelect, setEnabled, setErrorMessage, setId, setReadonly, setResource, setRole, setSelect, setTipVersion, setTitle, setUserRoleProvider, showPageTip, unregisterBusEvent, updateAttributeValues
-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
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, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cn.mapway.ui.client.mvc.attribute.editor.IAttributeEditor
getCode, getDesigner, getDisplayWidget, getEditorTip, setReadonly, setVisible, updateUI
-
Methods inherited from interface cn.mapway.ui.client.mvc.attribute.IAttributesProvider
isGroupInitExpand
-
Methods inherited from interface cn.mapway.ui.client.mvc.window.IProvideSize
requireDefaultSize
-
-
-
-
Method Detail
-
getSize
public Size getSize()
返回编辑器弹出窗的缺省大小- Specified by:
getSizein interfaceIAttributeEditor- Returns:
-
getAttribute
public IAttribute getAttribute()
Description copied from interface:IAttributeEditor获取编辑器对应的属性定义- Specified by:
getAttributein interfaceIAttributeEditor- Returns:
-
getRuntimeParameters
public List<ParameterValue> getRuntimeParameters()
获取编辑器选项 这个选项一定不为空 并且融合了 设计期和运行期 的所有编辑器参数选项- Returns:
-
option
public <T> T option(String name, T defaultValue)
首先从运行时中寻找参数 然后从 设计时中寻找参数- Parameters:
name-defaultValue-- Returns:
-
updateEditorOption
public void updateEditorOption(String key, Object value)
更新编辑器的某个选项- Specified by:
updateEditorOptionin interfaceIAttributeEditor- Parameters:
key-value-
-
updateAllEditorOption
public void updateAllEditorOption()
更新所有的编辑器选项- Specified by:
updateAllEditorOptionin interfaceIAttributeEditor
-
onEditorOptionChanged
public void onEditorOptionChanged(String key)
某个编辑属性改变了值- Parameters:
key- 如果key is null or empty 更新所有的属性编辑器组件的选项
-
setEditorNotifyHandler
public void setEditorNotifyHandler(IAttributeEditorNotifyHandler notifyHandler)
- Specified by:
setEditorNotifyHandlerin interfaceIAttributeEditor
-
expandExtraWidget
public void expandExtraWidget(com.google.gwt.user.client.ui.Widget widget, boolean appendOrRemove)扩展属性编辑器编辑框- Parameters:
widget-appendOrRemove-
-
editAttribute
public void editAttribute(ParameterValues runtimeParameters, IAttribute attribute)
设置组件编辑器的内容 通过组件工厂 AttributeEditorFactory 创建一个编辑器组件实例后 子组件必须首先调用此方法 处理一些基础数据 参见下拉框编辑器的设计 DropdownAttributeEditor- Specified by:
editAttributein interfaceIAttributeEditor- Parameters:
runtimeParameters- 编辑器选项 是一个 KV Ma,继承的组件自己定义所需的参数attribute- 属性编辑器对应的属性内容
-
castToValue
public Object castToValue(String value)
根据 DataType 将字符串转化为对象- Parameters:
value-- Returns:
-
setValueChangedHandler
public void setValueChangedHandler(IAttributeEditorValueChangedHandler handler)
Description copied from interface:IAttributeEditor属性变化通知事件- Specified by:
setValueChangedHandlerin interfaceIAttributeEditor
-
notifyValueChanged
public void notifyValueChanged()
通知监听器 属性发生了变化
-
readAttributeValue
public Object readAttributeValue(ParameterValue attribute, Object defaultValue)
读取attribute的值 如果为空 返回缺省值- Parameters:
attribute-defaultValue-- Returns:
-
fromUI
public abstract void fromUI()
从UI获取数据到 对象实体中- Specified by:
fromUIin interfaceIAttributeEditor
-
-