use of org.jcryptool.actions.ui.views.ActionView in project core by jcryptool.
the class MoveDownHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
ActionView view = (ActionView) HandlerUtil.getActivePart(event);
TableViewer viewer = view.getViewer();
ActionItem item = (ActionItem) ((IStructuredSelection) selection).getFirstElement();
ActionCascadeService.getInstance().moveDown(item);
// Set focus on moved row
viewer.setSelection(new StructuredSelection(item));
}
return null;
}
use of org.jcryptool.actions.ui.views.ActionView in project core by jcryptool.
the class MoveUpHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
ActionView view = (ActionView) HandlerUtil.getActivePart(event);
TableViewer viewer = view.getViewer();
ActionItem item = (ActionItem) ((IStructuredSelection) selection).getFirstElement();
ActionCascadeService.getInstance().moveUp(item);
// Set focus on moved row
viewer.setSelection(new StructuredSelection(item));
}
return null;
}
use of org.jcryptool.actions.ui.views.ActionView in project core by jcryptool.
the class GeneralPage method performOk.
@Override
public boolean performOk() {
storeValues();
boolean ret = super.performOk();
if (ret) {
ActionView av = getActionView();
if (av != null)
av.setFilenameVisibility();
}
return ret;
}
use of org.jcryptool.actions.ui.views.ActionView in project core by jcryptool.
the class RecordHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
// $NON-NLS-1$
Command command = service.getCommand("org.jcryptool.actions.recordCommand");
// $NON-NLS-1$
State state = command.getState("org.jcryptool.actions.recordCommand.toggleState");
doRecord = !(Boolean) state.getValue();
if (doRecord && HandlerUtil.getActivePart(event) instanceof ActionView) {
boolean launched = startRecording(HandlerUtil.getActiveEditor(event), (ActionView) HandlerUtil.getActivePart(event));
if (launched) {
state.setValue(doRecord);
service.refreshElements(event.getCommand().getId(), null);
}
} else {
state.setValue(doRecord);
service.refreshElements(event.getCommand().getId(), null);
}
final IWorkbenchWindow ww = HandlerUtil.getActiveWorkbenchWindowChecked(event);
final IEvaluationService evalService = (IEvaluationService) ww.getService(IEvaluationService.class);
if (evalService != null) {
// $NON-NLS-1$
evalService.requestEvaluation("org.jcryptool.actions.isDoRecord");
}
return null;
}
use of org.jcryptool.actions.ui.views.ActionView in project core by jcryptool.
the class StartHandler method execute.
public Object execute(final ExecutionEvent event) throws ExecutionException {
final ActionView view = (ActionView) HandlerUtil.getActivePart(event);
if (!view.hasContent()) {
MessageDialog.openInformation(HandlerUtil.getActiveShell(event), Messages.StartHandler_0, Messages.StartHandler_1);
} else {
final ActionItem a = (ActionItem) ((IStructuredSelection) (view.getViewer().getSelection())).getFirstElement();
Job job = new Job(Messages.StartHandler_5) {
public IStatus run(final IProgressMonitor monitor) {
return execute(view, a, HandlerUtil.getActiveShell(event), monitor);
}
};
job.setUser(true);
job.schedule();
}
return null;
}
Aggregations