Search in sources :

Example 11 with DraggingInfosPopup

use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.

the class CompleteDropTargetTableListener method dragLeave.

@Override
public void dragLeave(DropTargetEvent event) {
    // System.out.println("\n>>dragLeave");
    // System.out.println(event);
    super.dragLeave(event);
    DraggedData draggedData = TableEntriesTransfer.getInstance().getDraggedData();
    DropContextAnalyzer analyzer = analyzeDropTarget(event, draggedData);
    UIManager uiManager = getUiManager();
    if (!analyzer.isTableSourceAndTargetAreSame()) {
        draggableTargetControl.deselectAll();
    }
    retrieveInsertionIndicator().setVisible(false);
    DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
    draggingInfosPopup.setExpressionContext(false);
    draggingInfosPopup.setInsertionEntryContext(false);
    uiManager.setDragging(false);
}
Also used : DraggingInfosPopup(org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup) AbstractUIManager(org.talend.designer.abstractmap.managers.AbstractUIManager) UIManager(org.talend.designer.mapper.managers.UIManager) DraggedData(org.talend.designer.abstractmap.ui.dnd.DraggedData)

Example 12 with DraggingInfosPopup

use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.

the class CompleteDropTargetTableListener method configurePopupInfos.

private void configurePopupInfos(DropContextAnalyzer analyzer) {
    AbstractUIManager uiManager = mapperManager.getUiManager();
    DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
    if (analyzer.isDropValid()) {
        draggingInfosPopup.setOutputToOutputMode(analyzer.isOutputToOutput());
        if (uiManager.isCtrlPressed()) {
            draggingInfosPopup.setOverwriteMode(true);
        } else {
            draggingInfosPopup.setOverwriteMode(false);
        }
        if (uiManager.isShiftPressed() && analyzer.isMapOneToOneAuthorized()) {
            draggingInfosPopup.setMapOneToOneMode(true, true);
        } else {
            draggingInfosPopup.setMapOneToOneMode(false, analyzer.isMapOneToOneAuthorized());
        }
        if (analyzer.isInputToInput()) {
            draggingInfosPopup.setExpressionContext(true);
            draggingInfosPopup.setInsertionEntryContext(false);
        } else if (analyzer.isCursorOverExpressionCell()) {
            draggingInfosPopup.setExpressionContext(true);
            draggingInfosPopup.setInsertionEntryContext(analyzer.isInsertionEntryMode());
        } else if (analyzer.targetIsExpressionFilterText() || analyzer.targetTableIsFiltersTable()) {
            draggingInfosPopup.setExpressionContext(true);
            draggingInfosPopup.setInsertionEntryContext(false);
        } else {
            draggingInfosPopup.setExpressionContext(false);
            draggingInfosPopup.setInsertionEntryContext(true);
        }
        draggingInfosPopup.setDropInvalid(false, false);
    } else {
        draggingInfosPopup.setExpressionContext(false);
        draggingInfosPopup.setMapOneToOneMode(false, false);
        draggingInfosPopup.setInsertionEntryContext(false);
        draggingInfosPopup.setDropInvalid(true, analyzer.isInvalidKeyPressed());
    }
}
Also used : DraggingInfosPopup(org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup) AbstractUIManager(org.talend.designer.abstractmap.managers.AbstractUIManager)

Example 13 with DraggingInfosPopup

use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.

the class CompleteDropTargetTableListener method dragOperationChanged.

@Override
public void dragOperationChanged(DropTargetEvent event) {
    // System.out.println("\n>>dragOperationChanged");
    // showInfos(event);
    // super.dragOperationChanged(event);
    DraggedData draggedData = TableEntriesTransfer.getInstance().getDraggedData();
    detectPressedKeys(event);
    DropContextAnalyzer analyzer = analyzeDropTarget(event, draggedData);
    configurePopupInfos(analyzer);
    UIManager uiManager = getUiManager();
    DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
    draggingInfosPopup.updateVisibleLabels();
    fillEvent(event, analyzer);
    mapperManager.getUiManager().setCurrentDragDetail(event.detail);
}
Also used : DraggingInfosPopup(org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup) AbstractUIManager(org.talend.designer.abstractmap.managers.AbstractUIManager) UIManager(org.talend.designer.mapper.managers.UIManager) DraggedData(org.talend.designer.abstractmap.ui.dnd.DraggedData)

