Browse Source

REPORT-38778 去掉社区和模板商城的小红点,修正使用工厂类引起的bug,修改预装组件的逻辑

feature/big-screen
Yuan.Wang 4 years ago
parent
commit
1108edcbf3
  1. 9
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  2. 6
      designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java
  3. 6
      designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java
  4. 11
      designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java
  5. 11
      designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java

9
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -54,9 +54,7 @@ import com.fr.design.mainframe.ToolBarNewTemplatePane;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.SnapChatMenuDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.notification.SnapChatAllTypes;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.remote.action.RemoteDesignAuthManagerAction;
import com.fr.design.update.actions.SoftwareUpdateAction;
@ -655,11 +653,8 @@ public abstract class ToolBarMenuDock {
}
public MenuDef createCommunityMenuDef() {
MenuDef menuDef = new SnapChatMenuDef(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"),
'C',
SnapChatAllTypes.Menu.BBS);
MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"), 'C');
ShortCut[] otherCommunityShortCuts = createCommunityShortCuts();
for (ShortCut shortCut : otherCommunityShortCuts) {
menuDef.addShortCut(shortCut);

6
designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java

@ -2,7 +2,6 @@ package com.fr.design.menu;
import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.gui.imenu.UIScrollMenu;
import com.fr.design.notification.AbstractSnapChat;
import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatConfig;
import com.fr.design.notification.SnapChatFactory;
@ -24,21 +23,24 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat {
private SnapChatKey uniqueKey;
private SnapChatMenuUI menuUI = new SnapChatMenuUI(this);
private SnapChat snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
private SnapChat snapChat ;
public SnapChatMenuDef(String name, SnapChatKey uniqueKey) {
super(name);
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
}
public SnapChatMenuDef(Boolean rePaint, SnapChatKey uniqueKey) {
super(rePaint);
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
}
public SnapChatMenuDef(String name, char mnemonic, SnapChatKey uniqueKey) {
super(name, mnemonic);
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
}
@Override

6
designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java

@ -2,9 +2,7 @@ package com.fr.design.menu;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.notification.AbstractSnapChat;
import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatConfig;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.notification.SnapChatKey;
@ -16,11 +14,11 @@ import java.awt.event.ActionEvent;
public abstract class SnapChatUpdateAction extends UpdateAction implements SnapChat {
private SnapChatKey uniqueKey;
private SnapChat snapChat = SnapChatFactory.createSnapChat(false, uniqueKey);
private SnapChat snapChat ;
public SnapChatUpdateAction(SnapChatKey uniqueKey) {
this.uniqueKey = uniqueKey;
snapChat = SnapChatFactory.createSnapChat(false, uniqueKey);
}
@Override

11
designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java

@ -1,11 +1,17 @@
package com.fr.design.notification;
import com.fr.plugin.context.PluginContext;
/**
* @Author: Yuan.Wang
* @Date: 2020/10/10
*/
public class SnapChatFactory {
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) {
return createSnapChat(defaultStatus, snapChatKey, null);
}
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey, PluginContext context) {
return new AbstractSnapChat() {
@Override
public boolean defaultStatus() {
@ -16,6 +22,11 @@ public class SnapChatFactory {
public SnapChatKey key() {
return snapChatKey;
}
@Override
public String calcKey() {
return context == null ? key().calc() : key().calc(context);
}
};
}
}

11
designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java

@ -1,9 +1,18 @@
package com.fr.design.notification;
import com.fr.plugin.context.PluginContext;
/**
* created by Harrison on 2020/03/16
**/
public interface SnapChatKey {
String calc();
/**
* 插件刚被安装时不能通过PluginContexts.getContext()方法获取插件上下文因此加一个接口
*/
default String calc(PluginContext context) {
throw new UnsupportedOperationException();
}
}

Loading…
Cancel
Save