Commit bd237e2c authored by Markus Koschany's avatar Markus Koschany

Imported Upstream version 8.0.2+dfsg1

parent b8582526

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -51,6 +51,10 @@ import java.net.URL;
import org.apache.tools.ant.*;
import org.openide.awt.HtmlBrowser;
import org.netbeans.modules.web.browser.spi.URLDisplayerImplementation;
import org.netbeans.api.project.FileOwnerQuery;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
/**
* Opens a web browser.
......@@ -68,6 +72,16 @@ public class NbBrowse extends Task {
file = f;
}
private File context;
public void setContext(File f) {
context = f;
}
private String urlPath;
public void setUrlPath(String s) {
urlPath = s;
}
public void execute() throws BuildException {
if (url != null ^ file == null) throw new BuildException("You must define the url or file attributes", getLocation());
if (url == null) {
......@@ -75,7 +89,30 @@ public class NbBrowse extends Task {
}
log("Browsing: " + url);
try {
HtmlBrowser.URLDisplayer.getDefault().showURL(new URL(url));
URL u = new URL(url);
URL appRoot = null;
if (context != null) {
FileObject fo = FileUtil.toFileObject(context);
org.netbeans.api.project.Project p = null;
if (fo != null) {
p = FileOwnerQuery.getOwner(fo);
}
if (urlPath != null && urlPath.length() > 0) {
if (!url.endsWith(urlPath)) {
throw new BuildException("The urlPath("+urlPath+") is not part of the url("+url+")", getLocation());
}
appRoot = new URL(url.substring(0, url.length()-urlPath.length()));
}
if (p != null) {
URLDisplayerImplementation urlDisplayer = (URLDisplayerImplementation)
p.getLookup().lookup(URLDisplayerImplementation.class);
if (urlDisplayer != null) {
urlDisplayer.showURL(appRoot != null ? appRoot : u, u, fo);
return;
}
}
}
HtmlBrowser.URLDisplayer.getDefault().showURL(u);
} catch (MalformedURLException e) {
throw new BuildException(e, getLocation());
}
......
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.modules.ant.browsetask
OpenIDE-Module-Specification-Version: 1.24.1
OpenIDE-Module-Specification-Version: 1.37.1
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/browsetask/Bundle.properties
AutoUpdate-Show-In-Client: false
......@@ -42,7 +42,14 @@
ant.jar=${ant.core.lib}
javadoc.arch=${basedir}/arch.xml
# web.browser.api.dir is sometimes not set during the build (eg. nbms-and-javadoc build)
# hence the hotfix which adds "${projectapi.dir}/modules/org-netbeans-modules-web-browser-api.jar"
antsrc.cp=\
${ant.core.lib}:\
${openide.filesystems.dir}/core/org-openide-filesystems.jar:\
${openide.awt.dir}/modules/org-openide-awt.jar
${openide.awt.dir}/modules/org-openide-awt.jar:\
${openide.util.lookup.dir}/lib/org-openide-util-lookup.jar:\
${projectapi.dir}/modules/org-netbeans-modules-projectapi.jar:\
${web.browser.api.dir}/modules/org-netbeans-modules-web-browser-api.jar:\
${projectapi.dir}/modules/org-netbeans-modules-web-browser-api.jar
......@@ -54,14 +54,22 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<run-dependency>
<release-version>3</release-version>
<specification-version>3.47.1.2</specification-version>
<specification-version>3.6</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.projectapi</code-name-base>
<build-prerequisite/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.50</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.awt</code-name-base>
<build-prerequisite/>
<run-dependency>
<specification-version>7.31.1</specification-version>
<specification-version>6.2</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -69,6 +77,21 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<compile-dependency/>
</dependency>
<dependency>
<code-name-base>org.openide.util.lookup</code-name-base>
<build-prerequisite/>
<run-dependency>
<specification-version>8.19</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.web.browser.api</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.7</specification-version>
</run-dependency>
</dependency>
</module-dependencies>
<public-packages/>
<extra-compilation-unit>
......
......@@ -42,7 +42,7 @@
javac.compilerargs=-Xlint -Xlint:-serial
javac.source=1.6
spec.version.base=1.20.1
spec.version.base=1.33.1
test.unit.run.cp.extra=${tools.jar}
# Make the debugger find it, even if it is not on the startup debug classpath:
# (note: first entry is for accuracy in case you customize it; second for convenience)
......
......@@ -64,6 +64,7 @@ made subject to such option by the copyright holder.
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.36</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -72,7 +73,7 @@ made subject to such option by the copyright holder.
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.36.1</specification-version>
<specification-version>1.29</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -81,7 +82,7 @@ made subject to such option by the copyright holder.
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>2.27.1</specification-version>
<specification-version>2.13</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -97,7 +98,7 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.31.1</specification-version>
<specification-version>6.2</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -105,7 +106,7 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.20.1</specification-version>
<specification-version>6.2</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -113,7 +114,7 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.22.1</specification-version>
<specification-version>1.2</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -121,7 +122,7 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.47.1</specification-version>
<specification-version>7.57</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -135,7 +136,7 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.21.1</specification-version>
<specification-version>5.1</specification-version>
</run-dependency>
</dependency>
<dependency>
......@@ -143,7 +144,7 @@ made subject to such option by the copyright holder.
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.21.1</specification-version>
<specification-version>6.2</specification-version>