View | Details | Raw Unified | Return to bug 210334
Collapse All | Expand All

(-)a/groovy.grailsproject/nbproject/project.xml (-8 lines)
 Lines 175-188    Link Here 
175
                    </run-dependency>
175
                    </run-dependency>
176
                </dependency>
176
                </dependency>
177
                <dependency>
177
                <dependency>
178
                    <code-name-base>org.netbeans.modules.web.client.tools.api</code-name-base>
179
                    <build-prerequisite/>
180
                    <compile-dependency/>
181
                    <run-dependency>
182
                        <specification-version>1.0</specification-version>
183
                    </run-dependency>
184
                </dependency>
185
                <dependency>
186
                    <code-name-base>org.openide.actions</code-name-base>
178
                    <code-name-base>org.openide.actions</code-name-base>
187
                    <build-prerequisite/>
179
                    <build-prerequisite/>
188
                    <compile-dependency/>
180
                    <compile-dependency/>
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/commands/GrailsCommandSupport.java (-57 / +3 lines)
 Lines 78-89    Link Here 
78
import org.netbeans.modules.groovy.grailsproject.config.BuildConfig;
78
import org.netbeans.modules.groovy.grailsproject.config.BuildConfig;
79
import org.netbeans.modules.groovy.grailsproject.debug.GrailsDebugger;
79
import org.netbeans.modules.groovy.grailsproject.debug.GrailsDebugger;
80
import org.netbeans.modules.groovy.support.api.GroovySettings;
80
import org.netbeans.modules.groovy.support.api.GroovySettings;
81
import org.netbeans.modules.web.client.tools.api.JSToNbJSLocationMapper;
82
import org.netbeans.modules.web.client.tools.api.LocationMappersFactory;
83
import org.netbeans.modules.web.client.tools.api.NbJSToJSLocationMapper;
84
import org.netbeans.modules.web.client.tools.api.WebClientToolsProjectUtils;
85
import org.netbeans.modules.web.client.tools.api.WebClientToolsSessionException;
86
import org.netbeans.modules.web.client.tools.api.WebClientToolsSessionStarterService;
87
import org.openide.awt.HtmlBrowser;
81
import org.openide.awt.HtmlBrowser;
88
import org.openide.filesystems.FileAttributeEvent;
82
import org.openide.filesystems.FileAttributeEvent;
89
import org.openide.filesystems.FileChangeListener;
83
import org.openide.filesystems.FileChangeListener;
 Lines 280-340    Link Here 
280
    }
274
    }
281
275
282
    public static final void showURL(URL url, boolean debug, GrailsProject project) {
276
    public static final void showURL(URL url, boolean debug, GrailsProject project) {
283
        boolean debuggerAvailable = WebClientToolsSessionStarterService.isAvailable();
277
        if (!debug) {
284
285
        if (!debug || !debuggerAvailable) {
286
            if (GrailsProjectConfig.forProject(project).getDisplayBrowser()) {
278
            if (GrailsProjectConfig.forProject(project).getDisplayBrowser()) {
287
                HtmlBrowser.URLDisplayer.getDefault().showURL(url);
279
                HtmlBrowser.URLDisplayer.getDefault().showURL(url);
288
            }
280
            }
289
        } else {
281
        } else {
290
            FileObject webAppDir = project.getProjectDirectory().getFileObject(WEB_APP_DIR);
282
            // there is no other debugger than JavaScript is there?
291
            GrailsProjectConfig config = GrailsProjectConfig.forProject(project);
283
            HtmlBrowser.URLDisplayer.getDefault().showURL(url);
292
293
            String port = config.getPort();
294
            String prefix = url.getProtocol() + "://" + url.getHost() + ":" + port + "/" + project.getProjectDirectory().getName();
295
            String actualURL = url.toExternalForm();
296
297
            Lookup debugLookup;
298
            if (!actualURL.startsWith(prefix)) {
299
                LOGGER.warning("Could not construct URL mapper for JavaScript debugger.");
300
                debugLookup = Lookups.fixed(project);
301
            } else {
302
                LocationMappersFactory factory = Lookup.getDefault().lookup(LocationMappersFactory.class);
303
304
                if (factory == null) {
305
                    debugLookup = Lookups.fixed(project);
306
                } else {
307
                    try {
308
                        URI prefixURI = new URI(prefix);
309
310
                        JSToNbJSLocationMapper forwardMapper = factory.getJSToNbJSLocationMapper(webAppDir, prefixURI, null);
311
                        NbJSToJSLocationMapper reverseMapper = factory.getNbJSToJSLocationMapper(webAppDir, prefixURI, null);
312
313
                        debugLookup = Lookups.fixed(forwardMapper, reverseMapper, project);
314
                    } catch (URISyntaxException ex) {
315
                        LOGGER.log(Level.WARNING, "Server URI could not be constructed from displayed URL", ex);
316
                        debugLookup = Lookups.fixed(project);
317
                    }
318
                }
319
            }
320
321
            try {
322
                URI launchURI = url.toURI();
323
                HtmlBrowser.Factory browser = WebClientToolsProjectUtils.getFirefoxBrowser();
324
325
                String browserString = config.getDebugBrowser();
326
                if (browserString == null) {
327
                    browserString = WebClientToolsProjectUtils.Browser.FIREFOX.name();
328
                }
329
                if (WebClientToolsProjectUtils.Browser.valueOf(browserString) == WebClientToolsProjectUtils.Browser.INTERNET_EXPLORER) {
330
                     browser = WebClientToolsProjectUtils.getInternetExplorerBrowser();
331
                }
332
                WebClientToolsSessionStarterService.startSession(launchURI, browser, debugLookup);
333
            } catch (URISyntaxException ex) {
334
                LOGGER.log(Level.SEVERE, "Unable to obtain URI for URL", ex);
335
            } catch (WebClientToolsSessionException ex) {
336
                LOGGER.log(Level.SEVERE, "Unexpected exception launching javascript debugger", ex);
337
            }
338
        }
284
        }
339
    }
285
    }
340
286
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/resources/layer.xml (-4 lines)
 Lines 144-153    Link Here 
