use of com.evolveum.midpoint.studio.ui.trace.lens.TraceTreeViewColumn in project midpoint-studio by Evolveum.
the class TraceOptionsPanel method createColumnsPanel.
private void createColumnsPanel(JPanel root) {
JPanel columnsPanel = createBoxLayoutPanel();
columnsPanel.setBorder(JBUI.Borders.empty(5));
predefinedColumnsBox = new ComboBox<>(PredefinedColumnSet.values());
predefinedColumnsBox.setAlignmentX(Component.LEFT_ALIGNMENT);
predefinedColumnsBox.addActionListener(e -> {
PredefinedColumnSet predefinedSet = (PredefinedColumnSet) predefinedColumnsBox.getSelectedItem();
LOG.info("Buhahaha " + predefinedSet);
if (predefinedSet != null) {
columnsChecks.forEach((column, checkBox) -> checkBox.setSelected(predefinedSet.contains(column)));
}
});
columnsPanel.add(predefinedColumnsBox);
for (TraceTreeViewColumn column : TraceTreeViewColumn.values()) {
JCheckBox check = new JCheckBox();
check.setText(column.getName());
check.setSelected(true);
columnsPanel.add(check);
columnsChecks.put(column, check);
}
root.add(new HeaderDecorator("Columns to show", columnsPanel), BorderLayout.SOUTH);
}
use of com.evolveum.midpoint.studio.ui.trace.lens.TraceTreeViewColumn in project midpoint-studio by Evolveum.
the class OpTreePanel method initMain.
private JComponent initMain() {
for (TraceTreeViewColumn column : TraceTreeViewColumn.values()) {
columnDefinitions.add(new TreeTableColumnDefinition<>(column));
}
opTreeTableModel = new OpTreeTableModel(columnDefinitions, rootOpNode);
traceTreeTable = MidPointUtils.createTable2(opTreeTableModel, MidPointUtils.createTableColumnModel(columnDefinitions), false);
traceTreeTable.addHighlighter(new AbstractHighlighter() {
@Override
protected Component doHighlight(Component component, ComponentAdapter adapter) {
int row = adapter.convertRowIndexToModel(adapter.row);
TreePath pathForRow = traceTreeTable.getPathForRow(row);
AbstractOpTreeTableNode node = (AbstractOpTreeTableNode) pathForRow.getLastPathComponent();
OpNode opNode = node.getUserObject();
if (opNode != null) {
// fixme hack
AbstractOpNodePresentation<?> presentation = (AbstractOpNodePresentation<?>) opNode.getPresentation();
if (adapter.isSelected()) {
component.setBackground(traceTreeTable.getSelectionBackground());
} else {
Color backgroundColor = presentation.getBackgroundColor();
if (backgroundColor != null) {
component.setBackground(backgroundColor);
} else {
component.setBackground(traceTreeTable.getBackground());
}
}
}
return component;
}
});
traceTreeTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
traceTreeTable.addTreeSelectionListener(this::traceTreeTableSelectionChanged);
JPanel panel = new BorderLayoutPanel();
JComponent toolbar = initMainToolbar();
panel.add(toolbar, BorderLayout.NORTH);
panel.add(new JBScrollPane(traceTreeTable), BorderLayout.CENTER);
return panel;
}
Aggregations