Browse Source

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

在UIConstants中添加一个EMPTY_ICON代表无图标,然后在UpdateAction的setSmallIcon方法中对传过来的资源路径进行判断,如果为"",就把null作为Icon
的Value值put到map中,与之前的逻辑一致
feature/big-screen
Yvan 4 years ago
parent
commit
1c836a495e
  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. 6
      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. 2
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  6. 2
      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_disabled.svg或者a_pressed.svg缺失则不会被设置成灰化状态或者按压状态图标
* 如果a_normal.svg缺失则会读到a.png这也就不是一个SVGIcon了 * 如果a_normal.svg缺失则会读到a.png这也就不是一个SVGIcon了
* 如果连 a.png 也不存在那么这个action的图标就是空白的 * 如果连 a.png 也不存在那么这个action的图标就是空白的
* @param resource *
* 如果想让这个Action没有图标可以传入""
* @param resource 图标资源路径
*/ */
public void setSmallIcon(String 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(Action.SMALL_ICON, IconUtils.readIcon(resource));
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED)); 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; package com.fr.design.constants;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.base.svg.SVGIcon;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.border.Border; import javax.swing.border.Border;
import java.awt.BasicStroke; import java.awt.BasicStroke;
import java.awt.Color; 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 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 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_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"); public static final Image APPFIT_V1 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png");

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

@ -125,7 +125,7 @@ public class SQLEditPane extends RSyntaxTextArea {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name"));
this.setMnemonic('N'); this.setMnemonic('N');
this.setSmallIcon((Icon) null); this.setSmallIcon(UIConstants.EMPTY_ICON);
} }
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -146,7 +146,7 @@ public class SQLEditPane extends RSyntaxTextArea {
this.setName("SELECT *"); this.setName("SELECT *");
this.setMnemonic('s'); this.setMnemonic('s');
this.setSmallIcon((Icon) null); this.setSmallIcon(UIConstants.EMPTY_ICON);
} }
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -165,7 +165,7 @@ public class SQLEditPane extends RSyntaxTextArea {
this.setName("CALL PROCEDURE "); this.setName("CALL PROCEDURE ");
this.setMnemonic('s'); this.setMnemonic('s');
this.setSmallIcon((Icon) null); this.setSmallIcon(UIConstants.EMPTY_ICON);
} }
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {

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

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

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

@ -49,7 +49,7 @@ public class CellRichTextEditor extends CellQuickEditor {
protected void refreshDetails() { protected void refreshDetails() {
RichTextCellAction subReportCellAction = new RichTextCellAction(tc); RichTextCellAction subReportCellAction = new RichTextCellAction(tc);
subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
subReportCellAction.setSmallIcon((Icon) null); subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON);
richTextButton.setAction(subReportCellAction); richTextButton.setAction(subReportCellAction);
} }

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

@ -45,7 +45,7 @@ public class CellSubReportEditor extends CellQuickEditor {
protected void refreshDetails() { protected void refreshDetails() {
SubReportCellAction subReportCellAction = new SubReportCellAction(tc); SubReportCellAction subReportCellAction = new SubReportCellAction(tc);
subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
subReportCellAction.setSmallIcon((Icon) null); subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON);
subReportButton.setAction(subReportCellAction); subReportButton.setAction(subReportCellAction);
} }

Loading…
Cancel
Save