Example 14 with DraggingInfosPopup

use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.

the class CompleteDropTargetStyledTextListener method dragOver.

public void dragOver(DropTargetEvent event) {
    super.dragOver(event);
    UIManager uiManager = getUiManager();
    DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
    // System.out.println("\n>>dragOver");
    DraggedData draggedData = TableEntriesTransfer.getInstance().getDraggedData();
    DropContextAnalyzer analyzer = analyzeDropTarget(event, draggedData);
    fillEvent(event, analyzer);
    if (analyzer.isDropValid()) {
        draggingInfosPopup.setExpressionContext(true);
    } else {
        draggingInfosPopup.setMapOneToOneMode(false, false);
        draggingInfosPopup.setExpressionContext(false);
        draggingInfosPopup.setInsertionEntryContext(false);
        draggingInfosPopup.setDropInvalid(true, analyzer.isInvalidKeyPressed());
    }
}
Also used : DraggingInfosPopup(org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup) UIManager(org.talend.designer.mapper.managers.UIManager) DraggedData(org.talend.designer.abstractmap.ui.dnd.DraggedData)

Example 15 with DraggingInfosPopup

use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.

the class CompleteDropTargetStyledTextListener method configurePopupInfos.

private void configurePopupInfos(DropContextAnalyzer analyzer) {
    UIManager uiManager = getUiManager();
    DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
    if (analyzer.isDropValid()) {
        draggingInfosPopup.setOutputToOutputMode(analyzer.isOutputToOutput());
        if (uiManager.isCtrlPressed()) {
            draggingInfosPopup.setOverwriteMode(true);
        } else {
            draggingInfosPopup.setOverwriteMode(false);
        }
        if (uiManager.isShiftPressed() && analyzer.isMapOneToOneAuthorized()) {
            draggingInfosPopup.setMapOneToOneMode(true, true);
        } else {
            draggingInfosPopup.setMapOneToOneMode(false, analyzer.isMapOneToOneAuthorized());
        }
        if (analyzer.isInputToInput()) {
            draggingInfosPopup.setExpressionContext(true);
            draggingInfosPopup.setInsertionEntryContext(false);
        } else if (analyzer.isCursorOverExpressionCell()) {
            draggingInfosPopup.setExpressionContext(true);
            draggingInfosPopup.setInsertionEntryContext(analyzer.isInsertionEntryMode());
        } else if (analyzer.targetIsExpressionFilterText() || analyzer.targetTableIsFiltersTable()) {
            draggingInfosPopup.setExpressionContext(true);
            draggingInfosPopup.setInsertionEntryContext(false);
        } else {
            draggingInfosPopup.setExpressionContext(false);
            draggingInfosPopup.setInsertionEntryContext(true);
        }
        draggingInfosPopup.setDropInvalid(false, false);
    } else {
        draggingInfosPopup.setExpressionContext(false);
        draggingInfosPopup.setMapOneToOneMode(false, false);
        draggingInfosPopup.setInsertionEntryContext(false);
        draggingInfosPopup.setDropInvalid(true, analyzer.isInvalidKeyPressed());
    }
}
Also used : DraggingInfosPopup(org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup) UIManager(org.talend.designer.mapper.managers.UIManager)

Aggregations

DraggingInfosPopup (org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup)17 AbstractUIManager (org.talend.designer.abstractmap.managers.AbstractUIManager)13 DraggedData (org.talend.designer.abstractmap.ui.dnd.DraggedData)8 Point (org.eclipse.swt.graphics.Point)6 UIManager (org.talend.designer.mapper.managers.UIManager)6 UIManager (org.talend.designer.dbmap.managers.UIManager)4 Rectangle (org.eclipse.swt.graphics.Rectangle)2