144
                    <attr name="instanceCreate" methodvalue="org.netbeans.modules.groovy.grailsproject.ui.customizer.GrailsProjectCustomizerProvider.createLibraries"/>
144
                    <attr name="instanceCreate" methodvalue="org.netbeans.modules.groovy.grailsproject.ui.customizer.GrailsProjectCustomizerProvider.createLibraries"/>
145
                    <attr name="position" intvalue="150"/>
145
                    <attr name="position" intvalue="150"/>
146
                </file>
146
                </file>
147
                <file name="Debugging.instance">
148
                    <attr name="instanceCreate" methodvalue="org.netbeans.modules.groovy.grailsproject.ui.customizer.GrailsProjectCustomizerProvider.createDebugging"/>
149
                    <attr name="position" intvalue="200"/>
150
                </file>
151
                <file name="Formatting.instance">
147
                <file name="Formatting.instance">
152
                    <attr name="instanceOf" stringvalue="org.netbeans.spi.project.ui.support.ProjectCustomizer$CompositeCategoryProvider"/>
148
                    <attr name="instanceOf" stringvalue="org.netbeans.spi.project.ui.support.ProjectCustomizer$CompositeCategoryProvider"/>
153
                    <attr name="instanceCreate" methodvalue="org.netbeans.modules.editor.indent.project.api.Customizers.createFormattingCategoryProvider"/>
149
                    <attr name="instanceCreate" methodvalue="org.netbeans.modules.editor.indent.project.api.Customizers.createFormattingCategoryProvider"/>
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/customizer/Bundle.properties (-6 lines)
 Lines 38-47    Link Here 
38
#
38
#
39
# Portions Copyrighted 2008 Sun Microsystems, Inc.
39
# Portions Copyrighted 2008 Sun Microsystems, Inc.
40
40
41
DebugCustomizerPanel.firefoxRadioButton.text=&Firefox
42
DebugCustomizerPanel.internetExplorerRadioButton.text=&Internet Explorer (Windows only)
43
DebugCustomizerPanel.noSupportedBrowserLabel.text=No supported client-side debugging browsers are configured in the IDE
44
DebugCustomizerPanel.debugClientLabel.text=Debug Grails Application (Client Side)
45
GeneralCustomizerPanel.grailsServerPortLabel.text=Server Port:
41
GeneralCustomizerPanel.grailsServerPortLabel.text=Server Port:
46
GeneralCustomizerPanel.projectFolderTextField.text=
42
GeneralCustomizerPanel.projectFolderTextField.text=
47
GeneralCustomizerPanel.grailsServerPort.text=
43
GeneralCustomizerPanel.grailsServerPort.text=
 Lines 60-67    Link Here 
60
LBL_GeneralSettings=General Settings
56
LBL_GeneralSettings=General Settings
61
LBL_Libraries=Libraries
57
LBL_Libraries=Libraries
62
58
63
DEBUG_CATEGORY=Debug
64
DebugCustomizerPanel.internetExplorerRadioButton.tooltip=Available on Windows only
65
GeneralCustomizerPanel.grailsDisplayBrowser.text=Display &Browser on Run
59
GeneralCustomizerPanel.grailsDisplayBrowser.text=Display &Browser on Run
66
GeneralCustomizerPanel.vmOptionsLabel.text=&VM Options:
60
GeneralCustomizerPanel.vmOptionsLabel.text=&VM Options:
67
GeneralCustomizerPanel.vmOptionsTipLabel.text=(e.g. -Xms10m)
61
GeneralCustomizerPanel.vmOptionsTipLabel.text=(e.g. -Xms10m)
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/customizer/DebugCustomizerPanel.form (-102 lines)
 Lines 1-102    Link Here 
1
<?xml version="1.1" encoding="UTF-8" ?>
2
3
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <NonVisualComponents>
5
    <Component class="javax.swing.ButtonGroup" name="browserButtonGroup">
6
    </Component>
7
  </NonVisualComponents>
8
  <AuxValues>
9
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
10
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
11
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
12
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
13
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
14
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
15
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
16
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
17
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
18
  </AuxValues>
19
20
  <Layout>
21
    <DimensionLayout dim="0">
22
      <Group type="103" groupAlignment="0" attributes="0">
23
          <Group type="102" attributes="0">
24
              <EmptySpace max="-2" attributes="0"/>
25
              <Group type="103" groupAlignment="0" attributes="0">
26
                  <Component id="debugClientLabel" alignment="0" min="-2" max="-2" attributes="0"/>
27
                  <Group type="102" alignment="0" attributes="0">
28
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
29
                      <Group type="103" groupAlignment="0" attributes="0">
30
                          <Component id="internetExplorerRadioButton" alignment="0" min="-2" max="-2" attributes="0"/>
31
                          <Component id="firefoxRadioButton" alignment="0" min="-2" max="-2" attributes="0"/>
32
                      </Group>
33
                  </Group>
34
                  <Component id="noSupportedBrowserLabel" alignment="0" min="-2" max="-2" attributes="0"/>
35
              </Group>
36
              <EmptySpace max="32767" attributes="0"/>
37
          </Group>
38
      </Group>
39
    </DimensionLayout>
40
    <DimensionLayout dim="1">
41
      <Group type="103" groupAlignment="0" attributes="0">
42
          <Group type="102" alignment="0" attributes="0">
43
              <EmptySpace max="-2" attributes="0"/>
44
              <Component id="debugClientLabel" min="-2" max="-2" attributes="0"/>
45
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
46
              <Component id="firefoxRadioButton" min="-2" max="-2" attributes="0"/>
47
              <EmptySpace max="-2" attributes="0"/>
48
              <Component id="internetExplorerRadioButton" min="-2" max="-2" attributes="0"/>
49
              <EmptySpace type="separate" max="-2" attributes="0"/>
50
              <Component id="noSupportedBrowserLabel" min="-2" max="-2" attributes="0"/>
51
              <EmptySpace pref="181" max="32767" attributes="0"/>
52
          </Group>
53
      </Group>
54
    </DimensionLayout>
55
  </Layout>
56
  <SubComponents>
57
    <Component class="javax.swing.JLabel" name="debugClientLabel">
58
      <Properties>
