Search in sources :

Example 1 with SuspendPolicy

use of com.intellij.xdebugger.breakpoints.SuspendPolicy in project intellij-community by JetBrains.

the class XSuspendPolicyPanel method loadProperties.

@Override
void loadProperties() {
    SuspendPolicy suspendPolicy = myBreakpoint.getSuspendPolicy();
    boolean selected = suspendPolicy != SuspendPolicy.NONE;
    boolean suspendThreadSupported = myBreakpoint.getType().isSuspendThreadSupported();
    changeVisibleState(suspendThreadSupported);
    if (suspendThreadSupported) {
        mySuspendPolicyGroup.setSelected(suspendPolicy == SuspendPolicy.THREAD ? mySuspendThread.getModel() : mySuspendAll.getModel(), true);
        changeEnableState(selected);
    }
    mySuspendCheckBox.setSelected(selected);
    if (!selected && myDelegate != null) {
        myDelegate.showMoreOptionsIfNeeded();
    }
}
Also used : SuspendPolicy(com.intellij.xdebugger.breakpoints.SuspendPolicy)

Example 2 with SuspendPolicy

use of com.intellij.xdebugger.breakpoints.SuspendPolicy in project intellij-community by JetBrains.

the class XSuspendPolicyPanel method updateSuspendPolicyFont.

private void updateSuspendPolicyFont() {
    SuspendPolicy defaultPolicy = ((XBreakpointManagerImpl) myBreakpointManager).getBreakpointDefaults(myBreakpointType).getSuspendPolicy();
    Font font = mySuspendAll.getFont().deriveFont(Font.PLAIN);
    Font boldFont = font.deriveFont(Font.BOLD);
    mySuspendAll.setFont(SuspendPolicy.ALL.equals(defaultPolicy) ? boldFont : font);
    mySuspendThread.setFont(SuspendPolicy.THREAD.equals(defaultPolicy) ? boldFont : font);
}
Also used : SuspendPolicy(com.intellij.xdebugger.breakpoints.SuspendPolicy)

Example 3 with SuspendPolicy

use of com.intellij.xdebugger.breakpoints.SuspendPolicy in project intellij-community by JetBrains.

the class XSuspendPolicyPanel method init.

@Override
public void init(Project project, final XBreakpointManager breakpointManager, @NotNull XBreakpointBase breakpoint) {
    super.init(project, breakpointManager, breakpoint);
    mySuspendCheckBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            boolean selected = mySuspendCheckBox.isSelected();
            if (myBreakpoint.getType().isSuspendThreadSupported()) {
                changeEnableState(selected);
            }
            if (myDelegate != null && !selected) {
                myDelegate.showMoreOptionsIfNeeded();
            }
        }
    });
    if (!myBreakpoint.getType().isSuspendThreadSupported()) {
        return;
    }
    updateSuspendPolicyFont();
    ItemListener suspendPolicyChangeListener = new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            updateMakeDefaultEnableState();
        }
    };
    updateMakeDefaultEnableState();
    mySuspendAll.addItemListener(suspendPolicyChangeListener);
    mySuspendThread.addItemListener(suspendPolicyChangeListener);
    myMakeDefaultButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            SuspendPolicy suspendPolicy = getSelectedSuspendPolicy();
            ((XBreakpointManagerImpl) myBreakpointManager).getBreakpointDefaults(myBreakpointType).setSuspendPolicy(suspendPolicy);
            updateSuspendPolicyFont();
            if (SuspendPolicy.THREAD == suspendPolicy) {
                IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
                    IdeFocusManager.getGlobalInstance().requestFocus(mySuspendThread, true);
                });
            } else {
                IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
                    IdeFocusManager.getGlobalInstance().requestFocus(mySuspendAll, true);
                });
            }
            myMakeDefaultButton.setEnabled(false);
        }
    });
}
Also used : ItemEvent(java.awt.event.ItemEvent) SuspendPolicy(com.intellij.xdebugger.breakpoints.SuspendPolicy) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) ItemListener(java.awt.event.ItemListener) XBreakpointManagerImpl(com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl)

Aggregations

SuspendPolicy (com.intellij.xdebugger.breakpoints.SuspendPolicy)3 XBreakpointManagerImpl (com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl)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