|
23 | 23 | */ |
24 | 24 | public class PackInstallerViewUtils { |
25 | 25 |
|
| 26 | + private static final String[][] VIEW_MENU_COMMANDS = { // id, image |
| 27 | + { "com.arm.cmsis.pack.installer.commands.reloadCommand", CpPlugInUI.ICON_REFRESH }, //$NON-NLS-1$ |
| 28 | + { "com.arm.cmsis.pack.installer.commands.updateCommand", CpPlugInUI.ICON_CHECK4UPDATE }, //$NON-NLS-1$ |
| 29 | + { "com.arm.cmsis.pack.installer.commands.importPackCommand", CpPlugInUI.ICON_RTE_UNPACK }, //$NON-NLS-1$ |
| 30 | + { "com.arm.cmsis.pack.installer.commands.importFolderPacksCommand", CpPlugInUI.ICON_IMPORT_FOLDER }, //$NON-NLS-1$ |
| 31 | + { "com.arm.cmsis.pack.installer.commands.manLocalRepoCommand", CpPlugInUI.ICON_MAN_LOCAL_REPO } //$NON-NLS-1$ |
| 32 | + }; |
| 33 | + |
26 | 34 | /** |
27 | 35 | * Add the Management Commands to the Local Tool bar |
28 | 36 | * @param viewPart the view part, e.g. PacksView, ExamplesView... |
29 | 37 | * @param manager the contributionManager |
30 | 38 | */ |
31 | 39 | public static void addManagementCommandsToLocalToolBar(IViewPart viewPart, IContributionManager manager) { |
32 | | - String[][] commands = { // id, image |
33 | | - { "com.arm.cmsis.pack.installer.commands.reloadCommand", CpPlugInUI.ICON_REFRESH }, //$NON-NLS-1$ |
34 | | - { "com.arm.cmsis.pack.installer.commands.updateCommand", CpPlugInUI.ICON_CHECK4UPDATE }, //$NON-NLS-1$ |
35 | | - { "com.arm.cmsis.pack.installer.commands.importPackCommand", CpPlugInUI.ICON_RTE_UNPACK }, //$NON-NLS-1$ |
36 | | - { "com.arm.cmsis.pack.installer.commands.importFolderPacksCommand", CpPlugInUI.ICON_IMPORT_FOLDER }, //$NON-NLS-1$ |
37 | | - { "com.arm.cmsis.pack.installer.commands.manLocalRepoCommand", CpPlugInUI.ICON_MAN_LOCAL_REPO } //$NON-NLS-1$ |
38 | | - }; |
39 | | - |
40 | | - for (int i = 0; i < commands.length; i++) { |
41 | | - String commandId = commands[i][0]; |
| 40 | + for (int i = 0; i < VIEW_MENU_COMMANDS.length; i++) { |
| 41 | + String commandId = VIEW_MENU_COMMANDS[i][0]; |
42 | 42 | CommandContributionItemParameter p = new CommandContributionItemParameter(viewPart.getSite(), commandId, commandId, |
43 | 43 | CommandContributionItem.STYLE_PUSH); |
44 | | - p.icon = CpPlugInUI.getImageDescriptor(commands[i][1]); |
| 44 | + p.icon = CpPlugInUI.getImageDescriptor(VIEW_MENU_COMMANDS[i][1]); |
45 | 45 | CommandContributionItem item = new CommandContributionItem(p); |
46 | 46 | manager.add(item); |
47 | 47 | } |
|
0 commit comments