use of org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineContext 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);
}
}
}
}
use of org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineContext in project hop by apache.
the class HopGuiPipelineGraph method mouseDoubleClick.
@Override
public void mouseDoubleClick(MouseEvent e) {
if (!PropsUi.getInstance().useDoubleClick()) {
return;
}
doubleClick = true;
clearSettings();
Point real = screen2real(e.x, e.y);
// Hide the tooltip!
hideToolTips();
AreaOwner areaOwner = getVisibleAreaOwner(real.x, real.y);
try {
HopGuiPipelineGraphExtension ext = new HopGuiPipelineGraphExtension(this, e, real, areaOwner);
ExtensionPointHandler.callExtensionPoint(LogChannel.GENERAL, variables, HopExtensionPoint.PipelineGraphMouseDoubleClick.id, ext);
if (ext.isPreventingDefault()) {
return;
}
} catch (Exception ex) {
LogChannel.GENERAL.logError("Error calling PipelineGraphMouseDoubleClick extension point", ex);
}
TransformMeta transformMeta = pipelineMeta.getTransform(real.x, real.y, iconSize);
if (transformMeta != null) {
if (e.button == 1) {
editTransform(transformMeta);
} else {
editDescription(transformMeta);
}
} else {
// Check if point lies on one of the many hop-lines...
PipelineHopMeta online = findPipelineHop(real.x, real.y);
if (online != null) {
editHop(online);
} else {
NotePadMeta ni = pipelineMeta.getNote(real.x, real.y);
if (ni != null) {
selectedNote = null;
editNote(ni);
} else {
//
if (areaOwner != null && areaOwner.getParent() instanceof TransformMeta && areaOwner.getOwner().equals(PipelinePainter.STRING_PARTITIONING_CURRENT_TRANSFORM)) {
TransformMeta transform = (TransformMeta) areaOwner.getParent();
pipelineTransformDelegate.editTransformPartitioning(pipelineMeta, transform);
} else {
editPipelineProperties(new HopGuiPipelineContext(pipelineMeta, this, real));
}
}
}
}
}
Aggregations