59
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
60
          <ResourceString bundle="org/netbeans/modules/groovy/grailsproject/ui/customizer/Bundle.properties" key="DebugCustomizerPanel.debugClientLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
61
        </Property>
62
      </Properties>
63
    </Component>
64
    <Component class="javax.swing.JRadioButton" name="firefoxRadioButton">
65
      <Properties>
66
        <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
67
          <ComponentRef name="browserButtonGroup"/>
68
        </Property>
69
        <Property name="selected" type="boolean" value="true"/>
70
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
71
          <ResourceString bundle="org/netbeans/modules/groovy/grailsproject/ui/customizer/Bundle.properties" key="DebugCustomizerPanel.firefoxRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
72
        </Property>
73
      </Properties>
74
      <Events>
75
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="firefoxRadioButtonActionPerformed"/>
76
      </Events>
77
    </Component>
78
    <Component class="javax.swing.JRadioButton" name="internetExplorerRadioButton">
79
      <Properties>
80
        <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
81
          <ComponentRef name="browserButtonGroup"/>
82
        </Property>
83
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
84
          <ResourceString bundle="org/netbeans/modules/groovy/grailsproject/ui/customizer/Bundle.properties" key="DebugCustomizerPanel.internetExplorerRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
85
        </Property>
86
        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
87
          <ResourceString bundle="org/netbeans/modules/groovy/grailsproject/ui/Bundle.properties" key="DebugCustomizerPanel.internetExplorerRadioButton.tooltip" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
88
        </Property>
89
      </Properties>
90
      <Events>
91
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="internetExplorerRadioButtonActionPerformed"/>
92
      </Events>
93
    </Component>
94
    <Component class="javax.swing.JLabel" name="noSupportedBrowserLabel">
95
      <Properties>
96
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
97
          <ResourceString bundle="org/netbeans/modules/groovy/grailsproject/ui/customizer/Bundle.properties" key="DebugCustomizerPanel.noSupportedBrowserLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
98
        </Property>
99
      </Properties>
100
    </Component>
101
  </SubComponents>
102
</Form>
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/customizer/DebugCustomizerPanel.java (-182 lines)
 Lines 1-182    Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
41
 */
42
43
/*
44
 * DebugCustomizerPanel.java
45
 *
46
 * Created on Jul 12, 2008, 11:15:15 AM
47
 */
48
49
package org.netbeans.modules.groovy.grailsproject.ui.customizer;
50
51
import org.netbeans.modules.web.client.tools.api.WebClientToolsProjectUtils;
52
53
/**
54
 *
55
 * @author sc32560
56
 */
57
public class DebugCustomizerPanel extends javax.swing.JPanel {
58
    
59
    private GrailsProjectProperties uiProperties;
60
61
    private final boolean ieBrowserSupported;
62
63
    private final boolean ffBrowserSupported;
64
65
    /** Creates new form DebugCustomizerPanel */
66
    public DebugCustomizerPanel(GrailsProjectProperties uiProperties) {
67
        this.uiProperties = uiProperties;
68
        
69
        initComponents();
70
        
71
        ieBrowserSupported = WebClientToolsProjectUtils.isInternetExplorerSupported();
72
        ffBrowserSupported = WebClientToolsProjectUtils.isFirefoxSupported();
73
        
74
        String browserString = uiProperties.getDebugBrowser();
75
        WebClientToolsProjectUtils.Browser selectedBrowser = null;
76
        if (browserString == null) {
77
            browserString = (ffBrowserSupported || !ieBrowserSupported) ? WebClientToolsProjectUtils.Browser.FIREFOX.name() :
78
                WebClientToolsProjectUtils.Browser.INTERNET_EXPLORER.name();
79
        }
80
        selectedBrowser = WebClientToolsProjectUtils.Browser.valueOf(browserString);
81
        
82
        firefoxRadioButton.setSelected(selectedBrowser == WebClientToolsProjectUtils.Browser.FIREFOX);
83
        internetExplorerRadioButton.setSelected(selectedBrowser == WebClientToolsProjectUtils.Browser.INTERNET_EXPLORER);
84
        
85
        firefoxRadioButton.setEnabled(ffBrowserSupported);
86
        internetExplorerRadioButton.setEnabled(ieBrowserSupported);
87
        
88
        noSupportedBrowserLabel.setVisible(!ieBrowserSupported && !ffBrowserSupported);
89
    }
90
91
    /** This method is called from within the constructor to
92
     * initialize the form.
93
     * WARNING: Do NOT modify this code. The content of this method is
94
     * always regenerated by the Form Editor.
95
     */
96
    @SuppressWarnings("unchecked")
97
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
98
    private void initComponents() {
99
100
        browserButtonGroup = new javax.swing.ButtonGroup();
101
        debugClientLabel = new javax.swing.JLabel();
102
        firefoxRadioButton = new javax.swing.JRadioButton();
103
        internetExplorerRadioButton = new javax.swing.JRadioButton();
104
        noSupportedBrowserLabel = new javax.swing.JLabel();
105
106
        org.openide.awt.Mnemonics.setLocalizedText(debugClientLabel, org.openide.util.NbBundle.getMessage(DebugCustomizerPanel.class, "DebugCustomizerPanel.debugClientLabel.text")); // NOI18N
107
108
        browserButtonGroup.add(firefoxRadioButton);
109
        firefoxRadioButton.setSelected(true);
110
        org.openide.awt.Mnemonics.setLocalizedText(firefoxRadioButton, org.openide.util.NbBundle.getMessage(DebugCustomizerPanel.class, "DebugCustomizerPanel.firefoxRadioButton.text")); // NOI18N
111
        firefoxRadioButton.addActionListener(new java.awt.event.ActionListener() {
112
            public void actionPerformed(java.awt.event.ActionEvent evt) {
113
                firefoxRadioButtonActionPerformed(evt);
114
            }
115
        });
116
117
        browserButtonGroup.add(internetExplorerRadioButton);
118
        org.openide.awt.Mnemonics.setLocalizedText(internetExplorerRadioButton, org.openide.util.NbBundle.getMessage(DebugCustomizerPanel.class, "DebugCustomizerPanel.internetExplorerRadioButton.text")); // NOI18N
119
        internetExplorerRadioButton.setToolTipText(org.openide.util.NbBundle.getMessage(DebugCustomizerPanel.class, "DebugCustomizerPanel.internetExplorerRadioButton.tooltip")); // NOI18N
120
        internetExplorerRadioButton.addActionListener(new java.awt.event.ActionListener() {
121
            public void actionPerformed(java.awt.event.ActionEvent evt) {
122
                internetExplorerRadioButtonActionPerformed(evt);
123
            }
124
        });
125
126
        org.openide.awt.Mnemonics.setLocalizedText(noSupportedBrowserLabel, org.openide.util.NbBundle.getMessage(DebugCustomizerPanel.class, "DebugCustomizerPanel.noSupportedBrowserLabel.text")); // NOI18N
127
128
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
129
        this.setLayout(layout);
130
        layout.setHorizontalGroup(
131
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132
            .addGroup(layout.createSequentialGroup()
133
                .addContainerGap()
134
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
135
                    .addComponent(debugClientLabel)
136
                    .addGroup(layout.createSequentialGroup()
137
                        .addGap(12, 12, 12)
138
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
139
                            .addComponent(internetExplorerRadioButton)
140
                            .addComponent(firefoxRadioButton)))
141
                    .addComponent(noSupportedBrowserLabel))
142
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
143
        );
144
        layout.setVerticalGroup(
145
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
146
            .addGroup(layout.createSequentialGroup()
147
                .addContainerGap()
148
                .addComponent(debugClientLabel)
149
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
150
                .addComponent(firefoxRadioButton)
151
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
152
                .addComponent(internetExplorerRadioButton)
153
                .addGap(18, 18, 18)
154
                .addComponent(noSupportedBrowserLabel)
155
                .addContainerGap(181, Short.MAX_VALUE))
156
        );
157
    }// </editor-fold>//GEN-END:initComponents
