forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apache#7776 from asotona/SingleJavaSourceRunAction…
…Provider_improvements Single Java source run action provider improvements
- Loading branch information
Showing
13 changed files
with
424 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...her/src/org/netbeans/modules/java/file/launcher/GlobalSettingsOptionsPanelController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.netbeans.modules.java.file.launcher; | ||
|
||
import java.beans.PropertyChangeListener; | ||
import java.beans.PropertyChangeSupport; | ||
import javax.swing.JComponent; | ||
import javax.swing.SwingUtilities; | ||
import org.netbeans.spi.options.OptionsPanelController; | ||
import org.netbeans.modules.options.java.api.JavaOptions; | ||
import org.openide.util.HelpCtx; | ||
import org.openide.util.Lookup; | ||
|
||
@OptionsPanelController.SubRegistration( | ||
location = JavaOptions.JAVA, | ||
displayName = "#AdvancedOption_DisplayName_GlobalSettings", | ||
keywords = "#AdvancedOption_Keywords_GlobalSettings", | ||
keywordsCategory = "Java/GlobalSettings" | ||
) | ||
@org.openide.util.NbBundle.Messages({"AdvancedOption_DisplayName_GlobalSettings=Source Launcher", "AdvancedOption_Keywords_GlobalSettings=single source"}) | ||
public final class GlobalSettingsOptionsPanelController extends OptionsPanelController { | ||
|
||
private GlobalSettingsPanel panel; | ||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); | ||
private boolean changed; | ||
|
||
public void update() { | ||
getPanel().load(); | ||
changed = false; | ||
} | ||
|
||
public void applyChanges() { | ||
SwingUtilities.invokeLater(new Runnable() { | ||
@Override | ||
public void run() { | ||
getPanel().store(); | ||
changed = false; | ||
} | ||
}); | ||
} | ||
|
||
public void cancel() { | ||
// need not do anything special, if no changes have been persisted yet | ||
} | ||
|
||
public boolean isValid() { | ||
return getPanel().valid(); | ||
} | ||
|
||
public boolean isChanged() { | ||
return changed; | ||
} | ||
|
||
public HelpCtx getHelpCtx() { | ||
return null; // new HelpCtx("...ID") if you have a help set | ||
} | ||
|
||
public JComponent getComponent(Lookup masterLookup) { | ||
return getPanel(); | ||
} | ||
|
||
public void addPropertyChangeListener(PropertyChangeListener l) { | ||
pcs.addPropertyChangeListener(l); | ||
} | ||
|
||
public void removePropertyChangeListener(PropertyChangeListener l) { | ||
pcs.removePropertyChangeListener(l); | ||
} | ||
|
||
private GlobalSettingsPanel getPanel() { | ||
if (panel == null) { | ||
panel = new GlobalSettingsPanel(this); | ||
} | ||
return panel; | ||
} | ||
|
||
void changed() { | ||
if (!changed) { | ||
changed = true; | ||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); | ||
} | ||
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); | ||
} | ||
|
||
} |
105 changes: 105 additions & 0 deletions
105
java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/GlobalSettingsPanel.form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> | ||
<AuxValues> | ||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> | ||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> | ||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/> | ||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/> | ||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> | ||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> | ||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> | ||
</AuxValues> | ||
|
||
<Layout> | ||
<DimensionLayout dim="0"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Group type="102" attributes="0"> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Group type="102" alignment="0" attributes="0"> | ||
<Component id="vmLabel" min="-2" max="-2" attributes="0"/> | ||
<EmptySpace type="unrelated" max="-2" attributes="0"/> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Component id="singleRunCheckBox" max="32767" attributes="0"/> | ||
<Component id="vmTextField" max="32767" attributes="0"/> | ||
</Group> | ||
</Group> | ||
<Group type="102" alignment="0" attributes="0"> | ||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> | ||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/> | ||
</Group> | ||
</Group> | ||
<EmptySpace max="-2" attributes="0"/> | ||
</Group> | ||
</Group> | ||
</DimensionLayout> | ||
<DimensionLayout dim="1"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Group type="102" alignment="0" attributes="0"> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Component id="vmLabel" alignment="0" min="-2" max="-2" attributes="0"/> | ||
<Component id="vmTextField" min="-2" max="-2" attributes="0"/> | ||
</Group> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Component id="singleRunCheckBox" min="-2" max="-2" attributes="0"/> | ||
<EmptySpace max="32767" attributes="0"/> | ||
</Group> | ||
</Group> | ||
</DimensionLayout> | ||
</Layout> | ||
<SubComponents> | ||
<Component class="javax.swing.JTextField" name="vmTextField"> | ||
</Component> | ||
<Component class="javax.swing.JLabel" name="vmLabel"> | ||
<Properties> | ||
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor"> | ||
<ComponentRef name="vmTextField"/> | ||
</Property> | ||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> | ||
<ResourceString bundle="org/netbeans/modules/java/file/launcher/Bundle.properties" key="GlobalSettingsPanel.vmLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> | ||
</Property> | ||
</Properties> | ||
</Component> | ||
<Component class="javax.swing.JCheckBox" name="singleRunCheckBox"> | ||
<Properties> | ||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> | ||
<ResourceString bundle="org/netbeans/modules/java/file/launcher/Bundle.properties" key="GlobalSettingsPanel.singleRunCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> | ||
</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/file/launcher/Bundle.properties" key="GlobalSettingsPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> | ||
</Property> | ||
</Properties> | ||
</Component> | ||
</SubComponents> | ||
</Form> |
Oops, something went wrong.