use of org.talend.designer.gefabstractmap.figures.table.ColumnSash in project tdi-studio-se by Talend.
the class VarTable method createColumns.
/*
* (non-Javadoc)
*
* @see org.talend.designer.newabstractmap.figures.table.AbstractTable#createColumns()
*/
@Override
protected void createColumns() {
TableColumn column = new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
column.setText("Expression");
addColumn(column);
ColumnSash sash = new ColumnSash(this);
sash.setLeftColumn(column);
addSeparator(sash);
column = new TableColumn(ColumnKeyConstant.KEY_TYPE);
column.setText("Type");
sash.setRightColumn(column);
addColumn(column);
sash = new ColumnSash(this);
sash.setLeftColumn(column);
addSeparator(sash);
column = new TableColumn(ColumnKeyConstant.KEY_VARIABLE);
column.setText("Variable");
sash.setRightColumn(column);
addColumn(column);
}
use of org.talend.designer.gefabstractmap.figures.table.ColumnSash in project tdi-studio-se by Talend.
the class InputTreeSettingTable method createColumns.
/*
* (non-Javadoc)
*
* @see org.talend.designer.newabstractmap.figures.table.AbstractTable#createColumns()
*/
@Override
protected void createColumns() {
TableColumn column = new TableColumn(ColumnKeyConstant.TREE_SETTING_PROPERTY);
column.setText("Property");
addColumn(column);
ColumnSash sash = new ColumnSash(this);
sash.setLeftColumn(column);
addSeparator(sash);
column = new TableColumn(ColumnKeyConstant.TREE_SETTING_VALUE);
column.setText("Value");
sash.setRightColumn(column);
addColumn(column);
Figure container = getTableItemContainer();
lookupModelRow = new Figure();
lookupModelRow.setLayoutManager(new RowLayout());
Label label = new Label();
label.setText("Lookup Model");
label.setLabelAlignment(PositionConstants.LEFT);
CompoundBorder compoundBorder = new CompoundBorder(new ColumnBorder(), new RowBorder(2, 5, 2, -1));
label.setBorder(compoundBorder);
lookupModelRow.add(label);
lookupModel = new ComboCellLabel();
lookupModel.setDirectEditType(DirectEditType.LOOKUP_MODEL);
lookupModel.setText(getLookupDisplayName(inputxmlTree.getLookupMode()));
lookupModel.setLabelAlignment(PositionConstants.LEFT);
lookupModel.setBorder(new RowBorder(2, 5, 2, -1));
lookupModelRow.add(lookupModel);
container.add(lookupModelRow);
matchModelRow = new Figure();
matchModelRow.setLayoutManager(new RowLayout());
label = new Label();
label.setText("Match Model");
label.setLabelAlignment(PositionConstants.LEFT);
compoundBorder = new CompoundBorder(new ColumnBorder(), new RowBorder(2, 5, 2, -1));
label.setBorder(compoundBorder);
matchModelRow.add(label);
matchModel = new ComboCellLabel();
matchModel.setDirectEditType(DirectEditType.MATCH_MODEL);
matchModel.setText(getMatchModelDisplayName(inputxmlTree.getMatchingMode()));
matchModel.setLabelAlignment(PositionConstants.LEFT);
matchModel.setBorder(new RowBorder(2, 5, 2, -1));
matchModelRow.add(matchModel);
container.add(matchModelRow);
joinModelRow = new Figure();
joinModelRow.setLayoutManager(new RowLayout());
label = new Label();
label.setText("Join Model");
label.setLabelAlignment(PositionConstants.LEFT);
compoundBorder = new CompoundBorder(new ColumnBorder(), new RowBorder(2, 5, 2, -1));
label.setBorder(compoundBorder);
joinModelRow.add(label);
joinModel = new ComboCellLabel();
joinModel.setDirectEditType(DirectEditType.JOIN_MODEL);
String join = "";
if (inputxmlTree.isInnerJoin()) {
join = TreeSettingsConstant.INNER_JOIN;
} else {
join = TreeSettingsConstant.LEFT_OUTER_JOIN;
}
joinModel.setText(join);
joinModel.setLabelAlignment(PositionConstants.LEFT);
joinModel.setBorder(new RowBorder(2, 5, 2, -1));
joinModelRow.add(joinModel);
container.add(joinModelRow);
// TDI-17714:remove the true option in the Store temp data lookup property.
// persistentModelRow = new Figure();
// persistentModelRow.setLayoutManager(new TableItemLayout());
// label = new Label();
// label.setText("Store Temp Data");
// label.setLabelAlignment(PositionConstants.LEFT);
// compoundBorder = new CompoundBorder(new RowBorder(), new ColumnBorder());
// label.setBorder(compoundBorder);
// persistentModelRow.add(label);
// persistentModel = new ComboCellLabel();
// persistentModel.setDirectEditType(DirectEditType.PERSISTENT_MODEL);
// persistentModel.setText(String.valueOf(inputxmlTree.isPersistent()));
// persistentModel.setLabelAlignment(PositionConstants.LEFT);
// persistentModel.setBorder(new RowBorder(2, 5, 2, -1));
// persistentModelRow.add(persistentModel);
// container.add(persistentModelRow);
container.setOpaque(true);
container.setBackgroundColor(ColorConstants.white);
container.addMouseListener(new MouseListener() {
Figure selectedFigure = null;
@Override
public void mousePressed(MouseEvent me) {
boolean lookup = lookupModelRow.containsPoint(me.x, me.y);
if (lookup) {
if (selectedFigure != lookupModelRow) {
lookupModelRow.setOpaque(true);
lookupModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_COLUMN_TREE_SETTING));
matchModelRow.setOpaque(false);
joinModelRow.setOpaque(false);
// persistentModelRow.setOpaque(false);
}
return;
}
boolean matchModel = matchModelRow.containsPoint(me.x, me.y);
if (matchModel) {
if (selectedFigure != matchModelRow) {
matchModelRow.setOpaque(true);
matchModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_COLUMN_TREE_SETTING));
lookupModelRow.setOpaque(false);
joinModelRow.setOpaque(false);
// persistentModelRow.setOpaque(false);
}
return;
}
boolean joinModel = joinModelRow.containsPoint(me.x, me.y);
if (joinModel) {
if (selectedFigure != joinModelRow) {
joinModelRow.setOpaque(true);
joinModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_COLUMN_TREE_SETTING));
lookupModelRow.setOpaque(false);
matchModelRow.setOpaque(false);
// persistentModelRow.setOpaque(false);
}
return;
}
// boolean persistentModel = persistentModelRow.containsPoint(me.x, me.y);
// if (persistentModel) {
// if (selectedFigure != persistentModelRow) {
// persistentModelRow.setOpaque(true);
// persistentModelRow.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_SELECTION));
// lookupModelRow.setOpaque(false);
// matchModelRow.setOpaque(false);
// joinModelRow.setOpaque(false);
// }
// }
}
@Override
public void mouseReleased(MouseEvent me) {
}
@Override
public void mouseDoubleClicked(MouseEvent me) {
}
});
}
Aggregations