Search in sources :

Example 1 with OpType

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

the class TraceService method createOptions.

private Options createOptions(PredefinedOpView opViewType) {
    Options options = new Options();
    for (OpType op : OpType.values()) {
        if (opViewType.getTypes().contains(op)) {
            options.getTypesToShow().add(op);
        }
    }
    for (PerformanceCategory pc : PerformanceCategory.values()) {
        if (opViewType.getCategories() == null || opViewType.getCategories().contains(pc)) {
            options.getCategoriesToShow().add(pc);
        }
    }
    options.setShowAlsoParents(opViewType.isShowAlsoParents());
    options.getColumnsToShow().addAll(opViewType.getColumnsToShow());
    return options;
}
Also used : PerformanceCategory(com.evolveum.midpoint.schema.traces.PerformanceCategory) OpType(com.evolveum.midpoint.schema.traces.OpType)

Example 2 with OpType

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

the class TraceOptionsPanel method createOptions.

private Options createOptions() {
    Options rv = new Options();
    for (Map.Entry<OpType, JCheckBox> e : opTypesChecks.entrySet()) {
        if (e.getValue().isSelected()) {
            rv.getTypesToShow().add(e.getKey());
        }
    }
    for (Map.Entry<PerformanceCategory, JCheckBox> e : categoriesChecks.entrySet()) {
        if (e.getValue().isSelected()) {
            rv.getCategoriesToShow().add(e.getKey());
        }
    }
    rv.setShowAlsoParents(alsoParentsCheck.isSelected());
    columnsChecks.entrySet().stream().filter(e -> e.getValue().isSelected()).map(Map.Entry::getKey).forEach(column -> rv.getColumnsToShow().add(column));
    return rv;
}
Also used : Options(com.evolveum.midpoint.studio.impl.trace.Options) PerformanceCategory(com.evolveum.midpoint.schema.traces.PerformanceCategory) OpType(com.evolveum.midpoint.schema.traces.OpType) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with OpType

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

the class TraceOptionsPanel method createOpTypesPanel.

private void createOpTypesPanel(JPanel root) {
    JPanel opTypesPanel = createBoxLayoutPanel();
    opTypesPanel.setBorder(JBUI.Borders.empty(5));
    predefinedOpTypesBox = new ComboBox<>(PredefinedOpTypeSet.values());
    predefinedOpTypesBox.setAlignmentX(Component.LEFT_ALIGNMENT);
    predefinedOpTypesBox.addActionListener(e -> {
        PredefinedOpTypeSet predefinedSet = (PredefinedOpTypeSet) predefinedOpTypesBox.getSelectedItem();
        LOG.info("Buhahaha " + predefinedSet);
        if (predefinedSet != null) {
            opTypesChecks.forEach((opType, checkBox) -> checkBox.setSelected(predefinedSet.contains(opType)));
        }
    });
    opTypesPanel.add(predefinedOpTypesBox);
    for (OpType type : OpType.values()) {
        JCheckBox check = new JCheckBox();
        check.setText(type.getLabel());
        opTypesPanel.add(check);
        opTypesChecks.put(type, check);
    }
    root.add(new HeaderDecorator("Operation types to show", opTypesPanel), BorderLayout.NORTH);
}
Also used : HeaderDecorator(com.evolveum.midpoint.studio.ui.HeaderDecorator) OpType(com.evolveum.midpoint.schema.traces.OpType)

Aggregations

OpType (com.evolveum.midpoint.schema.traces.OpType)3 PerformanceCategory (com.evolveum.midpoint.schema.traces.PerformanceCategory)2 Options (com.evolveum.midpoint.studio.impl.trace.Options)1 HeaderDecorator (com.evolveum.midpoint.studio.ui.HeaderDecorator)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1