Browse Source

Merge pull request #11128 in DESIGN/design from feature/10.0 to feature/big-screen

* commit '7ee1a08b62a6fa21b26e9b1b3d3b65430bb5717f':
  REPORT-87779 FR10决策报表:不同tablayout会存在同名tab
  REPORT-87787 10.0新增启动报错,File not exists:/com/fr/design/images/platform/platform
feature/big-screen
superman 2 years ago
parent
commit
b4299388d8
  1. 12
      designer-base/src/main/java/com/fr/design/actions/UpdateAction.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java
  3. 10
      designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java
  4. 11
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  5. 13
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

12
designer-base/src/main/java/com/fr/design/actions/UpdateAction.java

@ -185,13 +185,25 @@ public abstract class UpdateAction extends ShortCut implements Action {
* @param resource 图标资源路径 * @param resource 图标资源路径
*/ */
public void setSmallIcon(String resource) { public void setSmallIcon(String resource) {
setSmallIcon(resource, true);
}
/**
* 使用传入资源url的方式设置Icon会自动设置_normal.svg然后通过needDisable参数判断是否需要自动设置_disable.svg
* 因为有些地方是不需要设置灰化图标的所以不存在灰化图标资源这边如果一并设置就会报错文件找不到
* @param resource
* @param needDisable
*/
public void setSmallIcon(String resource, boolean needDisable) {
if (StringUtils.equals(resource, StringUtils.EMPTY)) { if (StringUtils.equals(resource, StringUtils.EMPTY)) {
this.putValue(Action.SMALL_ICON, null); this.putValue(Action.SMALL_ICON, null);
return; return;
} }
this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource)); this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource));
if (needDisable) {
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED)); this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
} }
}
public void setSmallIcon(Icon[] smallIcon, boolean white) { public void setSmallIcon(Icon[] smallIcon, boolean white) {
this.putValue(Action.SMALL_ICON, smallIcon); this.putValue(Action.SMALL_ICON, smallIcon);

2
designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java

@ -20,7 +20,7 @@ import java.net.URI;
public class ServicePlatformAction extends UpdateAction { public class ServicePlatformAction extends UpdateAction {
public ServicePlatformAction() { public ServicePlatformAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title")); this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title"));
this.setSmallIcon("/com/fr/design/images/platform/platform"); this.setSmallIcon("/com/fr/design/images/platform/platform", false);
} }
@Override @Override

10
designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java

@ -61,6 +61,15 @@ public abstract class ModelUtil {
if (StringUtils.isEmpty(widgetName)) { if (StringUtils.isEmpty(widgetName)) {
widgetName = xCreator.createDefaultName(); widgetName = xCreator.createDefaultName();
} }
//先保存默认名字
return uniqueName(form, widgetName, duplicated);
}
public static String uniqueName(Form form, String widgetName) {
return uniqueName(form, widgetName, new HashSet<>());
}
private static String uniqueName(Form form, String widgetName, Set<String> duplicated) {
//先保存默认名字 //先保存默认名字
String raw = widgetName; String raw = widgetName;
int i = 0; int i = 0;
@ -74,5 +83,4 @@ public abstract class ModelUtil {
duplicated.add(widgetName); duplicated.add(widgetName);
return widgetName; return widgetName;
} }
} }

11
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -7,6 +7,7 @@ import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.beans.models.ModelUtil;
import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -21,6 +22,7 @@ import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.editors.DoubleEditor; import com.fr.design.mainframe.widget.editors.DoubleEditor;
import com.fr.form.main.Form;
import com.fr.form.ui.CardAddButton; import com.fr.form.ui.CardAddButton;
import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
@ -39,6 +41,7 @@ import com.fr.general.cardtag.DefaultTemplateStyle;
import com.fr.general.cardtag.TemplateStyle; import com.fr.general.cardtag.TemplateStyle;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -246,7 +249,13 @@ public class XWCardLayout extends XLayoutContainer {
*/ */
@Override @Override
protected void setWrapperName(XLayoutContainer parentPanel, String widgetName) { protected void setWrapperName(XLayoutContainer parentPanel, String widgetName) {
parentPanel.toData().setWidgetName("tablayout" + widgetName.replaceAll(createDefaultName(), "")); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
Form form = formDesigner.getTarget();
String name = "tablayout" + widgetName.replaceAll(createDefaultName(), StringUtils.EMPTY);
if (form.isNameExist(name)) {
name = ModelUtil.uniqueName(formDesigner.getTarget(), parentPanel.createDefaultName());
}
parentPanel.toData().setWidgetName(name);
} }
/** /**

13
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -52,7 +52,7 @@ import java.util.List;
* @date: 2014-12-9-下午9:59:31 * @date: 2014-12-9-下午9:59:31
*/ */
public class XWCardMainBorderLayout extends XWBorderLayout { public class XWCardMainBorderLayout extends XWBorderLayout {
private static final String DEFAULT_NAME = "tablayout";
private static final int BORDER_WIDTH = 4; private static final int BORDER_WIDTH = 4;
private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30); private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30);
@ -85,6 +85,17 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
return (WCardMainBorderLayout) super.toData(); return (WCardMainBorderLayout) super.toData();
} }
/**
* 获取默认名字
*
* @return 默认名
* @date 2014-11-25-下午6:22:40
*/
@Override
public String createDefaultName() {
return DEFAULT_NAME;
}
/** /**
* 添加标题区域 * 添加标题区域
* *

Loading…
Cancel
Save