Search in sources :

Example 1 with SelectKeyDialog

use of org.jcryptool.crypto.keystore.ui.dialogs.SelectKeyDialog in project core by jcryptool.

the class SelectKeyHandler method select.

/**
 * @param event
 * @param )
 * @return
 */
private IKeyStoreAlias select(int options, ExecutionEvent event) {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    String algorithm = null;
    SelectKeyDialog dialog = new SelectKeyDialog(window.getShell(), new Style(options), algorithm);
    dialog.create();
    dialog.open();
    IKeyStoreAlias selectionFromDialog = null;
    switch(dialog.getReturnCode()) {
        case Window.OK:
            selectionFromDialog = dialog.getSelectedAlias();
            this.cancel = false;
            break;
        case Window.CANCEL:
            this.cancel = true;
            break;
    }
    ;
    return selectionFromDialog;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) SelectKeyDialog(org.jcryptool.crypto.keystore.ui.dialogs.SelectKeyDialog) Style(org.jcryptool.crypto.keystore.ui.KeystoreWidget.Style) IKeyStoreAlias(org.jcryptool.crypto.keystore.keys.IKeyStoreAlias)

Aggregations

IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 IKeyStoreAlias (org.jcryptool.crypto.keystore.keys.IKeyStoreAlias)1 Style (org.jcryptool.crypto.keystore.ui.KeystoreWidget.Style)1 SelectKeyDialog (org.jcryptool.crypto.keystore.ui.dialogs.SelectKeyDialog)1