use of org.talend.designer.abstractmap.ui.dnd.DraggedData in project tdi-studio-se by Talend.
the class CompleteDropTargetStyledTextListener method drop.
// private void showInfos(DropTargetEvent event) {
// System.out.println(event);
// System.out.println("event.feedback=" + event.feedback);
// System.out.println("event.detail=" + event.detail);
// System.out.println("event.operations=" + event.operations);
//
// System.out.println("DND.DROP_DEFAULT=" + DND.DROP_DEFAULT);
// System.out.println("DND.DROP_COPY=" + DND.DROP_COPY);
// System.out.println("DND.DROP_MOVE=" + DND.DROP_MOVE);
// System.out.println("DND.DROP_LINK=" + DND.DROP_LINK);
// System.out.println("DND.DROP_TARGET_MOVE=" + DND.DROP_TARGET_MOVE);
// }
//
public void drop(DropTargetEvent event) {
super.drop(event);
UIManager uiManager = getUiManager();
DraggedData draggedData = TableEntriesTransfer.getInstance().getDraggedData();
DropContextAnalyzer analyzer = analyzeDropTarget(event, draggedData);
// System.out.println("\n>>drop");
// System.out.println(event);
ILanguage currentLanguage = LanguageProvider.getCurrentLanguage();
DataMapTableView dataMapTableViewTarget = getMapperManager().retrieveDataMapTableView(draggableTargetControl);
uiManager.selectDataMapTableView(dataMapTableViewTarget, true, false);
List<TransferableEntry> transferableEntryList = draggedData.getTransferableEntryList();
ITableEntry currentEntryTarget = ((AbstractInOutTable) dataMapTableViewTarget.getDataMapTable()).getExpressionFilter();
boolean overwrite = false;
if (analyzer.isOverwriteExpression()) {
//$NON-NLS-1$
currentEntryTarget.setExpression("");
}
for (TransferableEntry transferableEntry : transferableEntryList) {
ITableEntry tableEntrySource = transferableEntry.getTableEntrySource();
Zone zoneSourceEntry = (Zone) transferableEntry.getZoneSourceEntry();
modifyExistingExpression(currentLanguage, currentEntryTarget, tableEntrySource, overwrite, zoneSourceEntry);
}
// for TransferableEntry transferableEntry : transferableEntryList
uiManager.parseExpression(currentEntryTarget.getExpression(), currentEntryTarget, false, true, true);
ControlUtils.setText(draggableTargetControl, currentEntryTarget.getExpression());
uiManager.refreshBackground(true, false);
uiManager.unselectAllInputMetaDataEntries();
// uiManager.parseAllExpressionsForAllTables();
getMapperManager().getProblemsManager().checkProblemsForTableEntry(currentEntryTarget, true);
uiManager.selectLinks(dataMapTableViewTarget, Arrays.<ITableEntry>asList(currentEntryTarget), true, false);
uiManager.setDragging(false);
}
Aggregations