use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class UIManager method updateDropDownJoinTypeForInputs.
/**
* DOC amaumont Comment method "updateDropDownJoinTypeForInputs".
*/
public void updateDropDownJoinTypeForInputs() {
List<DataMapTableView> inputsTablesView;
inputsTablesView = getInputsTablesView();
if (inputsTablesView.size() >= 1) {
InputDataMapTableView inputView0 = (InputDataMapTableView) inputsTablesView.get(0);
inputView0.setEnableJoinTypeDropDown(false);
}
if (inputsTablesView.size() >= 2) {
InputDataMapTableView inputView1 = (InputDataMapTableView) inputsTablesView.get(1);
inputView1.setEnableJoinTypeDropDown(true);
}
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class UIManager method parseAllExpressionsForAllTables.
/**
* DOC amaumont Comment method "processAllExpressions".
*/
@SuppressWarnings("unchecked")
public void parseAllExpressionsForAllTables() {
List<DataMapTableView> tablesView = tableManager.getInputsTablesView();
tablesView.addAll(tableManager.getVarsTablesView());
tablesView.addAll(tableManager.getOutputsTablesView());
for (DataMapTableView view : tablesView) {
parseAllExpressions(view, false);
}
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class UIManager method selectLinkedTableEntries.
/**
* DOC amaumont Comment method "selectTableEntries".
*
* @param metadataTable
* @param selectedTableEntries
* @param selectionIndices
*/
public void selectLinkedTableEntries(IMetadataTable metadataTable, int[] selectionIndices) {
DataMapTableView dataMapTableView = tableManager.getView(metadataTable);
if (dataMapTableView == null) {
return;
}
dataMapTableView.setTableSelection(selectionIndices);
List<ITableEntry> list = extractSelectedTableEntries(dataMapTableView.getTableViewerCreatorForColumns().getTableViewer().getSelection());
selectLinks(dataMapTableView, list, false, false);
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class DropContextAnalyzer method analyzeCursorOverExpressionCell.
/**
* .
*/
@SuppressWarnings("unchecked")
private void analyzeCursorOverExpressionCell() {
DataMapTableView dataMapTableView = mapperManager.retrieveDataMapTableView(currentTableTarget);
TableViewerCreator tableViewerCreatorForColumns = dataMapTableView.getTableViewerCreatorForColumns();
Point pointCursor = currentTableTarget.toControl(event.x, event.y);
if (tableViewerCreatorForColumns.getTable() != currentTableTarget) {
isCursorOverExpressionCell = false;
return;
}
int maxY = (WindowSystem.isWIN32() && currentTableTarget.getHeaderVisible() ? currentTableTarget.getHeaderHeight() : 0) + (currentTableTarget.getItemCount() * (currentTableTarget.getItemHeight() + currentTableTarget.getBorderWidth() + (WindowSystem.isGTK() ? 2 : 0)));
if (pointCursor.y < 0 || pointCursor.y >= maxY) {
isCursorOverExpressionCell = false;
return;
}
// searching current column index
int currentColumnIndex = 0;
TableColumn[] columns = currentTableTarget.getColumns();
for (int i = 0, width = 0; i < columns.length; i++) {
TableColumn column = columns[i];
int widthColumn = column.getWidth();
if (pointCursor.x >= width && pointCursor.x <= width + widthColumn) {
currentColumnIndex = i;
break;
}
width += widthColumn;
}
List<TableViewerCreatorColumnNotModifiable> viewerColumns = tableViewerCreatorForColumns.getColumns();
TableViewerCreatorColumnNotModifiable viewerColumn = viewerColumns.get(currentColumnIndex);
if (DataMapTableView.ID_EXPRESSION_COLUMN.equals(viewerColumn.getId())) {
isCursorOverExpressionCell = true;
} else {
isCursorOverExpressionCell = false;
}
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class UIManager method moveSelectTableUp.
/**
*
* DOC amaumont Comment method "moveSelectTableUp".
*
* @param currentSelectedTableView
* @param tablesView
* @param indexStartMovedAuthorized
*/
private void moveSelectTableUp(DataMapTableView currentSelectedTableView, List<DataMapTableView> tablesView, int indexStartMovedAuthorized) {
int indexCurrentTable = tablesView.indexOf(currentSelectedTableView);
if (indexCurrentTable < indexStartMovedAuthorized) {
return;
}
FormData formDataCurrent = (FormData) currentSelectedTableView.getLayoutData();
DataMapTableView beforePreviousTableView = null;
if (indexCurrentTable - 2 >= 0) {
beforePreviousTableView = tablesView.get(indexCurrentTable - 2);
formDataCurrent.top.control = beforePreviousTableView;
} else {
formDataCurrent.top.control = null;
}
DataMapTableView previousTableView = null;
if (indexCurrentTable - 1 >= 0) {
previousTableView = tablesView.get(indexCurrentTable - 1);
FormData formDataPrevious = (FormData) previousTableView.getLayoutData();
formDataPrevious.top.control = currentSelectedTableView;
}
if (indexCurrentTable + 1 <= tablesView.size() - 1) {
DataMapTableView nextTableView = tablesView.get(indexCurrentTable + 1);
FormData formDataNext = (FormData) nextTableView.getLayoutData();
formDataNext.top.control = previousTableView;
}
tableManager.swapWithPreviousTable(currentSelectedTableView.getDataMapTable());
currentSelectedTableView.getParent().layout();
parseAllExpressions(currentSelectedTableView, false);
parseAllExpressions(previousTableView, false);
mapperManager.getProblemsManager().checkProblemsForAllEntries(currentSelectedTableView, true);
mapperManager.getProblemsManager().checkProblemsForAllEntries(previousTableView, true);
}
Aggregations