Browse Source

Pull request #11121: REPORT-87787 10.0新增启动报错,File not exists:/com/fr/design/images/platform/platform

Merge in DESIGN/design from ~JOHN.YING/design:release/10.0 to release/10.0

* commit '8dff071b0ad4a72dcdb62056da391b50dd127fd3':
  REPORT-87787 10.0新增启动报错,File not exists:/com/fr/design/images/platform/platform
security/10.0
John.Ying-应志浩 2 years ago
parent
commit
9a63acd2c5
  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

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 图标资源路径
*/
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)) {
this.putValue(Action.SMALL_ICON, null);
return;
}
this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource));
if (needDisable) {
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
}
}
public void setSmallIcon(Icon[] smallIcon, boolean white) {
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 ServicePlatformAction() {
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

Loading…
Cancel
Save