Browse Source

Pull request #3278: REPORT-46683 【冒烟】数据库查询,选中表并拖动的时候,弹窗变化了

Merge in DESIGN/design from ~YVAN/design:REPORT-46683 to release/10.0

* commit '1c836a495ecf67632ce873bef2731e4f560c81a2':
  REPORT-46683 【冒烟】数据库查询,选中表并拖动的时候,弹窗变化了 在UIConstants中添加一个EMPTY_ICON代表无图标,然后在UpdateAction的setSmallIcon方法中对传过来的资源路径进行判断,如果为"",就把null作为Icon 的Value值put到map中,与之前的逻辑一致
  REPORT-46683 【冒烟】数据库查询,选中表并拖动的时候,弹窗变化了 SQLEitPane的分隔符误传成CR了,改为LF重新上传
  REPORT-46683 【冒烟】数据库查询,选中表并拖动的时候,弹窗变化了 【问题原因】之前做迭代任务的时候重载了UpdateAction的setSmallIcon方法,然后原先设计器中的setSmallIcon(null)就会报错,当时想错了,以为不能传null,就给改成了UIConstant.BLACK_ICON,其实是因为重载了方法后,传入null,jdk不能判断是调用哪个方法,然后导致了一些场景里本来没图标,变成了一个空白的占位图标,因此显示发生了变化 【改动思路】把迭代任务中由null改为BLACK_ICON的地方,回退为null,再为这个null加上个Icon类型,以便于绑定方法,且与此前逻辑保持一致
feature/big-screen
ju|剧浩宇 4 years ago
parent
commit
620e8e0666
  1. 8
      designer-base/src/main/java/com/fr/design/actions/UpdateAction.java
  2. 4
      designer-base/src/main/java/com/fr/design/constants/UIConstants.java
  3. 195
      designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java
  4. 2
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  5. 3
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  6. 3
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

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

@ -180,9 +180,15 @@ public abstract class UpdateAction extends ShortCut implements Action {
* 如果a_disabled.svg或者a_pressed.svg缺失则不会被设置成灰化状态或者按压状态图标
* 如果a_normal.svg缺失则会读到a.png这也就不是一个SVGIcon了
* 如果连 a.png 也不存在那么这个action的图标就是空白的
* @param resource
*
* 如果想让这个Action没有图标可以传入""
* @param resource 图标资源路径
*/
public void setSmallIcon(String resource) {
if (StringUtils.equals(resource, StringUtils.EMPTY)) {
this.putValue(Action.SMALL_ICON, null);
return;
}
this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource));
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
}

4
designer-base/src/main/java/com/fr/design/constants/UIConstants.java

@ -4,11 +4,14 @@
package com.fr.design.constants;
import com.fr.base.svg.IconUtils;
import com.fr.base.svg.SVGIcon;
import com.fr.general.IOUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.border.Border;
import java.awt.BasicStroke;
import java.awt.Color;
@ -26,6 +29,7 @@ public interface UIConstants {
public static final Icon CPT_ICON = IOUtils.readIcon("/com/fr/base/images/oem/cpt.png");
public static final Icon BLACK_ICON = IOUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final String EMPTY_ICON = StringUtils.EMPTY;
public static final Image APPFIT_V0 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png");
public static final Image APPFIT_V1 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png");

195
designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java

File diff suppressed because one or more lines are too long

2
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -260,7 +260,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
condition.setEditingComponent(tc);
}
//丢掉icon,修改按钮名称为编辑
condition.setSmallIcon(UIConstants.BLACK_ICON);
condition.setSmallIcon(UIConstants.EMPTY_ICON);
condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit"));
conditionUIButton = new UIButton(condition);
Component[][] components = new Component[][]{

3
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -48,7 +49,7 @@ public class CellRichTextEditor extends CellQuickEditor {
protected void refreshDetails() {
RichTextCellAction subReportCellAction = new RichTextCellAction(tc);
subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON);
subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON);
richTextButton.setAction(subReportCellAction);
}

3
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -44,7 +45,7 @@ public class CellSubReportEditor extends CellQuickEditor {
protected void refreshDetails() {
SubReportCellAction subReportCellAction = new SubReportCellAction(tc);
subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON);
subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON);
subReportButton.setAction(subReportCellAction);
}

Loading…
Cancel
Save