use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.
the class InputDataMapTableView method getCellColor.
/**
* DOC amaumont Comment method "getCellColor".
*
* @param tableViewerCreator
* @param element
* @param columnIndex
* @param isBackground TODO
* @return
*/
protected Color getCellColor(TableViewerCreator tableViewerCreator, Object element, int columnIndex, boolean isBackground) {
ITableEntry entry = (ITableEntry) element;
TableViewerCreatorColumnNotModifiable column = (TableViewerCreatorColumnNotModifiable) tableViewerCreator.getColumns().get(columnIndex);
if (column.getId().equals(ID_OPERATOR)) {
return getExpressionColorProvider().getColor(isBackground, entry.getProblems(), ProblemsManager.KEY_OPERATOR_EMPTY);
}
if (column.getId().equals(ID_NAME_COLUMN)) {
return getExpressionColorProvider().getColor(isBackground, entry.getProblems(), ProblemsManager.KEY_NO_MATCHING);
}
return super.getCellColor(tableViewerCreator, element, columnIndex, isBackground);
}
use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.
the class OutputDataMapTableView method onOutputTableFiltersModified.
@Override
protected void onOutputTableFiltersModified(ModifiedBeanEvent<FilterTableEntry> event, AbstractExtendedTableViewer<FilterTableEntry> _extendedTableViewerForFilters) {
super.onOutputTableFiltersModified(event, _extendedTableViewerForFilters);
TableViewerCreator tableViewerCreator = entendedTableViewerForOtherClauses.getTableViewerCreator();
ITableEntry tableEntry = event.bean;
parseExpressionIfNeeded(event, tableViewerCreator, tableEntry);
}
use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.
the class DataMapTableView method initShowMessageErrorListener.
/**
* DOC amaumont Comment method "initShowMessageErrorListener".
*
* @param table
*/
protected void initShowMessageErrorListener(final Table table) {
showErrorMessageListener = new Listener() {
@Override
public void handleEvent(Event event) {
switch(event.type) {
case SWT.MouseMove:
// System.out.println("ToolTipText:" + table.getToolTipText());
String defaultToolTip = null;
if (WindowSystem.isGTK() && table.getToolTipText() != null) {
//$NON-NLS-1$
defaultToolTip = " ";
}
Point cursorPositionFromTableOrigin = TableUtils.getCursorPositionFromTableOrigin(table, event);
TableColumn tableColumn = TableUtils.getTableColumn(table, cursorPositionFromTableOrigin);
if (tableColumn == null) {
setTableToolTipText(table, null, null, defaultToolTip);
return;
}
TableItem tableItem = TableUtils.getTableItem(table, cursorPositionFromTableOrigin);
if (tableItem == null) {
setTableToolTipText(table, tableColumn, null, defaultToolTip);
return;
}
ITableEntry tableEntry = (ITableEntry) tableItem.getData();
String toolTip = null;
if (tableEntry.getProblems() != null) {
List<Problem> problems = tableEntry.getProblems();
//$NON-NLS-1$
toolTip = "";
for (Problem problem : problems) {
//$NON-NLS-1$ //$NON-NLS-2$
String description = problem.getDescription().replaceAll("[\r\n\t]", "");
//$NON-NLS-1$
toolTip += description + "\n";
}
}
if (WindowSystem.isGTK() && toolTip == null && table.getToolTipText() != null) {
toolTip = defaultToolTip;
}
setTableToolTipText(table, tableColumn, tableEntry, toolTip);
break;
default:
}
}
/**
* DOC amaumont Comment method "setTableToolTipText".
*
* @param table
* @param tableColumn
* @param text
*/
private void setTableToolTipText(final Table table, TableColumn tableColumn, ITableEntry tableEntry, String text) {
table.setToolTipText(text);
}
};
table.addListener(SWT.MouseMove, showErrorMessageListener);
}
use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.
the class DataMapTableView method unselectAllEntriesIfErrorDetected.
/**
* DOC amaumont Comment method "unselectAllEntriesIfErrorDetected".
*
* @param e
*/
protected void unselectAllEntriesIfErrorDetected(TableCellValueModifiedEvent e) {
if (e.column.getId().equals(ID_EXPRESSION_COLUMN)) {
ITableEntry currentEntry = (ITableEntry) e.bean;
TableViewer tableViewer = null;
if (currentEntry instanceof IColumnEntry) {
tableViewer = DataMapTableView.this.getTableViewerCreatorForColumns().getTableViewer();
} else if (currentEntry instanceof FilterTableEntry) {
if (FilterTableEntry.OTHER_FILTER.equals(((FilterTableEntry) currentEntry).getFilterKind())) {
tableViewer = entendedTableViewerForOtherClauses.getTableViewerCreator().getTableViewer();
} else {
tableViewer = extendedTableViewerForFilters.getTableViewerCreator().getTableViewer();
}
}
if (currentEntry.getProblems() != null) {
tableViewer.getTable().deselectAll();
}
}
}
use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.
the class DataMapTableView method getCellColor.
/**
* DOC amaumont Comment method "getCellColor".
*
* @param tableViewerCreator
* @param element
* @param columnIndex
* @param isBackground TODO
* @return
*/
protected Color getCellColor(TableViewerCreatorNotModifiable tableViewerCreator, Object element, int columnIndex, boolean isBackground) {
ITableEntry entry = (ITableEntry) element;
TableViewerCreatorColumnNotModifiable column = (TableViewerCreatorColumnNotModifiable) tableViewerCreator.getColumns().get(columnIndex);
if (column.getId().equals(ID_EXPRESSION_COLUMN)) {
return expressionColorProvider.getColor(isBackground, entry.getProblems(), ProblemsManager.KEY_INPUT_EXPRESSION_EMPTY, ProblemsManager.KEY_OUTPUT_EXPRESSION_EMPTY);
}
return null;
}
Aggregations