Browse Source

REPORT-17656 决策报表报表块复制后值被清空

bugfix/10.0
Hades 6 years ago
parent
commit
63cf9064fe
  1. 16
      designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java
  2. 21
      designer-base/src/main/java/com/fr/design/i18n/Action.java
  3. 38
      designer-base/src/main/java/com/fr/design/i18n/ActionType.java
  4. 54
      designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java
  5. 47
      designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java
  6. 60
      designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java
  7. 22
      designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java
  8. 34
      designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java
  9. 17
      designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java
  10. 28
      designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java
  11. 28
      designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java
  12. 13
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  13. 2
      designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java
  14. 22
      designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java
  15. 15
      designer-realize/src/main/java/com/fr/start/SplashContext.java

16
designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java

@ -1,15 +1,15 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.i18n.ActionType;
import com.fr.design.i18n.LocaleCenter;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.util.Locale;
public class VideoAction extends UpdateAction
{
@ -19,14 +19,20 @@ public class VideoAction extends UpdateAction
this.setMenuKeySet(VIDEO);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/video.png"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/video.png"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
BrowseUtils.browser(LocaleCenter.getInstance().getLocaleAction().getUrls().get(ActionType.VIDEO));
String url;
if (GeneralContext.getLocale().equals(Locale.US)) {
url = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en");
} else {
url = CloudCenter.getInstance().acquireUrlByKind("bbs.video");
}
BrowseUtils.browser(url);
}
public static final MenuKeySet VIDEO = new MenuKeySet() {

21
designer-base/src/main/java/com/fr/design/i18n/Action.java

@ -1,21 +0,0 @@
package com.fr.design.i18n;
/**
* 包装一些动作
* @author Hades
* @date 2019/6/4
*/
public interface Action {
Action EMPTY_ACTION = new Action() {
@Override
public void todo() {
// do nothing
}
};
/**
* 具体动作
*/
void todo();
}

38
designer-base/src/main/java/com/fr/design/i18n/ActionType.java

@ -1,38 +0,0 @@
package com.fr.design.i18n;
/**
* 不同语言环境下的action
*
* @author Hades
* @date 2019/5/30
*/
public enum ActionType {
/**
* 视频教学
*/
VIDEO("video"),
/**
* 激活码
*/
ACTIVATION_CODE("activationCode"),
/**
* 帮助文档
*/
HELP_DOCUMENT("helpDocument"),
/**
* 论坛
*/
BBS("bbs");
private String description;
ActionType(String description) {
this.description = description;
}
}

54
designer-base/src/main/java/com/fr/design/i18n/LocaleCenter.java

@ -1,54 +0,0 @@
package com.fr.design.i18n;
import com.fr.design.DesignerEnvManager;
import com.fr.design.i18n.impl.ChinaLocaleAction;
import com.fr.design.i18n.impl.JapanLocaleAction;
import com.fr.design.i18n.impl.KoreaLocaleAction;
import com.fr.design.i18n.impl.TaiWanLocaleAction;
import com.fr.design.i18n.impl.USLocaleAction;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* 不同语言环境的动作管理
*
* @author Hades
* @date 2019/5/30
*/
public class LocaleCenter {
private Map<Locale, LocaleDifference> actionMap = new HashMap<Locale, LocaleDifference>();
private LocaleCenter() {
init();
}
private void init() {
actionMap.put(Locale.CHINA, new ChinaLocaleAction());
actionMap.put(Locale.US, new USLocaleAction());
actionMap.put(Locale.TAIWAN, new TaiWanLocaleAction());
actionMap.put(Locale.JAPAN, new JapanLocaleAction());
actionMap.put(Locale.KOREA, new KoreaLocaleAction());
}
private static class Holder {
private static final LocaleCenter INSTANCE = new LocaleCenter();
}
public static LocaleCenter getInstance() {
return Holder.INSTANCE;
}
public LocaleDifference getLocaleAction() {
Locale locale = GeneralContext.getLocale();
if (!ComparatorUtils.equals(locale, DesignerEnvManager.getEnvManager().getLanguage())) {
locale = DesignerEnvManager.getEnvManager().getLanguage();
}
LocaleDifference localeDifference = actionMap.get(locale);
return localeDifference == null ? actionMap.get(Locale.CHINA) : localeDifference;
}
}

47
designer-base/src/main/java/com/fr/design/i18n/LocaleDifference.java

@ -1,47 +0,0 @@
package com.fr.design.i18n;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* 国际化之间有不同表现的动作
*
* @author Hades
* @date 2019/5/30
*/
public interface LocaleDifference {
/**
* 返回该国际化所有的url
* @return url
*/
Map<ActionType, String> getUrls();
/**
* 哪些国际化需要执行该动作
* @param locales
*/
void doAction(Locale ...locales);
/**
* 构建具体的动作
* @param action
* @return
*/
LocaleDifference buildAction(Action action);
/**
* 返回设计器启动画面路径
* @return 路径
*/
String getSplashPath();
/**
* 对应的国际化
* @return
*/
Locale getLocale();
}

60
designer-base/src/main/java/com/fr/design/i18n/impl/AbstractDefaultLocaleAction.java

@ -1,60 +0,0 @@
package com.fr.design.i18n.impl;
import com.fr.design.i18n.Action;
import com.fr.design.i18n.LocaleDifference;
import com.fr.design.i18n.ActionType;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* 一些默认的实现
*
* @author Hades
* @date 2019/5/30
*/
public abstract class AbstractDefaultLocaleAction implements LocaleDifference {
protected EnumMap<ActionType, String> urls = new EnumMap<ActionType, String>(ActionType.class);
private Action action = Action.EMPTY_ACTION;
protected void init() {
urls.put(ActionType.BBS, CloudCenter.getInstance().acquireUrlByKind("bbs"));
urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video"));
urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"));
urls.put(ActionType.HELP_DOCUMENT, CloudCenter.getInstance().acquireUrlByKind("help.zh_CN.10"));
}
@Override
public Map<ActionType, String> getUrls() {
if (urls.isEmpty()) {
init();
}
return urls;
}
@Override
public void doAction(Locale ...locales) {
List<Locale> localeList = Arrays.asList(locales);
if (localeList.contains(this.getLocale())) {
action.todo();
}
}
@Override
public LocaleDifference buildAction(Action action) {
this.action = action;
return this;
}
@Override
public String getSplashPath() {
return "/com/fr/design/images/splash_10_en.gif";
}
}

22
designer-base/src/main/java/com/fr/design/i18n/impl/ChinaLocaleAction.java

@ -1,22 +0,0 @@
package com.fr.design.i18n.impl;
import java.util.Locale;
/**
* 简体中文环境具体的表现动作
*
* @author Hades
* @date 2019/5/30
*/
public class ChinaLocaleAction extends AbstractDefaultLocaleAction {
@Override
public String getSplashPath() {
return "/com/fr/design/images/splash_10.gif";
}
@Override
public Locale getLocale() {
return Locale.CHINA;
}
}

34
designer-base/src/main/java/com/fr/design/i18n/impl/JapanLocaleAction.java

@ -1,34 +0,0 @@
package com.fr.design.i18n.impl;
import com.fr.design.i18n.ActionType;
import com.fr.general.CloudCenter;
import java.util.Locale;
/**
* 日文环境具体的表现动作
*
* @author Hades
* @date 2019/5/30
*/
public class JapanLocaleAction extends AbstractDefaultLocaleAction {
@Override
protected void init() {
super.init();
urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"));
}
@Override
public String getSplashPath() {
return "/com/fr/design/images/splash_10_jp.gif";
}
@Override
public Locale getLocale() {
return Locale.JAPAN;
}
}

17
designer-base/src/main/java/com/fr/design/i18n/impl/KoreaLocaleAction.java

@ -1,17 +0,0 @@
package com.fr.design.i18n.impl;
import java.util.Locale;
/**
* 韩文环境具体的表现动作
*
* @author Hades
* @date 2019/5/30
*/
public class KoreaLocaleAction extends AbstractDefaultLocaleAction {
@Override
public Locale getLocale() {
return Locale.KOREA;
}
}

28
designer-base/src/main/java/com/fr/design/i18n/impl/TaiWanLocaleAction.java

@ -1,28 +0,0 @@
package com.fr.design.i18n.impl;
import com.fr.design.i18n.ActionType;
import com.fr.general.CloudCenter;
import java.util.List;
import java.util.Locale;
/**
* 繁体中文具体的表现动作
*
* @author Hades
* @date 2019/5/30
*/
public class TaiWanLocaleAction extends AbstractDefaultLocaleAction {
@Override
protected void init() {
super.init();
urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_TW"));
urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"));
}
@Override
public Locale getLocale() {
return Locale.TAIWAN;
}
}

28
designer-base/src/main/java/com/fr/design/i18n/impl/USLocaleAction.java

@ -1,28 +0,0 @@
package com.fr.design.i18n.impl;
import com.fr.design.i18n.ActionType;
import com.fr.general.CloudCenter;
import java.util.Locale;
/**
* 英文环境具体的表现动作
*
* @author Hades
* @date 2019/5/30
*/
public class USLocaleAction extends AbstractDefaultLocaleAction {
@Override
protected void init() {
super.init();
urls.put(ActionType.VIDEO, CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"));
urls.put(ActionType.HELP_DOCUMENT, CloudCenter.getInstance().acquireUrlByKind("help.en_US.10"));
urls.put(ActionType.ACTIVATION_CODE, CloudCenter.getInstance().acquireUrlByKind("frlogin.en"));
}
@Override
public Locale getLocale() {
return Locale.US;
}
}

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

@ -47,8 +47,6 @@ import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.gui.imenu.UIMenuBar;
import com.fr.design.gui.itoolbar.UILargeToolbar;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Action;
import com.fr.design.i18n.LocaleCenter;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.ToolBarNewTemplatePane;
import com.fr.design.menu.MenuDef;
@ -534,7 +532,7 @@ public abstract class ToolBarMenuDock {
* @return 社区菜单的子菜单
*/
public ShortCut[] createCommunityShortCuts() {
final java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new BBSAction());
shortCuts.add(new VideoAction());
shortCuts.add(new TutorialAction());
@ -545,12 +543,9 @@ public abstract class ToolBarMenuDock {
shortCuts.add(new CusDemandAction());
shortCuts.add(new CenterAction());
shortCuts.add(new SignAction());
LocaleCenter.getInstance().getLocaleAction().buildAction(new Action() {
@Override
public void todo() {
shortCuts.add(new FacebookFansAction());
}
}).doAction(Locale.TAIWAN);
if (Locale.TAIWAN.equals(GeneralContext.getLocale())) {
shortCuts.add(new FacebookFansAction());
}
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
}

2
designer-realize/src/main/java/com/fr/grid/GridCornerMouseHandler.java

@ -29,6 +29,8 @@ public class GridCornerMouseHandler extends MouseInputAdapter {
private void doSelectAll() {
ElementCasePane reportPane = this.gridCorner.getElementCasePane();
// 全选时,停止编辑状态
reportPane.getGrid().stopEditing();
ColumnRow lastColumnRow = GridUtils.getAdjustLastColumnRowOfReportPane(reportPane);
reportPane.setSelection(new CellSelection(0, 0, lastColumnRow.getColumn(), lastColumnRow.getRow()));

22
designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java

@ -7,11 +7,11 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.DescriptionTextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.ActionType;
import com.fr.design.i18n.LocaleCenter;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import javax.swing.*;
@ -31,6 +31,11 @@ public class CollectUserInformationDialog extends UIDialog {
private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000;
private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn");
private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en");
private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw");
private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp");
private UITextField keyTextField;
private ActionListener actionListener = new ActionListener() {
@ -124,8 +129,19 @@ public class CollectUserInformationDialog extends UIDialog {
private void getKeyAction() {
Locale locale = GeneralContext.getLocale();
String url = EN_LOGIN_HTML;
if (ComparatorUtils.equals(locale, Locale.TAIWAN)) {
url = TW_LOGIN_HTML;
}
if (ComparatorUtils.equals(locale, Locale.CHINA)) {
url = CN_LOGIN_HTML;
}
if (ComparatorUtils.equals(locale, Locale.JAPAN)) {
url = JP_LOGIN_HTML;
}
try {
Desktop.getDesktop().browse(new URI(LocaleCenter.getInstance().getLocaleAction().getUrls().get(ActionType.ACTIVATION_CODE)));
Desktop.getDesktop().browse(new URI(url));
} catch (Exception ignored) {
}

15
designer-realize/src/main/java/com/fr/start/SplashContext.java

@ -1,6 +1,6 @@
package com.fr.start;
import com.fr.design.i18n.LocaleCenter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
public class SplashContext {
public static final String SPLASH_PATH = getSplashPath();
public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf('/') + 1);
public static final String SPLASH_CACHE_NAME = SPLASH_PATH.substring(SPLASH_PATH.lastIndexOf("/") + 1);
private static final int FETCH_ONLINE_MAX_TIMES = 50;
private static final SplashContext SPLASH_CONTEXT = new SplashContext();
@ -166,6 +166,13 @@ public class SplashContext {
}
private static String getSplashPath() {
return LocaleCenter.getInstance().getLocaleAction().getSplashPath();
Locale locale = DesignerEnvManager.getEnvManager().getLanguage();
if (Locale.US.equals(locale) || Locale.KOREA.equals(locale) || Locale.TAIWAN.equals(locale)) {
return "/com/fr/design/images/splash_10_en.gif";
} else if (Locale.JAPAN.equals(locale)) {
return "/com/fr/design/images/splash_10_jp.gif";
} else {
return "/com/fr/design/images/splash_10.gif";
}
}
}
}
Loading…
Cancel
Save