Browse Source

Pull request #1946: REPORT-35463 添加BUG需求反馈、技术支持菜单项,英文帮助菜单新增技术支持,韩文、日文帮助菜单新增帮助文档,台湾社区菜单BUG 与需求反馈合为一个,新增技术支持菜单项 && REPORT-23260 将原本的全选框替换为三态的CheckBox,并在三态的CheckBox中添加状态监听器

Merge in DESIGN/design from ~YUAN.WANG/design:release/10.0 to release/10.0

* commit 'cc9878b8ff5f92054dad3b9a9f8bcfa90ff884e4':
  REPORT-35463 修改SaveSomeTemplatePane的换行格式
  REPORT-35463 使用LocaleAction包装action
  REPORT-35463 添加BUG需求反馈、技术支持菜单项,英文帮助菜单新增技术支持,韩文、日文帮助菜单新增帮助文档,台湾社区菜单BUG 与需求反馈合为一个,新增技术支持菜单项
  REPORT-23260 将原本的全选框替换为三态的CheckBox,并在三态的CheckBox中添加状态监听器
feature/big-screen
Yuan.Wang 4 years ago
parent
commit
d1f9702a17
  1. 48
      designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java
  2. 49
      designer-base/src/main/java/com/fr/design/actions/community/TechSupportAction.java
  3. 9
      designer-base/src/main/java/com/fr/design/event/StateChangeListener.java
  4. 245
      designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java
  5. 20
      designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/TristateCheckBox.java
  6. 29
      designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java
  7. 107
      designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java
  8. 30
      designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java
  9. 57
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  10. BIN
      designer-base/src/main/resources/com/fr/design/images/bbs/support.png

48
designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java

@ -0,0 +1,48 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.locale.impl.BugNeedMark;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
* @Author: Yuan.Wang
* @Date: 2020/7/28
*/
public class BugNeedAction extends UpdateAction {
public BugNeedAction() {
this.setMenuKeySet(BugAndNeed);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
LocaleMark<String> localeMark = LocaleCenter.getMark(BugNeedMark.class);
BrowseUtils.browser(localeMark.getValue());
}
public static final MenuKeySet BugAndNeed = new MenuKeySet() {
@Override
public char getMnemonic() {
return 0;
}
@Override
public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_BugAndNeed");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

49
designer-base/src/main/java/com/fr/design/actions/community/TechSupportAction.java

@ -0,0 +1,49 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.locale.impl.TechSupportMark;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
* @Author: Yuan.Wang
* @Date: 2020/7/28
*/
public class TechSupportAction extends UpdateAction {
public TechSupportAction() {
this.setMenuKeySet(TechSupport);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/support.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
LocaleMark<String> localeMark = LocaleCenter.getMark(TechSupportMark.class);
String str=localeMark.getValue();
BrowseUtils.browser(localeMark.getValue());
}
public static final MenuKeySet TechSupport = new MenuKeySet() {
@Override
public char getMnemonic() {
return 0;
}
@Override
public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_TechSupport");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

9
designer-base/src/main/java/com/fr/design/event/StateChangeListener.java

@ -0,0 +1,9 @@
package com.fr.design.event;
/**
* @Author: Yuan.Wang
* @Date: 2020/7/29
*/
public interface StateChangeListener {
public void stateChange();
}

245
designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java

File diff suppressed because one or more lines are too long

20
designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/TristateCheckBox.java

@ -1,6 +1,7 @@
package com.fr.design.gui.itree.checkboxtree;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.StateChangeListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
@ -75,6 +76,8 @@ public class TristateCheckBox extends UICheckBox {
private final TristateDecorator model;
public StateChangeListener stateChangeListener;
public TristateCheckBox(String text, Icon icon, State initial) {
super(text, icon);
setUI(new TristateCheckBoxUI());
@ -83,7 +86,7 @@ public class TristateCheckBox extends UICheckBox {
@Override
public void mousePressed(MouseEvent e) {
grabFocus();
model.setState(getNextState(model.getState()));
setState(getNextState(model.getState()));
}
});
// Reset the keyboard action map
@ -92,7 +95,7 @@ public class TristateCheckBox extends UICheckBox {
@Override
public void actionPerformed(ActionEvent e) {
grabFocus();
model.setState(getNextState(model.getState()));
setState(getNextState(model.getState()));
}
});
map.put("released", null);
@ -125,12 +128,20 @@ public class TristateCheckBox extends UICheckBox {
public void addMouseListener(MouseListener l) {
}
public void addStateChangeListener(StateChangeListener stateChangeListener) {
this.stateChangeListener=stateChangeListener;
}
/**
* Set the new state to either SELECTED, NOT_SELECTED or
* DO_NOT_CARE. If state == null, it is treated as DO_NOT_CARE.
*/
public void setState(State state) {
State old = getState();
model.setState(state);
if (old != state) {
fireBoxStateChanged();
}
}
/**
@ -141,6 +152,11 @@ public class TristateCheckBox extends UICheckBox {
return model.getState();
}
public void fireBoxStateChanged() {
if (stateChangeListener != null) {
stateChangeListener.stateChange();
}
}
/**
* Exactly which Design Pattern is this? Is it an Adapter,

29
designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java

@ -0,0 +1,29 @@
package com.fr.design.locale.impl;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @Author: Yuan.Wang
* @Date: 2020/7/29
*/
public class BugNeedMark implements LocaleMark<String> {
private Map<Locale, String> map = new HashMap<>();
private static final String TW_BUG_AND_NEEDS = CloudCenter.getInstance().acquireUrlByKind("bbs.bug.needs.zh_TW");
public BugNeedMark() {
map.put(Locale.TAIWAN, TW_BUG_AND_NEEDS);
}
@Override
public String getValue() {
String result = map.get(GeneralContext.getLocale());
return result == null ? TW_BUG_AND_NEEDS : result;
}
}

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;
}
}
}

30
designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java

@ -0,0 +1,30 @@
package com.fr.design.locale.impl;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.locale.LocaleMark;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* @Author: Yuan.Wang
* @Date: 2020/7/29
*/
public class TechSupportMark implements LocaleMark<String> {
private Map<Locale, String> map = new HashMap<>();
private static final String EN_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.en_US");
private static final String TW_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.zh_TW");
public TechSupportMark() {
map.put(Locale.US, EN_TECH_SUPPORT);
map.put(Locale.TAIWAN, TW_TECH_SUPPORT);
}
@Override
public String getValue() {
String result = map.get(GeneralContext.getLocale());
return result == null ? EN_TECH_SUPPORT : result;
}
}

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

@ -11,12 +11,14 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
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;
@ -529,11 +531,30 @@ public abstract class ToolBarMenuDock {
*/
public ShortCut[] createHelpShortCuts() {
final java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
// 英文,把 video 和帮助文档放到 Help 下面
if (GeneralContext.getLocale().equals(Locale.US)) {
Locale locale = GeneralContext.getLocale();
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());
@ -577,8 +598,40 @@ public abstract class ToolBarMenuDock {
shortCuts.add(SeparatorDef.DEFAULT);
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);

BIN
designer-base/src/main/resources/com/fr/design/images/bbs/support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Loading…
Cancel
Save