158
159
    private void firefoxRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_firefoxRadioButtonActionPerformed
160
        setBrowser();
161
    }//GEN-LAST:event_firefoxRadioButtonActionPerformed
162
163
    private void internetExplorerRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_internetExplorerRadioButtonActionPerformed
164
        setBrowser();
165
    }//GEN-LAST:event_internetExplorerRadioButtonActionPerformed
166
167
168
    // Variables declaration - do not modify//GEN-BEGIN:variables
169
    private javax.swing.ButtonGroup browserButtonGroup;
170
    private javax.swing.JLabel debugClientLabel;
171
    private javax.swing.JRadioButton firefoxRadioButton;
172
    private javax.swing.JRadioButton internetExplorerRadioButton;
173
    private javax.swing.JLabel noSupportedBrowserLabel;
174
    // End of variables declaration//GEN-END:variables
175
176
    private void setBrowser() {
177
        uiProperties.setDebugBrowser(internetExplorerRadioButton.isSelected() ?
178
                WebClientToolsProjectUtils.Browser.INTERNET_EXPLORER.name() :
179
                WebClientToolsProjectUtils.Browser.FIREFOX.name());
180
    }
181
182
}
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/customizer/GrailsProjectCustomizerProvider.java (-21 lines)
 Lines 39-45    Link Here 
39
import javax.swing.JComponent;
39
import javax.swing.JComponent;
40
import org.netbeans.api.project.Project;
40
import org.netbeans.api.project.Project;
41
import org.netbeans.api.project.ProjectUtils;
41
import org.netbeans.api.project.ProjectUtils;
42
import org.netbeans.modules.web.client.tools.api.WebClientToolsSessionStarterService;
43
import org.netbeans.spi.project.ui.CustomizerProvider;
42
import org.netbeans.spi.project.ui.CustomizerProvider;
44
import org.netbeans.spi.project.ui.support.ProjectCustomizer;
43
import org.netbeans.spi.project.ui.support.ProjectCustomizer;
45
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category;
44
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category;
 Lines 137-162    Link Here 
137
        };
136
        };
138
    }
137
    }
139
138
140
    // used from XML layer
141
    public static ProjectCustomizer.CompositeCategoryProvider createDebugging() {
142
        return new ProjectCustomizer.CompositeCategoryProvider() {
143
            public Category createCategory(Lookup context) {
144
                if (WebClientToolsSessionStarterService.isAvailable()) {
145
                    return ProjectCustomizer.Category.create(
146
                        DEBUG_CATEGORY,
147
                        NbBundle.getMessage(GrailsProjectCustomizerProvider.class, "DEBUG_CATEGORY"), // NOI18N
148
                        null);
149
                } else {
150
                    return null;
151
                }
152
            }
153
154
            public JComponent createComponent(Category category, Lookup context) {
155
                return new DebugCustomizerPanel(context.lookup(GrailsProjectProperties.class));
156
            }
157
        };
158
    }
