use of org.jcryptool.actions.ui.views.ActionView in project core by jcryptool.
the class GeneralPage method performApply.
@Override
protected void performApply() {
storeValues();
super.performApply();
ActionView av = getActionView();
if (av != null)
av.setFilenameVisibility();
}
use of org.jcryptool.actions.ui.views.ActionView in project core by jcryptool.
the class ImportHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
ActionCascadeService service = ActionCascadeService.getInstance();
if (service.getCurrentActionCascade() != null && service.getCurrentActionCascade().getSize() > 0) {
boolean confirmImport = MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), Messages.ImportHandler_0, Messages.ImportHandler_1);
if (!confirmImport) {
return null;
}
}
ActionView view = (ActionView) HandlerUtil.getActivePart(event);
FileDialog dialog = new FileDialog(HandlerUtil.getActiveShell(event), SWT.OPEN);
dialog.setFilterPath(DirectoryService.getUserHomeDir());
dialog.setFilterNames(Constants.FILTER_NAMES);
dialog.setFilterExtensions(Constants.FILTER_EXTENSIONS);
String filename = dialog.open();
if (filename != null && filename.length() > 0) {
view.setImportPath(ImportUtils.getPathFromFile(filename));
ImportUtils importUtil = new ImportUtils(filename);
boolean isValid = importUtil.validateActionCascade();
if (isValid) {
service.setCurrentActionCascade(importUtil.createActionCascade());
} else {
MessageDialog.openInformation(HandlerUtil.getActiveShell(event), Messages.ImportHandler_2, Messages.ImportHandler_3);
}
}
return null;
}
Aggregations