Search in sources :

Example 1 with OpNode

use of com.evolveum.midpoint.schema.traces.OpNode in project midpoint-studio by Evolveum.

the class OpDetailsTreePanel method updateModel.

@Override
void updateModel(OpNode node) {
    super.updateModel(node);
    Node result;
    Node trace;
    if (node != null) {
        result = new ResultNode(node);
        trace = createTraceNodeTreatingExceptions(node);
    } else {
        result = TextNode.create("Result", "", null);
        trace = TextNode.create("Trace", "", null);
    }
    DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode();
    root.add(result);
    root.add(trace);
    updateTreeModel(root);
    applySelection(null);
}
Also used : ResultNode(com.evolveum.midpoint.studio.ui.trace.entry.ResultNode) OpNode(com.evolveum.midpoint.schema.traces.OpNode) TextNode(com.evolveum.midpoint.studio.ui.trace.entry.TextNode) TraceNode(com.evolveum.midpoint.studio.ui.trace.entry.TraceNode) DefaultMutableTreeTableNode(org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode) ResultNode(com.evolveum.midpoint.studio.ui.trace.entry.ResultNode) Node(com.evolveum.midpoint.studio.ui.trace.entry.Node) DefaultMutableTreeTableNode(org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode)

Example 2 with OpNode

use of com.evolveum.midpoint.schema.traces.OpNode in project midpoint-studio by Evolveum.

the class OpOverviewTreePanel method updateModel.

@Override
void updateModel(OpNode node) {
    super.updateModel(node);
    ViewingState initialState = new ViewingState();
    DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode();
    if (node != null) {
        root.add(new TextNode("Operation", node.getLabel()));
        if (node.getType() != null) {
            try {
                // noinspection unchecked
                ((AbstractOpNodePresentation<OpNode>) node.getPresentation()).getOverviewProvider().provideOverview(node, root, initialState);
            } catch (SchemaException e) {
                TextNode.create("Couldn't provide overview", e.getMessage(), root);
            }
        }
    }
    updateTreeModel(root);
    setViewingState(initialState);
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ViewingState(com.evolveum.midpoint.studio.ui.trace.ViewingState) TextNode(com.evolveum.midpoint.studio.ui.trace.entry.TextNode) OpNode(com.evolveum.midpoint.schema.traces.OpNode) DefaultMutableTreeTableNode(org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode)

Example 3 with OpNode

use of com.evolveum.midpoint.schema.traces.OpNode 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;
}
Also used : AbstractOpNodePresentation(com.evolveum.midpoint.studio.ui.trace.presentation.AbstractOpNodePresentation) OpTreeTableModel(com.evolveum.midpoint.studio.ui.trace.mainTree.model.OpTreeTableModel) BorderLayoutPanel(com.intellij.util.ui.components.BorderLayoutPanel) TreePath(javax.swing.tree.TreePath) AbstractHighlighter(org.jdesktop.swingx.decorator.AbstractHighlighter) AbstractOpTreeTableNode(com.evolveum.midpoint.studio.ui.trace.mainTree.model.AbstractOpTreeTableNode) TraceTreeViewColumn(com.evolveum.midpoint.studio.ui.trace.lens.TraceTreeViewColumn) OpNode(com.evolveum.midpoint.schema.traces.OpNode) ComponentAdapter(org.jdesktop.swingx.decorator.ComponentAdapter) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Example 4 with OpNode

use of com.evolveum.midpoint.schema.traces.OpNode in project midpoint-studio by Evolveum.

the class OpTreePanel method setChildrenVisible.

private void setChildrenVisible(boolean deep) {
    List<TreePath> selectedPaths = getSelectedPaths();
    for (TreePath selectedPath : selectedPaths) {
        AbstractOpTreeTableNode selectedTreeNode = (AbstractOpTreeTableNode) selectedPath.getLastPathComponent();
        OpNode selectedOpNode = selectedTreeNode.getUserObject();
        assert selectedOpNode != null;
        for (OpNode child : selectedOpNode.getChildren()) {
            setNodeVisible(child, true, deep);
        }
    }
    updateLinksAndRefresh(selectedPaths);
}
Also used : TreePath(javax.swing.tree.TreePath) AbstractOpTreeTableNode(com.evolveum.midpoint.studio.ui.trace.mainTree.model.AbstractOpTreeTableNode) OpNode(com.evolveum.midpoint.schema.traces.OpNode)

Example 5 with OpNode

use of com.evolveum.midpoint.schema.traces.OpNode in project midpoint-studio by Evolveum.

the class OpTreeTableModel method updateParentChildLinks.

private void updateParentChildLinks(AbstractOpTreeTableNode node) {
    for (OpNode visibleChild : node.getUserObject().getVisibleChildren()) {
        RegularOpTreeTableNode visibleTreeTableChild = convertedNodeMap.get(visibleChild);
        node.addChild(visibleTreeTableChild);
        updateParentChildLinks(visibleTreeTableChild);
    }
}
Also used : OpNode(com.evolveum.midpoint.schema.traces.OpNode)

Aggregations

OpNode (com.evolveum.midpoint.schema.traces.OpNode)10 AbstractOpTreeTableNode (com.evolveum.midpoint.studio.ui.trace.mainTree.model.AbstractOpTreeTableNode)3 TreePath (javax.swing.tree.TreePath)3 TextNode (com.evolveum.midpoint.studio.ui.trace.entry.TextNode)2 JBScrollPane (com.intellij.ui.components.JBScrollPane)2 BorderLayoutPanel (com.intellij.util.ui.components.BorderLayoutPanel)2 DefaultMutableTreeTableNode (org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode)2 PrismContext (com.evolveum.midpoint.prism.PrismContext)1 OpNodeTreeBuilder (com.evolveum.midpoint.schema.traces.OpNodeTreeBuilder)1 PerformanceCategory (com.evolveum.midpoint.schema.traces.PerformanceCategory)1 PerformanceCategoryInfo (com.evolveum.midpoint.schema.traces.PerformanceCategoryInfo)1 TraceParser (com.evolveum.midpoint.schema.traces.TraceParser)1 MidPointProjectNotifier (com.evolveum.midpoint.studio.impl.MidPointProjectNotifier)1 MidPointProjectNotifierAdapter (com.evolveum.midpoint.studio.impl.MidPointProjectNotifierAdapter)1 MidPointService (com.evolveum.midpoint.studio.impl.MidPointService)1 StudioNameResolver (com.evolveum.midpoint.studio.impl.trace.StudioNameResolver)1 TreeTableColumnDefinition (com.evolveum.midpoint.studio.ui.TreeTableColumnDefinition)1 ViewingState (com.evolveum.midpoint.studio.ui.trace.ViewingState)1 Node (com.evolveum.midpoint.studio.ui.trace.entry.Node)1 ResultNode (com.evolveum.midpoint.studio.ui.trace.entry.ResultNode)1