159
160
    private class StoreListener implements ActionListener {
139
    private class StoreListener implements ActionListener {
161
        private final GrailsProjectProperties uiProperties;
140
        private final GrailsProjectProperties uiProperties;
162
141
(-)a/nbbuild/cluster.properties (-2 / +2 lines)
 Lines 410-416    Link Here 
410
        versioning.system.cvss.installer,\
410
        versioning.system.cvss.installer,\
411
        versioning.ui,\
411
        versioning.ui,\
412
        versioning.util,\
412
        versioning.util,\
413
        web.client.tools.api,\
414
        web.common,\
413
        web.common,\
415
        web.indent,\
414
        web.indent,\
416
        xml,\
415
        xml,\
 Lines 635-641    Link Here 
635
        spring.webmvc,\
634
        spring.webmvc,\
636
        tomcat5,\
635
        tomcat5,\
637
        web.beans,\
636
        web.beans,\
638
        web.client.javascript.debugger.ant,\
639
        web.core,\
637
        web.core,\
640
        web.core.syntax,\
638
        web.core.syntax,\
641
        web.debug,\
639
        web.debug,\
 Lines 1155-1160    Link Here 
1155
        php.phpdoc,\
1153
        php.phpdoc,\
1156
        projectimport.jbuilder,\
1154
        projectimport.jbuilder,\
1157
        uihandler.interactive,\
1155
        uihandler.interactive,\
1156
        web.client.javascript.debugger.ant,\
1157
        web.client.tools.api,\
1158
        web.client.tools.common,\
1158
        web.client.tools.common,\
1159
        web.client.tools.firefox,\
1159
        web.client.tools.firefox,\
1160
        web.client.tools.firefox.extension,\
1160
        web.client.tools.firefox.extension,\
(-)a/php.kit/manifest.mf (-1 / +1 lines)
 Lines 2-5    Link Here 
2
OpenIDE-Module: org.netbeans.modules.php.kit
2
OpenIDE-Module: org.netbeans.modules.php.kit
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/kit/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/kit/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.36
4
OpenIDE-Module-Specification-Version: 1.36
5
OpenIDE-Module-Recommends: org.netbeans.modules.web.client.tools.kit,org.netbeans.modules.hudson.php
5
OpenIDE-Module-Recommends: org.netbeans.modules.hudson.php
(-)a/php.project/nbproject/project.xml (-8 lines)
 Lines 269-282    Link Here 
269
                    </run-dependency>
269
                    </run-dependency>
270
                </dependency>
270
                </dependency>
271
                <dependency>
271
                <dependency>
272
                    <code-name-base>org.netbeans.modules.web.client.tools.api</code-name-base>
273
                    <build-prerequisite/>
274
                    <compile-dependency/>
275
                    <run-dependency>
276
                        <specification-version>1.0</specification-version>
277
                    </run-dependency>
278
                </dependency>
279
                <dependency>
280
                    <code-name-base>org.netbeans.modules.web.common</code-name-base>
272
                    <code-name-base>org.netbeans.modules.web.common</code-name-base>
281
                    <build-prerequisite/>
273
                    <build-prerequisite/>
282
                    <compile-dependency/>
274
                    <compile-dependency/>
(-)a/php.project/src/org/netbeans/modules/php/project/ui/actions/support/CommandUtils.java (-39 lines)
 Lines 65-72    Link Here 
65
import org.netbeans.modules.php.project.ui.customizer.PhpProjectProperties.XDebugUrlArguments;
65
import org.netbeans.modules.php.project.ui.customizer.PhpProjectProperties.XDebugUrlArguments;
66
import org.netbeans.modules.php.project.ui.options.PhpOptions;
66
import org.netbeans.modules.php.project.ui.options.PhpOptions;
67
import org.netbeans.modules.php.project.util.PhpProjectUtils;
67
import org.netbeans.modules.php.project.util.PhpProjectUtils;
68
import org.netbeans.modules.web.client.tools.api.WebClientToolsProjectUtils;
69
import org.netbeans.modules.web.client.tools.api.WebClientToolsSessionStarterService;
70
import org.openide.DialogDisplayer;
68
import org.openide.DialogDisplayer;
71
import org.openide.NotifyDescriptor;
69
import org.openide.NotifyDescriptor;
72
import org.openide.filesystems.FileObject;
70
import org.openide.filesystems.FileObject;
 Lines 375-385    Link Here 
375
     * @throws MalformedURLException if any error occurs.
373
     * @throws MalformedURLException if any error occurs.
376
     */
374
     */
377
    public static URL urlForDebugProject(PhpProject project, XDebugUrlArguments xDebugArgument) throws MalformedURLException {
375
    public static URL urlForDebugProject(PhpProject project, XDebugUrlArguments xDebugArgument) throws MalformedURLException {
378
        DebugInfo debugInfo = getDebugInfo(project);
379
        URL debugUrl = urlForProject(project);
376
        URL debugUrl = urlForProject(project);
380
        if (debugInfo.debugServer) {
381
            debugUrl = appendQuery(debugUrl, getDebugArguments(xDebugArgument));
377
            debugUrl = appendQuery(debugUrl, getDebugArguments(xDebugArgument));
382
        }
383
        return debugUrl;
378
        return debugUrl;
384
    }
379
    }
385
380
 Lines 437-447    Link Here 
437
     * @throws MalformedURLException if any error occurs.
432
     * @throws MalformedURLException if any error occurs.
438
     */
433
     */
439
    public static URL urlForDebugContext(PhpProject project, Lookup context, XDebugUrlArguments xDebugArgument) throws MalformedURLException {
434
    public static URL urlForDebugContext(PhpProject project, Lookup context, XDebugUrlArguments xDebugArgument) throws MalformedURLException {
440
        DebugInfo debugInfo = getDebugInfo(project);
441
        URL debugUrl = urlForContext(project, context);
435
        URL debugUrl = urlForContext(project, context);
442
        if (debugInfo.debugServer) {
443
            debugUrl = appendQuery(debugUrl, getDebugArguments(xDebugArgument));
436
            debugUrl = appendQuery(debugUrl, getDebugArguments(xDebugArgument));
444
        }
445
        return debugUrl;
437
        return debugUrl;
446
    }
438
    }
447
439
 Lines 462-485    Link Here 
462
        return baseDirectory;
454
        return baseDirectory;
463
    }
455
    }
464
456
465
    /**
466
     * Get {@link DebugInfo debug information} for a project (server side debugging,
467
     * client side debugging).
468
     * @param project a project to get information for.
469
     * @return {@link DebugInfo debug information} for a project.
470
     */
471
    public static DebugInfo getDebugInfo(PhpProject project) {
472
        boolean debugServer = WebClientToolsProjectUtils.getServerDebugProperty(project);
473
        boolean debugClient = WebClientToolsProjectUtils.getClientDebugProperty(project);
474
475
        if (!WebClientToolsSessionStarterService.isAvailable()) {
476
            debugServer = true;
477
            debugClient = false;
478
        }
479
        assert debugServer || debugClient;
480
        return new DebugInfo(debugClient, debugServer);
481
    }
482
483
    public static URL getBaseURL(PhpProject project) throws MalformedURLException {
457
    public static URL getBaseURL(PhpProject project) throws MalformedURLException {
484
        return getBaseURL(project, false);
458
        return getBaseURL(project, false);
485
    }
459
    }
 Lines 577-593    Link Here 
577
        return (!retval.isEmpty()) ? retval.toArray(new FileObject[retval.size()]) : null;
