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();
}
}
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);
}
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);
}
});
}
Aggregations