use of org.jcryptool.crypto.flexiprovider.operations.ui.views.nodes.io.OutputNode in project core by jcryptool.
the class EditorDragListener method dragSetData.
public void dragSetData(DragSourceEvent event) {
Object selected = viewer.getTree().getSelection()[0].getData();
if (selected instanceof InputNode) {
InputNode node = (InputNode) selected;
// $NON-NLS-1$
LogUtil.logInfo("Input: " + node.getInput());
if (!node.getInput().equals("-1") && !node.getInput().equals(Messages.InputType)) {
// $NON-NLS-1$
EditorInputTransfer.EditorInputData data = EditorInputTransfer.createEditorInputData(IOperationsConstants.ID_HEX_EDITOR, // $NON-NLS-1$
new PathEditorInput(node.getInput()));
event.data = new EditorInputTransfer.EditorInputData[] { data };
}
} else if (selected instanceof OutputNode) {
OutputNode node = (OutputNode) selected;
// $NON-NLS-1$
LogUtil.logInfo("Output: " + node.getOutput());
if (!node.getOutput().equals("-1") && !node.getOutput().equals("<Editor>")) {
// $NON-NLS-1$
EditorInputTransfer.EditorInputData data = EditorInputTransfer.createEditorInputData(IOperationsConstants.ID_HEX_EDITOR, // $NON-NLS-1$
new PathEditorInput(node.getOutput()));
event.data = new EditorInputTransfer.EditorInputData[] { data };
}
}
}
use of org.jcryptool.crypto.flexiprovider.operations.ui.views.nodes.io.OutputNode in project core by jcryptool.
the class EditorDragListener method dragStart.
public void dragStart(DragSourceEvent event) {
Object selected = viewer.getTree().getSelection()[0].getData();
// $NON-NLS-1$
LogUtil.logInfo("Selected for drag: " + selected.getClass().getName());
if (!(selected instanceof InputNode) && !(selected instanceof OutputNode)) {
event.doit = false;
return;
}
if (selected instanceof InputNode) {
InputNode node = (InputNode) selected;
if (node.getInput().equals("-1") || node.getInput().equals(Messages.InputType)) {
// $NON-NLS-1$
// $NON-NLS-1$
LogUtil.logInfo("not doing it");
event.doit = false;
}
} else if (selected instanceof OutputNode) {
OutputNode node = (OutputNode) selected;
if (!node.getOutput().equals("-1") && !node.getOutput().equals("<Editor>")) {
// $NON-NLS-1$
// $NON-NLS-1$
LogUtil.logInfo("not doing it");
event.doit = false;
}
}
}
use of org.jcryptool.crypto.flexiprovider.operations.ui.views.nodes.io.OutputNode in project core by jcryptool.
the class FlexiProviderOperationsView method hookContextMenu.
// private IExtendedOperationDescriptor currentOperation;
private void hookContextMenu() {
// $NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
if (viewer.getTree().getSelection().length > 0) {
Object selection = viewer.getTree().getSelection()[0].getData();
if (selection instanceof TreeNode) {
currentEntryNode = getCurrentEntryNode((TreeNode) selection);
}
if (selection instanceof EntryNode) {
fillEntryNodeContextMenu(manager);
} else if (selection instanceof OperationsNode) {
if (displayOperationContextMenu(currentEntryNode)) {
fillEncryptDecryptNodeContextMenu(manager);
}
} else if (selection instanceof InputNode) {
fillInputContextMenu(manager);
} else if (selection instanceof OutputNode) {
fillOutputContextMenu(manager);
} else if (selection instanceof SignatureNode) {
fillSignatureOutputContextMenu(manager);
} else if (selection instanceof KeyNode) {
fillKeyNodeContextMenu(manager);
}
}
}
});
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu("org.jcryptool.crypto.flexiprovider.operations.popup", menuMgr, viewer);
}
Aggregations