Exemplo n.º 1
0
  private void defineAllCommands() {
    commandService = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
    autogeneratedCategory = commandService.getCategory(CommandManager.AUTOGENERATED_CATEGORY_ID);

    defineCommand(newContactCommandId, Messages.getString("Label.NewContact"), newContactHandler);
    defineCommand(
        deleteContactCommandId, Messages.getString("Label.DeleteContact"), deleteContactHandler);

    defineCommand(
        deleteCertificateCommandId,
        Messages.getString("Label.DeleteCertificate"),
        deleteCertificateHandler);
    defineCommand(
        deleteKeyPairCommandId, Messages.getString("Label.DeleteKeyPair"), deleteKeyPairHandler);
    defineCommand(
        deleteSecretKeyCommandId,
        Messages.getString("Label.DeleteSecretKey"),
        deleteSecretKeyHandler);

    defineCommand(
        exportCertificateCommandId,
        org.jcryptool.crypto.keystore.ui.actions.ex.Messages.getString("Label.ExportPublicKey"),
        exportCertificateHandler);
    defineCommand(
        exportKeyPairCommandId,
        org.jcryptool.crypto.keystore.ui.actions.ex.Messages.getString("Label.ExportKeyPair"),
        exportKeyPairHandler);
    defineCommand(
        exportSecretKeyCommandId,
        org.jcryptool.crypto.keystore.ui.actions.ex.Messages.getString("Label.ExportSecretKey"),
        exportSecretKeyHandler);
  }
Exemplo n.º 2
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.ui.tests.harness.util.UITestCase#doSetUp()
   */
  protected void doSetUp() throws Exception {
    for (int i = 0; i < CREATE_CONTEXTS.length; i++) {
      final String[] contextInfo = CREATE_CONTEXTS[i];
      final Context context = contextService.getContext(contextInfo[0]);
      if (!context.isDefined()) {
        context.define(contextInfo[1], contextInfo[2], contextInfo[3]);
      }
    }

    Command cmd = commandService.getCommand(CMD_ID);
    if (!cmd.isDefined()) {
      Category cat = commandService.getCategory(CATEGORY_ID);
      cmd.define("Test Handler", "Test handler activation", cat);
    }
  }