|
|
|
@ -11,6 +11,7 @@ import com.fr.design.actions.UpdateAction;
|
|
|
|
|
import com.fr.design.actions.community.*; |
|
|
|
|
import com.fr.design.actions.file.*; |
|
|
|
|
import com.fr.design.actions.help.AboutAction; |
|
|
|
|
import com.fr.design.actions.help.AlphaFine.AlphafineAction; |
|
|
|
|
import com.fr.design.actions.help.TutorialAction; |
|
|
|
|
import com.fr.design.actions.help.WebDemoAction; |
|
|
|
|
import com.fr.design.actions.server.*; |
|
|
|
@ -36,10 +37,8 @@ import com.fr.stable.ProductConstants;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.awt.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Locale; |
|
|
|
|
import java.util.Set; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author richer |
|
|
|
@ -56,6 +55,7 @@ public abstract class ToolBarMenuDock {
|
|
|
|
|
public static final int PANLE_HEIGNT = 26; |
|
|
|
|
private MenuDef[] menus; |
|
|
|
|
private ToolBarDef toolBarDef; |
|
|
|
|
private ArrayList<UpdateAction> shortCuts; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 更新菜单 |
|
|
|
@ -144,10 +144,35 @@ public abstract class ToolBarMenuDock {
|
|
|
|
|
// 添加社区菜单
|
|
|
|
|
addCommunityMenuDef(menuList); |
|
|
|
|
|
|
|
|
|
// 添加全部UpdateAction到actionmanager中
|
|
|
|
|
getAllUpdateActions(menuList); |
|
|
|
|
UpdateActionManager.getUpdateActionManager().setUpdateActions(shortCuts); |
|
|
|
|
|
|
|
|
|
return menuList.toArray(new MenuDef[menuList.size()]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void addCommunityMenuDef(java.util.List<MenuDef> menuList){ |
|
|
|
|
private List<UpdateAction> getAllUpdateActions(List<MenuDef> menuList) { |
|
|
|
|
shortCuts = new ArrayList<>(); |
|
|
|
|
for (MenuDef menuDef : menuList) { |
|
|
|
|
addUpdateActionToList(menuDef); |
|
|
|
|
} |
|
|
|
|
return shortCuts; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void addUpdateActionToList(MenuDef menuDef) { |
|
|
|
|
if (menuDef instanceof OpenRecentReportMenuDef) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
for (ShortCut shortCut : menuDef.getShortcutList()) { |
|
|
|
|
if (shortCut instanceof UpdateAction) { |
|
|
|
|
shortCuts.add((UpdateAction) shortCut); |
|
|
|
|
} else if (shortCut instanceof MenuDef) { |
|
|
|
|
addUpdateActionToList((MenuDef) shortCut); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void addCommunityMenuDef(java.util.List<MenuDef> menuList){ |
|
|
|
|
Locale locale = FRContext.getLocale(); |
|
|
|
|
Locale [] locales =supportCommunityLocales(); |
|
|
|
|
for(int i = 0; i < locales.length; i++) { |
|
|
|
@ -158,7 +183,7 @@ public abstract class ToolBarMenuDock {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Locale[] supportCommunityLocales() { |
|
|
|
|
public Locale[] supportCommunityLocales() { |
|
|
|
|
return new Locale[]{ |
|
|
|
|
Locale.CHINA, |
|
|
|
|
Locale.TAIWAN, |
|
|
|
@ -266,6 +291,10 @@ public abstract class ToolBarMenuDock {
|
|
|
|
|
return new UILabel(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Component createAlphafinePane(){ |
|
|
|
|
return new UILabel(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { |
|
|
|
|
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Server"), 'S'); |
|
|
|
@ -332,6 +361,8 @@ public abstract class ToolBarMenuDock {
|
|
|
|
|
} |
|
|
|
|
shortCuts.add(SeparatorDef.DEFAULT); |
|
|
|
|
shortCuts.add(new AboutAction()); |
|
|
|
|
shortCuts.add(SeparatorDef.DEFAULT); |
|
|
|
|
shortCuts.add(new AlphafineAction()); |
|
|
|
|
|
|
|
|
|
return shortCuts.toArray(new ShortCut[shortCuts.size()]); |
|
|
|
|
} |
|
|
|
@ -544,7 +575,7 @@ public abstract class ToolBarMenuDock {
|
|
|
|
|
|
|
|
|
|
for (MenuHandler handler : target) { |
|
|
|
|
int insertPosition = handler.insertPosition(menuDef.getShortCutCount()); |
|
|
|
|
if (insertPosition == MenuHandler.HIDE) { |
|
|
|
|
if (insertPosition == MenuHandler.HIDE) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ShortCut shortCut = action.methodAction(handler); |
|
|
|
|