Search in sources :

Example 1 with ClassFilterEditor

use of com.intellij.ui.classFilter.ClassFilterEditor in project intellij-community by JetBrains.

the class DebuggerDataViewsConfigurable method createComponent.

@Override
public JComponent createComponent() {
    if (myProject == null) {
        myProject = JavaDebuggerSupport.getContextProjectForEditorFieldsInDebuggerConfigurables();
    }
    final JPanel panel = new JPanel(new GridBagLayout());
    myCbAutoscroll = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.autoscroll"));
    myCbShowSyntheticFields = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.synthetic.fields"));
    myCbShowValFieldsAsLocalVariables = new StateRestoringCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.val.fields.as.locals"));
    myCbHideNullArrayElements = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.hide.null.array.elements"));
    myCbShowStatic = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.static.fields"));
    myCbShowStaticFinalFields = new StateRestoringCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.static.final.fields"));
    myCbEnableAlternateViews = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.alternate.view"));
    myCbShowStatic.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            if (myCbShowStatic.isSelected()) {
                myCbShowStaticFinalFields.makeSelectable();
            } else {
                myCbShowStaticFinalFields.makeUnselectable(false);
            }
        }
    });
    myCbShowSyntheticFields.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            if (myCbShowSyntheticFields.isSelected()) {
                myCbShowValFieldsAsLocalVariables.makeSelectable();
            } else {
                myCbShowValFieldsAsLocalVariables.makeUnselectable(false);
            }
        }
    });
    myCbShowDeclaredType = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.declared.type"));
    myCbShowFQNames = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.fq.names"));
    myCbShowObjectId = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.object.id"));
    myCbHexValue = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.hex.value"));
    myCbShowStringsType = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.strings.type"));
    myCbEnableToString = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.enable.toString"));
    myRbAllThatOverride = new JRadioButton(DebuggerBundle.message("label.base.renderer.configurable.all.overriding"));
    myRbFromList = new JRadioButton(DebuggerBundle.message("label.base.renderer.configurable.classes.from.list"));
    ButtonGroup group = new ButtonGroup();
    group.add(myRbAllThatOverride);
    group.add(myRbFromList);
    myToStringFilterEditor = new ClassFilterEditor(myProject, null, "reference.viewBreakpoints.classFilters.newPattern");
    myCbEnableToString.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            final boolean enabled = myCbEnableToString.isSelected();
            myRbAllThatOverride.setEnabled(enabled);
            myRbFromList.setEnabled(enabled);
            myToStringFilterEditor.setEnabled(enabled && myRbFromList.isSelected());
        }
    });
    myRbFromList.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            myToStringFilterEditor.setEnabled(myCbEnableToString.isSelected() && myRbFromList.isSelected());
        }
    });
    panel.add(myCbAutoscroll, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insetsTop(4), 0, 0));
    final JPanel showPanel = new JPanel(new GridBagLayout());
    showPanel.setBorder(IdeBorderFactory.createTitledBorder("Show", true));
    showPanel.add(myCbShowDeclaredType, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
    showPanel.add(myCbShowObjectId, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insetsTop(4), 0, 0));
    showPanel.add(myCbShowSyntheticFields, new GridBagConstraints(1, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insetsLeft(10), 0, 0));
    showPanel.add(myCbShowStatic, new GridBagConstraints(1, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 10, 0, 0), 0, 0));
    showPanel.add(myCbShowValFieldsAsLocalVariables, new GridBagConstraints(2, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 10, 0, 0), 0, 0));
    showPanel.add(myCbShowStaticFinalFields, new GridBagConstraints(2, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 10, 0, 0), 0, 0));
    showPanel.add(myCbShowFQNames, new GridBagConstraints(3, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsLeft(10), 0, 0));
    panel.add(showPanel, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, HORIZONTAL, JBUI.insetsTop(4), 0, 0));
    //final JPanel arraysPanel = new JPanel(new BorderLayout(0, UIUtil.DEFAULT_VGAP));
    //final JComponent arraysComponent = myArrayRendererConfigurable.createComponent();
    //assert arraysComponent != null;
    //arraysPanel.add(arraysComponent, BorderLayout.CENTER);
    //arraysPanel.add(myCbHideNullArrayElements, BorderLayout.SOUTH);
    //arraysPanel.setBorder(IdeBorderFactory.createTitledBorder("Arrays", true));
    //panel.add(arraysPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 3, 1, 1.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    panel.add(myCbShowStringsType, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, NORTH, HORIZONTAL, JBUI.emptyInsets(), 0, 0));
    panel.add(myCbHexValue, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, NORTH, HORIZONTAL, JBUI.insetsTop(4), 0, 0));
    panel.add(myCbHideNullArrayElements, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, NORTH, HORIZONTAL, JBUI.insetsTop(4), 0, 0));
    panel.add(myCbEnableAlternateViews, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 0, 0, 10), 0, 0));
    // starting 4-th row
    panel.add(myCbEnableToString, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsTop(4), 0, 0));
    panel.add(myRbAllThatOverride, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsLeft(12), 0, 0));
    panel.add(myRbFromList, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsLeft(12), 0, 0));
    myToStringFilterEditor.setMinimumSize(JBUI.size(50, 100));
    panel.add(myToStringFilterEditor, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 1.0, CENTER, BOTH, JBUI.insetsLeft(12), 0, 0));
    return panel;
}
Also used : ItemEvent(java.awt.event.ItemEvent) GridBagConstraints(java.awt.GridBagConstraints) ClassFilterEditor(com.intellij.ui.classFilter.ClassFilterEditor) ChangeEvent(javax.swing.event.ChangeEvent) StateRestoringCheckBox(com.intellij.ui.StateRestoringCheckBox) ChangeListener(javax.swing.event.ChangeListener) ItemListener(java.awt.event.ItemListener)