551
        return (!retval.isEmpty()) ? retval.toArray(new FileObject[retval.size()]) : null;
578
    }
552
    }
579
553
580
    /**
581
     * Holder class for debug information for a project (server side debugging,
582
     * client side debugging).
583
     */
584
    public static final class DebugInfo {
585
        public final boolean debugClient;
586
        public final boolean debugServer;
587
588
        public DebugInfo(boolean debugClient, boolean debugServer) {
589
            this.debugClient = debugClient;
590
            this.debugServer = debugServer;
591
        }
592
    }
593
}
554
}
(-)a/php.project/src/org/netbeans/modules/php/project/ui/actions/support/ConfigActionLocal.java (-94 lines)
 Lines 43-49    Link Here 
43
package org.netbeans.modules.php.project.ui.actions.support;
43
package org.netbeans.modules.php.project.ui.actions.support;
44
44
45
import java.net.MalformedURLException;
45
import java.net.MalformedURLException;
46
import java.net.URI;
47
import java.net.URISyntaxException;
46
import java.net.URISyntaxException;
48
import java.net.URL;
47
import java.net.URL;
49
import java.util.concurrent.Callable;
48
import java.util.concurrent.Callable;
 Lines 55-74    Link Here 
55
import org.netbeans.modules.php.project.spi.XDebugStarter;
54
import org.netbeans.modules.php.project.spi.XDebugStarter;
56
import org.netbeans.modules.php.project.ui.customizer.PhpProjectProperties.DebugUrl;
55
import org.netbeans.modules.php.project.ui.customizer.PhpProjectProperties.DebugUrl;
57
import org.netbeans.modules.php.project.ui.customizer.PhpProjectProperties.XDebugUrlArguments;
56
import org.netbeans.modules.php.project.ui.customizer.PhpProjectProperties.XDebugUrlArguments;
58
import org.netbeans.modules.php.project.util.PhpProjectUtils;
59
import org.netbeans.modules.web.client.tools.api.JSToNbJSLocationMapper;
60
import org.netbeans.modules.web.client.tools.api.LocationMappersFactory;
61
import org.netbeans.modules.web.client.tools.api.NbJSToJSLocationMapper;
62
import org.netbeans.modules.web.client.tools.api.WebClientToolsProjectUtils;
63
import org.netbeans.modules.web.client.tools.api.WebClientToolsSessionException;
64
import org.netbeans.modules.web.client.tools.api.WebClientToolsSessionStarterService;
65
import org.openide.awt.HtmlBrowser;
57
import org.openide.awt.HtmlBrowser;
66
import org.openide.filesystems.FileObject;
58
import org.openide.filesystems.FileObject;
67
import org.openide.filesystems.FileUtil;
59
import org.openide.filesystems.FileUtil;
68
import org.openide.util.Cancellable;
60
import org.openide.util.Cancellable;
69
import org.openide.util.Exceptions;
61
import org.openide.util.Exceptions;
70
import org.openide.util.Lookup;
62
import org.openide.util.Lookup;
71
import org.openide.util.lookup.Lookups;
72
63
73
/**
64
/**
74
 * Action implementation for LOCAL configuration.
65
 * Action implementation for LOCAL configuration.
 Lines 142-163    Link Here 
142
        Runnable runnable = new Runnable() {
133
        Runnable runnable = new Runnable() {
143
            @Override
134
            @Override
144
            public void run() {
135
            public void run() {
145
                try {
146
                    if (urlToShow[0] != null) {
136
                    if (urlToShow[0] != null) {
147
                        if (CommandUtils.getDebugInfo(project).debugClient) {
148
                            try {
149
                                launchJavaScriptDebugger(urlToShow[0]);
150
                            } catch (URISyntaxException ex) {
151
                                Exceptions.printStackTrace(ex);
152
                            }
153
                        } else {
154
                            HtmlBrowser.URLDisplayer.getDefault().showURL(urlToShow[0]);
137
                            HtmlBrowser.URLDisplayer.getDefault().showURL(urlToShow[0]);
155
                        }
138
                        }
156
                    }
139
                    }
157
                } catch (MalformedURLException ex) {
158
                    Exceptions.printStackTrace(ex);
159
                }
160
            }
161
        };
140
        };
162
141
163
        Cancellable cancellable = new Cancellable() {
142
        Cancellable cancellable = new Cancellable() {
 Lines 171-185    Link Here 
171
        };
150
        };
172
151
173
152
174
        boolean jsDebuggingAvailable = WebClientToolsSessionStarterService.isAvailable();
175
        if (jsDebuggingAvailable) {
176
            boolean keepDebugging = WebClientToolsProjectUtils.showDebugDialog(project);
177
            if (!keepDebugging) {
178
                return;
179
            }
180
        }
181
182
        if (!jsDebuggingAvailable || WebClientToolsProjectUtils.getServerDebugProperty(project)) {
183
            //temporary; after narrowing deps. will be changed
153
            //temporary; after narrowing deps. will be changed
184
            XDebugStarter dbgStarter = XDebugStarterFactory.getInstance();
154
            XDebugStarter dbgStarter = XDebugStarterFactory.getInstance();
185
            if (dbgStarter != null) {
155
            if (dbgStarter != null) {
 Lines 192-200    Link Here 
192
                    startDebugger(dbgStarter, runnable, cancellable, FileUtil.toFileObject(RunConfigLocal.forProject(project).getIndexFile()));
162
                    startDebugger(dbgStarter, runnable, cancellable, FileUtil.toFileObject(RunConfigLocal.forProject(project).getIndexFile()));
193
                }
163
                }
194
            }
164
            }
195
        } else {
196
            runnable.run();
197
        }
198
    }
165
    }
199
166
200
    @Override
167
    @Override
 Lines 268-288    Link Here 
268
            @Override
235
            @Override
269
            public void run() {
236
            public void run() {
270
                if (urlForStartDebugging != null) {
237
                if (urlForStartDebugging != null) {
271
                    try {
272
                        if (CommandUtils.getDebugInfo(project).debugClient) {
273
                            try {
274
                                launchJavaScriptDebugger(urlForStartDebugging);
275
                            } catch (URISyntaxException ex) {
276
                                Exceptions.printStackTrace(ex);
277
                            }
278
                        } else {
279
                            HtmlBrowser.URLDisplayer.getDefault().showURL(urlForStartDebugging);
238
                            HtmlBrowser.URLDisplayer.getDefault().showURL(urlForStartDebugging);
280
                        }
239
                        }
281
                    } catch (MalformedURLException ex) {
282
                        //TODO improve error handling
283
                        Exceptions.printStackTrace(ex);
284
                    }
285
                }
286
            }
240
            }
287
        };
241
        };
288
242
 Lines 296-310    Link Here 
296
            }
250
            }
297
        };
251
        };
298
252
299
        boolean jsDebuggingAvailable = WebClientToolsSessionStarterService.isAvailable();
300
        if (jsDebuggingAvailable) {
301
            boolean keepDebugging = WebClientToolsProjectUtils.showDebugDialog(project);
302
            if (!keepDebugging) {
303
                return;
304
            }
305
        }
306
307
        if (!jsDebuggingAvailable || WebClientToolsProjectUtils.getServerDebugProperty(project)) {
308
            XDebugStarter dbgStarter = XDebugStarterFactory.getInstance();
253
            XDebugStarter dbgStarter = XDebugStarterFactory.getInstance();
309
            if (dbgStarter != null) {
254
            if (dbgStarter != null) {
310
                if (dbgStarter.isAlreadyRunning()) {
255
                if (dbgStarter.isAlreadyRunning()) {
 Lines 316-324    Link Here 
316
                    startDebugger(dbgStarter, runnable, cancellable, selectedFile);
261
                    startDebugger(dbgStarter, runnable, cancellable, selectedFile);
317
                }
262
                }
318
            }
263
            }
319
        } else {
320
            runnable.run();
321
        }
322
    }
264
    }
323
265
324
    protected void preShowUrl(Lookup context) {
266
    protected void preShowUrl(Lookup context) {
 Lines 338-379    Link Here 
338
        dbgStarter.start(project, initDebuggingCallable, props);
280
        dbgStarter.start(project, initDebuggingCallable, props);
339
    }
281
    }
340
282
341
    private void launchJavaScriptDebugger(URL url) throws MalformedURLException, URISyntaxException {
342
        LocationMappersFactory mapperFactory = Lookup.getDefault().lookup(LocationMappersFactory.class);
343
        Lookup debuggerLookup = null;
344
        if (mapperFactory != null) {
345
            URI appContext = CommandUtils.getBaseURL(project).toURI();
346
            FileObject[] srcRoots = PhpProjectUtils.getSourceObjects(project);
347
348
            JSToNbJSLocationMapper forwardMapper =
349
                    mapperFactory.getJSToNbJSLocationMapper(srcRoots, appContext, null);
350
            NbJSToJSLocationMapper reverseMapper =
351
                    mapperFactory.getNbJSToJSLocationMapper(srcRoots, appContext, null);
352
            debuggerLookup = Lookups.fixed(forwardMapper, reverseMapper, project);
353
        } else {
354
            debuggerLookup = Lookups.fixed(project);
355
        }
356
357
        URI clientUrl = url.toURI();
358
359
        HtmlBrowser.Factory browser = null;
360
        if (WebClientToolsProjectUtils.isInternetExplorer(project)) {
361
            browser = WebClientToolsProjectUtils.getInternetExplorerBrowser();
362
        } else {
363
            browser = WebClientToolsProjectUtils.getFirefoxBrowser();
364
        }
365
366
        if (browser == null) {
367
            HtmlBrowser.URLDisplayer.getDefault().showURL(url);
368
        } else {
369
            try {
370
                WebClientToolsSessionStarterService.startSession(clientUrl, browser, debuggerLookup);
371
            } catch (WebClientToolsSessionException ex) {
372
                Exceptions.printStackTrace(ex);
373
            }
374
        }
375
    }
376
377
    private static final class StopDebuggingException extends Exception {
283
    private static final class StopDebuggingException extends Exception {
378
        private static final long serialVersionUID = -22807171434417714L;
284
        private static final long serialVersionUID = -22807171434417714L;
379
    }
285
    }
(-)a/web.client.tools.api/nbproject/project.xml (-3 lines)
 Lines 64-78    Link Here 
64
                </dependency>
64
                </dependency>
65
            </module-dependencies>
65
            </module-dependencies>
66
            <friend-packages>
66
            <friend-packages>
67
                <friend>org.netbeans.modules.groovy.grailsproject</friend>
68
                <friend>org.netbeans.modules.php.project</friend>
69
                <friend>org.netbeans.modules.ruby.railsprojects</friend>
67
                <friend>org.netbeans.modules.ruby.railsprojects</friend>
70
                <friend>org.netbeans.modules.web.client.javascript.debugger.ant</friend>
68
                <friend>org.netbeans.modules.web.client.javascript.debugger.ant</friend>
71
                <friend>org.netbeans.modules.web.client.tools.common</friend>
69
                <friend>org.netbeans.modules.web.client.tools.common</friend>
72
                <friend>org.netbeans.modules.web.client.tools.firefox</friend>
70
                <friend>org.netbeans.modules.web.client.tools.firefox</friend>
73
                <friend>org.netbeans.modules.web.client.tools.internetexplorer</friend>
71
                <friend>org.netbeans.modules.web.client.tools.internetexplorer</friend>
74
                <friend>org.netbeans.modules.web.client.tools.impl</friend>
72
                <friend>org.netbeans.modules.web.client.tools.impl</friend>
75
                <friend>org.netbeans.modules.web.project</friend>
76
                <package>org.netbeans.modules.web.client.tools.api</package>
73
                <package>org.netbeans.modules.web.client.tools.api</package>
77
                <package>org.netbeans.modules.web.client.tools.spi</package>
74
                <package>org.netbeans.modules.web.client.tools.spi</package>
78
            </friend-packages>
75
            </friend-packages>
(-)a/web.kit/manifest.mf (-2 / +1 lines)
 Lines 2-7    Link Here 
2
OpenIDE-Module: org.netbeans.modules.web.kit
2
OpenIDE-Module: org.netbeans.modules.web.kit
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/kit/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/kit/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.14
4
OpenIDE-Module-Specification-Version: 1.14
5
OpenIDE-Module-Recommends: org.netbeans.modules.web.client.tools.kit,
5
OpenIDE-Module-Recommends: org.netbeans.modules.web.project.framework
6
 org.netbeans.modules.web.project.framework
7
6
(-)a/web.kit/nbproject/project.xml (-6 lines)
 Lines 109-120    Link Here 
109
                    </run-dependency>
109
                    </run-dependency>
110
                </dependency>
110
                </dependency>
111
                <dependency>
111
                <dependency>
112
                    <code-name-base>org.netbeans.modules.web.client.javascript.debugger.ant</code-name-base>
113
                    <run-dependency>
114
                        <specification-version>0.6</specification-version>
115
                    </run-dependency>
116
                </dependency>
117
                <dependency>
118
                    <code-name-base>org.netbeans.modules.web.core</code-name-base>
112
                    <code-name-base>org.netbeans.modules.web.core</code-name-base>
119
                    <run-dependency>
113
                    <run-dependency>
120
                        <release-version>2</release-version>
114
                        <release-version>2</release-version>
(-)a/web.project/nbproject/project.xml (-8 lines)
 Lines 335-348    Link Here 
335
                    </run-dependency>
335
                    </run-dependency>
336
                </dependency>
336
                </dependency>
337
                <dependency>
337
                <dependency>
338
                    <code-name-base>org.netbeans.modules.web.client.tools.api</code-name-base>
339
                    <build-prerequisite/>
340
                    <compile-dependency/>
341
                    <run-dependency>
342
                        <specification-version>1.0</specification-version>
343
                    </run-dependency>
344
                </dependency>
345
                <dependency>
346
                    <code-name-base>org.netbeans.modules.web.common</code-name-base>
338
                    <code-name-base>org.netbeans.modules.web.common</code-name-base>
347
                    <build-prerequisite/>
339
                    <build-prerequisite/>
348
                    <compile-dependency/>
340
                    <compile-dependency/>
(-)a/web.project/src/org/netbeans/modules/web/project/WebActionProvider.java (-33 lines)
 Lines 99-106    Link Here 
99
import org.netbeans.modules.java.api.common.project.BaseActionProvider;
99
import org.netbeans.modules.java.api.common.project.BaseActionProvider;
100
import org.netbeans.modules.java.api.common.project.ProjectProperties;
100
import org.netbeans.modules.java.api.common.project.ProjectProperties;
101
import org.netbeans.modules.web.api.webmodule.RequestParametersQuery;
101
import org.netbeans.modules.web.api.webmodule.RequestParametersQuery;
102
import org.netbeans.modules.web.client.tools.api.WebClientToolsProjectUtils;
103
import org.netbeans.modules.web.client.tools.api.WebClientToolsSessionStarterService;
104
import org.netbeans.modules.web.jsps.parserapi.JspParserAPI;
102
import org.netbeans.modules.web.jsps.parserapi.JspParserAPI;
105
import org.netbeans.modules.web.jsps.parserapi.JspParserFactory;
103
import org.netbeans.modules.web.jsps.parserapi.JspParserFactory;
106
import org.netbeans.modules.web.jsps.parserapi.PageInfo;
104
import org.netbeans.modules.web.jsps.parserapi.PageInfo;
 Lines 319-328    Link Here 
319
            String targetNames[];
317
            String targetNames[];
320
            if (command.equals(COMMAND_DEBUG_SINGLE)) {
318
            if (command.equals(COMMAND_DEBUG_SINGLE)) {
321
                targetNames = new String[]{"debug"};
319
                targetNames = new String[]{"debug"};
322
                boolean keepDebugging = setJavaScriptDebuggerProperties(p);
323
                if (!keepDebugging) {
324
                    return null;
325
                }
326
            } else {
320
            } else {
327
                targetNames = new String[]{"run"};
321
                targetNames = new String[]{"run"};
328
            }
322
            }
 Lines 376-385    Link Here 
376
            if (!isSelectedServer()) {
370
            if (!isSelectedServer()) {
377
                return null;
371
                return null;
378
            }
372
            }
379
            boolean keepDebugging = setJavaScriptDebuggerProperties(p);
380
            if (!keepDebugging) {
381
                return null;
382
            }
383
            initWebServiceProperties(p);
373
            initWebServiceProperties(p);
384
        } else if (command.equals(COMMAND_COMPILE_SINGLE)) {
374
        } else if (command.equals(COMMAND_COMPILE_SINGLE)) {
385
            String res[] = super.getTargetNames(command, context, p, doJavaChecks);
375
            String res[] = super.getTargetNames(command, context, p, doJavaChecks);
 Lines 613-641    Link Here 
613
        }
603
        }
614
    }
604
    }
615
605
616
    private boolean setJavaScriptDebuggerProperties(Properties p) {
617
        if (!WebClientToolsSessionStarterService.isAvailable()) {
618
            // If JavaScript debugger is not available, set to server debugging only
619
            p.setProperty("debug.client", "false"); // NOI18N
620
            p.setProperty("debug.server", "true"); // NOI18N
621
            return true;
622
        } else {
623
            // display Debug Project Dialog
624
            boolean keepDebugging = WebClientToolsProjectUtils.showDebugDialog(getProject());
625
            if (!keepDebugging) {
626
                return false;
627
            }
628
629
            boolean debugServer = WebClientToolsProjectUtils.getServerDebugProperty(getProject());
630
            boolean debugClient = WebClientToolsProjectUtils.getClientDebugProperty(getProject());
631
632
            p.setProperty("debug.client", String.valueOf(debugClient)); // NOI18N
633
            p.setProperty("debug.server", String.valueOf(debugServer)); // NOI18N
634
635
            return true;
636
        }
637
    }
638
639
    /* Deletes translated class/java file to force recompilation of the page with all includes
606
    /* Deletes translated class/java file to force recompilation of the page with all includes
640
     */
607
     */
641
    public void invalidateClassFile(FileObject jsp) {
608
    public void invalidateClassFile(FileObject jsp) {

Return to bug 210334
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo