Yuan.Wang
4 years ago
6 changed files with 174 additions and 14 deletions
@ -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; |
||||
} |
||||
}; |
||||
} |
@ -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; |
||||
} |
||||
}; |
||||
} |
@ -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; |
||||
} |
||||
|
||||
} |
@ -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; |
||||
} |
||||
} |
After Width: | Height: | Size: 385 B |
Loading…
Reference in new issue