|
|
@ -41,13 +41,14 @@ public class XDateEditor extends XDirectWriteEditor { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 控件的属性列表 |
|
|
|
* 控件的属性列表 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 此控件所用的属性列表 |
|
|
|
* @return 此控件所用的属性列表 |
|
|
|
* @throws IntrospectionException 异常 |
|
|
|
* @throws IntrospectionException 异常 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
CRPropertyDescriptor [] tempt=(CRPropertyDescriptor[]) ArrayUtils.addAll( |
|
|
|
CRPropertyDescriptor[] tempt = (CRPropertyDescriptor[]) ArrayUtils.addAll( |
|
|
|
new CRPropertyDescriptor[] { |
|
|
|
new CRPropertyDescriptor[]{ |
|
|
|
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( |
|
|
|
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( |
|
|
|
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass( |
|
|
|
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass( |
|
|
|
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, |
|
|
|
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, |
|
|
@ -57,9 +58,9 @@ public class XDateEditor extends XDirectWriteEditor { |
|
|
|
public void propertyChange() { |
|
|
|
public void propertyChange() { |
|
|
|
initFieldText(); |
|
|
|
initFieldText(); |
|
|
|
} |
|
|
|
} |
|
|
|
})},super.supportedDescriptor()); |
|
|
|
})}, super.supportedDescriptor()); |
|
|
|
return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt, |
|
|
|
return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt, |
|
|
|
new CRPropertyDescriptor[] { |
|
|
|
new CRPropertyDescriptor[]{ |
|
|
|
new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName( |
|
|
|
new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName( |
|
|
|
Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass( |
|
|
|
Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass( |
|
|
|
DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), |
|
|
|
DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), |
|
|
@ -93,12 +94,12 @@ public class XDateEditor extends XDirectWriteEditor { |
|
|
|
//格式
|
|
|
|
//格式
|
|
|
|
String format = dateEditor.getFormatText(); |
|
|
|
String format = dateEditor.getFormatText(); |
|
|
|
|
|
|
|
|
|
|
|
if(value instanceof Date){ |
|
|
|
if (value instanceof Date) { |
|
|
|
valueStr = DateUtils.getDate2Str(format, (Date) value); |
|
|
|
valueStr = DateUtils.getDate2Str(format, (Date) value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//日期控件默认值
|
|
|
|
//日期控件默认值
|
|
|
|
if(StringUtils.isEmpty(valueStr)){ |
|
|
|
if (StringUtils.isEmpty(valueStr)) { |
|
|
|
valueStr = DateUtils.getDate2Str(format, new Date()); |
|
|
|
valueStr = DateUtils.getDate2Str(format, new Date()); |
|
|
|
dateEditor.setWidgetValue(new WidgetValue(new Date())); |
|
|
|
dateEditor.setWidgetValue(new WidgetValue(new Date())); |
|
|
|
} |
|
|
|
} |
|
|
@ -140,14 +141,10 @@ public class XDateEditor extends XDirectWriteEditor { |
|
|
|
* 获取当前XCreator的一个封装父容器 |
|
|
|
* 获取当前XCreator的一个封装父容器 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param widgetName 当前组件名 |
|
|
|
* @param widgetName 当前组件名 |
|
|
|
* |
|
|
|
|
|
|
|
* @return 封装的父容器 |
|
|
|
* @return 封装的父容器 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-11-25-下午4:47:23 |
|
|
|
* @date 2014-11-25-下午4:47:23 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected XLayoutContainer getCreatorWrapper(String widgetName){ |
|
|
|
protected XLayoutContainer getCreatorWrapper(String widgetName) { |
|
|
|
return new XWScaleLayout(); |
|
|
|
return new XWScaleLayout(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -155,12 +152,9 @@ public class XDateEditor extends XDirectWriteEditor { |
|
|
|
* 将当前对象添加到父容器中 |
|
|
|
* 将当前对象添加到父容器中 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param parentPanel 父容器组件 |
|
|
|
* @param parentPanel 父容器组件 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-11-25-下午4:57:55 |
|
|
|
* @date 2014-11-25-下午4:57:55 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight){ |
|
|
|
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight) { |
|
|
|
this.setSize(width, minHeight); |
|
|
|
this.setSize(width, minHeight); |
|
|
|
parentPanel.add(this); |
|
|
|
parentPanel.add(this); |
|
|
|
} |
|
|
|
} |
|
|
@ -177,9 +171,8 @@ public class XDateEditor extends XDirectWriteEditor { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* data属性改变触发其他操作 |
|
|
|
* data属性改变触发其他操作 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void firePropertyChange(){ |
|
|
|
public void firePropertyChange() { |
|
|
|
initFieldText(); |
|
|
|
initFieldText(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |