use of org.jcryptool.crypto.keystore.ui.dialogs.ShowSecretKeyDialog in project core by jcryptool.
the class ShowPropertiesHandler method execute.
/*
* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
Object selectedNode = ((IStructuredSelection) selection).getFirstElement();
CommonPropertyDialog keyDialog = null;
if (selectedNode instanceof SecretKeyNode) {
keyDialog = new ShowSecretKeyDialog(HandlerUtil.getActiveShell(event), (SecretKeyNode) selectedNode);
} else if (selectedNode instanceof PrivateKeyNode) {
keyDialog = new ShowSecretKeyDialog(HandlerUtil.getActiveShell(event), (PrivateKeyNode) selectedNode);
} else if (selectedNode instanceof CertificateNode) {
keyDialog = new ShowCertificateDialog(HandlerUtil.getActiveShell(event), (CertificateNode) selectedNode);
} else {
LogUtil.logError(KeyStorePlugin.PLUGIN_ID, "unsupported key node type");
return null;
}
keyDialog.create();
keyDialog.open();
return null;
}
Aggregations