private void addFlexibleActions(IToolBarManager manager) { Iterator<IKeyStoreActionDescriptor> it = KeyStoreActionManager.getInstance().getNewSymmetricKeyActions(); IKeyStoreActionDescriptor tmp; while (it.hasNext()) { tmp = it.next(); if (tmp.getExtensionUID() .equals("org.jcryptool.crypto.flexiprovider.keystore")) { // $NON-NLS-1$ LogUtil.logInfo("should add a secret key command"); // $NON-NLS-1$ addContributionItem( manager, tmp.getID(), KeyStorePlugin.getImageDescriptor(tmp.getIcon()), tmp.getToolTipText()); break; } } Iterator<IKeyStoreActionDescriptor> it2 = KeyStoreActionManager.getInstance().getNewKeyPairActions(); IKeyStoreActionDescriptor tmp2; while (it2.hasNext()) { tmp2 = it2.next(); if (tmp2.getExtensionUID() .equals("org.jcryptool.crypto.flexiprovider.keystore")) { // $NON-NLS-1$ LogUtil.logInfo("should add a key pair command"); // $NON-NLS-1$ addContributionItem( manager, tmp2.getID(), KeyStorePlugin.getImageDescriptor(tmp2.getIcon()), tmp2.getToolTipText()); break; } } Iterator<IKeyStoreActionDescriptor> it3 = KeyStoreActionManager.getInstance().getImportActions(); IKeyStoreActionDescriptor tmp3; while (it3.hasNext()) { tmp3 = it3.next(); if (tmp3.getExtensionUID() .equals("org.jcryptool.crypto.flexiprovider.keystore")) { // $NON-NLS-1$ LogUtil.logInfo("should add an import command"); // $NON-NLS-1$ addContributionItem( manager, tmp3.getID(), KeyStorePlugin.getImageDescriptor(tmp3.getIcon()), tmp3.getToolTipText()); break; } } }
private void fillLocalPullDown(IMenuManager manager) { Iterator<IKeyStoreActionDescriptor> secretKeyActionIterator = KeyStoreActionManager.getInstance().getNewSymmetricKeyActions(); while (secretKeyActionIterator.hasNext()) { IKeyStoreActionDescriptor descriptor = secretKeyActionIterator.next(); String commandId = descriptor.getID(); defineCommand(commandId, descriptor.getText(), new ShadowKeyStoreHandler(descriptor)); addContributionItem( manager, commandId, KeyStorePlugin.getImageDescriptor(descriptor.getIcon()), null); newSymmetricKeyCommandContributed = true; } if (newSymmetricKeyCommandContributed) { manager.add(new Separator()); } Iterator<IKeyStoreActionDescriptor> keyPairActionIterator = KeyStoreActionManager.getInstance().getNewKeyPairActions(); while (keyPairActionIterator.hasNext()) { IKeyStoreActionDescriptor descriptor = keyPairActionIterator.next(); String commandId = descriptor.getID(); defineCommand(commandId, descriptor.getText(), new ShadowKeyStoreHandler(descriptor)); addContributionItem( manager, commandId, KeyStorePlugin.getImageDescriptor(descriptor.getIcon()), null); } manager.add(new Separator()); Iterator<IKeyStoreActionDescriptor> importActionIterator = KeyStoreActionManager.getInstance().getImportActions(); while (importActionIterator.hasNext()) { IKeyStoreActionDescriptor descriptor = importActionIterator.next(); String commandId = descriptor.getID(); defineCommand(commandId, descriptor.getText(), new ShadowKeyStoreHandler(descriptor)); addContributionItem( manager, commandId, KeyStorePlugin.getImageDescriptor(descriptor.getIcon()), null); } manager.add(new Separator()); defineCommand( commandIdBackup, Messages.getString("Menu.BackupRestoreKeystore"), new KeyStoreBackupHandler(this)); addContributionItem(manager, commandIdBackup, null, null); }