changeViewer.setUseHashlookup(true);
- TableViewerColumn selection = TableUtils.addColumn(changeViewer, getColumntTitle(0), false, false, 20);
- TableViewerColumn diagram = TableUtils.addColumn(changeViewer, getColumntTitle(1), true, true, 100);
- TableViewerColumn symbol = TableUtils.addColumn(changeViewer, getColumntTitle(2), true, true, 100);
- TableViewerColumn property = TableUtils.addColumn(changeViewer, getColumntTitle(3), true, true, 100);
- TableViewerColumn oldValue = TableUtils.addColumn(changeViewer, getColumntTitle(4), true, true, 100);
- TableViewerColumn newValue = TableUtils.addColumn(changeViewer, getColumntTitle(5), true, true, 100);
-
- diagram.setLabelProvider(getLabelProvider(1));
- symbol.setLabelProvider(getLabelProvider(2));
- property.setLabelProvider(getLabelProvider(3));
- oldValue.setLabelProvider(getLabelProvider(4));
- newValue.setLabelProvider(getLabelProvider(5));
+ TableViewerColumn cols[] = new TableViewerColumn[getChangeListColumnCount()];
+ TableViewerColumn selection = TableUtils.addColumn(changeViewer, getColumntTitle(0), false, false, getChangeListColumnWidth(0));
+ cols[0] = selection;
+ for (int i = 1 ; i < getChangeListColumnCount(); i++) {
+ TableViewerColumn column = TableUtils.addColumn(changeViewer, getColumntTitle(i), true, getChangeListColumnSortable(i), getChangeListColumnWidth(i));
+ cols[i] = column;
+ column.setLabelProvider(getLabelProvider(i));
+ configureChangeListColumn(i, column);
+ }
selection.setLabelProvider(new SelectionLabelProvider());
selection.getColumn().addSelectionListener(new SelectionAdapter() {
});
}
+ protected int getChangeListColumnCount() {
+ return 6;
+ }
+
+ protected int getChangeListColumnWidth(int col) {
+ if (col == 0)
+ return 20;
+ return 100;
+ }
+
+ protected boolean getChangeListColumnSortable(int col) {
+ if (col == 0)
+ return false;
+ return true;
+ }
+
+ protected void configureChangeListColumn(int col, TableViewerColumn column) {
+
+ }
+
protected Session getSession() {
return Simantics.getSession();
}
Statement stm = mod.getLeftStm();
sb.append(NameUtils.getSafeName(graph, mod.getLeftSub()) + " "+
NameUtils.getSafeName(graph, stm.getPredicate()) + " " +
- NameUtils.getSafeName(graph, stm.getObject()) + " (" +
+ truncate(NameUtils.getSafeName(graph, stm.getObject())) + " (" +
stm.getSubject() + " " +stm.getPredicate() + " " + stm.getObject() + ")\n");
}
{
Statement stm = mod.getRightStm();
sb.append(NameUtils.getSafeName(graph, mod.getRightSub()) + " "+
NameUtils.getSafeName(graph, stm.getPredicate()) + " " +
- NameUtils.getSafeName(graph, stm.getObject()) + " (" +
+ truncate(NameUtils.getSafeName(graph, stm.getObject())) + " (" +
stm.getSubject() + " " +stm.getPredicate() + " " + stm.getObject() + ")\n");
}
}
return sb.toString();
}
+ public String truncate(String s) {
+ if (s.length() < 100)
+ return s;
+ return s.substring(0, 100)+"...";
+ }
+
public String comparableToString(ReadGraph graph) throws DatabaseException {
StringBuilder sb = new StringBuilder();
sb.append("Comparable:\n");