Search in sources :

Example 1 with HopGuiPipelineHopContext

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);
            }
        }
    }
}
Also used : HopGuiPipelineTransformContext(org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineTransformContext) IGuiContextHandler(org.apache.hop.ui.hopgui.context.IGuiContextHandler) HopGuiPipelineHopContext(org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineHopContext) HopGuiPipelineContext(org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineContext) HopGuiPipelineNoteContext(org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineNoteContext) HopExtensionPoint(org.apache.hop.core.extension.HopExtensionPoint)

Aggregations

HopExtensionPoint (org.apache.hop.core.extension.HopExtensionPoint)1 IGuiContextHandler (org.apache.hop.ui.hopgui.context.IGuiContextHandler)1 HopGuiPipelineContext (org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineContext)1 HopGuiPipelineHopContext (org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineHopContext)1 HopGuiPipelineNoteContext (org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineNoteContext)1 HopGuiPipelineTransformContext (org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineTransformContext)1