|
|
@ -11,6 +11,7 @@ import com.fr.form.ui.WidgetTitle; |
|
|
|
import com.fr.form.ui.WidgetValue; |
|
|
|
import com.fr.form.ui.WidgetValue; |
|
|
|
import com.fr.form.ui.container.WTitleLayout; |
|
|
|
import com.fr.form.ui.container.WTitleLayout; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
import com.fr.general.TextFetcher; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
@ -41,7 +42,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initStyle() { |
|
|
|
protected void initStyle() { |
|
|
|
LayoutBorderStyle style = toData().getBorderStyle(); |
|
|
|
TextFetcher style = toData().getBorderStyle(); |
|
|
|
initBorderStyle(); |
|
|
|
initBorderStyle(); |
|
|
|
if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { |
|
|
|
if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { |
|
|
|
initTitleStyle(style); |
|
|
|
initTitleStyle(style); |
|
|
@ -52,7 +53,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ |
|
|
|
|
|
|
|
|
|
|
|
// 边框默认值设为NONE,不然像scalelayout这种只用默认边框的会不显示边框
|
|
|
|
// 边框默认值设为NONE,不然像scalelayout这种只用默认边框的会不显示边框
|
|
|
|
protected void initBorderStyle() { |
|
|
|
protected void initBorderStyle() { |
|
|
|
LayoutBorderStyle style = toData().getBorderStyle(); |
|
|
|
TextFetcher style = toData().getBorderStyle(); |
|
|
|
if (style != null && style.getBorder() != Constants.LINE_NONE) { |
|
|
|
if (style != null && style.getBorder() != Constants.LINE_NONE) { |
|
|
|
this.setBorder(new UIRoundedBorder(style.getBorder(), style.getColor(), style.getBorderRadius())); |
|
|
|
this.setBorder(new UIRoundedBorder(style.getBorder(), style.getColor(), style.getBorderRadius())); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -74,8 +75,8 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ |
|
|
|
* 设置样式为标题样式时,对应组件加上标题 |
|
|
|
* 设置样式为标题样式时,对应组件加上标题 |
|
|
|
* @param style 样式 |
|
|
|
* @param style 样式 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void initTitleStyle(LayoutBorderStyle style){ |
|
|
|
protected void initTitleStyle(TextFetcher style){ |
|
|
|
if (style.getTitle() == null) { |
|
|
|
if (style.getTextObject() == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
XWTitleLayout parent = (XWTitleLayout) this.getParent(); |
|
|
|
XWTitleLayout parent = (XWTitleLayout) this.getParent(); |
|
|
@ -100,13 +101,13 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新标题控件所有的样式 |
|
|
|
* 更新标题控件所有的样式 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void updateTitleWidgetStyle(Label title, LayoutBorderStyle style) { |
|
|
|
private void updateTitleWidgetStyle(Label title, TextFetcher style) { |
|
|
|
//标题的边框样式目前是取对应的控件的边框样式
|
|
|
|
//标题的边框样式目前是取对应的控件的边框样式
|
|
|
|
title.setBorder(style.getBorder()); |
|
|
|
title.setBorder(style.getBorder()); |
|
|
|
title.setColor(style.getColor()); |
|
|
|
title.setColor(style.getColor()); |
|
|
|
// title.setCorner(style.isCorner());
|
|
|
|
// title.setCorner(style.isCorner());
|
|
|
|
|
|
|
|
|
|
|
|
WidgetTitle wTitle = style.getTitle(); |
|
|
|
WidgetTitle wTitle = WidgetTitle.as(style); |
|
|
|
//设置成随机不重复的, 不然都用一个名字的话, 联动只能联动一个
|
|
|
|
//设置成随机不重复的, 不然都用一个名字的话, 联动只能联动一个
|
|
|
|
title.setWidgetName(wTitle.TITLE_NAME_INDEX + this.toData().getWidgetName()); |
|
|
|
title.setWidgetName(wTitle.TITLE_NAME_INDEX + this.toData().getWidgetName()); |
|
|
|
title.setWidgetValue(getTitleValue(wTitle)); |
|
|
|
title.setWidgetValue(getTitleValue(wTitle)); |
|
|
|