MRI-2340 Automatically convert all UI Designer forms to sources

GitOrigin-RevId: 55249a442675e053b5093502648453b84391ec54
This commit is contained in:
Leonid Shalupov
2026-02-14 16:43:48 +00:00
committed by intellij-monorepo-bot
parent 1a1cdc46b2
commit b5eb6d8e20
315 changed files with 47367 additions and 7910 deletions
@@ -4,18 +4,24 @@ package com.intellij.debugger.actions;
import com.intellij.debugger.JavaDebuggerBundle;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.ui.ex.MultiLineLabel;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.xdebugger.impl.ui.tree.ValueMarkerPresentationDialogBase;
import com.intellij.xdebugger.impl.ui.tree.ValueMarkup;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.AbstractButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Insets;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.ResourceBundle;
/**
* @author Eugene Zhuravlev
@@ -23,10 +29,10 @@ import java.util.Collection;
public class ObjectMarkupPropertiesDialog extends ValueMarkerPresentationDialogBase {
private static final @NonNls String MARK_ALL_REFERENCED_VALUES_KEY = "debugger.mark.all.referenced.values";
private static final boolean MARK_ALL_REFERENCED_VALUES_DEFAULT_VALUE = true;
private JCheckBox myCbMarkAdditionalFields;
private final JCheckBox myCbMarkAdditionalFields;
private final boolean mySuggestAdditionalMarkup;
private JPanel myAdditionalPropertiesPanel;
private MultiLineLabel myDescriptionLabel;
private final JPanel myAdditionalPropertiesPanel;
private final MultiLineLabel myDescriptionLabel;
public ObjectMarkupPropertiesDialog(@Nullable Component parent,
final @NotNull String defaultText,
@@ -34,15 +40,85 @@ public class ObjectMarkupPropertiesDialog extends ValueMarkerPresentationDialogB
@NotNull Collection<ValueMarkup> markups) {
super(parent, defaultText, markups);
mySuggestAdditionalMarkup = suggestAdditionalMarkup;
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
myAdditionalPropertiesPanel = new JPanel();
myAdditionalPropertiesPanel.setLayout(new GridLayoutManager(2, 1, new Insets(5, 0, 0, 0), -1, -1));
myDescriptionLabel = new MultiLineLabel();
myDescriptionLabel.setText("");
myAdditionalPropertiesPanel.add(myDescriptionLabel,
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
myCbMarkAdditionalFields = new JCheckBox();
this.$$$loadButtonText$$$(myCbMarkAdditionalFields, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.object.markup.dialog.mark.referenced"));
myAdditionalPropertiesPanel.add(myCbMarkAdditionalFields,
new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
myDescriptionLabel.setText(JavaDebuggerBundle.message("if.the.value.is.referenced.by.a.constant.field"));
myCbMarkAdditionalFields.setSelected(PropertiesComponent.getInstance().getBoolean(MARK_ALL_REFERENCED_VALUES_KEY, MARK_ALL_REFERENCED_VALUES_DEFAULT_VALUE));
myCbMarkAdditionalFields.setSelected(
PropertiesComponent.getInstance().getBoolean(MARK_ALL_REFERENCED_VALUES_KEY, MARK_ALL_REFERENCED_VALUES_DEFAULT_VALUE));
init();
}
private static Method $$$cachedGetBundleMethod$$$ = null;
/** @noinspection ALL */
private String $$$getMessageFromBundle$$$(String path, String key) {
ResourceBundle bundle;
try {
Class<?> thisClass = this.getClass();
if ($$$cachedGetBundleMethod$$$ == null) {
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
}
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
}
catch (Exception e) {
bundle = ResourceBundle.getBundle(path);
}
return bundle.getString(key);
}
/** @noinspection ALL */
private void $$$loadButtonText$$$(AbstractButton component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
/** @noinspection ALL */
public JComponent $$$getRootComponent$$$() { return myAdditionalPropertiesPanel; }
@Override
protected void doOKAction() {
if (mySuggestAdditionalMarkup) {
PropertiesComponent.getInstance().setValue(MARK_ALL_REFERENCED_VALUES_KEY, myCbMarkAdditionalFields.isSelected(), MARK_ALL_REFERENCED_VALUES_DEFAULT_VALUE);
PropertiesComponent.getInstance()
.setValue(MARK_ALL_REFERENCED_VALUES_KEY, myCbMarkAdditionalFields.isSelected(), MARK_ALL_REFERENCED_VALUES_DEFAULT_VALUE);
}
super.doOKAction();
}
@@ -12,32 +12,119 @@ import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.util.text.StringUtilRt;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.intellij.xdebugger.impl.settings.DebuggerConfigurable;
import org.jetbrains.annotations.NotNull;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.Method;
import java.util.ResourceBundle;
public class GenericDebuggerParametersRunnerConfigurable extends SettingsEditor<GenericDebuggerRunnerSettings> {
private static final Logger LOG = Logger.getInstance(GenericDebuggerParametersRunnerConfigurable.class);
private JPanel myPanel;
private JTextField myAddressField;
private JPanel myShMemPanel;
private JPanel myPortPanel;
private JTextField myPortField;
private final JPanel myPanel;
private final JTextField myAddressField;
private final JPanel myShMemPanel;
private final JPanel myPortPanel;
private final JTextField myPortField;
private boolean myIsLocal = false;
private JButton myDebuggerSettings;
private JRadioButton mySocketTransport;
private JRadioButton myShmemTransport;
private JPanel myTransportPanel;
private final JButton myDebuggerSettings;
private final JRadioButton mySocketTransport;
private final JRadioButton myShmemTransport;
private final JPanel myTransportPanel;
public GenericDebuggerParametersRunnerConfigurable(final Project project) {
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
myPanel = new JPanel();
myPanel.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
myShMemPanel = new JPanel();
myShMemPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
myPanel.add(myShMemPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
null, 0, false));
final JLabel label1 = new JLabel();
this.$$$loadLabelText$$$(label1, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.generic.debugger.parameters.patcher.configurable.shmem.address"));
myShMemPanel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
false));
myAddressField = new JTextField();
myAddressField.setText("");
myShMemPanel.add(myAddressField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
myPortPanel = new JPanel();
myPortPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
myPanel.add(myPortPanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
null, 0, false));
final JLabel label2 = new JLabel();
this.$$$loadLabelText$$$(label2, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.generic.debugger.parameters.patcher.configurable.port"));
myPortPanel.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
false));
myPortField = new JTextField();
myPortField.setColumns(5);
myPortPanel.add(myPortField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
myDebuggerSettings = new JButton();
this.$$$loadButtonText$$$(myDebuggerSettings,
this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle", "button.debugger.settings"));
myPanel.add(myDebuggerSettings, new GridConstraints(1, 1, 2, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myTransportPanel = new JPanel();
myTransportPanel.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1));
myPanel.add(myTransportPanel, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
final JLabel label3 = new JLabel();
this.$$$loadLabelText$$$(label3, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.generic.debugger.parameters.patcher.configurable.transport"));
myTransportPanel.add(label3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null,
0, false));
mySocketTransport = new JRadioButton();
mySocketTransport.setSelected(true);
this.$$$loadButtonText$$$(mySocketTransport, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.generic.debugger.parameters.patcher.configurable.socket"));
myTransportPanel.add(mySocketTransport, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK |
GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,
null, null, null, 0, false));
myShmemTransport = new JRadioButton();
this.$$$loadButtonText$$$(myShmemTransport, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.generic.debugger.parameters.patcher.configurable.shmem"));
myTransportPanel.add(myShmemTransport, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK |
GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,
null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
myTransportPanel.add(spacer1, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
}
myDebuggerSettings.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -70,6 +157,78 @@ public class GenericDebuggerParametersRunnerConfigurable extends SettingsEditor<
group.add(myShmemTransport);
}
private static Method $$$cachedGetBundleMethod$$$ = null;
/** @noinspection ALL */
private String $$$getMessageFromBundle$$$(String path, String key) {
ResourceBundle bundle;
try {
Class<?> thisClass = this.getClass();
if ($$$cachedGetBundleMethod$$$ == null) {
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
}
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
}
catch (Exception e) {
bundle = ResourceBundle.getBundle(path);
}
return bundle.getString(key);
}
/** @noinspection ALL */
private void $$$loadLabelText$$$(JLabel component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setDisplayedMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
/** @noinspection ALL */
private void $$$loadButtonText$$$(AbstractButton component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
/** @noinspection ALL */
public JComponent $$$getRootComponent$$$() { return myPanel; }
private boolean isSocket() {
return getTransport() == DebuggerSettings.SOCKET_TRANSPORT;
}
@@ -39,7 +39,11 @@ import com.intellij.ui.AnActionButtonRunnable;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.TableUtil;
import com.intellij.ui.ToolbarDecorator;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.ui.table.JBTable;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.PlatformIcons;
@@ -55,6 +59,7 @@ import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.AbstractButton;
import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JCheckBox;
@@ -67,27 +72,116 @@ import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumnModel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.KeyEvent;
import java.lang.reflect.Method;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.ResourceBundle;
public final class CaptureConfigurable implements SearchableConfigurable, NoScroll {
private static final Logger LOG = Logger.getInstance(CaptureConfigurable.class);
private final Project myProject;
private JCheckBox myDebuggerAgent;
private JCheckBox myThrottling;
private JButton myConfigureAnnotationsButton;
private JPanel myCapturePanel;
private final JCheckBox myDebuggerAgent;
private final JCheckBox myThrottling;
private final JButton myConfigureAnnotationsButton;
private final JPanel myCapturePanel;
private MyTableModel myTableModel;
private JCheckBox myCaptureVariables;
private JPanel myPanel;
private final JCheckBox myCaptureVariables;
private final JPanel myPanel;
public CaptureConfigurable(Project project) {
myProject = project;
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
myPanel = new JPanel();
myPanel.setLayout(new GridLayoutManager(3, 3, new Insets(0, 0, 0, 0), -1, -1));
myDebuggerAgent = new JBCheckBox();
this.$$$loadButtonText$$$(myDebuggerAgent, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.capture.configurable.debugger.agent"));
myPanel.add(myDebuggerAgent, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null,
0, false));
final Spacer spacer1 = new Spacer();
myPanel.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
myConfigureAnnotationsButton = new JButton();
this.$$$loadButtonText$$$(myConfigureAnnotationsButton, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.capture.configurable.annotations.configure"));
myPanel.add(myConfigureAnnotationsButton,
new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myThrottling = new JBCheckBox();
this.$$$loadButtonText$$$(myThrottling,
this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle", "label.capture.configurable.throttling"));
myPanel.add(myThrottling,
new GridConstraints(1, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 1, false));
myCapturePanel = new JPanel();
myCapturePanel.setLayout(new BorderLayout(0, 0));
myPanel.add(myCapturePanel, new GridConstraints(2, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
myCaptureVariables = new JBCheckBox();
this.$$$loadButtonText$$$(myCaptureVariables, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.capture.configurable.capture.variables"));
myCapturePanel.add(myCaptureVariables, BorderLayout.SOUTH);
}
}
private static Method $$$cachedGetBundleMethod$$$ = null;
/** @noinspection ALL */
private String $$$getMessageFromBundle$$$(String path, String key) {
ResourceBundle bundle;
try {
Class<?> thisClass = this.getClass();
if ($$$cachedGetBundleMethod$$$ == null) {
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
}
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
}
catch (Exception e) {
bundle = ResourceBundle.getBundle(path);
}
return bundle.getString(key);
}
/** @noinspection ALL */
private void $$$loadButtonText$$$(AbstractButton component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
/** @noinspection ALL */
public JComponent $$$getRootComponent$$$() { return myPanel; }
@Override
public @NotNull String getId() {
return getHelpTopic();
@@ -284,7 +378,8 @@ public final class CaptureConfigurable implements SearchableConfigurable, NoScro
@Override
public void actionPerformed(final @NotNull AnActionEvent e) {
VirtualFileWrapper wrapper = FileChooserFactory.getInstance()
.createSaveFileDialog(new FileSaverDescriptor(JavaDebuggerBundle.message("export.selected.capture.points.to.file"), "", "xml"), e.getProject())
.createSaveFileDialog(new FileSaverDescriptor(JavaDebuggerBundle.message("export.selected.capture.points.to.file"), "", "xml"),
e.getProject())
.save((Path)null, null);
if (wrapper == null) return;
@@ -7,30 +7,111 @@ import com.intellij.debugger.impl.DebuggerSession;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import java.awt.Insets;
import java.lang.reflect.Method;
import java.util.ResourceBundle;
/**
* @author Eugene Belyaev
*/
public class ThreadsViewConfigurable implements Configurable {
private final ThreadsViewSettings mySettings;
private JPanel myPanel;
private JCheckBox myShowGroupsCheckBox;
private JCheckBox myLineNumberCheckBox;
private JCheckBox myClassNameCheckBox;
private JCheckBox mySourceCheckBox;
private JCheckBox myShowSyntheticsCheckBox;
private JCheckBox myShowCurrentThreadChechBox;
private JCheckBox myPackageCheckBox;
private JCheckBox myArgsTypesCheckBox;
private final JPanel myPanel;
private final JCheckBox myShowGroupsCheckBox;
private final JCheckBox myLineNumberCheckBox;
private final JCheckBox myClassNameCheckBox;
private final JCheckBox mySourceCheckBox;
private final JCheckBox myShowSyntheticsCheckBox;
private final JCheckBox myShowCurrentThreadChechBox;
private final JCheckBox myPackageCheckBox;
private final JCheckBox myArgsTypesCheckBox;
private final CompositeDataBinding myDataBinding = new CompositeDataBinding();
public ThreadsViewConfigurable(ThreadsViewSettings settings) {
mySettings = settings;
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
myPanel = new JPanel();
myPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, 0));
myPanel.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, null, null));
myShowGroupsCheckBox = new JCheckBox();
myShowGroupsCheckBox.setMargin(new Insets(5, 2, 2, 2));
this.$$$loadButtonText$$$(myShowGroupsCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.show.thread.groups"));
panel1.add(myShowGroupsCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myShowSyntheticsCheckBox = new JCheckBox();
this.$$$loadButtonText$$$(myShowSyntheticsCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.show.stack.frames.for.synthetic.methods"));
panel1.add(myShowSyntheticsCheckBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myShowCurrentThreadChechBox = new JCheckBox();
this.$$$loadButtonText$$$(myShowCurrentThreadChechBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.current.thread.on.top"));
panel1.add(myShowCurrentThreadChechBox, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK |
GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,
null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, 0));
myPanel.add(panel2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null,
0, false));
panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, null, null));
myLineNumberCheckBox = new JCheckBox();
myLineNumberCheckBox.setMargin(new Insets(5, 2, 2, 2));
this.$$$loadButtonText$$$(myLineNumberCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.show.line.number"));
panel2.add(myLineNumberCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myClassNameCheckBox = new JCheckBox();
this.$$$loadButtonText$$$(myClassNameCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.show.class.name"));
panel2.add(myClassNameCheckBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
mySourceCheckBox = new JCheckBox();
this.$$$loadButtonText$$$(mySourceCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.show.source.file.name"));
panel2.add(mySourceCheckBox, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myPackageCheckBox = new JCheckBox();
this.$$$loadButtonText$$$(myPackageCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.show.package"));
panel2.add(myPackageCheckBox, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myArgsTypesCheckBox = new JCheckBox();
this.$$$loadButtonText$$$(myArgsTypesCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.threads.view.configurable.show.prams.types"));
panel2.add(myArgsTypesCheckBox, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
myDataBinding.addBinding(new ToggleButtonBinding("SHOW_CLASS_NAME", myClassNameCheckBox));
myDataBinding.addBinding(new ToggleButtonBinding("SHOW_PACKAGE_NAME", myPackageCheckBox));
@@ -41,6 +122,53 @@ public class ThreadsViewConfigurable implements Configurable {
myDataBinding.addBinding(new ToggleButtonBinding("SHOW_CURRENT_THREAD", myShowCurrentThreadChechBox));
}
private static Method $$$cachedGetBundleMethod$$$ = null;
/** @noinspection ALL */
private String $$$getMessageFromBundle$$$(String path, String key) {
ResourceBundle bundle;
try {
Class<?> thisClass = this.getClass();
if ($$$cachedGetBundleMethod$$$ == null) {
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
}
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
}
catch (Exception e) {
bundle = ResourceBundle.getBundle(path);
}
return bundle.getString(key);
}
/** @noinspection ALL */
private void $$$loadButtonText$$$(AbstractButton component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
/** @noinspection ALL */
public JComponent $$$getRootComponent$$$() { return myPanel; }
@Override
public String getDisplayName() {
return JavaDebuggerBundle.message("threads.view.configurable.display.name");
@@ -22,29 +22,123 @@ import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.ui.DocumentAdapter;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import javax.swing.event.DocumentEvent;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.Method;
import java.util.List;
import java.util.ResourceBundle;
public abstract class AddFieldBreakpointDialog extends DialogWrapper {
private final Project myProject;
private JPanel myPanel;
private TextFieldWithBrowseButton myFieldChooser;
private TextFieldWithBrowseButton myClassChooser;
private final JPanel myPanel;
private final TextFieldWithBrowseButton myFieldChooser;
private final TextFieldWithBrowseButton myClassChooser;
public AddFieldBreakpointDialog(Project project) {
super(project, true);
myProject = project;
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
myPanel = new JPanel();
myPanel.setLayout(new GridLayoutManager(6, 1, new Insets(0, 0, 0, 0), -1, 6));
myClassChooser = new TextFieldWithBrowseButton();
myPanel.add(myClassChooser, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
new Dimension(150, -1), null, 0, false));
myFieldChooser = new TextFieldWithBrowseButton();
myPanel.add(myFieldChooser, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
new Dimension(150, -1), null, 0, false));
final JPanel panel1 = new JPanel();
myPanel.add(panel1, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_SOUTH, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
new Dimension(-1, 1), null, new Dimension(-1, 1), 0, false));
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, null, null));
final Spacer spacer1 = new Spacer();
myPanel.add(spacer1, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JLabel label1 = new JLabel();
this.$$$loadLabelText$$$(label1, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.add.field.breakpoint.dialog.field.name"));
myPanel.add(label1,
new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label2 = new JLabel();
this.$$$loadLabelText$$$(label2,
this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle", "label.add.field.breakpoint.dialog.fq.name"));
myPanel.add(label2,
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
setTitle(JavaDebuggerBundle.message("add.field.breakpoint.dialog.title"));
init();
}
private static Method $$$cachedGetBundleMethod$$$ = null;
/** @noinspection ALL */
private String $$$getMessageFromBundle$$$(String path, String key) {
ResourceBundle bundle;
try {
Class<?> thisClass = this.getClass();
if ($$$cachedGetBundleMethod$$$ == null) {
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
}
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
}
catch (Exception e) {
bundle = ResourceBundle.getBundle(path);
}
return bundle.getString(key);
}
/** @noinspection ALL */
private void $$$loadLabelText$$$(JLabel component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setDisplayedMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
/** @noinspection ALL */
public JComponent $$$getRootComponent$$$() { return myPanel; }
@Override
protected JComponent createCenterPanel() {
myClassChooser.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@@ -19,25 +19,112 @@ import com.intellij.debugger.JavaDebuggerBundle;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.Dimension;
import java.awt.Insets;
import java.lang.reflect.Method;
import java.util.ResourceBundle;
/**
* @author Eugene Zhuravlev
*/
public class AddWildcardBreakpointDialog extends DialogWrapper {
private JPanel myPanel;
private JTextField myClassPatternField;
private JTextField myMethodNameField;
private final JPanel myPanel;
private final JTextField myClassPatternField;
private final JTextField myMethodNameField;
public AddWildcardBreakpointDialog(Project project) {
super(project, true);
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
myPanel = new JPanel();
myPanel.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1));
myClassPatternField = new JTextField();
myPanel.add(myClassPatternField, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
new Dimension(300, -1), null, 0, false));
final JLabel label1 = new JLabel();
this.$$$loadLabelText$$$(label1, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.add.wildcard.breakpoint.dialog.method.name"));
myPanel.add(label1,
new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myMethodNameField = new JTextField();
myPanel.add(myMethodNameField, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
new Dimension(150, -1), null, 0, false));
final Spacer spacer1 = new Spacer();
myPanel.add(spacer1, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JLabel label2 = new JLabel();
this.$$$loadLabelText$$$(label2, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"label.add.wildcard.breakpoint.dialog.class.pattern"));
myPanel.add(label2,
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
label1.setLabelFor(myMethodNameField);
label2.setLabelFor(myClassPatternField);
}
setTitle(JavaDebuggerBundle.message("add.method.breakpoint"));
init();
}
private static Method $$$cachedGetBundleMethod$$$ = null;
/** @noinspection ALL */
private String $$$getMessageFromBundle$$$(String path, String key) {
ResourceBundle bundle;
try {
Class<?> thisClass = this.getClass();
if ($$$cachedGetBundleMethod$$$ == null) {
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
}
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
}
catch (Exception e) {
bundle = ResourceBundle.getBundle(path);
}
return bundle.getString(key);
}
/** @noinspection ALL */
private void $$$loadLabelText$$$(JLabel component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setDisplayedMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
/** @noinspection ALL */
public JComponent $$$getRootComponent$$$() { return myPanel; }
@Override
protected void doOKAction() {
if (getClassPattern().isEmpty()) {
@@ -13,6 +13,9 @@ import com.intellij.psi.PsiClass;
import com.intellij.ui.FieldPanel;
import com.intellij.ui.MultiLineTooltipUI;
import com.intellij.ui.components.fields.ExtendableTextField;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.intellij.util.text.LiteralFormatUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.xdebugger.breakpoints.XBreakpoint;
@@ -25,6 +28,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties;
import org.jetbrains.java.debugger.breakpoints.properties.JavaExceptionBreakpointProperties;
import javax.swing.AbstractButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JPanel;
@@ -32,28 +36,33 @@ import javax.swing.JTextField;
import javax.swing.JToolTip;
import javax.swing.ToolTipManager;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ResourceBundle;
public class JavaBreakpointFiltersPanel<T extends JavaBreakpointProperties, B extends XBreakpoint<T>> extends XBreakpointCustomPropertiesPanel<B> {
private JPanel myConditionsPanel;
private JCheckBox myInstanceFiltersCheckBox;
private JPanel myInstanceFiltersFieldPanel;
private JCheckBox myClassFiltersCheckBox;
private ClassFiltersField myClassFiltersField;
private JCheckBox myPassCountCheckbox;
private JTextField myPassCountField;
private JCheckBox myCatchCheckBox;
private ClassFiltersField myCatchClassFilters;
private JPanel myCatchFiltersPanel;
private JPanel myPassCountFieldPanel;
private JCheckBox myCallerFiltersCheckBox;
private CallerFiltersField myCallerFilters;
private JPanel myCallerFiltersPanel;
public class JavaBreakpointFiltersPanel<T extends JavaBreakpointProperties, B extends XBreakpoint<T>>
extends XBreakpointCustomPropertiesPanel<B> {
private final JPanel myConditionsPanel;
private final JCheckBox myInstanceFiltersCheckBox;
private final JPanel myInstanceFiltersFieldPanel;
private final JCheckBox myClassFiltersCheckBox;
private final ClassFiltersField myClassFiltersField;
private final JCheckBox myPassCountCheckbox;
private final JTextField myPassCountField;
private final JCheckBox myCatchCheckBox;
private final ClassFiltersField myCatchClassFilters;
private final JPanel myCatchFiltersPanel;
private final JPanel myPassCountFieldPanel;
private final JCheckBox myCallerFiltersCheckBox;
private final CallerFiltersField myCallerFilters;
private final JPanel myCallerFiltersPanel;
private final FieldPanel myInstanceFiltersField;
@@ -64,6 +73,152 @@ public class JavaBreakpointFiltersPanel<T extends JavaBreakpointProperties, B ex
public JavaBreakpointFiltersPanel(Project project) {
myProject = project;
{
myClassFiltersField = new ClassFiltersField(myProject, this);
myCatchClassFilters = new ClassFiltersField(myProject, this);
myCallerFilters = new CallerFiltersField(myProject, this);
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
myConditionsPanel = new JPanel();
myConditionsPanel.setLayout(new GridLayoutManager(6, 2, new Insets(2, 0, 5, 0), -1, 7));
myConditionsPanel.putClientProperty("BorderFactoryClass", "com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent");
panel1.add(myConditionsPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, 0));
myConditionsPanel.add(panel2, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
myInstanceFiltersCheckBox = new JCheckBox();
myInstanceFiltersCheckBox.setMargin(new Insets(2, 2, 0, 2));
this.$$$loadButtonText$$$(myInstanceFiltersCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"breakpoint.properties.panel.option.instance.filters"));
panel2.add(myInstanceFiltersCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
panel2.add(panel3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null,
0, false));
myInstanceFiltersFieldPanel = new JPanel();
panel3.add(myInstanceFiltersFieldPanel,
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0,
false));
final JPanel panel4 = new JPanel();
panel4.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, 0));
myConditionsPanel.add(panel4, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
myClassFiltersCheckBox = new JCheckBox();
myClassFiltersCheckBox.setMargin(new Insets(2, 2, 0, 2));
this.$$$loadButtonText$$$(myClassFiltersCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"breakpoint.properties.panel.option.class.filters"));
panel4.add(myClassFiltersCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel5 = new JPanel();
panel5.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
panel4.add(panel5, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null,
0, false));
panel5.add(myClassFiltersField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
final JPanel panel6 = new JPanel();
panel6.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, 0));
myConditionsPanel.add(panel6, new GridConstraints(3, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
myPassCountCheckbox = new JCheckBox();
myPassCountCheckbox.setMargin(new Insets(2, 2, 0, 2));
this.$$$loadButtonText$$$(myPassCountCheckbox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"breakpoint.properties.panel.option.pass.count"));
panel6.add(myPassCountCheckbox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myPassCountFieldPanel = new JPanel();
myPassCountFieldPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
panel6.add(myPassCountFieldPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
null, null, null, 0, false));
myPassCountField = new JTextField();
myPassCountField.setEnabled(false);
myPassCountField.setHorizontalAlignment(10);
myPassCountFieldPanel.add(myPassCountField,
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
new Dimension(15, -1), null, 0, false));
final Spacer spacer1 = new Spacer();
myConditionsPanel.add(spacer1, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
myCatchFiltersPanel = new JPanel();
myCatchFiltersPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, 0));
myConditionsPanel.add(myCatchFiltersPanel,
new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
null, 0, false));
myCatchCheckBox = new JCheckBox();
myCatchCheckBox.setMargin(new Insets(2, 2, 0, 2));
this.$$$loadButtonText$$$(myCatchCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"breakpoint.properties.panel.option.catch.class.filters"));
myCatchFiltersPanel.add(myCatchCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK |
GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,
null, null, null, 0, false));
final JPanel panel7 = new JPanel();
panel7.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
myCatchFiltersPanel.add(panel7, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
panel7.add(myCatchClassFilters, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
myCallerFiltersPanel = new JPanel();
myCallerFiltersPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, 0));
myConditionsPanel.add(myCallerFiltersPanel,
new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
null, 0, false));
myCallerFiltersCheckBox = new JCheckBox();
myCallerFiltersCheckBox.setMargin(new Insets(2, 2, 0, 2));
this.$$$loadButtonText$$$(myCallerFiltersCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaDebuggerBundle",
"breakpoint.properties.panel.option.caller.filter"));
myCallerFiltersPanel.add(myCallerFiltersCheckBox,
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel8 = new JPanel();
panel8.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
myCallerFiltersPanel.add(panel8, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
null, null, null, 0, false));
panel8.add(myCallerFilters, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
null, null, 0, false));
}
myInstanceFiltersField = new FieldPanel(new MyTextField(), "", null,
new ActionListener() {
@Override
@@ -111,6 +266,50 @@ public class JavaBreakpointFiltersPanel<T extends JavaBreakpointProperties, B ex
DebuggerUIUtil.focusEditorOnCheck(myCallerFiltersCheckBox, myCallerFilters);
}
private static Method $$$cachedGetBundleMethod$$$ = null;
/** @noinspection ALL */
private String $$$getMessageFromBundle$$$(String path, String key) {
ResourceBundle bundle;
try {
Class<?> thisClass = this.getClass();
if ($$$cachedGetBundleMethod$$$ == null) {
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
}
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
}
catch (Exception e) {
bundle = ResourceBundle.getBundle(path);
}
return bundle.getString(key);
}
/** @noinspection ALL */
private void $$$loadButtonText$$$(AbstractButton component, String text) {
StringBuffer result = new StringBuffer();
boolean haveMnemonic = false;
char mnemonic = '\0';
int mnemonicIndex = -1;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '&') {
i++;
if (i == text.length()) break;
if (!haveMnemonic && text.charAt(i) != '&') {
haveMnemonic = true;
mnemonic = text.charAt(i);
mnemonicIndex = result.length();
}
}
result.append(text.charAt(i));
}
component.setText(result.toString());
if (haveMnemonic) {
component.setMnemonic(mnemonic);
component.setDisplayedMnemonicIndex(mnemonicIndex);
}
}
@Override
public @NotNull JComponent getComponent() {
return myConditionsPanel;
@@ -152,16 +351,21 @@ public class JavaBreakpointFiltersPanel<T extends JavaBreakpointProperties, B ex
updateInstanceFilterEditor(true);
if (properties instanceof JavaExceptionBreakpointProperties exceptionBreakpointProperties) {
changed = exceptionBreakpointProperties.setCatchFiltersEnabled(!myCatchClassFilters.getText().isEmpty() && myCatchCheckBox.isSelected()) || changed;
changed =
exceptionBreakpointProperties.setCatchFiltersEnabled(!myCatchClassFilters.getText().isEmpty() && myCatchCheckBox.isSelected()) ||
changed;
changed = exceptionBreakpointProperties.setCatchClassFilters(myCatchClassFilters.getClassFilters()) || changed;
changed = exceptionBreakpointProperties.setCatchClassExclusionFilters(myCatchClassFilters.getClassExclusionFilters()) || changed;
}
changed = properties.setCLASS_FILTERS_ENABLED(!myClassFiltersField.getText().isEmpty() && myClassFiltersCheckBox.isSelected()) || changed;
changed =
properties.setCLASS_FILTERS_ENABLED(!myClassFiltersField.getText().isEmpty() && myClassFiltersCheckBox.isSelected()) || changed;
changed = properties.setClassFilters(myClassFiltersField.getClassFilters()) || changed;
changed = properties.setClassExclusionFilters(myClassFiltersField.getClassExclusionFilters()) || changed;
changed = properties.setINSTANCE_FILTERS_ENABLED(!myInstanceFiltersField.getText().isEmpty() && myInstanceFiltersCheckBox.isSelected()) || changed;
changed =
properties.setINSTANCE_FILTERS_ENABLED(!myInstanceFiltersField.getText().isEmpty() && myInstanceFiltersCheckBox.isSelected()) ||
changed;
changed = properties.setInstanceFilters(myInstanceFilters) || changed;
changed = properties.setCALLER_FILTERS_ENABLED(!myCallerFilters.getText().isEmpty() && myCallerFiltersCheckBox.isSelected()) || changed;
@@ -229,12 +433,6 @@ public class JavaBreakpointFiltersPanel<T extends JavaBreakpointProperties, B ex
myInstanceFiltersField.getTextField().setToolTipText(tipText);
}
private void createUIComponents() {
myClassFiltersField = new ClassFiltersField(myProject, this);
myCatchClassFilters = new ClassFiltersField(myProject, this);
myCallerFilters = new CallerFiltersField(myProject, this);
}
private class MyTextField extends ExtendableTextField {
MyTextField() {
}