Browse Source

REPORT-35463 使用LocaleAction包装action

feature/big-screen
Yuan.Wang 4 years ago
parent
commit
9f8e753b18
  1. 107
      designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java
  2. 85
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

107
designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java

@ -10,6 +10,7 @@ import java.util.Set;
* 某些国际化环境支持的操作
* 需要增加/删除支持的语言 统一在这里修改 无须改动业务代码
* 后续有新的不同语言下的差异操作 添加新的枚举
*
* @author Hades
* @date 2019/6/24
*/
@ -50,6 +51,112 @@ public enum SupportLocaleImpl implements SupportLocale {
set.add(Locale.KOREA);
return set;
}
},
/**
* BUG反馈
*/
BUG {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.CHINA);
set.add(Locale.US);
set.add(Locale.JAPAN);
set.add(Locale.KOREA);
return set;
}
},
/**
* 需求反馈
*/
NEED {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.CHINA);
set.add(Locale.US);
set.add(Locale.JAPAN);
set.add(Locale.KOREA);
return set;
}
},
/**
* BUG需求反馈
*/
BUG_AND_NEED {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.TAIWAN);
return set;
}
},
/**
* 视频
*/
VIDEO {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.US);
return set;
}
},
/**
* 技术支持-帮助菜单下
*/
TECH_SUPPORT_HELP {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.US);
return set;
}
},
/**
* 技术支持-社区菜单下
*/
TECH_SUPPORT_COMMUNITY {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.TAIWAN);
return set;
}
},
/**
* 帮助文档-帮助菜单下
*/
TUTORIAL_HELP {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.CHINA);
set.add(Locale.TAIWAN);
return set;
}
},
/**
* 帮助文档-社区菜单下
*/
TUTORIAL_COMMUNITY {
@Override
public Set<Locale> support() {
Set<Locale> set = new HashSet<Locale>();
set.add(Locale.US);
set.add(Locale.KOREA);
set.add(Locale.JAPAN);
return set;
}
}
}

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

@ -9,7 +9,17 @@ import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.*;
import com.fr.design.actions.community.BBSAction;
import com.fr.design.actions.community.BugAction;
import com.fr.design.actions.community.BugNeedAction;
import com.fr.design.actions.community.CenterAction;
import com.fr.design.actions.community.FacebookFansAction;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.TechSolutionAction;
import com.fr.design.actions.community.TechSupportAction;
import com.fr.design.actions.community.VideoAction;
import com.fr.design.actions.file.CloseCurrentTemplateAction;
import com.fr.design.actions.file.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef;
@ -523,15 +533,28 @@ public abstract class ToolBarMenuDock {
final java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
Locale locale = GeneralContext.getLocale();
// 英文,把Video和技术支持放到 Help 下面
if (locale.equals(Locale.US)) {
shortCuts.add(new VideoAction());
shortCuts.add(new TechSupportAction());
}
// 英文、韩文、日文,把帮助文档放到 Help 下面
if (locale.equals(Locale.US) || locale.equals(Locale.KOREA) || locale.equals(Locale.JAPAN)) {
shortCuts.add(new TutorialAction());
}
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new VideoAction());
}
}, SupportLocaleImpl.VIDEO);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new TutorialAction());
}
}, SupportLocaleImpl.TUTORIAL_HELP);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new TechSupportAction());
}
}, SupportLocaleImpl.TECH_SUPPORT_HELP);
//远程不使用更新升级,产品演示
if (WorkContext.getCurrent().isLocal()) {
shortCuts.add(new WebDemoAction());
@ -575,14 +598,40 @@ public abstract class ToolBarMenuDock {
shortCuts.add(SeparatorDef.DEFAULT);
//台湾,将BUG和需求合并成一个,同时新增技术支持
if (GeneralContext.getLocale().equals(Locale.TAIWAN)) {
shortCuts.add(new TechSupportAction());
shortCuts.add(new BugNeedAction());
} else {
shortCuts.add(new BugAction());
shortCuts.add(new NeedAction());
}
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new BugAction());
}
}, SupportLocaleImpl.BUG);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new NeedAction());
}
}, SupportLocaleImpl.NEED);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new BugNeedAction());
}
}, SupportLocaleImpl.BUG_AND_NEED);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new TechSupportAction());
}
}, SupportLocaleImpl.TECH_SUPPORT_COMMUNITY);
LocaleCenter.buildAction(new LocaleAction() {
@Override
public void execute() {
shortCuts.add(new TutorialAction());
}
}, SupportLocaleImpl.TUTORIAL_COMMUNITY);
shortCuts.add(SeparatorDef.DEFAULT);

Loading…
Cancel
Save