use of org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineHopContext in project hop by apache.
the class HopGuiPipelineGraph method showActionDialog.
private void showActionDialog(MouseEvent e, Point real, boolean fSingleClick, SingleClickType fSingleClickType, TransformMeta fSingleClickTransform, NotePadMeta fSingleClickNote, PipelineHopMeta fSingleClickHop) {
// In any case clear the selection region...
//
selectionRegion = null;
//
if (fSingleClickType == SingleClickType.Pipeline) {
if (pipelineMeta.getSelectedTransforms().size() > 0 || pipelineMeta.getSelectedNotes().size() > 0) {
pipelineMeta.unselectAll();
selectionRegion = null;
updateGui();
// Show a short tooltip
//
toolTip.setVisible(false);
toolTip.setAutoHide(true);
toolTip.setText(Const.CR + " Selection cleared " + Const.CR);
showToolTip(new org.eclipse.swt.graphics.Point(e.x, e.y));
return;
}
}
if (!doubleClick) {
//
if (fSingleClick && fSingleClickType != null) {
IGuiContextHandler contextHandler = null;
String message = null;
switch(fSingleClickType) {
case Pipeline:
message = BaseMessages.getString(PKG, "PipelineGraph.ContextualActionDialog.Pipeline.Header");
contextHandler = new HopGuiPipelineContext(pipelineMeta, this, real);
break;
case Transform:
message = BaseMessages.getString(PKG, "PipelineGraph.ContextualActionDialog.Transform.Header", fSingleClickTransform.getName());
contextHandler = new HopGuiPipelineTransformContext(pipelineMeta, fSingleClickTransform, this, real);
break;
case Note:
message = BaseMessages.getString(PKG, "PipelineGraph.ContextualActionDialog.Note.Header");
contextHandler = new HopGuiPipelineNoteContext(pipelineMeta, fSingleClickNote, this, real);
break;
case Hop:
message = BaseMessages.getString(PKG, "PipelineGraph.ContextualActionDialog.Hop.Header");
contextHandler = new HopGuiPipelineHopContext(pipelineMeta, fSingleClickHop, this, real);
break;
default:
break;
}
if (contextHandler != null) {
Shell parent = hopShell();
org.eclipse.swt.graphics.Point p = parent.getDisplay().map(canvas, null, e.x, e.y);
// Show the context dialog
//
avoidContextDialog = GuiContextUtil.getInstance().handleActionSelection(parent, message, new Point(p.x, p.y), contextHandler);
}
}
}
}
Aggregations