Example 2 with ClassFilterEditor

use of com.intellij.ui.classFilter.ClassFilterEditor in project intellij-community by JetBrains.

the class DebuggerSteppingConfigurable method getComponent.

@Override
@NotNull
public JComponent getComponent() {
    final JPanel panel = new JPanel(new GridBagLayout());
    myCbSkipSyntheticMethods = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.synthetic.methods"));
    myCbSkipConstructors = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.constructors"));
    myCbSkipClassLoaders = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.classLoaders"));
    myCbSkipSimpleGetters = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.simple.getters"));
    myCbStepInfoFiltersEnabled = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.step.filters.list.header"));
    panel.add(myCbSkipSyntheticMethods, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
    panel.add(myCbSkipConstructors, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
    panel.add(myCbSkipClassLoaders, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
    panel.add(myCbSkipSimpleGetters, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0));
    panel.add(myCbStepInfoFiltersEnabled, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsTop(8), 0, 0));
    mySteppingFilterEditor = new ClassFilterEditor(JavaDebuggerSupport.getContextProjectForEditorFieldsInDebuggerConfigurables(), null, "reference.viewBreakpoints.classFilters.newPattern");
    panel.add(mySteppingFilterEditor, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 1.0, CENTER, BOTH, JBUI.insetsLeft(5), 0, 0));
    myCbStepInfoFiltersEnabled.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            mySteppingFilterEditor.setEnabled(myCbStepInfoFiltersEnabled.isSelected());
        }
    });
    myRbEvaluateFinallyAlways = new JRadioButton(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.always"));
    myRbEvaluateFinallyNever = new JRadioButton(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.never"));
    myRbEvaluateFinallyAsk = new JRadioButton(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.ask"));
    int cbLeftOffset = 0;
    final Border border = myCbSkipSimpleGetters.getBorder();
    if (border != null) {
        final Insets insets = border.getBorderInsets(myCbSkipSimpleGetters);
        if (insets != null) {
            cbLeftOffset = insets.left;
        }
    }
    final ButtonGroup group = new ButtonGroup();
    group.add(myRbEvaluateFinallyAlways);
    group.add(myRbEvaluateFinallyNever);
    group.add(myRbEvaluateFinallyAsk);
    final Box box = Box.createHorizontalBox();
    box.add(myRbEvaluateFinallyAlways);
    box.add(myRbEvaluateFinallyNever);
    box.add(myRbEvaluateFinallyAsk);
    final JPanel evalFinallyPanel = new JPanel(new BorderLayout());
    evalFinallyPanel.add(box, BorderLayout.CENTER);
    evalFinallyPanel.add(new JLabel(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.on.pop")), BorderLayout.WEST);
    panel.add(evalFinallyPanel, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, NORTHWEST, NONE, new Insets(4, cbLeftOffset, 0, 0), 0, 0));
    myCbResumeOnlyCurrentThread = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.resume.only.current.thread"));
    panel.add(myCbResumeOnlyCurrentThread, new GridBagConstraints(0, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, new Insets(0, 0, 0, 0), 0, 0));
    return panel;
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) ActionEvent(java.awt.event.ActionEvent) ClassFilterEditor(com.intellij.ui.classFilter.ClassFilterEditor) ActionListener(java.awt.event.ActionListener) Border(javax.swing.border.Border) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with ClassFilterEditor

use of com.intellij.ui.classFilter.ClassFilterEditor in project intellij-community by JetBrains.

the class EditClassFiltersDialog method createCenterPanel.

protected JComponent createCenterPanel() {
    JPanel contentPanel = new JPanel(new BorderLayout());
    Box mainPanel = Box.createHorizontalBox();
    myClassFilterEditor = new ClassFilterEditor(myProject, myChooserFilter, "reference.viewBreakpoints.classFilters.newPattern");
    myClassFilterEditor.setPreferredSize(JBUI.size(400, 200));
    myClassFilterEditor.setBorder(IdeBorderFactory.createTitledBorder(DebuggerBundle.message("class.filters.dialog.inclusion.filters.group"), false));
    mainPanel.add(myClassFilterEditor);
    myClassExclusionFilterEditor = new ClassFilterEditor(myProject, myChooserFilter, "reference.viewBreakpoints.classFilters.newPattern");
    myClassExclusionFilterEditor.setPreferredSize(JBUI.size(400, 200));
    myClassExclusionFilterEditor.setBorder(IdeBorderFactory.createTitledBorder(DebuggerBundle.message("class.filters.dialog.exclusion.filters.group"), false));
    mainPanel.add(myClassExclusionFilterEditor);
    contentPanel.add(mainPanel, BorderLayout.CENTER);
    return contentPanel;
}
Also used : ClassFilterEditor(com.intellij.ui.classFilter.ClassFilterEditor)

Aggregations

ClassFilterEditor (com.intellij.ui.classFilter.ClassFilterEditor)3 GridBagConstraints (java.awt.GridBagConstraints)2 StateRestoringCheckBox (com.intellij.ui.StateRestoringCheckBox)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 ItemEvent (java.awt.event.ItemEvent)1 ItemListener (java.awt.event.ItemListener)1 Border (javax.swing.border.Border)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 NotNull (org.jetbrains.annotations.NotNull)1