Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ public String[] getExtraMakeTargets() {
case COMMAND_RUN_SINGLE: break;
case COMMAND_DEBUG_TEST_SINGLE:
try {
InetAddress addr = InetAddress.getLocalHost();
String userSelectedAddress = settings != null ? settings.getDebugListenAddress() : null;
InetAddress addr = userSelectedAddress == null || userSelectedAddress.isBlank() ? InetAddress.getLoopbackAddress() : InetAddress.getByName(userSelectedAddress);
debugSocket[0] = new ServerSocket(0, 1, addr);
BACKGROUND.post(() -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class Settings {
private static final String KEY_TEST_USE_IMAGE = "test-use-image";
private static final String KEY_USE_ANT_BUILD = "use-langtools-ant-build";
private static final String KEY_ANT_BUILD_LOCATION = "langtools-ant-build-location";
private static final String KEY_DEBUG_LISTEN_ADDRESS = "debug-listen-address";

private static final String DEF_ANT_BUILD_LOCATION = "make/ide/netbeans/langtools/build.xml";

Expand Down Expand Up @@ -93,6 +94,14 @@ public void setAntBuildLocation(String antBuildLocation) {
getPrivatePreferences().put(KEY_ANT_BUILD_LOCATION, antBuildLocation);
}

public String getDebugListenAddress() {
return getPrivatePreferences().get(KEY_DEBUG_LISTEN_ADDRESS, null);
}

public void setDebugListenAddress(String jtregLocation) {
getPrivatePreferences().put(KEY_DEBUG_LISTEN_ADDRESS, jtregLocation);
}

public void flush() {
try {
getPrivatePreferences().flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,25 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
<Component id="antBuildLocationLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="antBuildLocation" max="32767" attributes="0"/>
</Group>
<Component id="useAntBuild" pref="380" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
<Component id="antBuildLocationLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="antBuildLocation" max="32767" attributes="0"/>
<Component id="debugListenAddress" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
Expand All @@ -60,7 +72,14 @@
<Component id="antBuildLocationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="antBuildLocation" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="244" max="32767" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="debugListenAddress" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="186" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -90,5 +109,26 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/java/openjdk/project/customizer/Bundle.properties" key="BuildCategory.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="debugListenAddress">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/java/openjdk/project/customizer/Bundle.properties" key="BuildCategory.debugListenAddress.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/java/openjdk/project/customizer/Bundle.properties" key="BuildCategory.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ public class BuildCategory extends javax.swing.JPanel {
/**
* Creates new form BuildCategory
*/
public BuildCategory(boolean useAntBuild, String antBuildLocation) {
public BuildCategory(boolean useAntBuild, String antBuildLocation, String debugListenAddress) {
initComponents();
this.useAntBuild.setSelected(useAntBuild);
this.antBuildLocation.setText(antBuildLocation);
this.debugListenAddress.setText(debugListenAddress);
updateEnableDisable();
}

Expand All @@ -56,6 +57,9 @@ private void initComponents() {
useAntBuild = new javax.swing.JCheckBox();
antBuildLocationLabel = new javax.swing.JLabel();
antBuildLocation = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
debugListenAddress = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();

org.openide.awt.Mnemonics.setLocalizedText(useAntBuild, org.openide.util.NbBundle.getMessage(BuildCategory.class, "BuildCategory.useAntBuild.text")); // NOI18N
useAntBuild.addActionListener(new java.awt.event.ActionListener() {
Expand All @@ -68,19 +72,33 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

antBuildLocation.setText(org.openide.util.NbBundle.getMessage(BuildCategory.class, "BuildCategory.antBuildLocation.text")); // NOI18N

org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(BuildCategory.class, "BuildCategory.jLabel1.text")); // NOI18N

debugListenAddress.setText(org.openide.util.NbBundle.getMessage(BuildCategory.class, "BuildCategory.debugListenAddress.text")); // NOI18N

org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(BuildCategory.class, "BuildCategory.jLabel2.text")); // NOI18N

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(useAntBuild, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(antBuildLocationLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(antBuildLocation))
.addComponent(useAntBuild, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(antBuildLocationLabel))
.addComponent(jLabel1))
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(antBuildLocation)
.addComponent(debugListenAddress))))
.addContainerGap())
);
layout.setVerticalGroup(
Expand All @@ -92,7 +110,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(antBuildLocationLabel)
.addComponent(antBuildLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(244, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(debugListenAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addContainerGap(186, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents

Expand All @@ -104,6 +128,9 @@ private void useAntBuildActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField antBuildLocation;
private javax.swing.JLabel antBuildLocationLabel;
private javax.swing.JTextField debugListenAddress;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JCheckBox useAntBuild;
// End of variables declaration//GEN-END:variables

Expand All @@ -119,10 +146,11 @@ public ProjectCustomizer.Category createCategory(Lookup context) {
@Override
public JComponent createComponent(ProjectCustomizer.Category category, Lookup context) {
Settings settings = context.lookup(Settings.class);
BuildCategory panel = new BuildCategory(settings.isUseAntBuild(), settings.getAntBuildLocation());
BuildCategory panel = new BuildCategory(settings.isUseAntBuild(), settings.getAntBuildLocation(), settings.getDebugListenAddress());
category.setOkButtonListener(evt -> {
settings.setUseAntBuild(panel.useAntBuild.isSelected());
settings.setAntBuildLocation(panel.antBuildLocation.getText());
settings.setDebugListenAddress(panel.debugListenAddress.getText());
});
category.setStoreListener(evt -> settings.flush());
return panel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ BuildCategory.antBuildLocation.text=
BuildCategory.useAntBuild.text=Use ant build for langtools
BuildCategory.antBuildLocationLabel.text=Ant build location:
TestCategory.useFullImage.text=Use full JDK image to run tests
BuildCategory.jLabel1.text=Debug Listened Address:
BuildCategory.jLabel2.text=Leave empty for default
BuildCategory.debugListenAddress.text=
Loading