|
|
@ -11,6 +11,7 @@ import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.actions.community.*; |
|
|
|
import com.fr.design.actions.community.*; |
|
|
|
import com.fr.design.actions.file.*; |
|
|
|
import com.fr.design.actions.file.*; |
|
|
|
import com.fr.design.actions.help.AboutAction; |
|
|
|
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.TutorialAction; |
|
|
|
import com.fr.design.actions.help.WebDemoAction; |
|
|
|
import com.fr.design.actions.help.WebDemoAction; |
|
|
|
import com.fr.design.actions.server.*; |
|
|
|
import com.fr.design.actions.server.*; |
|
|
@ -36,10 +37,8 @@ import com.fr.stable.ProductConstants; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.*; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author richer |
|
|
|
* @author richer |
|
|
@ -56,6 +55,7 @@ public abstract class ToolBarMenuDock { |
|
|
|
public static final int PANLE_HEIGNT = 26; |
|
|
|
public static final int PANLE_HEIGNT = 26; |
|
|
|
private MenuDef[] menus; |
|
|
|
private MenuDef[] menus; |
|
|
|
private ToolBarDef toolBarDef; |
|
|
|
private ToolBarDef toolBarDef; |
|
|
|
|
|
|
|
private ArrayList<UpdateAction> shortCuts; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新菜单 |
|
|
|
* 更新菜单 |
|
|
@ -144,9 +144,34 @@ public abstract class ToolBarMenuDock { |
|
|
|
// 添加社区菜单
|
|
|
|
// 添加社区菜单
|
|
|
|
addCommunityMenuDef(menuList); |
|
|
|
addCommunityMenuDef(menuList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 添加全部UpdateAction到actionmanager中
|
|
|
|
|
|
|
|
getAllUpdateActions(menuList); |
|
|
|
|
|
|
|
UpdateActionManager.getUpdateActionManager().setUpdateActions(shortCuts); |
|
|
|
|
|
|
|
|
|
|
|
return menuList.toArray(new MenuDef[menuList.size()]); |
|
|
|
return menuList.toArray(new MenuDef[menuList.size()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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){ |
|
|
|
public void addCommunityMenuDef(java.util.List<MenuDef> menuList){ |
|
|
|
Locale locale = FRContext.getLocale(); |
|
|
|
Locale locale = FRContext.getLocale(); |
|
|
|
Locale [] locales =supportCommunityLocales(); |
|
|
|
Locale [] locales =supportCommunityLocales(); |
|
|
@ -266,6 +291,10 @@ public abstract class ToolBarMenuDock { |
|
|
|
return new UILabel(); |
|
|
|
return new UILabel(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Component createAlphafinePane(){ |
|
|
|
|
|
|
|
return new UILabel(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { |
|
|
|
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { |
|
|
|
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Server"), 'S'); |
|
|
|
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(SeparatorDef.DEFAULT); |
|
|
|
shortCuts.add(new AboutAction()); |
|
|
|
shortCuts.add(new AboutAction()); |
|
|
|
|
|
|
|
shortCuts.add(SeparatorDef.DEFAULT); |
|
|
|
|
|
|
|
shortCuts.add(new AlphafineAction()); |
|
|
|
|
|
|
|
|
|
|
|
return shortCuts.toArray(new ShortCut[shortCuts.size()]); |
|
|
|
return shortCuts.toArray(new ShortCut[shortCuts.size()]); |
|
|
|
} |
|
|
|
} |
|
|
|