1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/api.html4j/apichanges.xml Tue Sep 09 21:44:37 2014 +0200
1.3 @@ -0,0 +1,82 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +<!--
1.6 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1.7 +
1.8 +Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
1.9 +
1.10 +Oracle and Java are registered trademarks of Oracle and/or its affiliates.
1.11 +Other names may be trademarks of their respective owners.
1.12 +
1.13 +
1.14 +The contents of this file are subject to the terms of either the GNU
1.15 +General Public License Version 2 only ("GPL") or the Common
1.16 +Development and Distribution License("CDDL") (collectively, the
1.17 +"License"). You may not use this file except in compliance with the
1.18 +License. You can obtain a copy of the License at
1.19 +http://www.netbeans.org/cddl-gplv2.html
1.20 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
1.21 +specific language governing permissions and limitations under the
1.22 +License. When distributing the software, include this License Header
1.23 +Notice in each file and include the License file at
1.24 +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
1.25 +particular file as subject to the "Classpath" exception as provided
1.26 +by Oracle in the GPL Version 2 section of the License file that
1.27 +accompanied this code. If applicable, add the following below the
1.28 +License Header, with the fields enclosed by brackets [] replaced by
1.29 +your own identifying information:
1.30 +"Portions Copyrighted [year] [name of copyright owner]"
1.31 +
1.32 +Contributor(s):
1.33 +
1.34 +The Original Software is NetBeans. The Initial Developer of the Original
1.35 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
1.36 +Microsystems, Inc. All Rights Reserved.
1.37 +
1.38 +If you wish your version of this file to be governed by only the CDDL
1.39 +or only the GPL Version 2, indicate your decision by adding
1.40 +"[Contributor] elects to include this software in this distribution
1.41 +under the [CDDL or GPL Version 2] license." If you do not indicate a
1.42 +single choice of license, a recipient has the option to distribute
1.43 +your version of this file under either the CDDL, the GPL Version 2 or
1.44 +to extend the choice of license to its licensees as provided above.
1.45 +However, if you add GPL Version 2 code and therefore, elected the GPL
1.46 +Version 2 license, then the option applies only if the new code is
1.47 +made subject to such option by the copyright holder.
1.48 +-->
1.49 +<!DOCTYPE apichanges PUBLIC "-//NetBeans//DTD API changes list 1.0//EN" "../nbbuild/javadoctools/apichanges.dtd">
1.50 +<apichanges>
1.51 +<apidefs>
1.52 + <apidef name="html4j">HTML APIs for Java & NetBeans</apidef>
1.53 +</apidefs>
1.54 +<changes>
1.55 + <change id="start">
1.56 + <api name="html4j"/>
1.57 + <summary>Version 1.0 included in NetBeans Platform</summary>
1.58 + <version major="1" minor="0"/>
1.59 + <date year="2014" month="9" day="5"/>
1.60 + <author login="jtulach"/>
1.61 + <compatibility addition="yes" binary="compatible" source="compatible"/>
1.62 + <description>
1.63 + <p>
1.64 + The HTML for Java and NetBeans API has been included
1.65 + in the NetBeans platform.
1.66 + </p>
1.67 + </description>
1.68 + <issue number="246133"/>
1.69 + </change>
1.70 +</changes>
1.71 +<htmlcontents>
1.72 +<head>
1.73 +<title>Change History for the HTML for Java and NetBeans API</title>
1.74 +<link rel="stylesheet" href="prose.css" type="text/css"/>
1.75 +</head>
1.76 +<body>
1.77 +<p class="overviewlink">
1.78 +<a href="overview-summary.html">Overview</a>
1.79 +</p>
1.80 +<standard-changelists module-code-name="$codebase"/>
1.81 +<hr/>
1.82 +<p>@FOOTER@</p>
1.83 +</body>
1.84 +</htmlcontents>
1.85 +</apichanges>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/api.html4j/arch.xml Tue Sep 09 21:44:37 2014 +0200
2.3 @@ -0,0 +1,1054 @@
2.4 +<?xml version="1.0" encoding="UTF-8"?>
2.5 +<!DOCTYPE api-answers PUBLIC "-//NetBeans//DTD Arch Answers//EN" "../nbbuild/antsrc/org/netbeans/nbbuild/Arch.dtd" [
2.6 + <!ENTITY api-questions SYSTEM "../nbbuild/antsrc/org/netbeans/nbbuild/Arch-api-questions.xml">
2.7 +]>
2.8 +
2.9 +<api-answers
2.10 + question-version="1.29"
2.11 + author="jtulach@netbeans.org"
2.12 +>
2.13 +
2.14 + &api-questions;
2.15 +
2.16 +
2.17 + <answer id="arch-overall">
2.18 + <p>
2.19 + <api name="HTML4J" category="official" group="java" type="export">
2.20 + NetBeans Platform specific bindings over
2.21 + standard <a href="http://bits.netbeans.org/html4j/" onclick="target='_blank'">HTML for Java</a> API.
2.22 + </api>
2.23 + </p>
2.24 + </answer>
2.25 +
2.26 + <answer id="arch-quality">
2.27 + <p>
2.28 + Guaranteed by unit tests.
2.29 + </p>
2.30 + </answer>
2.31 +
2.32 + <answer id="arch-time">
2.33 + <p>
2.34 + Part of NetBeans platform since 8.1 release.
2.35 + </p>
2.36 + </answer>
2.37 +
2.38 + <answer id="arch-usecases">
2.39 + <p>
2.40 + Primary purpose of this API is to allow smooth use of HTML based UI
2.41 + in NetBeans Platform. To achieve that it provides specific annotatations
2.42 + like <a href="@TOP@/org/netbeans/api/html4j/OpenHTMLRegistration.html">@OpenHTMLRegistration</a>,
2.43 + but otherwise it builds on the same usecases as the
2.44 + <a onclick="target='_blank'" href="http://bits.netbeans.org/html4j/">HTML for Java</a> API.
2.45 + </p>
2.46 + <usecase id="window" name="Portable HTML based Window">
2.47 + <a name="use-window"></a>
2.48 + Want to open a live HTML page as a
2.49 + <a href="@org-openide-windows@/org/openide/windows/TopComponent.html">
2.50 + NetBeans window component</a>? Do you want
2.51 + to use Java to control enabled/disabled state of various HTML elements?
2.52 + Then have a look at
2.53 + <a href="@TOP@/org/netbeans/api/html4j/OpenHTMLRegistration.html">@OpenHTMLRegistration</a>
2.54 + annotation.
2.55 + </usecase>
2.56 + <usecase id="dialog" name="Portable HTML based Dialog">
2.57 + <a name="use-dialog"></a>
2.58 + Want to open a modal dialog filled with an HTML page and block until user
2.59 + makes his choice?
2.60 + Then have a look at
2.61 + <a href="@TOP@/org/netbeans/api/html4j/HTMLDialog.html">@HTMLDialog</a>
2.62 + annotation.
2.63 + </usecase>
2.64 + <usecase id="component" name="Embedding an HTML UI Component">
2.65 + Are you satisfied with your HTML UI as used in
2.66 + <a href="@TOP@architecture-summary.html#use-window">windows</a> and
2.67 + <a href="@TOP@architecture-summary.html#use-dialog">dialogs</a>, but you'd like to use it
2.68 + at a different part of the overall NetBeans UI? Then check
2.69 + <a href="@TOP@/org/netbeans/api/html4j/HTMLComponent.html">@HTMLComponent</a>
2.70 + annotation.
2.71 + </usecase>
2.72 + </answer>
2.73 +
2.74 +
2.75 +
2.76 +<!--
2.77 + <question id="arch-what" when="init">
2.78 + What is this project good for?
2.79 + <hint>
2.80 + Please provide here a few lines describing the project,
2.81 + what problem it should solve, provide links to documentation,
2.82 + specifications, etc.
2.83 + </hint>
2.84 + </question>
2.85 +-->
2.86 + <answer id="arch-what">
2.87 + <p>
2.88 + NetBeans Platform specific bindings over
2.89 + standard <a onclick="target='_blank'" href="http://bits.netbeans.org/html4j/">HTML for Java</a> API.
2.90 + </p>
2.91 + </answer>
2.92 +
2.93 +
2.94 +
2.95 +<!--
2.96 + <question id="arch-where" when="impl">
2.97 + Where one can find sources for your module?
2.98 + <hint>
2.99 + Please provide link to the Hg web client at
2.100 + http://hg.netbeans.org/
2.101 + or just use tag defaultanswer generate='here'
2.102 + </hint>
2.103 + </question>
2.104 +-->
2.105 + <answer id="arch-where">
2.106 + <defaultanswer generate='here' />
2.107 + </answer>
2.108 +
2.109 +
2.110 +
2.111 +<!--
2.112 + <question id="compat-deprecation" when="init">
2.113 + How the introduction of your project influences functionality
2.114 + provided by previous version of the product?
2.115 + <hint>
2.116 + If you are planning to deprecate/remove/change any existing APIs,
2.117 + list them here accompanied with the reason explaining why you
2.118 + are doing so.
2.119 + </hint>
2.120 + </question>
2.121 +-->
2.122 + <answer id="compat-deprecation">
2.123 + <p>
2.124 + XXX no answer for compat-deprecation
2.125 + </p>
2.126 + </answer>
2.127 +
2.128 +
2.129 +
2.130 +<!--
2.131 + <question id="compat-i18n" when="impl">
2.132 + Is your module correctly internationalized?
2.133 + <hint>
2.134 + Correct internationalization means that it obeys instructions
2.135 + at <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html">
2.136 + NetBeans I18N pages</a>.
2.137 + </hint>
2.138 + </question>
2.139 +-->
2.140 + <answer id="compat-i18n">
2.141 + <p>
2.142 + XXX no answer for compat-i18n
2.143 + </p>
2.144 + </answer>
2.145 +
2.146 +
2.147 +
2.148 +<!--
2.149 + <question id="compat-standards" when="init">
2.150 + Does the module implement or define any standards? Is the
2.151 + implementation exact or does it deviate somehow?
2.152 + </question>
2.153 +-->
2.154 + <answer id="compat-standards">
2.155 + <p>
2.156 + XXX no answer for compat-standards
2.157 + </p>
2.158 + </answer>
2.159 +
2.160 +
2.161 +
2.162 +<!--
2.163 + <question id="compat-version" when="impl">
2.164 + Can your module coexist with earlier and future
2.165 + versions of itself? Can you correctly read all old settings? Will future
2.166 + versions be able to read your current settings? Can you read
2.167 + or politely ignore settings stored by a future version?
2.168 +
2.169 + <hint>
2.170 + Very helpful for reading settings is to store version number
2.171 + there, so future versions can decide whether how to read/convert
2.172 + the settings and older versions can ignore the new ones.
2.173 + </hint>
2.174 + </question>
2.175 +-->
2.176 + <answer id="compat-version">
2.177 + <p>
2.178 + XXX no answer for compat-version
2.179 + </p>
2.180 + </answer>
2.181 +
2.182 +
2.183 +
2.184 +<!--
2.185 + <question id="dep-jre" when="final">
2.186 + Which version of JRE do you need (1.2, 1.3, 1.4, etc.)?
2.187 + <hint>
2.188 + It is expected that if your module runs on 1.x that it will run
2.189 + on 1.x+1 if no, state that please. Also describe here cases where
2.190 + you run different code on different versions of JRE and why.
2.191 + </hint>
2.192 + </question>
2.193 +-->
2.194 + <answer id="dep-jre">
2.195 + <p>
2.196 + XXX no answer for dep-jre
2.197 + </p>
2.198 + </answer>
2.199 +
2.200 +
2.201 +
2.202 +<!--
2.203 + <question id="dep-jrejdk" when="final">
2.204 + Do you require the JDK or is the JRE enough?
2.205 + </question>
2.206 +-->
2.207 + <answer id="dep-jrejdk">
2.208 + <p>
2.209 + XXX no answer for dep-jrejdk
2.210 + </p>
2.211 + </answer>
2.212 +
2.213 +
2.214 +
2.215 +<!--
2.216 + <question id="dep-nb" when="init">
2.217 + What other NetBeans projects and modules does this one depend on?
2.218 + <hint>
2.219 + Depending on other NetBeans projects influnces the ability of
2.220 + users of your work to customize their own branded version of
2.221 + NetBeans by enabling and disabling some modules. Too
2.222 + much dependencies restrict this kind of customization. If that
2.223 + is your case, then you may want to split your functionality into
2.224 + pieces of autoload, eager and regular modules which can be
2.225 + enabled independently. Usually the answer to this question
2.226 + is generated from your <code>project.xml</code> file, but
2.227 + if it is not guessed correctly, you can suppress it by
2.228 + specifying <defaultanswer generate="none"/> and
2.229 + write here your own. Please describe such projects as imported APIs using
2.230 + the <code><api name="identification" type="import or export" category="stable" url="where is the description" /></code>.
2.231 + By doing this information gets listed in the summary page of your
2.232 + javadoc.
2.233 + </hint>
2.234 + </question>
2.235 +-->
2.236 + <answer id="dep-nb">
2.237 + <defaultanswer generate='here' />
2.238 + </answer>
2.239 +
2.240 +
2.241 +
2.242 +<!--
2.243 + <question id="dep-non-nb" when="init">
2.244 + What other projects outside NetBeans does this one depend on?
2.245 +
2.246 + <hint>
2.247 + Depending on 3rd party libraries is always problematic,
2.248 + especially if they are not open source, as that complicates
2.249 + the licensing scheme of NetBeans. Please enumerate your
2.250 + external dependencies here, so it is correctly understood since
2.251 + the begining what are the legal implications of your project.
2.252 + Also please note that
2.253 + some non-NetBeans projects are packaged as NetBeans modules
2.254 + (see <a href="http://libs.netbeans.org/">libraries</a>) and
2.255 + it is preferred to use this approach when more modules may
2.256 + depend and share such third-party libraries.
2.257 + </hint>
2.258 + </question>
2.259 +-->
2.260 + <answer id="dep-non-nb">
2.261 + <p>
2.262 + XXX no answer for dep-non-nb
2.263 + </p>
2.264 + </answer>
2.265 +
2.266 +
2.267 +
2.268 +<!--
2.269 + <question id="dep-platform" when="init">
2.270 + On which platforms does your module run? Does it run in the same
2.271 + way on each?
2.272 + <hint>
2.273 + If you plan any dependency on OS or any usage of native code,
2.274 + please describe why you are doing so and describe how you envision
2.275 + to enforce the portability of your code.
2.276 + Please note that there is a support for <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-os-specific">OS conditionally
2.277 + enabled modules</a> which together with autoload/eager modules
2.278 + can allow you to enable to provide the best OS aware support
2.279 + on certain OSes while providing compatibility bridge on the not
2.280 + supported ones.
2.281 + Also please list the supported
2.282 + OSes/HW platforms and mentioned the lovest version of JDK required
2.283 + for your project to run on. Also state whether JRE is enough or
2.284 + you really need JDK.
2.285 + </hint>
2.286 + </question>
2.287 +-->
2.288 + <answer id="dep-platform">
2.289 + <p>
2.290 + XXX no answer for dep-platform
2.291 + </p>
2.292 + </answer>
2.293 +
2.294 +
2.295 +
2.296 +<!--
2.297 + <question id="deploy-dependencies" when="final">
2.298 + What do other modules need to do to declare a dependency on this one,
2.299 + in addition to or instead of the normal module dependency declaration
2.300 + (e.g. tokens to require)?
2.301 + <hint>
2.302 + Provide a sample of the actual lines you would add to a module manifest
2.303 + to declare a dependency, for example OpenIDE-Module-Requires: some.token.
2.304 + If other modules should not depend on this module, or should just use a
2.305 + simple regular module dependency, you can just answer "nothing". If you
2.306 + intentionally expose a semistable API to clients using implementation
2.307 + dependencies, you should mention that here (but there is no need to give
2.308 + an example of usage).
2.309 + </hint>
2.310 + </question>
2.311 +-->
2.312 + <answer id="deploy-dependencies">
2.313 + <p>
2.314 + The HTML for Java & NetBeans API is a classical NetBeans module. However
2.315 + it depends on other modules provided by the
2.316 + <a onclick="target='_blank'" href="http://bits.netbeans.org/html4j">HTML for Java</a>
2.317 + project and those are OSGi bundles. As such, when one decides to use this
2.318 + module, one needs to turn on an OSGi container inside of the NetBeans Platform.
2.319 + It can be either <a onclick="target='_blank'" href="http://felix.apache.org">Felix</a> or
2.320 + NetBeans version of <a onclick="target='_blank'" href="http://wiki.apidesign.org/wiki/Netbinox">Equinox</a>.
2.321 + </p>
2.322 + </answer>
2.323 +
2.324 +
2.325 +
2.326 +<!--
2.327 + <question id="deploy-jar" when="impl">
2.328 + Do you deploy just module JAR file(s) or other files as well?
2.329 + <hint>
2.330 + Usually a module consist of one JAR file (perhaps with Class-Path
2.331 + extensions) and also a configuration file that enables it. If you
2.332 + have any other files, use
2.333 + <api group="java.io.File" name="yourname" type="export" category="friend">...</api>
2.334 + to define the location, name and stability of your files (of course
2.335 + changing "yourname" and "friend" to suit your needs).
2.336 +
2.337 + If it uses more than one JAR, describe where they are located, how
2.338 + they refer to each other.
2.339 + If it consist of module JAR(s) and other files, please describe
2.340 + what is their purpose, why other files are necessary. Please
2.341 + make sure that installation/uninstallation leaves the system
2.342 + in state as it was before installation.
2.343 + </hint>
2.344 + </question>
2.345 +-->
2.346 + <answer id="deploy-jar">
2.347 + <p>
2.348 + XXX no answer for deploy-jar
2.349 + </p>
2.350 + </answer>
2.351 +
2.352 +
2.353 +
2.354 +<!--
2.355 + <question id="deploy-nbm" when="impl">
2.356 + Can you deploy an NBM via the Update Center?
2.357 + <hint>
2.358 + If not why?
2.359 + </hint>
2.360 + </question>
2.361 +-->
2.362 + <answer id="deploy-nbm">
2.363 + <p>
2.364 + XXX no answer for deploy-nbm
2.365 + </p>
2.366 + </answer>
2.367 +
2.368 +
2.369 +
2.370 +<!--
2.371 + <question id="deploy-packages" when="init">
2.372 + Are packages of your module made inaccessible by not declaring them
2.373 + public?
2.374 +
2.375 + <hint>
2.376 + By default NetBeans build harness treats all packages are private.
2.377 + If you export some of them - either as public or friend packages,
2.378 + you should have a reason. If the reason is described elsewhere
2.379 + in this document, you can ignore this question.
2.380 + </hint>
2.381 + </question>
2.382 +-->
2.383 + <answer id="deploy-packages">
2.384 + <p>
2.385 + XXX no answer for deploy-packages
2.386 + </p>
2.387 + </answer>
2.388 +
2.389 +
2.390 +
2.391 +<!--
2.392 + <question id="deploy-shared" when="final">
2.393 + Do you need to be installed in the shared location only, or in the user directory only,
2.394 + or can your module be installed anywhere?
2.395 + <hint>
2.396 + Installation location shall not matter, if it does explain why.
2.397 + Consider also whether <code>InstalledFileLocator</code> can help.
2.398 + </hint>
2.399 + </question>
2.400 +-->
2.401 + <answer id="deploy-shared">
2.402 + <p>
2.403 + XXX no answer for deploy-shared
2.404 + </p>
2.405 + </answer>
2.406 +
2.407 +
2.408 +
2.409 +<!--
2.410 + <question id="exec-ant-tasks" when="impl">
2.411 + Do you define or register any ant tasks that other can use?
2.412 +
2.413 + <hint>
2.414 + If you provide an ant task that users can use, you need to be very
2.415 + careful about its syntax and behaviour, as it most likely forms an
2.416 + API for end users and as there is a lot of end users, their reaction
2.417 + when such API gets broken can be pretty strong.
2.418 + </hint>
2.419 + </question>
2.420 +-->
2.421 + <answer id="exec-ant-tasks">
2.422 + <p>
2.423 + XXX no answer for exec-ant-tasks
2.424 + </p>
2.425 + </answer>
2.426 +
2.427 +
2.428 +
2.429 +<!--
2.430 + <question id="exec-classloader" when="impl">
2.431 + Does your code create its own class loader(s)?
2.432 + <hint>
2.433 + A bit unusual. Please explain why and what for.
2.434 + </hint>
2.435 + </question>
2.436 +-->
2.437 + <answer id="exec-classloader">
2.438 + <p>
2.439 + XXX no answer for exec-classloader
2.440 + </p>
2.441 + </answer>
2.442 +
2.443 +
2.444 +
2.445 +<!--
2.446 + <question id="exec-component" when="impl">
2.447 + Is execution of your code influenced by any (string) property
2.448 + of any of your components?
2.449 +
2.450 + <hint>
2.451 + Often <code>JComponent.getClientProperty</code>, <code>Action.getValue</code>
2.452 + or <code>PropertyDescriptor.getValue</code>, etc. are used to influence
2.453 + a behavior of some code. This of course forms an interface that should
2.454 + be documented. Also if one depends on some interface that an object
2.455 + implements (<code>component instanceof Runnable</code>) that forms an
2.456 + API as well.
2.457 + </hint>
2.458 + </question>
2.459 +-->
2.460 + <answer id="exec-component">
2.461 + <p>
2.462 + XXX no answer for exec-component
2.463 + </p>
2.464 + </answer>
2.465 +
2.466 +
2.467 +
2.468 +<!--
2.469 + <question id="exec-introspection" when="impl">
2.470 + Does your module use any kind of runtime type information (<code>instanceof</code>,
2.471 + work with <code>java.lang.Class</code>, etc.)?
2.472 + <hint>
2.473 + Check for cases when you have an object of type A and you also
2.474 + expect it to (possibly) be of type B and do some special action. That
2.475 + should be documented. The same applies on operations in meta-level
2.476 + (Class.isInstance(...), Class.isAssignableFrom(...), etc.).
2.477 + </hint>
2.478 + </question>
2.479 +-->
2.480 + <answer id="exec-introspection">
2.481 + <p>
2.482 + XXX no answer for exec-introspection
2.483 + </p>
2.484 + </answer>
2.485 +
2.486 +
2.487 +
2.488 +<!--
2.489 + <question id="exec-privateaccess" when="final">
2.490 + Are you aware of any other parts of the system calling some of
2.491 + your methods by reflection?
2.492 + <hint>
2.493 + If so, describe the "contract" as an API. Likely private or friend one, but
2.494 + still API and consider rewrite of it.
2.495 + </hint>
2.496 + </question>
2.497 +-->
2.498 + <answer id="exec-privateaccess">
2.499 + <p>
2.500 + XXX no answer for exec-privateaccess
2.501 + </p>
2.502 + </answer>
2.503 +
2.504 +
2.505 +
2.506 +<!--
2.507 + <question id="exec-process" when="impl">
2.508 + Do you execute an external process from your module? How do you ensure
2.509 + that the result is the same on different platforms? Do you parse output?
2.510 + Do you depend on result code?
2.511 + <hint>
2.512 + If you feed an input, parse the output please declare that as an API.
2.513 + </hint>
2.514 + </question>
2.515 +-->
2.516 + <answer id="exec-process">
2.517 + <p>
2.518 + XXX no answer for exec-process
2.519 + </p>
2.520 + </answer>
2.521 +
2.522 +
2.523 +
2.524 +<!--
2.525 + <question id="exec-property" when="impl">
2.526 + Is execution of your code influenced by any environment or
2.527 + Java system (<code>System.getProperty</code>) property?
2.528 + On a similar note, is there something interesting that you
2.529 + pass to <code>java.util.logging.Logger</code>? Or do you observe
2.530 + what others log?
2.531 + <hint>
2.532 + If there is a property that can change the behavior of your
2.533 + code, somebody will likely use it. You should describe what it does
2.534 + and the <a href="http://wiki.netbeans.org/API_Stability">stability category</a>
2.535 + of this API. You may use
2.536 + <pre>
2.537 + <api type="export" group="property" name="id" category="private" url="http://...">
2.538 + description of the property, where it is used, what it influence, etc.
2.539 + </api>
2.540 + </pre>
2.541 + </hint>
2.542 + </question>
2.543 +-->
2.544 + <answer id="exec-property">
2.545 + <p>
2.546 + XXX no answer for exec-property
2.547 + </p>
2.548 + </answer>
2.549 +
2.550 +
2.551 +
2.552 +<!--
2.553 + <question id="exec-reflection" when="impl">
2.554 + Does your code use Java Reflection to execute other code?
2.555 + <hint>
2.556 + This usually indicates a missing or insufficient API in the other
2.557 + part of the system. If the other side is not aware of your dependency
2.558 + this contract can be easily broken.
2.559 + </hint>
2.560 + </question>
2.561 +-->
2.562 + <answer id="exec-reflection">
2.563 + <p>
2.564 + XXX no answer for exec-reflection
2.565 + </p>
2.566 + </answer>
2.567 +
2.568 +
2.569 +
2.570 +<!--
2.571 + <question id="exec-threading" when="init">
2.572 + What threading models, if any, does your module adhere to? How the
2.573 + project behaves with respect to threading?
2.574 + <hint>
2.575 + Is your API threadsafe? Can it be accessed from any threads or
2.576 + just from some dedicated ones? Any special relation to AWT and
2.577 + its Event Dispatch thread? Also
2.578 + if your module calls foreign APIs which have a specific threading model,
2.579 + indicate how you comply with the requirements for multithreaded access
2.580 + (synchronization, mutexes, etc.) applicable to those APIs.
2.581 + If your module defines any APIs, or has complex internal structures
2.582 + that might be used from multiple threads, declare how you protect
2.583 + data against concurrent access, race conditions, deadlocks, etc.,
2.584 + and whether such rules are enforced by runtime warnings, errors, assertions, etc.
2.585 + Examples: a class might be non-thread-safe (like Java Collections); might
2.586 + be fully thread-safe (internal locking); might require access through a mutex
2.587 + (and may or may not automatically acquire that mutex on behalf of a client method);
2.588 + might be able to run only in the event queue; etc.
2.589 + Also describe when any events are fired: synchronously, asynchronously, etc.
2.590 + Ideas: <a href="http://core.netbeans.org/proposals/threading/index.html#recommendations">Threading Recommendations</a> (in progress)
2.591 + </hint>
2.592 + </question>
2.593 +-->
2.594 + <answer id="exec-threading">
2.595 + <p>
2.596 + XXX no answer for exec-threading
2.597 + </p>
2.598 + </answer>
2.599 +
2.600 +
2.601 +
2.602 +<!--
2.603 + <question id="format-clipboard" when="impl">
2.604 + Which data flavors (if any) does your code read from or insert to
2.605 + the clipboard (by access to clipboard on means calling methods on <code>java.awt.datatransfer.Transferable</code>?
2.606 +
2.607 + <hint>
2.608 + Often Node's deal with clipboard by usage of <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>.
2.609 + Check your code for overriding these methods.
2.610 + </hint>
2.611 + </question>
2.612 +-->
2.613 + <answer id="format-clipboard">
2.614 + <p>
2.615 + XXX no answer for format-clipboard
2.616 + </p>
2.617 + </answer>
2.618 +
2.619 +
2.620 +
2.621 +<!--
2.622 + <question id="format-dnd" when="impl">
2.623 + Which protocols (if any) does your code understand during Drag & Drop?
2.624 + <hint>
2.625 + Often Node's deal with clipboard by usage of <code>Node.drag, Node.getDropType</code>.
2.626 + Check your code for overriding these methods. Btw. if they are not overridden, they
2.627 + by default delegate to <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>.
2.628 + </hint>
2.629 + </question>
2.630 +-->
2.631 + <answer id="format-dnd">
2.632 + <p>
2.633 + XXX no answer for format-dnd
2.634 + </p>
2.635 + </answer>
2.636 +
2.637 +
2.638 +
2.639 +<!--
2.640 + <question id="format-types" when="impl">
2.641 + Which protocols and file formats (if any) does your module read or write on disk,
2.642 + or transmit or receive over the network? Do you generate an ant build script?
2.643 + Can it be edited and modified?
2.644 +
2.645 + <hint>
2.646 + <p>
2.647 + Files can be read and written by other programs, modules and users. If they influence
2.648 + your behaviour, make sure you either document the format or claim that it is a private
2.649 + api (using the <api> tag).
2.650 + </p>
2.651 +
2.652 + <p>
2.653 + If you generate an ant build file, this is very likely going to be seen by end users and
2.654 + they will be attempted to edit it. You should be ready for that and provide here a link
2.655 + to documentation that you have for such purposes and also describe how you are going to
2.656 + understand such files during next release, when you (very likely) slightly change the
2.657 + format.
2.658 + </p>
2.659 + </hint>
2.660 + </question>
2.661 +-->
2.662 + <answer id="format-types">
2.663 + <p>
2.664 + XXX no answer for format-types
2.665 + </p>
2.666 + </answer>
2.667 +
2.668 +
2.669 +
2.670 +<!--
2.671 + <question id="lookup-lookup" when="init">
2.672 + Does your module use <code>org.openide.util.Lookup</code>
2.673 + or any similar technology to find any components to communicate with? Which ones?
2.674 +
2.675 + <hint>
2.676 + NetBeans is build around a generic registry of services called
2.677 + lookup. It is preferable to use it for registration and discovery
2.678 + if possible. See
2.679 + <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/lookup/doc-files/index.html">
2.680 + The Solution to Comunication Between Components
2.681 + </a>. If you do not plan to use lookup and insist usage
2.682 + of other solution, then please describe why it is not working for
2.683 + you.
2.684 + <br/>
2.685 + When filling the final version of your arch document, please
2.686 + describe the interfaces you are searching for, where
2.687 + are defined, whether you are searching for just one or more of them,
2.688 + if the order is important, etc. Also classify the stability of such
2.689 + API contract. Use <api group=&lookup& /> tag, so
2.690 + your information gets listed in the summary page of your javadoc.
2.691 + </hint>
2.692 + </question>
2.693 +-->
2.694 + <answer id="lookup-lookup">
2.695 + <p>
2.696 + XXX no answer for lookup-lookup
2.697 + </p>
2.698 + </answer>
2.699 +
2.700 +
2.701 +
2.702 +<!--
2.703 + <question id="lookup-register" when="final">
2.704 + Do you register anything into lookup for other code to find?
2.705 + <hint>
2.706 + Do you register using layer file or using a declarative annotation such as <code>@ServiceProvider</code>?
2.707 + Who is supposed to find your component?
2.708 + </hint>
2.709 + </question>
2.710 +-->
2.711 + <answer id="lookup-register">
2.712 + <p>
2.713 + XXX no answer for lookup-register
2.714 + </p>
2.715 + </answer>
2.716 +
2.717 +
2.718 +
2.719 +<!--
2.720 + <question id="lookup-remove" when="final">
2.721 + Do you remove entries of other modules from lookup?
2.722 + <hint>
2.723 + Why? Of course, that is possible, but it can be dangerous. Is the module
2.724 + your are masking resource from aware of what you are doing?
2.725 + </hint>
2.726 + </question>
2.727 +-->
2.728 + <answer id="lookup-remove">
2.729 + <p>
2.730 + XXX no answer for lookup-remove
2.731 + </p>
2.732 + </answer>
2.733 +
2.734 +
2.735 +
2.736 +<!--
2.737 + <question id="perf-exit" when="final">
2.738 + Does your module run any code on exit?
2.739 + </question>
2.740 +-->
2.741 + <answer id="perf-exit">
2.742 + <p>
2.743 + XXX no answer for perf-exit
2.744 + </p>
2.745 + </answer>
2.746 +
2.747 +
2.748 +
2.749 +<!--
2.750 + <question id="perf-huge_dialogs" when="final">
2.751 + Does your module contain any dialogs or wizards with a large number of
2.752 + GUI controls such as combo boxes, lists, trees, or text areas?
2.753 + </question>
2.754 +-->
2.755 + <answer id="perf-huge_dialogs">
2.756 + <p>
2.757 + XXX no answer for perf-huge_dialogs
2.758 + </p>
2.759 + </answer>
2.760 +
2.761 +
2.762 +
2.763 +<!--
2.764 + <question id="perf-limit" when="init">
2.765 + Are there any hard-coded or practical limits in the number or size of
2.766 + elements your code can handle?
2.767 + <hint>
2.768 + Most of algorithms have increasing memory and speed complexity
2.769 + with respect to size of data they operate on. What is the critical
2.770 + part of your project that can be seen as a bottleneck with
2.771 + respect to speed or required memory? What are the practical
2.772 + sizes of data you tested your project with? What is your estimate
2.773 + of potential size of data that would cause visible performance
2.774 + problems? Is there some kind of check to detect such situation
2.775 + and prevent "hard" crashes - for example the CloneableEditorSupport
2.776 + checks for size of a file to be opened in editor
2.777 + and if it is larger than 1Mb it shows a dialog giving the
2.778 + user the right to decide - e.g. to cancel or commit suicide.
2.779 + </hint>
2.780 + </question>
2.781 +-->
2.782 + <answer id="perf-limit">
2.783 + <p>
2.784 + XXX no answer for perf-limit
2.785 + </p>
2.786 + </answer>
2.787 +
2.788 +
2.789 +
2.790 +<!--
2.791 + <question id="perf-mem" when="final">
2.792 + How much memory does your component consume? Estimate
2.793 + with a relation to the number of windows, etc.
2.794 + </question>
2.795 +-->
2.796 + <answer id="perf-mem">
2.797 + <p>
2.798 + XXX no answer for perf-mem
2.799 + </p>
2.800 + </answer>
2.801 +
2.802 +
2.803 +
2.804 +<!--
2.805 + <question id="perf-menus" when="final">
2.806 + Does your module use dynamically updated context menus, or
2.807 + context-sensitive actions with complicated and slow enablement logic?
2.808 + <hint>
2.809 + If you do a lot of tricks when adding actions to regular or context menus, you can significantly
2.810 + slow down display of the menu, even when the user is not using your action. Pay attention to
2.811 + actions you add to the main menu bar, and to context menus of foreign nodes or components. If
2.812 + the action is conditionally enabled, or changes its display dynamically, you need to check the
2.813 + impact on performance. In some cases it may be more appropriate to make a simple action that is
2.814 + always enabled but does more detailed checks in a dialog if it is actually run.
2.815 + </hint>
2.816 + </question>
2.817 +-->
2.818 + <answer id="perf-menus">
2.819 + <p>
2.820 + XXX no answer for perf-menus
2.821 + </p>
2.822 + </answer>
2.823 +
2.824 +
2.825 +
2.826 +<!--
2.827 + <question id="perf-progress" when="final">
2.828 + Does your module execute any long-running tasks?
2.829 +
2.830 + <hint>Long running tasks should never block
2.831 + AWT thread as it badly hurts the UI
2.832 + <a href="http://performance.netbeans.org/responsiveness/issues.html">
2.833 + responsiveness</a>.
2.834 + Tasks like connecting over
2.835 + network, computing huge amount of data, compilation
2.836 + be done asynchronously (for example
2.837 + using <code>RequestProcessor</code>), definitively it should
2.838 + not block AWT thread.
2.839 + </hint>
2.840 + </question>
2.841 +-->
2.842 + <answer id="perf-progress">
2.843 + <p>
2.844 + XXX no answer for perf-progress
2.845 + </p>
2.846 + </answer>
2.847 +
2.848 +
2.849 +
2.850 +<!--
2.851 + <question id="perf-scale" when="init">
2.852 + Which external criteria influence the performance of your
2.853 + program (size of file in editor, number of files in menu,
2.854 + in source directory, etc.) and how well your code scales?
2.855 + <hint>
2.856 + Please include some estimates, there are other more detailed
2.857 + questions to answer in later phases of implementation.
2.858 + </hint>
2.859 + </question>
2.860 +-->
2.861 + <answer id="perf-scale">
2.862 + <p>
2.863 + XXX no answer for perf-scale
2.864 + </p>
2.865 + </answer>
2.866 +
2.867 +
2.868 +
2.869 +<!--
2.870 + <question id="perf-spi" when="init">
2.871 + How the performance of the plugged in code will be enforced?
2.872 + <hint>
2.873 + If you allow foreign code to be plugged into your own module, how
2.874 + do you enforce that it will behave correctly and quickly and will not
2.875 + negatively influence the performance of your own module?
2.876 + </hint>
2.877 + </question>
2.878 +-->
2.879 + <answer id="perf-spi">
2.880 + <p>
2.881 + XXX no answer for perf-spi
2.882 + </p>
2.883 + </answer>
2.884 +
2.885 +
2.886 +
2.887 +<!--
2.888 + <question id="perf-startup" when="final">
2.889 + Does your module run any code on startup?
2.890 + </question>
2.891 +-->
2.892 + <answer id="perf-startup">
2.893 + <p>
2.894 + XXX no answer for perf-startup
2.895 + </p>
2.896 + </answer>
2.897 +
2.898 +
2.899 +
2.900 +<!--
2.901 + <question id="perf-wakeup" when="final">
2.902 + Does any piece of your code wake up periodically and do something
2.903 + even when the system is otherwise idle (no user interaction)?
2.904 + </question>
2.905 +-->
2.906 + <answer id="perf-wakeup">
2.907 + <p>
2.908 + XXX no answer for perf-wakeup
2.909 + </p>
2.910 + </answer>
2.911 +
2.912 +
2.913 +
2.914 +<!--
2.915 + <question id="resources-file" when="final">
2.916 + Does your module use <code>java.io.File</code> directly?
2.917 +
2.918 + <hint>
2.919 + NetBeans provide a logical wrapper over plain files called
2.920 + <code>org.openide.filesystems.FileObject</code> that
2.921 + provides uniform access to such resources and is the preferred
2.922 + way that should be used. But of course there can be situations when
2.923 + this is not suitable.
2.924 + </hint>
2.925 + </question>
2.926 +-->
2.927 + <answer id="resources-file">
2.928 + <p>
2.929 + XXX no answer for resources-file
2.930 + </p>
2.931 + </answer>
2.932 +
2.933 +
2.934 +
2.935 +<!--
2.936 + <question id="resources-layer" when="final">
2.937 + Does your module provide own layer? Does it create any files or
2.938 + folders in it? What it is trying to communicate by that and with which
2.939 + components?
2.940 +
2.941 + <hint>
2.942 + NetBeans allows automatic and declarative installation of resources
2.943 + by module layers. Module register files into appropriate places
2.944 + and other components use that information to perform their task
2.945 + (build menu, toolbar, window layout, list of templates, set of
2.946 + options, etc.).
2.947 + </hint>
2.948 + </question>
2.949 +-->
2.950 + <answer id="resources-layer">
2.951 + <p>
2.952 + XXX no answer for resources-layer
2.953 + </p>
2.954 + </answer>
2.955 +
2.956 +
2.957 +
2.958 +<!--
2.959 + <question id="resources-mask" when="final">
2.960 + Does your module mask/hide/override any resources provided by other modules in
2.961 + their layers?
2.962 +
2.963 + <hint>
2.964 + If you mask a file provided by another module, you probably depend
2.965 + on that and do not want the other module to (for example) change
2.966 + the file's name. That module shall thus make that file available as an API
2.967 + of some stability category.
2.968 + </hint>
2.969 + </question>
2.970 +-->
2.971 + <answer id="resources-mask">
2.972 + <p>
2.973 + XXX no answer for resources-mask
2.974 + </p>
2.975 + </answer>
2.976 +
2.977 +
2.978 +
2.979 +<!--
2.980 + <question id="resources-preferences" when="final">
2.981 + Does your module uses preferences via Preferences API? Does your module use NbPreferences or
2.982 + or regular JDK Preferences ? Does it read, write or both ?
2.983 + Does it share preferences with other modules ? If so, then why ?
2.984 + <hint>
2.985 + You may use
2.986 + <api type="export" group="preferences"
2.987 + name="preference node name" category="private">
2.988 + description of individual keys, where it is used, what it
2.989 + influences, whether the module reads/write it, etc.
2.990 + </api>
2.991 + Due to XML ID restrictions, rather than /org/netbeans/modules/foo give the "name" as org.netbeans.modules.foo.
2.992 + Note that if you use NbPreferences this name will then be the same as the code name base of the module.
2.993 + </hint>
2.994 + </question>
2.995 +-->
2.996 + <answer id="resources-preferences">
2.997 + <p>
2.998 + XXX no answer for resources-preferences
2.999 + </p>
2.1000 + </answer>
2.1001 +
2.1002 +
2.1003 +
2.1004 +<!--
2.1005 + <question id="resources-read" when="final">
2.1006 + Does your module read any resources from layers? For what purpose?
2.1007 +
2.1008 + <hint>
2.1009 + As this is some kind of intermodule dependency, it is a kind of API.
2.1010 + Please describe it and classify according to
2.1011 + <a href="http://wiki.netbeans.org/API_Design#What_is_an_API.3F">
2.1012 + common stability categories</a>.
2.1013 + </hint>
2.1014 + </question>
2.1015 +-->
2.1016 + <answer id="resources-read">
2.1017 + <p>
2.1018 + XXX no answer for resources-read
2.1019 + </p>
2.1020 + </answer>
2.1021 +
2.1022 +
2.1023 +
2.1024 +<!--
2.1025 + <question id="security-grant" when="final">
2.1026 + Does your code grant additional rights to some other code?
2.1027 + <hint>Avoid using a class loader that adds extra
2.1028 + permissions to loaded code unless really necessary.
2.1029 + Also note that your API implementation
2.1030 + can also expose unneeded permissions to enemy code by
2.1031 + calling AccessController.doPrivileged().</hint>
2.1032 + </question>
2.1033 +-->
2.1034 + <answer id="security-grant">
2.1035 + <p>
2.1036 + XXX no answer for security-grant
2.1037 + </p>
2.1038 + </answer>
2.1039 +
2.1040 +
2.1041 +
2.1042 +<!--
2.1043 + <question id="security-policy" when="final">
2.1044 + Does your functionality require modifications to the standard policy file?
2.1045 + <hint>Your code might pass control to third-party code not
2.1046 + coming from trusted domains. This could be code downloaded over the
2.1047 + network or code coming from libraries that are not bundled
2.1048 + with NetBeans. Which permissions need to be granted to which domains?</hint>
2.1049 + </question>
2.1050 +-->
2.1051 + <answer id="security-policy">
2.1052 + <p>
2.1053 + XXX no answer for security-policy
2.1054 + </p>
2.1055 + </answer>
2.1056 +
2.1057 +</api-answers>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/api.html4j/build.xml Tue Sep 09 21:44:37 2014 +0200
3.3 @@ -0,0 +1,5 @@
3.4 +<?xml version="1.0" encoding="UTF-8"?>
3.5 +<project basedir="." default="netbeans" name="api.html4j">
3.6 + <description>Builds, tests, and runs the project org.netbeans.api.html4j</description>
3.7 + <import file="../nbbuild/templates/projectized.xml"/>
3.8 +</project>
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/api.html4j/manifest.mf Tue Sep 09 21:44:37 2014 +0200
4.3 @@ -0,0 +1,5 @@
4.4 +Manifest-Version: 1.0
4.5 +OpenIDE-Module: org.netbeans.api.html4j
4.6 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html4j/Bundle.properties
4.7 +OpenIDE-Module-Specification-Version: 1.0
4.8 +
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/api.html4j/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
5.3 @@ -0,0 +1,4 @@
5.4 +is.autoload=true
5.5 +javac.source=1.7
5.6 +javac.compilerargs=-Xlint -Xlint:-serial
5.7 +javadoc.arch=${basedir}/arch.xml
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/api.html4j/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
6.3 @@ -0,0 +1,121 @@
6.4 +<?xml version="1.0" encoding="UTF-8"?>
6.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
6.6 + <type>org.netbeans.modules.apisupport.project</type>
6.7 + <configuration>
6.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6.9 + <code-name-base>org.netbeans.api.html4j</code-name-base>
6.10 + <module-dependencies>
6.11 + <dependency>
6.12 + <code-name-base>net.java.html</code-name-base>
6.13 + <build-prerequisite/>
6.14 + <compile-dependency/>
6.15 + <run-dependency/>
6.16 + </dependency>
6.17 + <dependency>
6.18 + <code-name-base>net.java.html.boot</code-name-base>
6.19 + <build-prerequisite/>
6.20 + <compile-dependency/>
6.21 + <run-dependency/>
6.22 + </dependency>
6.23 + <dependency>
6.24 + <code-name-base>net.java.html.boot.fx</code-name-base>
6.25 + <build-prerequisite/>
6.26 + <compile-dependency/>
6.27 + <run-dependency/>
6.28 + </dependency>
6.29 + <dependency>
6.30 + <code-name-base>net.java.html.json</code-name-base>
6.31 + <build-prerequisite/>
6.32 + <compile-dependency/>
6.33 + <run-dependency/>
6.34 + </dependency>
6.35 + <dependency>
6.36 + <code-name-base>org.netbeans.html.ko4j</code-name-base>
6.37 + <run-dependency/>
6.38 + </dependency>
6.39 + <dependency>
6.40 + <code-name-base>org.netbeans.libs.javafx</code-name-base>
6.41 + <build-prerequisite/>
6.42 + <compile-dependency/>
6.43 + <run-dependency>
6.44 + <specification-version>2.4</specification-version>
6.45 + </run-dependency>
6.46 + </dependency>
6.47 + <dependency>
6.48 + <code-name-base>org.objectweb.asm</code-name-base>
6.49 + <build-prerequisite/>
6.50 + <run-dependency/>
6.51 + </dependency>
6.52 + <dependency>
6.53 + <code-name-base>org.openide.awt</code-name-base>
6.54 + <build-prerequisite/>
6.55 + <compile-dependency/>
6.56 + <run-dependency>
6.57 + <specification-version>7.62</specification-version>
6.58 + </run-dependency>
6.59 + </dependency>
6.60 + <dependency>
6.61 + <code-name-base>org.openide.dialogs</code-name-base>
6.62 + <build-prerequisite/>
6.63 + <compile-dependency/>
6.64 + <run-dependency>
6.65 + <specification-version>7.30</specification-version>
6.66 + </run-dependency>
6.67 + </dependency>
6.68 + <dependency>
6.69 + <code-name-base>org.openide.filesystems</code-name-base>
6.70 + <build-prerequisite/>
6.71 + <compile-dependency/>
6.72 + <run-dependency>
6.73 + <specification-version>8.12</specification-version>
6.74 + </run-dependency>
6.75 + </dependency>
6.76 + <dependency>
6.77 + <code-name-base>org.openide.util</code-name-base>
6.78 + <build-prerequisite/>
6.79 + <compile-dependency/>
6.80 + <run-dependency>
6.81 + <specification-version>8.39</specification-version>
6.82 + </run-dependency>
6.83 + </dependency>
6.84 + <dependency>
6.85 + <code-name-base>org.openide.util.lookup</code-name-base>
6.86 + <build-prerequisite/>
6.87 + <compile-dependency/>
6.88 + <run-dependency>
6.89 + <specification-version>8.25</specification-version>
6.90 + </run-dependency>
6.91 + </dependency>
6.92 + <dependency>
6.93 + <code-name-base>org.openide.windows</code-name-base>
6.94 + <build-prerequisite/>
6.95 + <compile-dependency/>
6.96 + <run-dependency>
6.97 + <specification-version>6.71</specification-version>
6.98 + </run-dependency>
6.99 + </dependency>
6.100 + </module-dependencies>
6.101 + <test-dependencies>
6.102 + <test-type>
6.103 + <name>unit</name>
6.104 + <test-dependency>
6.105 + <code-name-base>org.netbeans.core.startup</code-name-base>
6.106 + <recursive/>
6.107 + <compile-dependency/>
6.108 + </test-dependency>
6.109 + <test-dependency>
6.110 + <code-name-base>org.netbeans.html.ko4j</code-name-base>
6.111 + <compile-dependency/>
6.112 + </test-dependency>
6.113 + <test-dependency>
6.114 + <code-name-base>org.netbeans.libs.testng</code-name-base>
6.115 + <compile-dependency/>
6.116 + </test-dependency>
6.117 + </test-type>
6.118 + </test-dependencies>
6.119 + <public-packages>
6.120 + <package>org.netbeans.api.html4j</package>
6.121 + </public-packages>
6.122 + </data>
6.123 + </configuration>
6.124 +</project>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/api.html4j/src/org/netbeans/api/html4j/HTMLComponent.java Tue Sep 09 21:44:37 2014 +0200
7.3 @@ -0,0 +1,96 @@
7.4 +/*
7.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
7.6 + *
7.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
7.8 + *
7.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7.10 + * Other names may be trademarks of their respective owners.
7.11 + *
7.12 + * The contents of this file are subject to the terms of either the GNU
7.13 + * General Public License Version 2 only ("GPL") or the Common
7.14 + * Development and Distribution License("CDDL") (collectively, the
7.15 + * "License"). You may not use this file except in compliance with the
7.16 + * License. You can obtain a copy of the License at
7.17 + * http://www.netbeans.org/cddl-gplv2.html
7.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
7.19 + * specific language governing permissions and limitations under the
7.20 + * License. When distributing the software, include this License Header
7.21 + * Notice in each file and include the License file at
7.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
7.23 + * particular file as subject to the "Classpath" exception as provided
7.24 + * by Oracle in the GPL Version 2 section of the License file that
7.25 + * accompanied this code. If applicable, add the following below the
7.26 + * License Header, with the fields enclosed by brackets [] replaced by
7.27 + * your own identifying information:
7.28 + * "Portions Copyrighted [year] [name of copyright owner]"
7.29 + *
7.30 + * If you wish your version of this file to be governed by only the CDDL
7.31 + * or only the GPL Version 2, indicate your decision by adding
7.32 + * "[Contributor] elects to include this software in this distribution
7.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
7.34 + * single choice of license, a recipient has the option to distribute
7.35 + * your version of this file under either the CDDL, the GPL Version 2 or
7.36 + * to extend the choice of license to its licensees as provided above.
7.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
7.38 + * Version 2 license, then the option applies only if the new code is
7.39 + * made subject to such option by the copyright holder.
7.40 + *
7.41 + * Contributor(s):
7.42 + *
7.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
7.44 + */
7.45 +
7.46 +package org.netbeans.api.html4j;
7.47 +
7.48 +import java.lang.annotation.ElementType;
7.49 +import java.lang.annotation.Retention;
7.50 +import java.lang.annotation.RetentionPolicy;
7.51 +import java.lang.annotation.Target;
7.52 +import java.util.Locale;
7.53 +import javax.swing.JComponent;
7.54 +import javafx.scene.Node;
7.55 +
7.56 +/** Generates factory method in class specified by {@link #className()}
7.57 + * that will return a component of requested {@link #type()} which can
7.58 + * later be embedded into Swing or JavaFX UI elements. When the factory
7.59 + * method is called, it returns immediatelly and starts loading of
7.60 + * the {@link #url() specified HTML page}. Once the page is ready
7.61 + * it calls back method annotated by this annotation to finish
7.62 + * initialization. The method is supposed to make the page live, preferrably
7.63 + * by using {@link net.java.html.json.Model} generated class and calling
7.64 + * <code>applyBindings()</code> on it.
7.65 + *
7.66 + * @author Jaroslav Tulach
7.67 + */
7.68 +@Retention(RetentionPolicy.SOURCE)
7.69 +@Target(ElementType.METHOD)
7.70 +public @interface HTMLComponent {
7.71 + /** URL of the page to display. Usually relative to the annotated class.
7.72 + * Will be resolved by the annotation processor and converted into
7.73 + * <code>nbresloc</code> protocol - as such the HTML page can be L10Ned
7.74 + * later by adding classical L10N suffixes. E.g. <code>index_cs.html</code>
7.75 + * will take preceedence over <code>index.html</code> if the user is
7.76 + * running in Czech {@link Locale}.
7.77 + *
7.78 + * @return relative path the HTML page
7.79 + */
7.80 + String url();
7.81 +
7.82 + /** The type of component to generate. Currently supports
7.83 + * two types: <em>Swing</em> and <em>JavaFX</em>.
7.84 + * To request Swing component
7.85 + * return {@link JComponent}.<b>class</b>. To request JavaFX
7.86 + * component, return {@link Node}.<b>class</b>.
7.87 + *
7.88 + * @return either {@link JComponent} or {@link Node} class
7.89 + */
7.90 + Class<?> type();
7.91 +
7.92 + /**
7.93 + * Name of the file to generate the method that opens the dialog into. Class
7.94 + * of such name will be generated into the same package.
7.95 + *
7.96 + * @return name of class to generate
7.97 + */
7.98 + String className() default "Pages";
7.99 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/api.html4j/src/org/netbeans/api/html4j/HTMLDialog.java Tue Sep 09 21:44:37 2014 +0200
8.3 @@ -0,0 +1,205 @@
8.4 +/*
8.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8.6 + *
8.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
8.8 + *
8.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
8.10 + * Other names may be trademarks of their respective owners.
8.11 + *
8.12 + * The contents of this file are subject to the terms of either the GNU
8.13 + * General Public License Version 2 only ("GPL") or the Common
8.14 + * Development and Distribution License("CDDL") (collectively, the
8.15 + * "License"). You may not use this file except in compliance with the
8.16 + * License. You can obtain a copy of the License at
8.17 + * http://www.netbeans.org/cddl-gplv2.html
8.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
8.19 + * specific language governing permissions and limitations under the
8.20 + * License. When distributing the software, include this License Header/*
8.21 +
8.22 + * Notice in each file and include the License file at
8.23 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
8.24 + * particular file as subject to the "Classpath" exception as provided
8.25 + * by Oracle in the GPL Version 2 section of the License file that
8.26 + * accompanied this code. If applicable, add the following below the
8.27 + * License Header, with the fields enclosed by brackets [] replaced by
8.28 + * your own identifying information:
8.29 + * "Portions Copyrighted [year] [name of copyright owner]"
8.30 + *
8.31 + * If you wish your version of this file to be governed by only the CDDL
8.32 + * or only the GPL Version 2, indicate your decision by adding
8.33 + * "[Contributor] elects to include this software in this distribution
8.34 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
8.35 + * single choice of license, a recipient has the option to distribute
8.36 + * your version of this file under either the CDDL, the GPL Version 2 or
8.37 + * to extend the choice of license to its licensees as provided above.
8.38 + * However, if you add GPL Version 2 code and therefore, elected the GPL
8.39 + * Version 2 license, then the option applies only if the new code is
8.40 + * made subject to such option by the copyright holder.
8.41 + *
8.42 + * Contributor(s):
8.43 + *
8.44 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
8.45 + */
8.46 +package org.netbeans.api.html4j;
8.47 +
8.48 +import java.lang.annotation.ElementType;
8.49 +import java.lang.annotation.Retention;
8.50 +import java.lang.annotation.RetentionPolicy;
8.51 +import java.lang.annotation.Target;
8.52 +import java.util.Locale;
8.53 +import javafx.embed.swing.JFXPanel;
8.54 +import javafx.scene.web.WebView;
8.55 +import java.awt.event.ActionEvent;
8.56 +import net.java.html.json.Model;
8.57 +import net.java.html.json.Property;
8.58 +import org.netbeans.modules.html4j.HTMLDialogImpl;
8.59 +
8.60 +/** Generates method that opens an HTML based modal dialog. Sample of a typical
8.61 + * usage follows.
8.62 + * <h4>HTML Page <small>dialog.html</small></h4>
8.63 + * <pre>
8.64 +<html>
8.65 + <head>
8.66 + <title>Base question</title>
8.67 + <meta charset="UTF-8">
8.68 + </head>
8.69 + <body>
8.70 + <div>Hello World! How are you?</div>
8.71 + <-- you need to check the checkbox to enabled the OK button -->
8.72 + <input type="checkbox" data-bind="checked: <em style="color: red">ok</em>">OK?<br>
8.73 + <-- enabled with checkbox is checked -->
8.74 + <button id='ok' hidden data-bind="enable: <em style="color: red">ok</em>">Good</button>
8.75 + <button id='bad' hidden>Bad</button>
8.76 + </body>
8.77 +</html>
8.78 + * </pre>
8.79 + * <h4>Java Source <small>AskQuestion.java</small></h4>
8.80 + * <pre>
8.81 +{@link Model @Model}(className = "AskCtrl", properties = {
8.82 + {@link Property @Property}(name = <em <em style="color: red">"ok"</em>, type = <b>boolean</b>.<b>class</b>)
8.83 +})
8.84 +<b>public final class</b> AskQuestion <b>implements</b> ActionListener {
8.85 + {@link HTMLDialog @HTMLDialog}(url = "dialog.html") <b>static void</b> showHelloWorld(boolean checked) {
8.86 + <b>new</b> AskCtrl(checked).applyBindings();
8.87 + }
8.88 +
8.89 + {@link Override @Override} <b>public void</b> actionPerformed({@link ActionEvent} e) {
8.90 + // shows dialog with a question, checkbox is checked by default
8.91 + // {@link #className() Pages} is automatically generated class
8.92 + String ret = Pages.showHelloWorld(true);
8.93 +
8.94 + System.out.println("User selected: " + ret);
8.95 + }
8.96 +}
8.97 + * </pre>
8.98 + * <p>
8.99 + * The method is generated into <code>Pages</code> class in the same package
8.100 + * (unless one changes the name via {@link #className()}) and has the same name,
8.101 + * and parameters as the method annotated by this annotation. When the method
8.102 + * is invoked, it opens a dialog, loads an HTML page into it. When the page is
8.103 + * loaded, it calls back the method annotated by this annotation and passes it
8.104 + * its own arguments. The method is supposed to make the page live, preferrably
8.105 + * by using {@link net.java.html.json.Model} generated class and calling
8.106 + * <code>applyBindings()</code> on it.
8.107 + * <p>
8.108 + * The HTML page may contain hidden <code><button></code> elements. If it does so,
8.109 + * those buttons are copied to the dialog frame and displayed underneath the page.
8.110 + * Their enabled/disabled state reflects the state of the buttons in the page.
8.111 + * When one of the buttons is selected, the dialog closes and the generated
8.112 + * method returns with 'id' of the selected button (or <code>null</code> if
8.113 + * the dialog was closed).
8.114 + * <p>
8.115 + * By default, if the HTML defines no hidden
8.116 + * <code><button></code> elements, two buttons are added. One representing
8.117 + * the <quote>OK</quote> choice (with <code>id="OK"</code>) and one representing
8.118 + * the cancel choice (with <code>null</code> id). Both buttons are always
8.119 + * enabled. One can check the
8.120 + * return value from the dialog showing method
8.121 + * to be <code>"OK"</code> to know whether the
8.122 + * user approved the dialog.
8.123 + *
8.124 + * @author Jaroslav Tulach
8.125 + */
8.126 +@Retention(RetentionPolicy.SOURCE)
8.127 +@Target(ElementType.METHOD)
8.128 +public @interface HTMLDialog {
8.129 + /** URL of the page to display. Usually relative to the annotated class.
8.130 + * Will be resolved by the annotation processor and converted into
8.131 + * <code>nbresloc</code> protocol - as such the HTML page can be L10Ned
8.132 + * later by adding classical L10N suffixes. E.g. <code>index_cs.html</code>
8.133 + * will take preceedence over <code>index.html</code> if the user is
8.134 + * running in Czech {@link Locale}.
8.135 + *
8.136 + * @return relative path the HTML page
8.137 + */
8.138 + String url();
8.139 +
8.140 + /** Name of the file to generate the method that opens the dialog
8.141 + * into. Class of such name will be generated into the same
8.142 + * package.
8.143 + *
8.144 + * @return name of class to generate
8.145 + */
8.146 + String className() default "Pages";
8.147 +
8.148 + /** Rather than using this class directly, consider
8.149 + * {@link HTMLDialog}. The {@link HTMLDialog} annotation
8.150 + * generates boilderplate code for you
8.151 + * and can do some compile times checks helping you to warnings
8.152 + * as soon as possible.
8.153 + */
8.154 + public static final class Builder {
8.155 + private final HTMLDialogImpl impl;
8.156 +
8.157 + private Builder(String u) {
8.158 + impl = new HTMLDialogImpl();
8.159 + impl.setUrl(u);
8.160 + }
8.161 +
8.162 + /** Starts creation of a new HTML dialog. The page
8.163 + * can contain hidden buttons as described at
8.164 + * {@link HTMLDialog}.
8.165 + *
8.166 + * @param url URL (usually using <code>nbresloc</code> protocol)
8.167 + * of the page to display in the dialog.
8.168 + * @return instance of the builder
8.169 + */
8.170 + public static Builder newDialog(String url) {
8.171 + return new Builder(url);
8.172 + }
8.173 +
8.174 + /** Registers a runnable to be executed when the page
8.175 + * becomes ready.
8.176 + *
8.177 + * @param run runnable to run
8.178 + * @return this builder
8.179 + */
8.180 + public Builder loadFinished(Runnable run) {
8.181 + impl.setOnPageLoad(run);
8.182 + return this;
8.183 + }
8.184 +
8.185 + /** Displays the dialog. This method blocks waiting for the
8.186 + * dialog to be shown and closed by the user.
8.187 + *
8.188 + * @return 'id' of a selected button element or <code>null</code>
8.189 + * if the dialog was closed without selecting a button
8.190 + */
8.191 + public String showAndWait() {
8.192 + return impl.showAndWait();
8.193 + }
8.194 +
8.195 + /** Obtains the component from the builder. The parameter
8.196 + * can either be {@link JFXPanel}.<b>class</b> or
8.197 + * {@link WebView}.<b>class</b>. After calling this
8.198 + * method the builder becomes useless.
8.199 + *
8.200 + * @param <C> requested component type
8.201 + * @param type either {@link JFXPanel} or {@link WebView} class
8.202 + * @return instance of the requested component
8.203 + */
8.204 + public <C> C component(Class<C> type) {
8.205 + return impl.component(type);
8.206 + }
8.207 + }
8.208 +}
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/api.html4j/src/org/netbeans/api/html4j/OpenHTMLRegistration.java Tue Sep 09 21:44:37 2014 +0200
9.3 @@ -0,0 +1,120 @@
9.4 +/**
9.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
9.6 + *
9.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
9.8 + *
9.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
9.10 + * Other names may be trademarks of their respective owners.
9.11 + *
9.12 + * The contents of this file are subject to the terms of either the GNU
9.13 + * General Public License Version 2 only ("GPL") or the Common
9.14 + * Development and Distribution License("CDDL") (collectively, the
9.15 + * "License"). You may not use this file except in compliance with the
9.16 + * License. You can obtain a copy of the License at
9.17 + * http://www.netbeans.org/cddl-gplv2.html
9.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
9.19 + * specific language governing permissions and limitations under the
9.20 + * License. When distributing the software, include this License Header
9.21 + * Notice in each file and include the License file at
9.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
9.23 + * particular file as subject to the "Classpath" exception as provided
9.24 + * by Oracle in the GPL Version 2 section of the License file that
9.25 + * accompanied this code. If applicable, add the following below the
9.26 + * License Header, with the fields enclosed by brackets [] replaced by
9.27 + * your own identifying information:
9.28 + * "Portions Copyrighted [year] [name of copyright owner]"
9.29 + *
9.30 + * Contributor(s):
9.31 + *
9.32 + * The Original Software is NetBeans. The Initial Developer of the Original
9.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
9.34 + *
9.35 + * If you wish your version of this file to be governed by only the CDDL
9.36 + * or only the GPL Version 2, indicate your decision by adding
9.37 + * "[Contributor] elects to include this software in this distribution
9.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
9.39 + * single choice of license, a recipient has the option to distribute
9.40 + * your version of this file under either the CDDL, the GPL Version 2 or
9.41 + * to extend the choice of license to its licensees as provided above.
9.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
9.43 + * Version 2 license, then the option applies only if the new code is
9.44 + * made subject to such option by the copyright holder.
9.45 + */
9.46 +
9.47 +package org.netbeans.api.html4j;
9.48 +
9.49 +import java.io.Closeable;
9.50 +import java.lang.annotation.ElementType;
9.51 +import java.lang.annotation.Retention;
9.52 +import java.lang.annotation.RetentionPolicy;
9.53 +import java.lang.annotation.Target;
9.54 +
9.55 +/** Registers an action to open an HTML (possibly with
9.56 + * {@link net.java.html.json.Model HTML for Java} integration). The essential
9.57 + * aspect is to create an HTML page and reference its location via {@link #url() } attribute.
9.58 + * The page may contain any JavaScript, but as we are Java developers, it is
9.59 + * preferrable to rather use <a href="http://bits.netbeans.org">HTML for Java API</a>.
9.60 + * In such case the associated static method (which is annotated by this annotation) will be
9.61 + * called once the HTML page is loaded. One is expected to instantiate class generated
9.62 + * by the {@link net.java.html.json.Model} annotation and call <code>applyBindings()</code>
9.63 + * on it. Here is an example: <pre>
9.64 + *{@link net.java.html.json.Model @Model}(className="UI", properties={
9.65 + * {@link net.java.html.json.Property @Property}(name = "text", type = {@link String}.<b>class</b>)
9.66 + *})
9.67 + *<b>public final class</b> UICntrl {
9.68 + * {@link org.openide.awt.ActionID @ActionID}(
9.69 + * category = "Tools",
9.70 + * id = "my.sample.HtmlHelloWorld"
9.71 + * )
9.72 + * {@link org.openide.awt.ActionReferences @ActionReferences}({
9.73 + * {@link org.openide.awt.ActionReference @ActionReference}(path = "Menu/Tools"),
9.74 + * {@link org.openide.awt.ActionReference @ActionReference}(path = "Toolbars/File"),
9.75 + * })
9.76 + * {@link org.openide.util.NbBundle.Messages @NbBundle.Messages}("CTL_OpenHtmlHelloWorld=Open HTML Hello World!")
9.77 + * {@link OpenHTMLRegistration @OpenHTMLRegistration}(
9.78 + * url = "ui.html",
9.79 + * displayName = "#CTL_OpenHtmlHelloWorld"
9.80 + * )
9.81 + * <b>public static</b> UI onPageLoad() {
9.82 + * <b>return new</b> UI("Hello World!").applyBindings();
9.83 + * }
9.84 + *}
9.85 + * </pre>
9.86 + * The above would display a new action in Toolbar and in Menu that would, upon invocation,
9.87 + * open up a new component displaying the
9.88 + * <code>ui.html</code> page. The page can use
9.89 + * <a target="_blank" href="http://knockoutjs.com">Knockout.js</a> bindings like
9.90 + * <code><input data-bind="value: text"></input></code> to reference
9.91 + * properties defined by the {@link net.java.html.json.Model} annotation in the generated class
9.92 + * <code>UI</code>.
9.93 + * <p>
9.94 + * In addition to the above, there is a special support for influencing {@link org.openide.util.Utilities#actionsGlobalContext()
9.95 + * action context} and thus turning on and off various actions shown in menu and toolbar. Just
9.96 + * define <code>{@link net.java.html.json.Property @Property}(name = "context", type = String.class, array = true)</code>
9.97 + * and put into it fully qualified names of classes you want to expose in the context.
9.98 + * Those classes should be public and have public constructor that takes instance of the model
9.99 + * class returned from the annotated method (e.g. <code>UI</code> in the above example). The
9.100 + * system will instantiate them appropriatelly and will make sure they are available in the action
9.101 + * context. If the interface also implements {@link Closeable}, its close method is invoked once
9.102 + * the instance is removed from the context to handle clean up.
9.103 + *
9.104 + * @author Jaroslav Tulach
9.105 + * @since 0.7.6
9.106 + */
9.107 +@Retention(RetentionPolicy.SOURCE)
9.108 +@Target(ElementType.METHOD)
9.109 +public @interface OpenHTMLRegistration {
9.110 + /** URL to the HTML page to display in the view.
9.111 + * @return relative or absolute URL to page to display
9.112 + */
9.113 + String url();
9.114 + /* Display name for the action that shows the view.
9.115 + */
9.116 + String displayName();
9.117 +
9.118 + /** Icon base for the action (and also the view) that shows
9.119 + * the HTML page.
9.120 + * @return the path to the base 16x16 icon
9.121 + */
9.122 + String iconBase() default "";
9.123 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/api.html4j/src/org/netbeans/api/html4j/package.html Tue Sep 09 21:44:37 2014 +0200
10.3 @@ -0,0 +1,96 @@
10.4 +<!--
10.5 +
10.6 + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
10.7 +
10.8 + Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
10.9 +
10.10 + Oracle and Java are registered trademarks of Oracle and/or its affiliates.
10.11 + Other names may be trademarks of their respective owners.
10.12 +
10.13 + The contents of this file are subject to the terms of either the GNU
10.14 + General Public License Version 2 only ("GPL") or the Common
10.15 + Development and Distribution License("CDDL") (collectively, the
10.16 + "License"). You may not use this file except in compliance with the
10.17 + License. You can obtain a copy of the License at
10.18 + http://www.netbeans.org/cddl-gplv2.html
10.19 + or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
10.20 + specific language governing permissions and limitations under the
10.21 + License. When distributing the software, include this License Header
10.22 + Notice in each file and include the License file at
10.23 + nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
10.24 + particular file as subject to the "Classpath" exception as provided
10.25 + by Oracle in the GPL Version 2 section of the License file that
10.26 + accompanied this code. If applicable, add the following below the
10.27 + License Header, with the fields enclosed by brackets [] replaced by
10.28 + your own identifying information:
10.29 + "Portions Copyrighted [year] [name of copyright owner]"
10.30 +
10.31 + Contributor(s):
10.32 +
10.33 + The Original Software is NetBeans. The Initial Developer of the Original
10.34 + Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
10.35 +
10.36 + If you wish your version of this file to be governed by only the CDDL
10.37 + or only the GPL Version 2, indicate your decision by adding
10.38 + "[Contributor] elects to include this software in this distribution
10.39 + under the [CDDL or GPL Version 2] license." If you do not indicate a
10.40 + single choice of license, a recipient has the option to distribute
10.41 + your version of this file under either the CDDL, the GPL Version 2 or
10.42 + to extend the choice of license to its licensees as provided above.
10.43 + However, if you add GPL Version 2 code and therefore, elected the GPL
10.44 + Version 2 license, then the option applies only if the new code is
10.45 + made subject to such option by the copyright holder.
10.46 +
10.47 +-->
10.48 +<!DOCTYPE html>
10.49 +<!--
10.50 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
10.51 +
10.52 +Copyright 2014 Oracle and/or its affiliates. All rights reserved.
10.53 +
10.54 +Oracle and Java are registered trademarks of Oracle and/or its affiliates.
10.55 +Other names may be trademarks of their respective owners.
10.56 +
10.57 +The contents of this file are subject to the terms of either the GNU
10.58 +General Public License Version 2 only ("GPL") or the Common
10.59 +Development and Distribution License("CDDL") (collectively, the
10.60 +"License"). You may not use this file except in compliance with the
10.61 +License. You can obtain a copy of the License at
10.62 +http://www.netbeans.org/cddl-gplv2.html
10.63 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
10.64 +specific language governing permissions and limitations under the
10.65 +License. When distributing the software, include this License Header
10.66 +Notice in each file and include the License file at
10.67 +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
10.68 +particular file as subject to the "Classpath" exception as provided
10.69 +by Oracle in the GPL Version 2 section of the License file that
10.70 +accompanied this code. If applicable, add the following below the
10.71 +License Header, with the fields enclosed by brackets [] replaced by
10.72 +your own identifying information:
10.73 +"Portions Copyrighted [year] [name of copyright owner]"
10.74 +
10.75 +If you wish your version of this file to be governed by only the CDDL
10.76 +or only the GPL Version 2, indicate your decision by adding
10.77 +"[Contributor] elects to include this software in this distribution
10.78 +under the [CDDL or GPL Version 2] license." If you do not indicate a
10.79 +single choice of license, a recipient has the option to distribute
10.80 +your version of this file under either the CDDL, the GPL Version 2 or
10.81 +to extend the choice of license to its licensees as provided above.
10.82 +However, if you add GPL Version 2 code and therefore, elected the GPL
10.83 +Version 2 license, then the option applies only if the new code is
10.84 +made subject to such option by the copyright holder.
10.85 +
10.86 +Contributor(s):
10.87 +
10.88 +Portions Copyrighted 2014 Sun Microsystems, Inc.
10.89 +-->
10.90 +<html>
10.91 + <head>
10.92 + <meta charset="UTF-8"/>
10.93 + <title>HTML for Java & NetBeans</title>
10.94 + </head>
10.95 + <body>
10.96 + <div>NetBeans specific {@link org.netbeans.api.html4j.OpenHTMLRegistration binding}
10.97 + for the <a target="_blank" href="http://bits.netbeans.org/html4j/">HTML for Java</a> APIs.</div>
10.98 + </body>
10.99 +</html>
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/Bundle.properties Tue Sep 09 21:44:37 2014 +0200
11.3 @@ -0,0 +1,1 @@
11.4 +OpenIDE-Module-Name=HTML UI API
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/Buttons.java Tue Sep 09 21:44:37 2014 +0200
12.3 @@ -0,0 +1,125 @@
12.4 +/*
12.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
12.6 + *
12.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
12.8 + *
12.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
12.10 + * Other names may be trademarks of their respective owners.
12.11 + *
12.12 + * The contents of this file are subject to the terms of either the GNU
12.13 + * General Public License Version 2 only ("GPL") or the Common
12.14 + * Development and Distribution License("CDDL") (collectively, the
12.15 + * "License"). You may not use this file except in compliance with the
12.16 + * License. You can obtain a copy of the License at
12.17 + * http://www.netbeans.org/cddl-gplv2.html
12.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
12.19 + * specific language governing permissions and limitations under the
12.20 + * License. When distributing the software, include this License Header
12.21 + * Notice in each file and include the License file at
12.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
12.23 + * particular file as subject to the "Classpath" exception as provided
12.24 + * by Oracle in the GPL Version 2 section of the License file that
12.25 + * accompanied this code. If applicable, add the following below the
12.26 + * License Header, with the fields enclosed by brackets [] replaced by
12.27 + * your own identifying information:
12.28 + * "Portions Copyrighted [year] [name of copyright owner]"
12.29 + *
12.30 + * If you wish your version of this file to be governed by only the CDDL
12.31 + * or only the GPL Version 2, indicate your decision by adding
12.32 + * "[Contributor] elects to include this software in this distribution
12.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
12.34 + * single choice of license, a recipient has the option to distribute
12.35 + * your version of this file under either the CDDL, the GPL Version 2 or
12.36 + * to extend the choice of license to its licensees as provided above.
12.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
12.38 + * Version 2 license, then the option applies only if the new code is
12.39 + * made subject to such option by the copyright holder.
12.40 + *
12.41 + * Contributor(s):
12.42 + *
12.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
12.44 + */
12.45 +package org.netbeans.modules.html4j;
12.46 +
12.47 +import java.awt.EventQueue;
12.48 +import java.util.ArrayList;
12.49 +import java.util.List;
12.50 +import javax.swing.JButton;
12.51 +import net.java.html.js.JavaScriptBody;
12.52 +import org.openide.util.NbBundle;
12.53 +
12.54 +/**
12.55 + *
12.56 + * @author Jaroslav Tulach <jtulach@netbeans.org>
12.57 + */
12.58 +final class Buttons {
12.59 + private final List<JButton> arr = new ArrayList<>();
12.60 +
12.61 + @JavaScriptBody(args = {}, javacall = true, body =
12.62 + "var self = this;\n" +
12.63 + "var list = window.document.getElementsByTagName('button');\n" +
12.64 + "var arr = [];\n" +
12.65 + "function add(target) {\n" +
12.66 + " var l = function(changes) {\n" +
12.67 + " var b = target;\n" +
12.68 + " self.@org.netbeans.modules.html4j.Buttons::changeState(Ljava/lang/String;ZLjava/lang/String;)(b.id, b.disabled, b.innerHTML);\n" +
12.69 + " }\n" +
12.70 + " target.addEventListener('DOMSubtreeModified', l, false);\n" +
12.71 + "}\n" +
12.72 + "var l = function(changes) { throw 'Here';\n" +
12.73 + " for (var i = 0; i < changes.length; i++) {\n" +
12.74 + " var b = changes[i].target;\n" +
12.75 + " };\n" +
12.76 + "};\n" +
12.77 + "for (var i = 0; i < list.length; i++) {\n" +
12.78 + " var b = list[i];\n" +
12.79 + " if (b.hidden === true) {\n" +
12.80 + " arr.push(b.id);\n" +
12.81 + " arr.push(b.innerHTML);\n" +
12.82 + " arr.push(b.disabled);\n" +
12.83 + " add(b);\n" +
12.84 + " }\n" +
12.85 + "}\n" +
12.86 + "return arr;\n"
12.87 + )
12.88 + private native Object[] list();
12.89 +
12.90 + final void changeState(final String id, final boolean disabled, final String text) {
12.91 + EventQueue.invokeLater(new Runnable() {
12.92 + @Override
12.93 + public void run() {
12.94 + for (JButton b : arr) {
12.95 + if (b.getName().equals(id)) {
12.96 + b.setEnabled(!disabled);
12.97 + b.setText(text);
12.98 + }
12.99 + }
12.100 + }
12.101 + });
12.102 + }
12.103 +
12.104 + @NbBundle.Messages({
12.105 + "CTL_OK=OK",
12.106 + "CTL_Cancel=Cancel",
12.107 + })
12.108 + public static JButton[] buttons() {
12.109 + final Buttons btns = new Buttons();
12.110 + final Object[] all = btns.list();
12.111 + for (int i = 0; i < all.length; i += 3) {
12.112 + JButton b = new JButton();
12.113 + b.setName(all[i].toString());
12.114 + b.setText(all[i + 1].toString());
12.115 + if (Boolean.TRUE.equals(all[i + 2])) {
12.116 + b.setEnabled(false);
12.117 + }
12.118 + btns.arr.add(b);
12.119 + }
12.120 + if (btns.arr.isEmpty()) {
12.121 + JButton ok = new JButton(Bundle.CTL_OK());
12.122 + ok.setName("OK");
12.123 + btns.arr.add(ok);
12.124 + btns.arr.add(new JButton(Bundle.CTL_Cancel()));
12.125 + }
12.126 + return btns.arr.toArray(new JButton[0]);
12.127 + }
12.128 +}
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/HTMLDialogImpl.java Tue Sep 09 21:44:37 2014 +0200
13.3 @@ -0,0 +1,219 @@
13.4 +/*
13.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
13.6 + *
13.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
13.8 + *
13.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
13.10 + * Other names may be trademarks of their respective owners.
13.11 + *
13.12 + * The contents of this file are subject to the terms of either the GNU
13.13 + * General Public License Version 2 only ("GPL") or the Common
13.14 + * Development and Distribution License("CDDL") (collectively, the
13.15 + * "License"). You may not use this file except in compliance with the
13.16 + * License. You can obtain a copy of the License at
13.17 + * http://www.netbeans.org/cddl-gplv2.html
13.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13.19 + * specific language governing permissions and limitations under the
13.20 + * License. When distributing the software, include this License Header
13.21 + * Notice in each file and include the License file at
13.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
13.23 + * particular file as subject to the "Classpath" exception as provided
13.24 + * by Oracle in the GPL Version 2 section of the License file that
13.25 + * accompanied this code. If applicable, add the following below the
13.26 + * License Header, with the fields enclosed by brackets [] replaced by
13.27 + * your own identifying information:
13.28 + * "Portions Copyrighted [year] [name of copyright owner]"
13.29 + *
13.30 + * If you wish your version of this file to be governed by only the CDDL
13.31 + * or only the GPL Version 2, indicate your decision by adding
13.32 + * "[Contributor] elects to include this software in this distribution
13.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
13.34 + * single choice of license, a recipient has the option to distribute
13.35 + * your version of this file under either the CDDL, the GPL Version 2 or
13.36 + * to extend the choice of license to its licensees as provided above.
13.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
13.38 + * Version 2 license, then the option applies only if the new code is
13.39 + * made subject to such option by the copyright holder.
13.40 + *
13.41 + * Contributor(s):
13.42 + *
13.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
13.44 + */
13.45 +package org.netbeans.modules.html4j;
13.46 +
13.47 +import java.awt.Dialog;
13.48 +import java.awt.Dimension;
13.49 +import java.awt.EventQueue;
13.50 +import java.lang.reflect.InvocationTargetException;
13.51 +import java.net.MalformedURLException;
13.52 +import java.net.URL;
13.53 +import javafx.application.Platform;
13.54 +import javafx.beans.value.ChangeListener;
13.55 +import javafx.beans.value.ObservableValue;
13.56 +import javafx.embed.swing.JFXPanel;
13.57 +import javafx.scene.Node;
13.58 +import javafx.scene.Scene;
13.59 +import javafx.scene.layout.BorderPane;
13.60 +import javafx.scene.paint.Color;
13.61 +import javafx.scene.web.WebView;
13.62 +import javax.swing.JButton;
13.63 +import javax.swing.JComponent;
13.64 +import net.java.html.boot.fx.FXBrowsers;
13.65 +import org.openide.*;
13.66 +import org.openide.util.Exceptions;
13.67 +import org.openide.util.Lookup;
13.68 +
13.69 +public final class HTMLDialogImpl implements Runnable {
13.70 + private volatile int state;
13.71 + private NbFxPanel p;
13.72 + private DialogDescriptor dd;
13.73 + private WebView webView;
13.74 +
13.75 + private String url;
13.76 + private Runnable onPageLoad;
13.77 +
13.78 + public void setUrl(String url) {
13.79 + this.url = url;
13.80 + }
13.81 +
13.82 + public void setOnPageLoad(Runnable onPageLoad) {
13.83 + this.onPageLoad = onPageLoad;
13.84 + }
13.85 +
13.86 + @Override
13.87 + public void run() {
13.88 + switch (state) {
13.89 + case 0:
13.90 + initPanel();
13.91 + break;
13.92 + case 1:
13.93 + initFX();
13.94 + break;
13.95 + case 2:
13.96 + initPage();
13.97 + state = -1;
13.98 + break;
13.99 + default:
13.100 + throw new IllegalStateException("State: " + state);
13.101 + }
13.102 + }
13.103 +
13.104 + public String showAndWait() {
13.105 + if (EventQueue.isDispatchThread()) {
13.106 + run();
13.107 + } else {
13.108 + try {
13.109 + EventQueue.invokeAndWait(this);
13.110 + } catch (InterruptedException ex) {
13.111 + throw new IllegalStateException(ex);
13.112 + } catch (InvocationTargetException ex) {
13.113 + throw new IllegalStateException(ex);
13.114 + }
13.115 + }
13.116 + p.setPreferredSize(new Dimension(600, 400));
13.117 + Dialog d = DialogDisplayer.getDefault().createDialog(dd);
13.118 + d.setVisible(true);
13.119 +
13.120 + Object val = dd.getValue();
13.121 + return val instanceof JButton ? ((JButton)val).getName() : null;
13.122 + }
13.123 +
13.124 + private void initPanel() {
13.125 + p = new NbFxPanel();
13.126 + dd = new DialogDescriptor(p, "");
13.127 + dd.setOptions(new Object[0]);
13.128 + state = 1;
13.129 + Platform.runLater(this);
13.130 + }
13.131 +
13.132 + private void initFX() {
13.133 + Platform.setImplicitExit(false);
13.134 + webView = new WebView();
13.135 + BorderPane bp = new BorderPane();
13.136 + Scene scene = new Scene(bp, Color.ALICEBLUE);
13.137 +
13.138 + class X implements ChangeListener<String>, Runnable {
13.139 +
13.140 + private String title;
13.141 +
13.142 + public X() {
13.143 + super();
13.144 + }
13.145 +
13.146 + @Override
13.147 + public void changed(ObservableValue<? extends String> ov, String t, String t1) {
13.148 + title = webView.getEngine().getTitle();
13.149 + EventQueue.invokeLater(this);
13.150 + }
13.151 +
13.152 + @Override
13.153 + public void run() {
13.154 + if (title != null) {
13.155 + dd.setTitle(title);
13.156 + }
13.157 + }
13.158 + }
13.159 + final X x = new X();
13.160 + webView.getEngine().titleProperty().addListener(x);
13.161 + Platform.runLater(x);
13.162 + bp.setCenter(webView);
13.163 + p.setScene(scene);
13.164 +
13.165 + ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);
13.166 + if (loader == null) {
13.167 + loader = HTMLDialogImpl.class.getClassLoader();
13.168 + }
13.169 + URL pageUrl;
13.170 + try {
13.171 + pageUrl = new URL(url);
13.172 + } catch (MalformedURLException ex) {
13.173 + throw new IllegalStateException(ex);
13.174 + }
13.175 + state = 2;
13.176 + FXBrowsers.load(webView, pageUrl, this, loader);
13.177 + }
13.178 +
13.179 + private void initPage() {
13.180 + try {
13.181 + onPageLoad.run();
13.182 + } catch (Throwable t) {
13.183 + Exceptions.printStackTrace(t);
13.184 + }
13.185 + final JButton[] buttons = Buttons.buttons();
13.186 + dd.setOptions(buttons);
13.187 + }
13.188 +
13.189 + public <C> C component(Class<C> type) {
13.190 + state = -1;
13.191 + ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);
13.192 + if (loader == null) {
13.193 + loader = HTMLDialogImpl.class.getClassLoader();
13.194 + }
13.195 + final URL pageUrl;
13.196 + try {
13.197 + pageUrl = new URL(url);
13.198 + } catch (MalformedURLException ex) {
13.199 + throw new IllegalStateException(ex);
13.200 + }
13.201 + if (type == Node.class) {
13.202 + WebView wv = new WebView();
13.203 + FXBrowsers.load(wv, pageUrl, onPageLoad, loader);
13.204 + return type.cast(wv);
13.205 + } else if (type == JComponent.class) {
13.206 + final JFXPanel p = new JFXPanel();
13.207 + final ClassLoader l = loader;
13.208 + Platform.runLater(new Runnable() {
13.209 + @Override
13.210 + public void run() {
13.211 + WebView wv = new WebView();
13.212 + FXBrowsers.load(wv, pageUrl, onPageLoad, l);
13.213 + Scene s = new Scene(wv);
13.214 + p.setScene(s);
13.215 + }
13.216 + });
13.217 + return type.cast(p);
13.218 + } else {
13.219 + throw new IllegalStateException("Unsupported type: " + type);
13.220 + }
13.221 + }
13.222 +}
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/HTMLDialogProcessor.java Tue Sep 09 21:44:37 2014 +0200
14.3 @@ -0,0 +1,377 @@
14.4 +/**
14.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
14.6 + *
14.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
14.8 + *
14.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
14.10 + * Other names may be trademarks of their respective owners.
14.11 + *
14.12 + * The contents of this file are subject to the terms of either the GNU
14.13 + * General Public License Version 2 only ("GPL") or the Common
14.14 + * Development and Distribution License("CDDL") (collectively, the
14.15 + * "License"). You may not use this file except in compliance with the
14.16 + * License. You can obtain a copy of the License at
14.17 + * http://www.netbeans.org/cddl-gplv2.html
14.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
14.19 + * specific language governing permissions and limitations under the
14.20 + * License. When distributing the software, include this License Header
14.21 + * Notice in each file and include the License file at
14.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
14.23 + * particular file as subject to the "Classpath" exception as provided
14.24 + * by Oracle in the GPL Version 2 section of the License file that
14.25 + * accompanied this code. If applicable, add the following below the
14.26 + * License Header, with the fields enclosed by brackets [] replaced by
14.27 + * your own identifying information:
14.28 + * "Portions Copyrighted [year] [name of copyright owner]"
14.29 + *
14.30 + * Contributor(s):
14.31 + *
14.32 + * The Original Software is NetBeans. The Initial Developer of the Original
14.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
14.34 + *
14.35 + * If you wish your version of this file to be governed by only the CDDL
14.36 + * or only the GPL Version 2, indicate your decision by adding
14.37 + * "[Contributor] elects to include this software in this distribution
14.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
14.39 + * single choice of license, a recipient has the option to distribute
14.40 + * your version of this file under either the CDDL, the GPL Version 2 or
14.41 + * to extend the choice of license to its licensees as provided above.
14.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
14.43 + * Version 2 license, then the option applies only if the new code is
14.44 + * made subject to such option by the copyright holder.
14.45 + */
14.46 +package org.netbeans.modules.html4j;
14.47 +
14.48 +import java.io.FileNotFoundException;
14.49 +import java.io.IOException;
14.50 +import java.io.Writer;
14.51 +import java.lang.annotation.Annotation;
14.52 +import java.net.MalformedURLException;
14.53 +import java.net.URL;
14.54 +import java.util.Comparator;
14.55 +import java.util.HashSet;
14.56 +import java.util.Map;
14.57 +import java.util.Set;
14.58 +import java.util.TreeMap;
14.59 +import java.util.TreeSet;
14.60 +import javax.annotation.processing.AbstractProcessor;
14.61 +import javax.annotation.processing.Processor;
14.62 +import javax.annotation.processing.RoundEnvironment;
14.63 +import javax.annotation.processing.SupportedSourceVersion;
14.64 +import javax.lang.model.SourceVersion;
14.65 +import javax.lang.model.element.Element;
14.66 +import javax.lang.model.element.ElementKind;
14.67 +import javax.lang.model.element.ExecutableElement;
14.68 +import javax.lang.model.element.Modifier;
14.69 +import javax.lang.model.element.PackageElement;
14.70 +import javax.lang.model.element.TypeElement;
14.71 +import javax.lang.model.element.VariableElement;
14.72 +import javax.lang.model.type.MirroredTypeException;
14.73 +import javax.tools.Diagnostic;
14.74 +import javax.tools.FileObject;
14.75 +import javax.tools.JavaFileManager;
14.76 +import javax.tools.JavaFileObject;
14.77 +import javax.tools.StandardLocation;
14.78 +import org.netbeans.api.html4j.HTMLComponent;
14.79 +import org.netbeans.api.html4j.HTMLDialog;
14.80 +import org.openide.filesystems.annotations.LayerBuilder;
14.81 +import org.openide.filesystems.annotations.LayerGenerationException;
14.82 +import org.openide.util.lookup.ServiceProvider;
14.83 +
14.84 +/**
14.85 + *
14.86 + * @author Jaroslav Tulach
14.87 + */
14.88 +@SupportedSourceVersion(SourceVersion.RELEASE_6)
14.89 +@ServiceProvider(service = Processor.class)
14.90 +public class HTMLDialogProcessor extends AbstractProcessor
14.91 +implements Comparator<ExecutableElement> {
14.92 + @Override
14.93 + public Set<String> getSupportedAnnotationTypes() {
14.94 + Set<String> hash = new HashSet<>();
14.95 + hash.add(HTMLDialog.class.getCanonicalName());
14.96 + hash.add(HtmlComponent.class.getCanonicalName());
14.97 + return hash;
14.98 + }
14.99 +
14.100 + @Override
14.101 + public boolean process(Set<? extends TypeElement> set, RoundEnvironment re) {
14.102 + Map<String,Set<ExecutableElement>> names = new TreeMap<>();
14.103 + for (Element e : re.getElementsAnnotatedWith(HTMLDialog.class)) {
14.104 + HTMLDialog reg = e.getAnnotation(HTMLDialog.class);
14.105 + if (reg == null || e.getKind() != ElementKind.METHOD) {
14.106 + continue;
14.107 + }
14.108 + ExecutableElement ee = (ExecutableElement) e;
14.109 + if (!e.getModifiers().contains(Modifier.STATIC)) {
14.110 + error("Method annotated by @HTMLDialog needs to be static", e);
14.111 + }
14.112 + if (e.getModifiers().contains(Modifier.PRIVATE)) {
14.113 + error("Method annotated by @HTMLDialog cannot be private", e);
14.114 + }
14.115 + if (!ee.getThrownTypes().isEmpty()) {
14.116 + error("Method annotated by @HTMLDialog cannot throw exceptions", e);
14.117 + }
14.118 +
14.119 + PackageElement pkg = findPkg(ee);
14.120 +
14.121 + String fqn = pkg.getQualifiedName() + "." + reg.className();
14.122 +
14.123 + Set<ExecutableElement> elems = names.get(fqn);
14.124 + if (elems == null) {
14.125 + elems = new TreeSet<>(this);
14.126 + names.put(fqn, elems);
14.127 + }
14.128 + elems.add(ee);
14.129 + }
14.130 + for (Element e : re.getElementsAnnotatedWith(HTMLComponent.class)) {
14.131 + HTMLComponent reg = e.getAnnotation(HTMLComponent.class);
14.132 + if (reg == null || e.getKind() != ElementKind.METHOD) {
14.133 + continue;
14.134 + }
14.135 + ExecutableElement ee = (ExecutableElement) e;
14.136 + if (!e.getModifiers().contains(Modifier.STATIC)) {
14.137 + error("Method annotated by @HTMLComponent needs to be static", e);
14.138 + }
14.139 + if (e.getModifiers().contains(Modifier.PRIVATE)) {
14.140 + error("Method annotated by @HTMLComponent cannot be private", e);
14.141 + }
14.142 + if (!ee.getThrownTypes().isEmpty()) {
14.143 + error("Method annotated by @HTMLComponent cannot throw exceptions", e);
14.144 + }
14.145 +
14.146 + PackageElement pkg = findPkg(ee);
14.147 +
14.148 + String fqn = pkg.getQualifiedName() + "." + reg.className();
14.149 +
14.150 + Set<ExecutableElement> elems = names.get(fqn);
14.151 + if (elems == null) {
14.152 + elems = new TreeSet<>(this);
14.153 + names.put(fqn, elems);
14.154 + }
14.155 + elems.add(ee);
14.156 + }
14.157 +
14.158 + for (Map.Entry<String, Set<ExecutableElement>> entry : names.entrySet()) {
14.159 + String clazzName = entry.getKey();
14.160 + Set<ExecutableElement> elems = entry.getValue();
14.161 + Element first = elems.iterator().next();
14.162 + try {
14.163 + JavaFileObject f = processingEnv.getFiler().createSourceFile(
14.164 + clazzName, elems.toArray(new Element[0])
14.165 + );
14.166 + Writer w = f.openWriter();
14.167 +
14.168 + final String[] arr = splitPkg(clazzName, first);
14.169 + w.append("package ").append(arr[0]).append(";\n");
14.170 + w.append("\n");
14.171 + w.append("import org.netbeans.api.html4j.HTMLDialog.Builder;\n");
14.172 + w.append("class ").append(arr[1]).append(" {\n");
14.173 + w.append(" private ").append(arr[1]).append("() {\n }\n");
14.174 + w.append("\n");
14.175 +
14.176 + for (ExecutableElement ee : elems) {
14.177 + HTMLDialog reg = ee.getAnnotation(HTMLDialog.class);
14.178 + HTMLComponent comp = ee.getAnnotation(HTMLComponent.class);
14.179 + if (reg != null) {
14.180 + String url = findURL(reg.url(), ee);
14.181 + if (url == null) {
14.182 + continue;
14.183 + }
14.184 + generateDialog(w, ee, url);
14.185 + }
14.186 + if (comp != null) {
14.187 + String url = findURL(comp.url(), ee);
14.188 + if (url == null) {
14.189 + continue;
14.190 + }
14.191 + String t;
14.192 + try {
14.193 + t = comp.type().getName();
14.194 + } catch (MirroredTypeException ex) {
14.195 + t = ex.getTypeMirror().toString();
14.196 + }
14.197 + if (
14.198 + !t.equals("javafx.scene.Node") &&
14.199 + !t.equals("javax.swing.JComponent")
14.200 + ) {
14.201 + error("type() can be either Node.class or JComponent.class", ee);
14.202 + }
14.203 + generateComponent(w, ee, t, url);
14.204 + }
14.205 + }
14.206 +
14.207 + w.append("}\n");
14.208 + w.close();
14.209 +
14.210 + } catch (IOException ex) {
14.211 + error("Cannot create " + clazzName, first);
14.212 + }
14.213 + }
14.214 +
14.215 + return true;
14.216 + }
14.217 +
14.218 + private String findURL(final String relativeURL, ExecutableElement ee) {
14.219 + String url;
14.220 + try {
14.221 + URL u = new URL(relativeURL);
14.222 + url = u.toExternalForm();
14.223 + } catch (MalformedURLException ex2) {
14.224 + try {
14.225 + final String res = LayerBuilder.absolutizeResource(ee, relativeURL);
14.226 + validateResource(res, ee, null, null, false);
14.227 + url = "nbresloc:/" + res;
14.228 + } catch (LayerGenerationException ex) {
14.229 + error("Cannot find resource " + relativeURL, ee);
14.230 + url = null;
14.231 + }
14.232 + }
14.233 + return url;
14.234 + }
14.235 +
14.236 + private void generateDialog(Writer w, ExecutableElement ee, String url) throws IOException {
14.237 + w.append(" public static String ").append(ee.getSimpleName());
14.238 + w.append("(");
14.239 + String sep = "";
14.240 + for (VariableElement v : ee.getParameters()) {
14.241 + w.append(sep);
14.242 + w.append("final ").append(v.asType().toString()).append(" ").append(v.getSimpleName());
14.243 + sep = ", ";
14.244 + }
14.245 +
14.246 + w.append(") {\n");
14.247 + w.append(" return Builder.newDialog(\"").append(url).append("\").\n");
14.248 + w.append(" loadFinished(new Runnable() {\n");
14.249 + w.append(" public void run() {\n");
14.250 + w.append(" ").append(ee.getEnclosingElement().getSimpleName())
14.251 + .append(".").append(ee.getSimpleName()).append("(");
14.252 + sep = "";
14.253 + for (VariableElement v : ee.getParameters()) {
14.254 + w.append(sep);
14.255 + w.append(v.getSimpleName());
14.256 + sep = ", ";
14.257 + }
14.258 + w.append(");\n");
14.259 + w.append(" }\n");
14.260 + w.append(" }).\n");
14.261 + w.append(" showAndWait();\n");
14.262 + w.append(" }\n");
14.263 + }
14.264 +
14.265 + private void generateComponent(
14.266 + Writer w, ExecutableElement ee, String type, String url
14.267 + ) throws IOException {
14.268 + w.append(" public static ").append(type).append(" ").append(ee.getSimpleName());
14.269 + w.append("(");
14.270 + String sep = "";
14.271 + for (VariableElement v : ee.getParameters()) {
14.272 + w.append(sep);
14.273 + w.append("final ").append(v.asType().toString()).append(" ").append(v.getSimpleName());
14.274 + sep = ", ";
14.275 + }
14.276 +
14.277 + w.append(") {\n");
14.278 + w.append(" return Builder.newDialog(\"").append(url).append("\").\n");
14.279 + w.append(" loadFinished(new Runnable() {\n");
14.280 + w.append(" public void run() {\n");
14.281 + w.append(" ").append(ee.getEnclosingElement().getSimpleName())
14.282 + .append(".").append(ee.getSimpleName()).append("(");
14.283 + sep = "";
14.284 + for (VariableElement v : ee.getParameters()) {
14.285 + w.append(sep);
14.286 + w.append(v.getSimpleName());
14.287 + sep = ", ";
14.288 + }
14.289 + w.append(");\n");
14.290 + w.append(" }\n");
14.291 + w.append(" }).\n");
14.292 + w.append(" component(").append(type).append(".class);\n");
14.293 + w.append(" }\n");
14.294 + }
14.295 +
14.296 + private void error(final String msg, Element e) {
14.297 + processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, msg, e);
14.298 + }
14.299 +
14.300 + private static PackageElement findPkg(Element e) {
14.301 + while (e.getKind() != ElementKind.PACKAGE) {
14.302 + e = e.getEnclosingElement();
14.303 + }
14.304 + return (PackageElement)e;
14.305 + }
14.306 +
14.307 + private String[] splitPkg(String s, Element e) {
14.308 + int last = s.lastIndexOf('.');
14.309 + if (last == -1) {
14.310 + error("Cannot generate " + s + " into default package!", e);
14.311 + return new String[] { "x", s };
14.312 + } else {
14.313 + return new String[] { s.substring(0, last), s.substring(last + 1) };
14.314 + }
14.315 + }
14.316 +
14.317 + @Override
14.318 + public int compare(ExecutableElement o1, ExecutableElement o2) {
14.319 + if (o1 == o2) {
14.320 + return 0;
14.321 + }
14.322 + int names = o1.getSimpleName().toString().compareTo(
14.323 + o2.getSimpleName().toString()
14.324 + );
14.325 + if (names != 0) {
14.326 + return names;
14.327 + }
14.328 + names = o1.getEnclosingElement().getSimpleName().toString().compareTo(
14.329 + o2.getEnclosingElement().getSimpleName().toString()
14.330 + );
14.331 + if (names != 0) {
14.332 + return names;
14.333 + }
14.334 + int id1 = System.identityHashCode(o1);
14.335 + int id2 = System.identityHashCode(o2);
14.336 + if (id1 == id2) {
14.337 + throw new IllegalStateException("Cannot order " + o1 + " and " + o2);
14.338 + }
14.339 + return id1 - id2;
14.340 + }
14.341 +
14.342 + FileObject validateResource(String resource, Element originatingElement, Annotation annotation, String annotationMethod, boolean searchClasspath) throws LayerGenerationException {
14.343 + if (resource.startsWith("/")) {
14.344 + throw new LayerGenerationException("do not use leading slashes on resource paths", originatingElement, processingEnv, annotation, annotationMethod);
14.345 + }
14.346 + if (searchClasspath) {
14.347 + for (JavaFileManager.Location loc : new JavaFileManager.Location[]{StandardLocation.SOURCE_PATH, /* #181355 */ StandardLocation.CLASS_OUTPUT, StandardLocation.CLASS_PATH, StandardLocation.PLATFORM_CLASS_PATH}) {
14.348 + try {
14.349 + FileObject f = processingEnv.getFiler().getResource(loc, "", resource);
14.350 + if (loc.isOutputLocation()) {
14.351 + f.openInputStream().close();
14.352 + }
14.353 + return f;
14.354 + } catch (IOException ex) {
14.355 + continue;
14.356 + }
14.357 + }
14.358 + throw new LayerGenerationException("Cannot find resource " + resource, originatingElement, processingEnv, annotation, annotationMethod);
14.359 + } else {
14.360 + try {
14.361 + try {
14.362 + FileObject f = processingEnv.getFiler().getResource(StandardLocation.SOURCE_PATH, "", resource);
14.363 + f.openInputStream().close();
14.364 + return f;
14.365 + } catch (FileNotFoundException x) {
14.366 + try {
14.367 + FileObject f = processingEnv.getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", resource);
14.368 + f.openInputStream().close();
14.369 + return f;
14.370 + } catch (IOException x2) {
14.371 + throw x;
14.372 + }
14.373 + }
14.374 + } catch (IOException x) {
14.375 + throw new LayerGenerationException("Cannot find resource " + resource, originatingElement, processingEnv, annotation, annotationMethod);
14.376 + }
14.377 + }
14.378 + }
14.379 +
14.380 +}
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/HTMLViewProcessor.java Tue Sep 09 21:44:37 2014 +0200
15.3 @@ -0,0 +1,137 @@
15.4 +/**
15.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
15.6 + *
15.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
15.8 + *
15.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
15.10 + * Other names may be trademarks of their respective owners.
15.11 + *
15.12 + * The contents of this file are subject to the terms of either the GNU
15.13 + * General Public License Version 2 only ("GPL") or the Common
15.14 + * Development and Distribution License("CDDL") (collectively, the
15.15 + * "License"). You may not use this file except in compliance with the
15.16 + * License. You can obtain a copy of the License at
15.17 + * http://www.netbeans.org/cddl-gplv2.html
15.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15.19 + * specific language governing permissions and limitations under the
15.20 + * License. When distributing the software, include this License Header
15.21 + * Notice in each file and include the License file at
15.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
15.23 + * particular file as subject to the "Classpath" exception as provided
15.24 + * by Oracle in the GPL Version 2 section of the License file that
15.25 + * accompanied this code. If applicable, add the following below the
15.26 + * License Header, with the fields enclosed by brackets [] replaced by
15.27 + * your own identifying information:
15.28 + * "Portions Copyrighted [year] [name of copyright owner]"
15.29 + *
15.30 + * Contributor(s):
15.31 + *
15.32 + * The Original Software is NetBeans. The Initial Developer of the Original
15.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
15.34 + *
15.35 + * If you wish your version of this file to be governed by only the CDDL
15.36 + * or only the GPL Version 2, indicate your decision by adding
15.37 + * "[Contributor] elects to include this software in this distribution
15.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
15.39 + * single choice of license, a recipient has the option to distribute
15.40 + * your version of this file under either the CDDL, the GPL Version 2 or
15.41 + * to extend the choice of license to its licensees as provided above.
15.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
15.43 + * Version 2 license, then the option applies only if the new code is
15.44 + * made subject to such option by the copyright holder.
15.45 + */
15.46 +package org.netbeans.modules.html4j;
15.47 +
15.48 +import java.util.HashSet;
15.49 +import java.util.Set;
15.50 +import javax.annotation.processing.Processor;
15.51 +import javax.annotation.processing.RoundEnvironment;
15.52 +import javax.annotation.processing.SupportedSourceVersion;
15.53 +import javax.lang.model.SourceVersion;
15.54 +import javax.lang.model.element.Element;
15.55 +import javax.lang.model.element.ElementKind;
15.56 +import javax.lang.model.element.ExecutableElement;
15.57 +import javax.lang.model.element.Modifier;
15.58 +import javax.lang.model.element.TypeElement;
15.59 +import javax.tools.Diagnostic;
15.60 +import org.netbeans.api.html4j.OpenHTMLRegistration;
15.61 +import org.openide.awt.ActionID;
15.62 +import org.openide.filesystems.annotations.LayerBuilder;
15.63 +import org.openide.filesystems.annotations.LayerGeneratingProcessor;
15.64 +import org.openide.filesystems.annotations.LayerGenerationException;
15.65 +import org.openide.util.lookup.ServiceProvider;
15.66 +
15.67 +/**
15.68 + *
15.69 + * @author jtulach
15.70 + */
15.71 +@SupportedSourceVersion(SourceVersion.RELEASE_6)
15.72 +@ServiceProvider(service = Processor.class)
15.73 +public class HTMLViewProcessor extends LayerGeneratingProcessor {
15.74 + @Override
15.75 + public Set<String> getSupportedAnnotationTypes() {
15.76 + Set<String> hash = new HashSet<>();
15.77 + hash.add(OpenHTMLRegistration.class.getCanonicalName());
15.78 + return hash;
15.79 + }
15.80 +
15.81 + @Override
15.82 + protected boolean handleProcess(Set<? extends TypeElement> set, RoundEnvironment re) throws LayerGenerationException {
15.83 + for (Element e : re.getElementsAnnotatedWith(OpenHTMLRegistration.class)) {
15.84 + OpenHTMLRegistration reg = e.getAnnotation(OpenHTMLRegistration.class);
15.85 + if (reg == null || e.getKind() != ElementKind.METHOD) {
15.86 + continue;
15.87 + }
15.88 + if (!e.getModifiers().contains(Modifier.STATIC)) {
15.89 + error("Method annotated by @OpenHTMLRegistration needs to be static", e);
15.90 + }
15.91 + if (!e.getModifiers().contains(Modifier.PUBLIC)) {
15.92 + error("Method annotated by @OpenHTMLRegistration needs to be public", e);
15.93 + }
15.94 + if (!((ExecutableElement)e).getParameters().isEmpty()) {
15.95 + error("Method annotated by @OpenHTMLRegistration should have no arguments", e);
15.96 + }
15.97 + if (!e.getEnclosingElement().getModifiers().contains(Modifier.PUBLIC)) {
15.98 + error("Method annotated by @OpenHTMLRegistration needs to be public in a public class", e);
15.99 + }
15.100 +
15.101 + ActionID aid = e.getAnnotation(ActionID.class);
15.102 + if (aid != null) {
15.103 + final LayerBuilder builder = layer(e);
15.104 + LayerBuilder.File actionFile = builder.
15.105 + file("Actions/" + aid.category() + "/" + aid.id().replace('.', '-') + ".instance").
15.106 + methodvalue("instanceCreate", "org.netbeans.modules.html4j.Pages", "openAction");
15.107 + String abs = LayerBuilder.absolutizeResource(e, reg.url());
15.108 + try {
15.109 + builder.validateResource(abs, e, reg, null, true);
15.110 + } catch (LayerGenerationException ex) {
15.111 + if (System.getProperty("netbeans.home") != null) {
15.112 + processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Cannot find resource " + abs, e);
15.113 + } else {
15.114 + throw ex;
15.115 + }
15.116 + }
15.117 + actionFile.stringvalue("url", abs);
15.118 + if (!reg.iconBase().isEmpty()) {
15.119 + actionFile.stringvalue("iconBase", reg.iconBase());
15.120 + }
15.121 + actionFile.stringvalue("method", e.getSimpleName().toString());
15.122 + actionFile.stringvalue("class", e.getEnclosingElement().asType().toString());
15.123 +// actionFile.instanceAttribute("component", TopComponent.class, reg, null);
15.124 +// if (reg.preferredID().length() > 0) {
15.125 +// actionFile.stringvalue("preferredID", reg.preferredID());
15.126 +// }
15.127 + actionFile.bundlevalue("displayName", reg.displayName(), reg, "displayName");
15.128 + actionFile.write();
15.129 + } else {
15.130 + error("@OpenHTMLRegistration needs to be accompanied with @ActionID annotation", e);
15.131 + }
15.132 +
15.133 + }
15.134 + return true;
15.135 + }
15.136 +
15.137 + private void error(final String msg, Element e) {
15.138 + processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, msg, e);
15.139 + }
15.140 +}
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/HtmlComponent.java Tue Sep 09 21:44:37 2014 +0200
16.3 @@ -0,0 +1,227 @@
16.4 +/**
16.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
16.6 + *
16.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
16.8 + *
16.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
16.10 + * Other names may be trademarks of their respective owners.
16.11 + *
16.12 + * The contents of this file are subject to the terms of either the GNU
16.13 + * General Public License Version 2 only ("GPL") or the Common
16.14 + * Development and Distribution License("CDDL") (collectively, the
16.15 + * "License"). You may not use this file except in compliance with the
16.16 + * License. You can obtain a copy of the License at
16.17 + * http://www.netbeans.org/cddl-gplv2.html
16.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16.19 + * specific language governing permissions and limitations under the
16.20 + * License. When distributing the software, include this License Header
16.21 + * Notice in each file and include the License file at
16.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
16.23 + * particular file as subject to the "Classpath" exception as provided
16.24 + * by Oracle in the GPL Version 2 section of the License file that
16.25 + * accompanied this code. If applicable, add the following below the
16.26 + * License Header, with the fields enclosed by brackets [] replaced by
16.27 + * your own identifying information:
16.28 + * "Portions Copyrighted [year] [name of copyright owner]"
16.29 + *
16.30 + * Contributor(s):
16.31 + *
16.32 + * The Original Software is NetBeans. The Initial Developer of the Original
16.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
16.34 + *
16.35 + * If you wish your version of this file to be governed by only the CDDL
16.36 + * or only the GPL Version 2, indicate your decision by adding
16.37 + * "[Contributor] elects to include this software in this distribution
16.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
16.39 + * single choice of license, a recipient has the option to distribute
16.40 + * your version of this file under either the CDDL, the GPL Version 2 or
16.41 + * to extend the choice of license to its licensees as provided above.
16.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
16.43 + * Version 2 license, then the option applies only if the new code is
16.44 + * made subject to such option by the copyright holder.
16.45 + */
16.46 +package org.netbeans.modules.html4j;
16.47 +
16.48 +import java.awt.BorderLayout;
16.49 +import java.awt.EventQueue;
16.50 +import java.io.Closeable;
16.51 +import java.io.IOException;
16.52 +import java.lang.reflect.Constructor;
16.53 +import java.lang.reflect.Method;
16.54 +import java.net.URL;
16.55 +import java.util.ArrayList;
16.56 +import java.util.Arrays;
16.57 +import java.util.HashMap;
16.58 +import java.util.List;
16.59 +import java.util.Map;
16.60 +import java.util.logging.Level;
16.61 +import java.util.logging.Logger;
16.62 +import javafx.application.Platform;
16.63 +import javafx.beans.value.ChangeListener;
16.64 +import javafx.beans.value.ObservableValue;
16.65 +import javafx.scene.Scene;
16.66 +import javafx.scene.layout.BorderPane;
16.67 +import javafx.scene.paint.Color;
16.68 +import javafx.scene.web.WebView;
16.69 +import net.java.html.boot.fx.FXBrowsers;
16.70 +import net.java.html.js.JavaScriptBody;
16.71 +import org.openide.util.Lookup;
16.72 +import org.openide.util.lookup.AbstractLookup;
16.73 +import org.openide.util.lookup.InstanceContent;
16.74 +import org.openide.windows.TopComponent;
16.75 +
16.76 +/**
16.77 + *
16.78 + * @author Jaroslav Tulach <jtulach@netbeans.org>
16.79 + */
16.80 +@TopComponent.Description(
16.81 + persistenceType = TopComponent.PERSISTENCE_NEVER,
16.82 + preferredID = "browser"
16.83 +)
16.84 +public final class HtmlComponent extends TopComponent {
16.85 + private static final Logger LOG = Logger.getLogger(HtmlComponent.class.getName());
16.86 + private final NbFxPanel p = new NbFxPanel();
16.87 + private /* final */ WebView v;
16.88 + private final InstanceContent ic;
16.89 + private Object value;
16.90 + private final Map<String,Object> cache = new HashMap<>();
16.91 +
16.92 + HtmlComponent() {
16.93 + ic = new InstanceContent();
16.94 + associateLookup(new AbstractLookup(ic));
16.95 + setLayout(new BorderLayout());
16.96 + add(p, BorderLayout.CENTER);
16.97 + }
16.98 +
16.99 + final WebView getWebView() {
16.100 + return v;
16.101 + }
16.102 +
16.103 + public void loadFX(URL pageUrl, final Class<?> clazz, final String m) {
16.104 + initFX();
16.105 + ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);
16.106 + if (loader == null) {
16.107 + loader = clazz.getClassLoader();
16.108 + }
16.109 + FXBrowsers.load(v, pageUrl, new Runnable() {
16.110 + @Override
16.111 + public void run() {
16.112 + try {
16.113 + HtmlComponent hc = HtmlComponent.this;
16.114 + Method method = clazz.getMethod(m);
16.115 + Object value = method.invoke(null);
16.116 + if (value != null) {
16.117 + hc.value = value;
16.118 + hc.ic.add(value);
16.119 + }
16.120 + listenOnContext(hc);
16.121 + } catch (Exception ex) {
16.122 + LOG.log(Level.WARNING, "Can't load " + m + " from " + clazz, ex);
16.123 + }
16.124 + }
16.125 + }, loader);
16.126 + }
16.127 +
16.128 +
16.129 + private void initFX() {
16.130 + Platform.setImplicitExit(false);
16.131 + v = new WebView();
16.132 + BorderPane bp = new BorderPane();
16.133 + Scene scene = new Scene(bp, Color.ALICEBLUE);
16.134 +
16.135 + class X implements ChangeListener<String>, Runnable {
16.136 +
16.137 + private String title;
16.138 +
16.139 + public X() {
16.140 + super();
16.141 + }
16.142 +
16.143 + @Override
16.144 + public void changed(ObservableValue<? extends String> ov, String t, String t1) {
16.145 + title = v.getEngine().getTitle();
16.146 + EventQueue.invokeLater(this);
16.147 + }
16.148 +
16.149 + @Override
16.150 + public void run() {
16.151 + if (title != null) {
16.152 + HtmlComponent.this.setDisplayName(title);
16.153 + }
16.154 + }
16.155 + }
16.156 + final X x = new X();
16.157 + v.getEngine().titleProperty().addListener(x);
16.158 + Platform.runLater(x);
16.159 + bp.setCenter(v);
16.160 + p.setScene(scene);
16.161 + }
16.162 +
16.163 + final void onChange(Object[] values) {
16.164 + List<Object> instances = new ArrayList<>();
16.165 + if (this.value != null) {
16.166 + instances.add(this.value);
16.167 + }
16.168 + if (values != null) {
16.169 + HashMap<String, Object> c = new HashMap<>(cache);
16.170 + for (Object o : values) {
16.171 + if (o instanceof String) {
16.172 + Object inst = c.remove((String)o);
16.173 + if (inst == null) try {
16.174 + Class<?> cookie = loadClass((String) o);
16.175 + Constructor<?>[] arr = cookie.getConstructors();
16.176 + if (arr.length != 1) {
16.177 + LOG.log(Level.WARNING, "Class {0} should have one public constructor. Found {1}", new Object[]{cookie, Arrays.toString(arr)});
16.178 + continue;
16.179 + }
16.180 + Constructor<?> cnstr = arr[0];
16.181 + if (cnstr.getParameterTypes().length == 1) {
16.182 + inst = cnstr.newInstance(value);
16.183 + } else {
16.184 + inst = cnstr.newInstance();
16.185 + }
16.186 + cache.put((String)o, inst);
16.187 + } catch (Throwable ex) {
16.188 + LOG.log(Level.WARNING, "Cannot associate context class " + o, ex);
16.189 + continue;
16.190 + }
16.191 + instances.add(inst);
16.192 + }
16.193 + }
16.194 + for (Map.Entry<String, Object> entry : c.entrySet()) {
16.195 + if (entry.getValue() instanceof Closeable) {
16.196 + try {
16.197 + ((Closeable)entry.getValue()).close();
16.198 + } catch (IOException ex) {
16.199 + LOG.log(Level.WARNING, "Error when closing" + entry.getValue(), ex);
16.200 + }
16.201 + cache.remove(entry.getKey());
16.202 + }
16.203 + }
16.204 + }
16.205 + ic.set(instances, null);
16.206 + }
16.207 +
16.208 + @JavaScriptBody(args = {"onChange"}, javacall = true, body = ""
16.209 + + "if (typeof ko === 'undefined') return;\n"
16.210 + + "var data = ko.dataFor(window.document.body);\n"
16.211 + + "if (typeof data === 'undefined') return;\n"
16.212 + + "if (typeof data.context === 'undefined') return;\n"
16.213 + + "data.context.subscribe(function(value) {\n"
16.214 + + " onChange.@org.netbeans.modules.html4j.HtmlComponent::onChange([Ljava/lang/Object;)(value);\n"
16.215 + + "});\n"
16.216 + + "onChange.@org.netbeans.modules.html4j.HtmlComponent::onChange([Ljava/lang/Object;)(data.context());\n"
16.217 + )
16.218 + private static native void listenOnContext(HtmlComponent onChange);
16.219 +
16.220 + static Class loadClass(String c) throws ClassNotFoundException {
16.221 + ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class);
16.222 + if (l == null) {
16.223 + l = Thread.currentThread().getContextClassLoader();
16.224 + }
16.225 + if (l == null) {
16.226 + l = Pages.class.getClassLoader();
16.227 + }
16.228 + return Class.forName(c, true, l);
16.229 + }
16.230 +}
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/NbFxPanel.java Tue Sep 09 21:44:37 2014 +0200
17.3 @@ -0,0 +1,61 @@
17.4 +/*
17.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
17.6 + *
17.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
17.8 + *
17.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
17.10 + * Other names may be trademarks of their respective owners.
17.11 + *
17.12 + * The contents of this file are subject to the terms of either the GNU
17.13 + * General Public License Version 2 only ("GPL") or the Common
17.14 + * Development and Distribution License("CDDL") (collectively, the
17.15 + * "License"). You may not use this file except in compliance with the
17.16 + * License. You can obtain a copy of the License at
17.17 + * http://www.netbeans.org/cddl-gplv2.html
17.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
17.19 + * specific language governing permissions and limitations under the
17.20 + * License. When distributing the software, include this License Header
17.21 + * Notice in each file and include the License file at
17.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
17.23 + * particular file as subject to the "Classpath" exception as provided
17.24 + * by Oracle in the GPL Version 2 section of the License file that
17.25 + * accompanied this code. If applicable, add the following below the
17.26 + * License Header, with the fields enclosed by brackets [] replaced by
17.27 + * your own identifying information:
17.28 + * "Portions Copyrighted [year] [name of copyright owner]"
17.29 + *
17.30 + * If you wish your version of this file to be governed by only the CDDL
17.31 + * or only the GPL Version 2, indicate your decision by adding
17.32 + * "[Contributor] elects to include this software in this distribution
17.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
17.34 + * single choice of license, a recipient has the option to distribute
17.35 + * your version of this file under either the CDDL, the GPL Version 2 or
17.36 + * to extend the choice of license to its licensees as provided above.
17.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
17.38 + * Version 2 license, then the option applies only if the new code is
17.39 + * made subject to such option by the copyright holder.
17.40 + *
17.41 + * Contributor(s):
17.42 + *
17.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
17.44 + */
17.45 +
17.46 +package org.netbeans.modules.html4j;
17.47 +
17.48 +import java.awt.im.InputMethodRequests;
17.49 +import javafx.embed.swing.JFXPanel;
17.50 +
17.51 +/**
17.52 + *
17.53 + * @author Jaroslav Tulach <jtulach@netbeans.org>
17.54 + */
17.55 +final class NbFxPanel extends JFXPanel {
17.56 + @Override
17.57 + public InputMethodRequests getInputMethodRequests() {
17.58 + try {
17.59 + return super.getInputMethodRequests();
17.60 + } catch (NullPointerException ex) {
17.61 + return null;
17.62 + }
17.63 + }
17.64 +}
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/api.html4j/src/org/netbeans/modules/html4j/Pages.java Tue Sep 09 21:44:37 2014 +0200
18.3 @@ -0,0 +1,106 @@
18.4 +/**
18.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
18.6 + *
18.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
18.8 + *
18.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
18.10 + * Other names may be trademarks of their respective owners.
18.11 + *
18.12 + * The contents of this file are subject to the terms of either the GNU
18.13 + * General Public License Version 2 only ("GPL") or the Common
18.14 + * Development and Distribution License("CDDL") (collectively, the
18.15 + * "License"). You may not use this file except in compliance with the
18.16 + * License. You can obtain a copy of the License at
18.17 + * http://www.netbeans.org/cddl-gplv2.html
18.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
18.19 + * specific language governing permissions and limitations under the
18.20 + * License. When distributing the software, include this License Header
18.21 + * Notice in each file and include the License file at
18.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
18.23 + * particular file as subject to the "Classpath" exception as provided
18.24 + * by Oracle in the GPL Version 2 section of the License file that
18.25 + * accompanied this code. If applicable, add the following below the
18.26 + * License Header, with the fields enclosed by brackets [] replaced by
18.27 + * your own identifying information:
18.28 + * "Portions Copyrighted [year] [name of copyright owner]"
18.29 + *
18.30 + * Contributor(s):
18.31 + *
18.32 + * The Original Software is NetBeans. The Initial Developer of the Original
18.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
18.34 + *
18.35 + * If you wish your version of this file to be governed by only the CDDL
18.36 + * or only the GPL Version 2, indicate your decision by adding
18.37 + * "[Contributor] elects to include this software in this distribution
18.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
18.39 + * single choice of license, a recipient has the option to distribute
18.40 + * your version of this file under either the CDDL, the GPL Version 2 or
18.41 + * to extend the choice of license to its licensees as provided above.
18.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
18.43 + * Version 2 license, then the option applies only if the new code is
18.44 + * made subject to such option by the copyright holder.
18.45 + */
18.46 +package org.netbeans.modules.html4j;
18.47 +
18.48 +import java.awt.event.ActionEvent;
18.49 +import java.awt.event.ActionListener;
18.50 +import java.net.URL;
18.51 +import java.util.Map;
18.52 +import javafx.application.Platform;
18.53 +import javax.swing.Action;
18.54 +import org.openide.awt.Actions;
18.55 +import org.openide.util.Lookup;
18.56 +
18.57 +/** API for controlling HTML like UI from Java language.
18.58 + *
18.59 + * @author Jaroslav Tulach <jtulach@netbeans.org>
18.60 + */
18.61 +public final class Pages {
18.62 + private Pages() {
18.63 + }
18.64 +
18.65 + public static Action openAction(final Map<?,?> map) {
18.66 + class R implements ActionListener, Runnable {
18.67 + private String m;
18.68 + private Class<?> clazz;
18.69 + private HtmlComponent tc;
18.70 + private URL pageUrl;
18.71 + @Override
18.72 + public void actionPerformed(ActionEvent e) {
18.73 + try {
18.74 + String u = (String) map.get("url");
18.75 + String c = (String) map.get("class");
18.76 + m = (String) map.get("method");
18.77 +
18.78 + clazz = HtmlComponent.loadClass(c);
18.79 + URL url = clazz.getResource("/" + u);
18.80 + if (url == null) {
18.81 + url = new URL(u);
18.82 + }
18.83 + pageUrl = url;
18.84 +
18.85 + tc = new HtmlComponent();
18.86 + tc.open();
18.87 + tc.requestActive();
18.88 +
18.89 + Platform.runLater(this);
18.90 + } catch (Exception ex) {
18.91 + throw new IllegalStateException(ex);
18.92 + }
18.93 + }
18.94 +
18.95 + @Override
18.96 + public void run() {
18.97 + tc.loadFX(pageUrl, clazz, m);
18.98 + }
18.99 + }
18.100 +
18.101 + R r = new R();
18.102 + return Actions.alwaysEnabled(
18.103 + r,
18.104 + (String) map.get("displayName"), // NOI18N
18.105 + (String) map.get("iconBase"), // NOI18N
18.106 + Boolean.TRUE.equals(map.get("noIconInMenu")) // NOI18N
18.107 + );
18.108 + }
18.109 +}
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/api.html4j/test/unit/src/org/netbeans/api/html4j/Compile.java Tue Sep 09 21:44:37 2014 +0200
19.3 @@ -0,0 +1,291 @@
19.4 +/**
19.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
19.6 + *
19.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
19.8 + *
19.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
19.10 + * Other names may be trademarks of their respective owners.
19.11 + *
19.12 + * The contents of this file are subject to the terms of either the GNU
19.13 + * General Public License Version 2 only ("GPL") or the Common
19.14 + * Development and Distribution License("CDDL") (collectively, the
19.15 + * "License"). You may not use this file except in compliance with the
19.16 + * License. You can obtain a copy of the License at
19.17 + * http://www.netbeans.org/cddl-gplv2.html
19.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
19.19 + * specific language governing permissions and limitations under the
19.20 + * License. When distributing the software, include this License Header
19.21 + * Notice in each file and include the License file at
19.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
19.23 + * particular file as subject to the "Classpath" exception as provided
19.24 + * by Oracle in the GPL Version 2 section of the License file that
19.25 + * accompanied this code. If applicable, add the following below the
19.26 + * License Header, with the fields enclosed by brackets [] replaced by
19.27 + * your own identifying information:
19.28 + * "Portions Copyrighted [year] [name of copyright owner]"
19.29 + *
19.30 + * Contributor(s):
19.31 + *
19.32 + * The Original Software is NetBeans. The Initial Developer of the Original
19.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
19.34 + *
19.35 + * If you wish your version of this file to be governed by only the CDDL
19.36 + * or only the GPL Version 2, indicate your decision by adding
19.37 + * "[Contributor] elects to include this software in this distribution
19.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
19.39 + * single choice of license, a recipient has the option to distribute
19.40 + * your version of this file under either the CDDL, the GPL Version 2 or
19.41 + * to extend the choice of license to its licensees as provided above.
19.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
19.43 + * Version 2 license, then the option applies only if the new code is
19.44 + * made subject to such option by the copyright holder.
19.45 + */
19.46 +package org.netbeans.api.html4j;
19.47 +
19.48 +import java.io.ByteArrayInputStream;
19.49 +import java.io.ByteArrayOutputStream;
19.50 +import java.io.IOException;
19.51 +import java.io.InputStream;
19.52 +import java.io.OutputStream;
19.53 +import java.net.URI;
19.54 +import java.net.URISyntaxException;
19.55 +import java.util.ArrayList;
19.56 +import java.util.Arrays;
19.57 +import java.util.HashMap;
19.58 +import java.util.List;
19.59 +import java.util.Locale;
19.60 +import java.util.Map;
19.61 +import java.util.regex.Matcher;
19.62 +import java.util.regex.Pattern;
19.63 +import javax.tools.Diagnostic;
19.64 +import javax.tools.DiagnosticListener;
19.65 +import javax.tools.FileObject;
19.66 +import javax.tools.ForwardingJavaFileManager;
19.67 +import javax.tools.JavaFileManager;
19.68 +import javax.tools.JavaFileObject;
19.69 +import javax.tools.JavaFileObject.Kind;
19.70 +import javax.tools.SimpleJavaFileObject;
19.71 +import javax.tools.StandardJavaFileManager;
19.72 +import javax.tools.StandardLocation;
19.73 +import javax.tools.ToolProvider;
19.74 +import static org.testng.Assert.assertFalse;
19.75 +import static org.testng.Assert.fail;
19.76 +
19.77 +/**
19.78 + *
19.79 + * @author Jaroslav Tulach <jtulach@netbeans.org>
19.80 + */
19.81 +final class Compile implements DiagnosticListener<JavaFileObject> {
19.82 + private final List<Diagnostic<? extends JavaFileObject>> errors =
19.83 + new ArrayList<Diagnostic<? extends JavaFileObject>>();
19.84 + private final Map<String, byte[]> classes;
19.85 + private final String pkg;
19.86 + private final String cls;
19.87 + private final String html;
19.88 + private final String sourceLevel;
19.89 +
19.90 + private Compile(String htmlName, String html, String code, String sl) throws IOException {
19.91 + this.pkg = findPkg(code);
19.92 + this.cls = findCls(code);
19.93 + this.html = html;
19.94 + this.sourceLevel = sl;
19.95 + classes = compile(htmlName, html, code);
19.96 + }
19.97 +
19.98 + /** Performs compilation of given HTML page and associated Java code
19.99 + */
19.100 + public static Compile create(String htmlName, String html, String code) throws IOException {
19.101 + return create(htmlName, html, code, "1.7");
19.102 + }
19.103 + static Compile create(String htmlName, String html, String code, String sourceLevel) throws IOException {
19.104 + return new Compile(htmlName, html, code, sourceLevel);
19.105 + }
19.106 +
19.107 + /** Checks for given class among compiled resources */
19.108 + public byte[] get(String res) {
19.109 + return classes.get(res);
19.110 + }
19.111 +
19.112 + /** Obtains errors created during compilation.
19.113 + */
19.114 + public List<Diagnostic<? extends JavaFileObject>> getErrors() {
19.115 + List<Diagnostic<? extends JavaFileObject>> err;
19.116 + err = new ArrayList<Diagnostic<? extends JavaFileObject>>();
19.117 + for (Diagnostic<? extends JavaFileObject> diagnostic : errors) {
19.118 + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
19.119 + err.add(diagnostic);
19.120 + }
19.121 + }
19.122 + return err;
19.123 + }
19.124 +
19.125 + private Map<String, byte[]> compile(final String htmlName, final String html, final String code) throws IOException {
19.126 + StandardJavaFileManager sjfm = ToolProvider.getSystemJavaCompiler().getStandardFileManager(this, null, null);
19.127 +
19.128 + final Map<String, ByteArrayOutputStream> class2BAOS;
19.129 + class2BAOS = new HashMap<String, ByteArrayOutputStream>();
19.130 +
19.131 + JavaFileObject file = new SimpleJavaFileObject(URI.create("mem://mem"), Kind.SOURCE) {
19.132 + @Override
19.133 + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
19.134 + return code;
19.135 + }
19.136 +
19.137 + @Override
19.138 + public boolean isNameCompatible(String simpleName, Kind kind) {
19.139 + return true;
19.140 + }
19.141 + };
19.142 + final JavaFileObject htmlFile = new SimpleJavaFileObject(URI.create("mem://mem2"), Kind.OTHER) {
19.143 + @Override
19.144 + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
19.145 + return html;
19.146 + }
19.147 +
19.148 + @Override
19.149 + public InputStream openInputStream() throws IOException {
19.150 + return new ByteArrayInputStream(html.getBytes());
19.151 + }
19.152 + };
19.153 +
19.154 + final URI scratch;
19.155 + try {
19.156 + scratch = new URI("mem://mem3");
19.157 + } catch (URISyntaxException ex) {
19.158 + throw new IOException(ex);
19.159 + }
19.160 +
19.161 + JavaFileManager jfm = new ForwardingJavaFileManager<JavaFileManager>(sjfm) {
19.162 + @Override
19.163 + public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException {
19.164 + if (kind == Kind.CLASS) {
19.165 + final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
19.166 +
19.167 + class2BAOS.put(className.replace('.', '/') + ".class", buffer);
19.168 + return new SimpleJavaFileObject(sibling.toUri(), kind) {
19.169 + @Override
19.170 + public OutputStream openOutputStream() throws IOException {
19.171 + return buffer;
19.172 + }
19.173 + };
19.174 + }
19.175 +
19.176 + if (kind == Kind.SOURCE) {
19.177 + final String n = className.replace('.', '/') + ".java";
19.178 + final URI un;
19.179 + try {
19.180 + un = new URI("mem://" + n);
19.181 + } catch (URISyntaxException ex) {
19.182 + throw new IOException(ex);
19.183 + }
19.184 + return new VirtFO(un/*sibling.toUri()*/, kind, n);
19.185 + }
19.186 +
19.187 + throw new IllegalStateException();
19.188 + }
19.189 +
19.190 + @Override
19.191 + public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException {
19.192 + if (location == StandardLocation.SOURCE_PATH) {
19.193 + if (packageName.equals(pkg) || relativeName.endsWith("/" + htmlName)) {
19.194 + return htmlFile;
19.195 + }
19.196 + }
19.197 +
19.198 + throw new IOException("Cannot find " + relativeName);
19.199 + }
19.200 +
19.201 + @Override
19.202 + public boolean isSameFile(FileObject a, FileObject b) {
19.203 + if (a instanceof VirtFO && b instanceof VirtFO) {
19.204 + return ((VirtFO)a).getName().equals(((VirtFO)b).getName());
19.205 + }
19.206 +
19.207 + return super.isSameFile(a, b);
19.208 + }
19.209 +
19.210 + class VirtFO extends SimpleJavaFileObject {
19.211 +
19.212 + private final String n;
19.213 +
19.214 + public VirtFO(URI uri, Kind kind, String n) {
19.215 + super(uri, kind);
19.216 + this.n = n;
19.217 + }
19.218 + private final ByteArrayOutputStream data = new ByteArrayOutputStream();
19.219 +
19.220 + @Override
19.221 + public OutputStream openOutputStream() throws IOException {
19.222 + return data;
19.223 + }
19.224 +
19.225 + @Override
19.226 + public String getName() {
19.227 + return n;
19.228 + }
19.229 +
19.230 + @Override
19.231 + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
19.232 + data.close();
19.233 + return new String(data.toByteArray());
19.234 + }
19.235 + }
19.236 + };
19.237 +
19.238 + ToolProvider.getSystemJavaCompiler().getTask(null, jfm, this, /*XXX:*/Arrays.asList("-source", sourceLevel, "-target", "1.7"), null, Arrays.asList(file)).call();
19.239 +
19.240 + Map<String, byte[]> result = new HashMap<String, byte[]>();
19.241 +
19.242 + for (Map.Entry<String, ByteArrayOutputStream> e : class2BAOS.entrySet()) {
19.243 + result.put(e.getKey(), e.getValue().toByteArray());
19.244 + }
19.245 +
19.246 + return result;
19.247 + }
19.248 +
19.249 +
19.250 + @Override
19.251 + public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
19.252 + errors.add(diagnostic);
19.253 + }
19.254 + private static String findPkg(String java) throws IOException {
19.255 + Pattern p = Pattern.compile("package\\p{javaWhitespace}*([\\p{Alnum}\\.]+)\\p{javaWhitespace}*;", Pattern.MULTILINE);
19.256 + Matcher m = p.matcher(java);
19.257 + if (!m.find()) {
19.258 + throw new IOException("Can't find package declaration in the java file");
19.259 + }
19.260 + String pkg = m.group(1);
19.261 + return pkg;
19.262 + }
19.263 + private static String findCls(String java) throws IOException {
19.264 + Pattern p = Pattern.compile("class\\p{javaWhitespace}*([\\p{Alnum}\\.]+)\\p{javaWhitespace}", Pattern.MULTILINE);
19.265 + Matcher m = p.matcher(java);
19.266 + if (!m.find()) {
19.267 + throw new IOException("Can't find package declaration in the java file");
19.268 + }
19.269 + String cls = m.group(1);
19.270 + return cls;
19.271 + }
19.272 +
19.273 + String getHtml() {
19.274 + String fqn = "'" + pkg + '.' + cls + "'";
19.275 + return html.replace("'${fqn}'", fqn);
19.276 + }
19.277 + void assertErrors() {
19.278 + assertFalse(getErrors().isEmpty(), "There are supposed to be some errors");
19.279 + }
19.280 +
19.281 + void assertError(String expMsg) {
19.282 + StringBuilder sb = new StringBuilder();
19.283 + sb.append("Can't find ").append(expMsg).append(" among:");
19.284 + for (Diagnostic<? extends JavaFileObject> e : errors) {
19.285 + String msg = e.getMessage(Locale.US);
19.286 + if (msg.contains(expMsg)) {
19.287 + return;
19.288 + }
19.289 + sb.append("\n");
19.290 + sb.append(msg);
19.291 + }
19.292 + fail(sb.toString());
19.293 + }
19.294 +}
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/api.html4j/test/unit/src/org/netbeans/api/html4j/HTMLViewProcessorTest.java Tue Sep 09 21:44:37 2014 +0200
20.3 @@ -0,0 +1,228 @@
20.4 +/**
20.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
20.6 + *
20.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
20.8 + *
20.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
20.10 + * Other names may be trademarks of their respective owners.
20.11 + *
20.12 + * The contents of this file are subject to the terms of either the GNU
20.13 + * General Public License Version 2 only ("GPL") or the Common
20.14 + * Development and Distribution License("CDDL") (collectively, the
20.15 + * "License"). You may not use this file except in compliance with the
20.16 + * License. You can obtain a copy of the License at
20.17 + * http://www.netbeans.org/cddl-gplv2.html
20.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
20.19 + * specific language governing permissions and limitations under the
20.20 + * License. When distributing the software, include this License Header
20.21 + * Notice in each file and include the License file at
20.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
20.23 + * particular file as subject to the "Classpath" exception as provided
20.24 + * by Oracle in the GPL Version 2 section of the License file that
20.25 + * accompanied this code. If applicable, add the following below the
20.26 + * License Header, with the fields enclosed by brackets [] replaced by
20.27 + * your own identifying information:
20.28 + * "Portions Copyrighted [year] [name of copyright owner]"
20.29 + *
20.30 + * Contributor(s):
20.31 + *
20.32 + * The Original Software is NetBeans. The Initial Developer of the Original
20.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
20.34 + *
20.35 + * If you wish your version of this file to be governed by only the CDDL
20.36 + * or only the GPL Version 2, indicate your decision by adding
20.37 + * "[Contributor] elects to include this software in this distribution
20.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
20.39 + * single choice of license, a recipient has the option to distribute
20.40 + * your version of this file under either the CDDL, the GPL Version 2 or
20.41 + * to extend the choice of license to its licensees as provided above.
20.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
20.43 + * Version 2 license, then the option applies only if the new code is
20.44 + * made subject to such option by the copyright holder.
20.45 + */
20.46 +package org.netbeans.api.html4j;
20.47 +
20.48 +import java.io.IOException;
20.49 +import java.util.Locale;
20.50 +import javax.tools.Diagnostic;
20.51 +import javax.tools.JavaFileObject;
20.52 +import static org.testng.Assert.assertFalse;
20.53 +import static org.testng.Assert.fail;
20.54 +import org.testng.annotations.Test;
20.55 +
20.56 +/**
20.57 + * @author Jaroslav Tulach
20.58 + */
20.59 +public class HTMLViewProcessorTest {
20.60 + @Test public void needActionId() throws Exception {
20.61 + String html = "<html><body>"
20.62 + + "</body></html>";
20.63 + String code = "package x.y.z;\n"
20.64 + + "import org.netbeans.api.html4j.OpenHTMLRegistration;\n"
20.65 + + "public class X {\n"
20.66 + + " @OpenHTMLRegistration(url=\"empty.html\", displayName=\"X\")\n"
20.67 + + " public static void someMethod() {\n"
20.68 + + " }\n"
20.69 + + "}\n";
20.70 +
20.71 + Compile c = Compile.create("empty.html", html, code);
20.72 + assertFalse(c.getErrors().isEmpty(), "One error: " + c.getErrors());
20.73 + boolean ok = false;
20.74 + StringBuilder msgs = new StringBuilder();
20.75 + for (Diagnostic<? extends JavaFileObject> e : c.getErrors()) {
20.76 + String msg = e.getMessage(Locale.ENGLISH);
20.77 + if (msg.contains("ActionID")) {
20.78 + ok = true;
20.79 + }
20.80 + msgs.append("\n").append(msg);
20.81 + }
20.82 + if (!ok) {
20.83 + fail("Should contain warning about ActionID:" + msgs);
20.84 + }
20.85 + }
20.86 +
20.87 + @Test public void failIfHTMLPageDoesNotExist() throws Exception {
20.88 + String html = "<html><body>"
20.89 + + "</body></html>";
20.90 + String code = "package x.y.z;\n"
20.91 + + "import org.netbeans.api.html4j.OpenHTMLRegistration;\n"
20.92 + + "import org.openide.awt.ActionID;\n"
20.93 + + "class X {\n"
20.94 + + " @ActionID(category=\"test\", id=\"test.id.at.x\")\n"
20.95 + + " @OpenHTMLRegistration(url=\"does-not-exist.html\", displayName=\"X\")\n"
20.96 + + " public static void someMethod() {\n"
20.97 + + " }\n"
20.98 + + "}\n";
20.99 +
20.100 + Compile c = Compile.create("different.html", html, code);
20.101 + assertFalse(c.getErrors().isEmpty(), "One error: " + c.getErrors());
20.102 + boolean ok = false;
20.103 + StringBuilder msgs = new StringBuilder();
20.104 + for (Diagnostic<? extends JavaFileObject> e : c.getErrors()) {
20.105 + String msg = e.getMessage(Locale.ENGLISH);
20.106 + if (msg.contains("Cannot find resource")) {
20.107 + ok = true;
20.108 + }
20.109 + msgs.append("\n").append(msg);
20.110 + }
20.111 + if (!ok) {
20.112 + fail("Should contain warning about Cannot find resource:" + msgs);
20.113 + }
20.114 + }
20.115 +
20.116 + @Test public void methodIsNotStatic() throws Exception {
20.117 + String html = "<html><body>"
20.118 + + "</body></html>";
20.119 + String code = "package x.y.z;\n"
20.120 + + "import org.netbeans.api.html4j.OpenHTMLRegistration;\n"
20.121 + + "import org.openide.awt.ActionID;\n"
20.122 + + "public final class X {\n"
20.123 + + " @ActionID(category=\"test\", id=\"test.id.at.x\")\n"
20.124 + + " @OpenHTMLRegistration(url=\"page.html\", displayName=\"X\")\n"
20.125 + + " public void someMethod() {\n"
20.126 + + " }\n"
20.127 + + "}\n";
20.128 +
20.129 + Compile c = Compile.create("page.html", html, code);
20.130 + assertFalse(c.getErrors().isEmpty(), "One error: " + c.getErrors());
20.131 + boolean ok = false;
20.132 + StringBuilder msgs = new StringBuilder();
20.133 + for (Diagnostic<? extends JavaFileObject> e : c.getErrors()) {
20.134 + String msg = e.getMessage(Locale.ENGLISH);
20.135 + if (msg.contains("needs to be static")) {
20.136 + ok = true;
20.137 + }
20.138 + msgs.append("\n").append(msg);
20.139 + }
20.140 + if (!ok) {
20.141 + fail("Should contain warning about static:" + msgs);
20.142 + }
20.143 + }
20.144 +
20.145 + @Test public void methodNeedsToBePublic() throws Exception {
20.146 + String html = "<html><body>"
20.147 + + "</body></html>";
20.148 + String code = "package x.y.z;\n"
20.149 + + "import org.netbeans.api.html4j.OpenHTMLRegistration;\n"
20.150 + + "import org.openide.awt.ActionID;\n"
20.151 + + "public class X {\n"
20.152 + + " @ActionID(category=\"test\", id=\"test.id.at.x\")\n"
20.153 + + " @OpenHTMLRegistration(url=\"page.html\", displayName=\"X\")\n"
20.154 + + " static void someMethod() {\n"
20.155 + + " }\n"
20.156 + + "}\n";
20.157 +
20.158 + Compile c = Compile.create("page.html", html, code);
20.159 + assertFalse(c.getErrors().isEmpty(), "One error: " + c.getErrors());
20.160 + boolean ok = false;
20.161 + StringBuilder msgs = new StringBuilder();
20.162 + for (Diagnostic<? extends JavaFileObject> e : c.getErrors()) {
20.163 + String msg = e.getMessage(Locale.ENGLISH);
20.164 + if (msg.contains("needs to be public")) {
20.165 + ok = true;
20.166 + }
20.167 + msgs.append("\n").append(msg);
20.168 + }
20.169 + if (!ok) {
20.170 + fail("Should contain warning about public:" + msgs);
20.171 + }
20.172 + }
20.173 +
20.174 + @Test public void methodNeedsToBeInPublicClass() throws Exception {
20.175 + String html = "<html><body>"
20.176 + + "</body></html>";
20.177 + String code = "package x.y.z;\n"
20.178 + + "import org.netbeans.api.html4j.OpenHTMLRegistration;\n"
20.179 + + "import org.openide.awt.ActionID;\n"
20.180 + + "final class X {\n"
20.181 + + " @ActionID(category=\"test\", id=\"test.id.at.x\")\n"
20.182 + + " @OpenHTMLRegistration(url=\"page.html\", displayName=\"X\")\n"
20.183 + + " public static void someMethod() {\n"
20.184 + + " }\n"
20.185 + + "}\n";
20.186 +
20.187 + Compile c = Compile.create("page.html", html, code);
20.188 + assertFalse(c.getErrors().isEmpty(), "One error: " + c.getErrors());
20.189 + boolean ok = false;
20.190 + StringBuilder msgs = new StringBuilder();
20.191 + for (Diagnostic<? extends JavaFileObject> e : c.getErrors()) {
20.192 + String msg = e.getMessage(Locale.ENGLISH);
20.193 + if (msg.contains("needs to be public")) {
20.194 + ok = true;
20.195 + }
20.196 + msgs.append("\n").append(msg);
20.197 + }
20.198 + if (!ok) {
20.199 + fail("Should contain warning about public:" + msgs);
20.200 + }
20.201 + }
20.202 +
20.203 + @Test public void methodWithNoParamsIsOK() throws Exception {
20.204 + String html = "<html><body>"
20.205 + + "</body></html>";
20.206 + String code = "package x.y.z;\n"
20.207 + + "import org.netbeans.api.html4j.OpenHTMLRegistration;\n"
20.208 + + "import org.openide.awt.ActionID;\n"
20.209 + + "public class X {\n"
20.210 + + " @ActionID(category=\"test\", id=\"test.id.at.x\")\n"
20.211 + + " @OpenHTMLRegistration(url=\"page.html\", displayName=\"X\")\n"
20.212 + + " public static void someMethod(int x) {\n"
20.213 + + " }\n"
20.214 + + "}\n";
20.215 +
20.216 + Compile c = Compile.create("page.html", html, code);
20.217 + assertFalse(c.getErrors().isEmpty(), "One error: " + c.getErrors());
20.218 + boolean ok = false;
20.219 + StringBuilder msgs = new StringBuilder();
20.220 + for (Diagnostic<? extends JavaFileObject> e : c.getErrors()) {
20.221 + String msg = e.getMessage(Locale.ENGLISH);
20.222 + if (msg.contains("no arguments")) {
20.223 + ok = true;
20.224 + }
20.225 + msgs.append("\n").append(msg);
20.226 + }
20.227 + if (!ok) {
20.228 + fail("Should contain warning about arguments:" + msgs);
20.229 + }
20.230 + }
20.231 +}
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/api.html4j/test/unit/src/org/netbeans/api/html4j/OpenHTMLRegistrationTest.java Tue Sep 09 21:44:37 2014 +0200
21.3 @@ -0,0 +1,79 @@
21.4 +/**
21.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
21.6 + *
21.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
21.8 + *
21.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
21.10 + * Other names may be trademarks of their respective owners.
21.11 + *
21.12 + * The contents of this file are subject to the terms of either the GNU
21.13 + * General Public License Version 2 only ("GPL") or the Common
21.14 + * Development and Distribution License("CDDL") (collectively, the
21.15 + * "License"). You may not use this file except in compliance with the
21.16 + * License. You can obtain a copy of the License at
21.17 + * http://www.netbeans.org/cddl-gplv2.html
21.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
21.19 + * specific language governing permissions and limitations under the
21.20 + * License. When distributing the software, include this License Header
21.21 + * Notice in each file and include the License file at
21.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
21.23 + * particular file as subject to the "Classpath" exception as provided
21.24 + * by Oracle in the GPL Version 2 section of the License file that
21.25 + * accompanied this code. If applicable, add the following below the
21.26 + * License Header, with the fields enclosed by brackets [] replaced by
21.27 + * your own identifying information:
21.28 + * "Portions Copyrighted [year] [name of copyright owner]"
21.29 + *
21.30 + * Contributor(s):
21.31 + *
21.32 + * The Original Software is NetBeans. The Initial Developer of the Original
21.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
21.34 + *
21.35 + * If you wish your version of this file to be governed by only the CDDL
21.36 + * or only the GPL Version 2, indicate your decision by adding
21.37 + * "[Contributor] elects to include this software in this distribution
21.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
21.39 + * single choice of license, a recipient has the option to distribute
21.40 + * your version of this file under either the CDDL, the GPL Version 2 or
21.41 + * to extend the choice of license to its licensees as provided above.
21.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
21.43 + * Version 2 license, then the option applies only if the new code is
21.44 + * made subject to such option by the copyright holder.
21.45 + */
21.46 +package org.netbeans.api.html4j;
21.47 +
21.48 +import org.netbeans.api.html4j.OpenHTMLRegistration;
21.49 +import javax.swing.Action;
21.50 +import org.openide.awt.ActionID;
21.51 +import org.openide.filesystems.FileObject;
21.52 +import org.openide.filesystems.FileUtil;
21.53 +import static org.testng.Assert.*;
21.54 +import org.testng.annotations.Test;
21.55 +
21.56 +/**
21.57 + *
21.58 + * @author jtulach
21.59 + */
21.60 +public class OpenHTMLRegistrationTest {
21.61 +
21.62 + public OpenHTMLRegistrationTest() {
21.63 + }
21.64 +
21.65 + @ActionID(category = "Test", id="html.test")
21.66 + @OpenHTMLRegistration(displayName = "Open me!", iconBase = "x.png", url = "empty.html")
21.67 + public static void main() {
21.68 +
21.69 + }
21.70 +
21.71 + @Test public void verifyRegistered() {
21.72 + final String path = "Actions/Test/html-test.instance";
21.73 + FileObject fo = FileUtil.getConfigFile(path);
21.74 + assertNotNull(fo, "Registration found");
21.75 + Action a = FileUtil.getConfigObject(path, Action.class);
21.76 + assertNotNull(a, "Action found");
21.77 + assertEquals(a.getValue(Action.NAME), "Open me!");
21.78 +
21.79 + assertEquals(fo.getAttribute("class"), OpenHTMLRegistrationTest.class.getCanonicalName(), "Fully qualified name");
21.80 + assertEquals(fo.getAttribute("method"), "main");
21.81 + }
21.82 +}
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/api.html4j/test/unit/src/org/netbeans/api/html4j/empty.html Tue Sep 09 21:44:37 2014 +0200
22.3 @@ -0,0 +1,96 @@
22.4 +<!--
22.5 +
22.6 + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
22.7 +
22.8 + Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
22.9 +
22.10 + Oracle and Java are registered trademarks of Oracle and/or its affiliates.
22.11 + Other names may be trademarks of their respective owners.
22.12 +
22.13 + The contents of this file are subject to the terms of either the GNU
22.14 + General Public License Version 2 only ("GPL") or the Common
22.15 + Development and Distribution License("CDDL") (collectively, the
22.16 + "License"). You may not use this file except in compliance with the
22.17 + License. You can obtain a copy of the License at
22.18 + http://www.netbeans.org/cddl-gplv2.html
22.19 + or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
22.20 + specific language governing permissions and limitations under the
22.21 + License. When distributing the software, include this License Header
22.22 + Notice in each file and include the License file at
22.23 + nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
22.24 + particular file as subject to the "Classpath" exception as provided
22.25 + by Oracle in the GPL Version 2 section of the License file that
22.26 + accompanied this code. If applicable, add the following below the
22.27 + License Header, with the fields enclosed by brackets [] replaced by
22.28 + your own identifying information:
22.29 + "Portions Copyrighted [year] [name of copyright owner]"
22.30 +
22.31 + Contributor(s):
22.32 +
22.33 + The Original Software is NetBeans. The Initial Developer of the Original
22.34 + Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
22.35 +
22.36 + If you wish your version of this file to be governed by only the CDDL
22.37 + or only the GPL Version 2, indicate your decision by adding
22.38 + "[Contributor] elects to include this software in this distribution
22.39 + under the [CDDL or GPL Version 2] license." If you do not indicate a
22.40 + single choice of license, a recipient has the option to distribute
22.41 + your version of this file under either the CDDL, the GPL Version 2 or
22.42 + to extend the choice of license to its licensees as provided above.
22.43 + However, if you add GPL Version 2 code and therefore, elected the GPL
22.44 + Version 2 license, then the option applies only if the new code is
22.45 + made subject to such option by the copyright holder.
22.46 +
22.47 +-->
22.48 +<!DOCTYPE html>
22.49 +<!--
22.50 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
22.51 +
22.52 +Copyright 2014 Oracle and/or its affiliates. All rights reserved.
22.53 +
22.54 +Oracle and Java are registered trademarks of Oracle and/or its affiliates.
22.55 +Other names may be trademarks of their respective owners.
22.56 +
22.57 +The contents of this file are subject to the terms of either the GNU
22.58 +General Public License Version 2 only ("GPL") or the Common
22.59 +Development and Distribution License("CDDL") (collectively, the
22.60 +"License"). You may not use this file except in compliance with the
22.61 +License. You can obtain a copy of the License at
22.62 +http://www.netbeans.org/cddl-gplv2.html
22.63 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
22.64 +specific language governing permissions and limitations under the
22.65 +License. When distributing the software, include this License Header
22.66 +Notice in each file and include the License file at
22.67 +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
22.68 +particular file as subject to the "Classpath" exception as provided
22.69 +by Oracle in the GPL Version 2 section of the License file that
22.70 +accompanied this code. If applicable, add the following below the
22.71 +License Header, with the fields enclosed by brackets [] replaced by
22.72 +your own identifying information:
22.73 +"Portions Copyrighted [year] [name of copyright owner]"
22.74 +
22.75 +If you wish your version of this file to be governed by only the CDDL
22.76 +or only the GPL Version 2, indicate your decision by adding
22.77 +"[Contributor] elects to include this software in this distribution
22.78 +under the [CDDL or GPL Version 2] license." If you do not indicate a
22.79 +single choice of license, a recipient has the option to distribute
22.80 +your version of this file under either the CDDL, the GPL Version 2 or
22.81 +to extend the choice of license to its licensees as provided above.
22.82 +However, if you add GPL Version 2 code and therefore, elected the GPL
22.83 +Version 2 license, then the option applies only if the new code is
22.84 +made subject to such option by the copyright holder.
22.85 +
22.86 +Contributor(s):
22.87 +
22.88 +Portions Copyrighted 2014 Sun Microsystems, Inc.
22.89 +-->
22.90 +<html>
22.91 + <head>
22.92 + <title>TODO supply a title</title>
22.93 + <meta charset="UTF-8">
22.94 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
22.95 + </head>
22.96 + <body>
22.97 + <div>TODO write content</div>
22.98 + </body>
22.99 +</html>
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23.2 +++ b/api.html4j/test/unit/src/org/netbeans/modules/html4j/ComponentsTest.java Tue Sep 09 21:44:37 2014 +0200
23.3 @@ -0,0 +1,123 @@
23.4 +/*
23.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
23.6 + *
23.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
23.8 + *
23.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
23.10 + * Other names may be trademarks of their respective owners.
23.11 + *
23.12 + * The contents of this file are subject to the terms of either the GNU
23.13 + * General Public License Version 2 only ("GPL") or the Common
23.14 + * Development and Distribution License("CDDL") (collectively, the
23.15 + * "License"). You may not use this file except in compliance with the
23.16 + * License. You can obtain a copy of the License at
23.17 + * http://www.netbeans.org/cddl-gplv2.html
23.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
23.19 + * specific language governing permissions and limitations under the
23.20 + * License. When distributing the software, include this License Header
23.21 + * Notice in each file and include the License file at
23.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
23.23 + * particular file as subject to the "Classpath" exception as provided
23.24 + * by Oracle in the GPL Version 2 section of the License file that
23.25 + * accompanied this code. If applicable, add the following below the
23.26 + * License Header, with the fields enclosed by brackets [] replaced by
23.27 + * your own identifying information:
23.28 + * "Portions Copyrighted [year] [name of copyright owner]"
23.29 + *
23.30 + * If you wish your version of this file to be governed by only the CDDL
23.31 + * or only the GPL Version 2, indicate your decision by adding
23.32 + * "[Contributor] elects to include this software in this distribution
23.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
23.34 + * single choice of license, a recipient has the option to distribute
23.35 + * your version of this file under either the CDDL, the GPL Version 2 or
23.36 + * to extend the choice of license to its licensees as provided above.
23.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
23.38 + * Version 2 license, then the option applies only if the new code is
23.39 + * made subject to such option by the copyright holder.
23.40 + *
23.41 + * Contributor(s):
23.42 + *
23.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
23.44 + */
23.45 +package org.netbeans.modules.html4j;
23.46 +
23.47 +import java.net.URL;
23.48 +import java.net.URLStreamHandlerFactory;
23.49 +import java.util.concurrent.CountDownLatch;
23.50 +import javafx.application.Platform;
23.51 +import javafx.embed.swing.JFXPanel;
23.52 +import javafx.scene.Group;
23.53 +import javafx.scene.Node;
23.54 +import javafx.scene.Scene;
23.55 +import javax.swing.JComponent;
23.56 +import javax.swing.JFrame;
23.57 +import org.netbeans.api.html4j.HTMLComponent;
23.58 +import org.openide.util.Lookup;
23.59 +import static org.testng.Assert.*;
23.60 +import org.testng.annotations.BeforeClass;
23.61 +import org.testng.annotations.Test;
23.62 +
23.63 +/**
23.64 + *
23.65 + * @author Jaroslav Tulach
23.66 + */
23.67 +public class ComponentsTest {
23.68 + public ComponentsTest() {
23.69 + }
23.70 +
23.71 + @BeforeClass public void initNbResLoc() {
23.72 + URLStreamHandlerFactory f = Lookup.getDefault().lookup(URLStreamHandlerFactory.class);
23.73 + assertNotNull(f, "Factory found");
23.74 + URL.setURLStreamHandlerFactory(f);
23.75 + }
23.76 +
23.77 + @Test public void loadSwing() throws Exception {
23.78 + CountDownLatch cdl = new CountDownLatch(1);
23.79 + JComponent p = TestPages.getSwing(10, cdl);
23.80 + JFrame f = new JFrame();
23.81 + f.getContentPane().add(p);
23.82 + f.pack();
23.83 + f.setVisible(true);
23.84 + cdl.await();
23.85 + }
23.86 +
23.87 + @Test public void loadFX() throws Exception {
23.88 + final CountDownLatch cdl = new CountDownLatch(1);
23.89 + final CountDownLatch done = new CountDownLatch(1);
23.90 + final JFXPanel p = new JFXPanel();
23.91 + Platform.runLater(new Runnable() {
23.92 + @Override
23.93 + public void run() {
23.94 + Node wv = TestPages.getFX(10, cdl);
23.95 + Scene s = new Scene(new Group(wv));
23.96 + p.setScene(s);
23.97 + done.countDown();
23.98 + }
23.99 + });
23.100 + done.await();
23.101 + JFrame f = new JFrame();
23.102 + f.getContentPane().add(p);
23.103 + f.pack();
23.104 + f.setVisible(true);
23.105 + cdl.await();
23.106 + }
23.107 +
23.108 + @HTMLComponent(
23.109 + url = "simple.html", className = "TestPages",
23.110 + type = JComponent.class
23.111 + )
23.112 + static void getSwing(int param, CountDownLatch called) {
23.113 + assertEquals(param, 10, "Correct value passed in");
23.114 + called.countDown();
23.115 + }
23.116 +
23.117 + @HTMLComponent(
23.118 + url = "simple.html", className = "TestPages",
23.119 + type = Node.class
23.120 + )
23.121 + static void getFX(int param, CountDownLatch called) {
23.122 + assertEquals(param, 10, "Correct value passed in");
23.123 + called.countDown();
23.124 + }
23.125 +
23.126 +}
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/api.html4j/test/unit/src/org/netbeans/modules/html4j/DialogsTest.java Tue Sep 09 21:44:37 2014 +0200
24.3 @@ -0,0 +1,208 @@
24.4 +/*
24.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
24.6 + *
24.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
24.8 + *
24.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
24.10 + * Other names may be trademarks of their respective owners.
24.11 + *
24.12 + * The contents of this file are subject to the terms of either the GNU
24.13 + * General Public License Version 2 only ("GPL") or the Common
24.14 + * Development and Distribution License("CDDL") (collectively, the
24.15 + * "License"). You may not use this file except in compliance with the
24.16 + * License. You can obtain a copy of the License at
24.17 + * http://www.netbeans.org/cddl-gplv2.html
24.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
24.19 + * specific language governing permissions and limitations under the
24.20 + * License. When distributing the software, include this License Header
24.21 + * Notice in each file and include the License file at
24.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
24.23 + * particular file as subject to the "Classpath" exception as provided
24.24 + * by Oracle in the GPL Version 2 section of the License file that
24.25 + * accompanied this code. If applicable, add the following below the
24.26 + * License Header, with the fields enclosed by brackets [] replaced by
24.27 + * your own identifying information:
24.28 + * "Portions Copyrighted [year] [name of copyright owner]"
24.29 + *
24.30 + * If you wish your version of this file to be governed by only the CDDL
24.31 + * or only the GPL Version 2, indicate your decision by adding
24.32 + * "[Contributor] elects to include this software in this distribution
24.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
24.34 + * single choice of license, a recipient has the option to distribute
24.35 + * your version of this file under either the CDDL, the GPL Version 2 or
24.36 + * to extend the choice of license to its licensees as provided above.
24.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
24.38 + * Version 2 license, then the option applies only if the new code is
24.39 + * made subject to such option by the copyright holder.
24.40 + *
24.41 + * Contributor(s):
24.42 + *
24.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
24.44 + */
24.45 +package org.netbeans.modules.html4j;
24.46 +
24.47 +import java.awt.EventQueue;
24.48 +import java.net.URL;
24.49 +import java.util.concurrent.CountDownLatch;
24.50 +import javafx.application.Platform;
24.51 +import javafx.embed.swing.JFXPanel;
24.52 +import javafx.scene.Scene;
24.53 +import javafx.scene.web.WebView;
24.54 +import javax.swing.JButton;
24.55 +import javax.swing.JFrame;
24.56 +import net.java.html.BrwsrCtx;
24.57 +import net.java.html.boot.fx.FXBrowsers;
24.58 +import net.java.html.js.JavaScriptBody;
24.59 +import org.netbeans.api.html4j.HTMLDialog;
24.60 +import org.testng.annotations.BeforeClass;
24.61 +import org.testng.annotations.Test;
24.62 +import static org.testng.Assert.*;
24.63 +
24.64 +/**
24.65 + *
24.66 + * @author Jaroslav Tulach
24.67 + */
24.68 +public class DialogsTest {
24.69 + private static final CountDownLatch down = new CountDownLatch(1);
24.70 + private static BrwsrCtx ctx;
24.71 +
24.72 + public DialogsTest() {
24.73 + }
24.74 +
24.75 + @BeforeClass
24.76 + public static void initializeContext() throws Exception {
24.77 + final JFXPanel p = new JFXPanel();
24.78 + final URL u = DialogsTest.class.getResource("/org/netbeans/api/html4j/empty.html");
24.79 + Platform.runLater(new Runnable() {
24.80 + @Override
24.81 + public void run() {
24.82 + WebView v = new WebView();
24.83 + Scene s = new Scene(v);
24.84 + p.setScene(s);
24.85 + FXBrowsers.load(v, u, new Runnable() {
24.86 + @Override
24.87 + public void run() {
24.88 + ctx = BrwsrCtx.findDefault(DialogsTest.class);
24.89 + down.countDown();
24.90 + }
24.91 + }, null);
24.92 + }
24.93 + });
24.94 + down.await();
24.95 + JFrame f = new JFrame();
24.96 + f.getContentPane().add(p);
24.97 + f.pack();
24.98 + f.setVisible(true);
24.99 + }
24.100 +
24.101 + @Test public void parseButtons() throws Throwable {
24.102 + final Throwable[] ex = { null };
24.103 + final JButton[] buttons = { null, null };
24.104 + final CountDownLatch done = new CountDownLatch(1);
24.105 + ctx.execute(new Runnable() {
24.106 + @Override
24.107 + public void run() {
24.108 + try {
24.109 + String body =
24.110 + " <button>Normal button in a text</button>" +
24.111 + " <button hidden=true id='OK' disabled=true>Agree</button>" +
24.112 + " <button hidden=true id='Cancel'>Disagree</button>";
24.113 + setBody(body);
24.114 +
24.115 + JButton[] arr = Buttons.buttons();
24.116 + assertEquals(arr.length, 2, "Two buttons");
24.117 + assertEquals(arr[0].getName(), "OK", "id of 1st button parsed");
24.118 + assertEquals(arr[1].getName(), "Cancel", "id of 2nd button parsed");
24.119 + assertEquals(arr[0].getText(), "Agree", "text of 1st button parsed");
24.120 + assertEquals(arr[1].getText(), "Disagree", "text of 2nd button parsed");
24.121 +
24.122 + assertFalse(arr[0].isEnabled(), "OK is disabled");
24.123 + assertTrue(arr[1].isEnabled(), "Cancel is enabled");
24.124 +
24.125 + setDisabled("OK", false);
24.126 +
24.127 + String prev = setText("OK", "Fine");
24.128 + assertEquals(prev, "Agree");
24.129 +
24.130 + buttons[0] = arr[0];
24.131 + buttons[1] = arr[1];
24.132 + } catch (Throwable t) {
24.133 + ex[0] = t;
24.134 + } finally {
24.135 + done.countDown();
24.136 + }
24.137 + }
24.138 + });
24.139 + done.await();
24.140 + if (ex[0] != null) {
24.141 + throw ex[0];
24.142 + }
24.143 + EventQueue.invokeAndWait(new Runnable() {
24.144 + @Override
24.145 + public void run() {
24.146 + assertEquals(buttons[0].getText(), "Fine", "Text of OK changed");
24.147 + assertTrue(buttons[0].isEnabled(), "OK is now enabled");
24.148 + }
24.149 + });
24.150 + }
24.151 +
24.152 + @Test public void noDefinedButtonsMeanOKCancel() throws Throwable {
24.153 + final Throwable[] ex = { null };
24.154 + final CountDownLatch done = new CountDownLatch(1);
24.155 + ctx.execute(new Runnable() {
24.156 + @Override
24.157 + public void run() {
24.158 + try {
24.159 + String body =
24.160 + " <button>Normal button in a text</button>" +
24.161 +// no dialog buttons defined:
24.162 +// " <button hidden=true id='OK' disabled=true>Agree</button>" +
24.163 +// " <button hidden=true id='Cancel'>Disagree</button>" +
24.164 + "";
24.165 + setBody(body);
24.166 +
24.167 + JButton[] arr = Buttons.buttons();
24.168 + assertEquals(arr.length, 2, "Two buttons");
24.169 + assertEquals(arr[0].getName(), "OK", "id of 1st default button");
24.170 + assertEquals(arr[1].getName(), null, "id of 2nd default button");
24.171 +
24.172 + assertTrue(arr[0].isEnabled(), "OK is enabled");
24.173 + assertTrue(arr[1].isEnabled(), "Cancel is enabled");
24.174 + } catch (Throwable t) {
24.175 + ex[0] = t;
24.176 + } finally {
24.177 + done.countDown();
24.178 + }
24.179 + }
24.180 + });
24.181 + done.await();
24.182 + if (ex[0] != null) {
24.183 + throw ex[0];
24.184 + }
24.185 + }
24.186 +
24.187 + @JavaScriptBody(args = "b", body = "window.document.getElementsByTagName('body')[0].innerHTML = b;")
24.188 + private static native void setBody(String b);
24.189 +
24.190 + @JavaScriptBody(args = { "id", "state" }, body = "window.document.getElementById(id).disabled = state;")
24.191 + private static native void setDisabled(String id, boolean state);
24.192 +
24.193 + @JavaScriptBody(args = { "id", "t" }, body = ""
24.194 + + "var prev = window.document.getElementById(id).innerHTML;\n"
24.195 + + "window.document.getElementById(id).innerHTML = t;\n"
24.196 + + "return prev;\n"
24.197 + )
24.198 + private static native String setText(String id, String t);
24.199 +
24.200 +
24.201 + @HTMLDialog(url = "simple.html", className = "TestPages")
24.202 + static void showDialog() {
24.203 + String ret = TestPages.showDialog();
24.204 + }
24.205 +
24.206 + @HTMLDialog(url = "http://www.netbeans.org", className = "TestPages")
24.207 + static void showDialog(int x, String[] y, DialogsTest t) {
24.208 + String ret = TestPages.showDialog(10, y, null);
24.209 + }
24.210 +
24.211 +}
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/api.html4j/test/unit/src/org/netbeans/modules/html4j/HtmlComponentTest.java Tue Sep 09 21:44:37 2014 +0200
25.3 @@ -0,0 +1,179 @@
25.4 +/**
25.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
25.6 + *
25.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
25.8 + *
25.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
25.10 + * Other names may be trademarks of their respective owners.
25.11 + *
25.12 + * The contents of this file are subject to the terms of either the GNU
25.13 + * General Public License Version 2 only ("GPL") or the Common
25.14 + * Development and Distribution License("CDDL") (collectively, the
25.15 + * "License"). You may not use this file except in compliance with the
25.16 + * License. You can obtain a copy of the License at
25.17 + * http://www.netbeans.org/cddl-gplv2.html
25.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
25.19 + * specific language governing permissions and limitations under the
25.20 + * License. When distributing the software, include this License Header
25.21 + * Notice in each file and include the License file at
25.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
25.23 + * particular file as subject to the "Classpath" exception as provided
25.24 + * by Oracle in the GPL Version 2 section of the License file that
25.25 + * accompanied this code. If applicable, add the following below the
25.26 + * License Header, with the fields enclosed by brackets [] replaced by
25.27 + * your own identifying information:
25.28 + * "Portions Copyrighted [year] [name of copyright owner]"
25.29 + *
25.30 + * Contributor(s):
25.31 + *
25.32 + * The Original Software is NetBeans. The Initial Developer of the Original
25.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
25.34 + *
25.35 + * If you wish your version of this file to be governed by only the CDDL
25.36 + * or only the GPL Version 2, indicate your decision by adding
25.37 + * "[Contributor] elects to include this software in this distribution
25.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
25.39 + * single choice of license, a recipient has the option to distribute
25.40 + * your version of this file under either the CDDL, the GPL Version 2 or
25.41 + * to extend the choice of license to its licensees as provided above.
25.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
25.43 + * Version 2 license, then the option applies only if the new code is
25.44 + * made subject to such option by the copyright holder.
25.45 + */
25.46 +package org.netbeans.modules.html4j;
25.47 +
25.48 +import java.io.Closeable;
25.49 +import java.io.IOException;
25.50 +import java.net.URL;
25.51 +import java.util.concurrent.CountDownLatch;
25.52 +import javafx.application.Platform;
25.53 +import net.java.html.BrwsrCtx;
25.54 +import net.java.html.json.Model;
25.55 +import net.java.html.json.ModelOperation;
25.56 +import net.java.html.json.Property;
25.57 +import org.openide.util.Lookup;
25.58 +import static org.testng.Assert.*;
25.59 +import org.testng.annotations.BeforeClass;
25.60 +import org.testng.annotations.Test;
25.61 +
25.62 +/**
25.63 + * @author Jaroslav Tulach
25.64 + */
25.65 +@Model(className = "CheckContext", properties = {
25.66 + @Property(name = "context", type = String.class, array = true)
25.67 +})
25.68 +public class HtmlComponentTest {
25.69 + private static final CountDownLatch down = new CountDownLatch(1);
25.70 + private static Lookup lkp;
25.71 + private static BrwsrCtx ctx;
25.72 +
25.73 + public HtmlComponentTest() {
25.74 + }
25.75 +
25.76 + @BeforeClass public static void initializeContext() throws Exception {
25.77 + final HtmlComponent tc = new HtmlComponent();
25.78 + final URL u = HtmlComponent.class.getResource("/org/netbeans/api/html4j/empty.html");
25.79 + Platform.runLater(new Runnable() {
25.80 + @Override
25.81 + public void run() {
25.82 + tc.loadFX(u, HtmlComponentTest.class, "onLoad");
25.83 + }
25.84 + });
25.85 + lkp = tc.getLookup();
25.86 + }
25.87 +
25.88 + public static Object onLoad() {
25.89 + ctx = BrwsrCtx.findDefault(HtmlComponentTest.class);
25.90 + return new CheckContext().applyBindings();
25.91 + }
25.92 +
25.93 + @Test public void updateContext() throws Exception {
25.94 + CheckContext cc = assertContext();
25.95 +
25.96 + assertNull(lkp.lookup(DefCnstr.class), "No instance yet");
25.97 + cc.addContext(DefCnstr.class.getName());
25.98 + waitFX();
25.99 + assertNotNull(lkp.lookup(DefCnstr.class), "Instance added");
25.100 + cc.clearContext();
25.101 + waitFX();
25.102 + assertNull(lkp.lookup(DefCnstr.class), "Disappeared again");
25.103 + }
25.104 +
25.105 + @Test public void closedWhenRemoved() throws Exception {
25.106 + CheckContext cc = assertContext();
25.107 +
25.108 + cc.addContext(ClsblCnstr.class.getName());
25.109 + waitFX();
25.110 + final ClsblCnstr inst = lkp.lookup(ClsblCnstr.class);
25.111 + assertNotNull(inst, "Instance added");
25.112 + assertFalse(inst.closed, "No close called yet");
25.113 + cc.clearContext();
25.114 + waitFX();
25.115 + assertNull(lkp.lookup(ClsblCnstr.class), "Disappeared");
25.116 + assertTrue(inst.closed, "Close has been called on removal");
25.117 + }
25.118 +
25.119 + @Test public void updateContextWithNonDefaultCnstr() throws Exception {
25.120 + CheckContext cc = assertContext();
25.121 +
25.122 + assertNull(lkp.lookup(MdlCnstr.class), "No instance yet");
25.123 + cc.addContext(MdlCnstr.class.getName());
25.124 + waitFX();
25.125 + final MdlCnstr mdl = lkp.lookup(MdlCnstr.class);
25.126 + assertNotNull(mdl, "Instance added");
25.127 + assertEquals(mdl.cc, cc, "Context is passed into the constructor");
25.128 + cc.clearContext();
25.129 + waitFX();
25.130 + assertNull(lkp.lookup(MdlCnstr.class), "Disappeared again");
25.131 + }
25.132 +
25.133 + private CheckContext assertContext() throws InterruptedException {
25.134 + CheckContext cc = null;
25.135 + for (int i = 0; i < 100; i++) {
25.136 + cc = lkp.lookup(CheckContext.class);
25.137 + if (cc != null) {
25.138 + break;
25.139 + }
25.140 + Thread.sleep(100);
25.141 + }
25.142 + assertNotNull(cc, "Value returned from onLoad is in the lookup");
25.143 + return cc;
25.144 + }
25.145 +
25.146 + @ModelOperation static void addContext(CheckContext cc, String name) {
25.147 + cc.getContext().add(name);
25.148 + }
25.149 +
25.150 + @ModelOperation static void clearContext(CheckContext cc) {
25.151 + cc.getContext().clear();
25.152 + }
25.153 +
25.154 + private static void waitFX() throws Exception {
25.155 + final CountDownLatch down = new CountDownLatch(1);
25.156 + Platform.runLater(new Runnable() {
25.157 + @Override
25.158 + public void run() {
25.159 + down.countDown();
25.160 + }
25.161 + });
25.162 + down.await();
25.163 + }
25.164 +
25.165 + public static final class DefCnstr {
25.166 + }
25.167 + public static final class MdlCnstr {
25.168 + final CheckContext cc;
25.169 +
25.170 + public MdlCnstr(CheckContext cc) {
25.171 + this.cc = cc;
25.172 + }
25.173 + }
25.174 + public static final class ClsblCnstr implements Closeable {
25.175 + boolean closed;
25.176 +
25.177 + @Override
25.178 + public void close() throws IOException {
25.179 + this.closed = true;
25.180 + }
25.181 + }
25.182 +}
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/api.html4j/test/unit/src/org/netbeans/modules/html4j/simple.html Tue Sep 09 21:44:37 2014 +0200
26.3 @@ -0,0 +1,51 @@
26.4 +<!DOCTYPE html>
26.5 +<!--
26.6 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
26.7 +
26.8 +Copyright 2014 Oracle and/or its affiliates. All rights reserved.
26.9 +
26.10 +Oracle and Java are registered trademarks of Oracle and/or its affiliates.
26.11 +Other names may be trademarks of their respective owners.
26.12 +
26.13 +The contents of this file are subject to the terms of either the GNU
26.14 +General Public License Version 2 only ("GPL") or the Common
26.15 +Development and Distribution License("CDDL") (collectively, the
26.16 +"License"). You may not use this file except in compliance with the
26.17 +License. You can obtain a copy of the License at
26.18 +http://www.netbeans.org/cddl-gplv2.html
26.19 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
26.20 +specific language governing permissions and limitations under the
26.21 +License. When distributing the software, include this License Header
26.22 +Notice in each file and include the License file at
26.23 +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
26.24 +particular file as subject to the "Classpath" exception as provided
26.25 +by Oracle in the GPL Version 2 section of the License file that
26.26 +accompanied this code. If applicable, add the following below the
26.27 +License Header, with the fields enclosed by brackets [] replaced by
26.28 +your own identifying information:
26.29 +"Portions Copyrighted [year] [name of copyright owner]"
26.30 +
26.31 +If you wish your version of this file to be governed by only the CDDL
26.32 +or only the GPL Version 2, indicate your decision by adding
26.33 +"[Contributor] elects to include this software in this distribution
26.34 +under the [CDDL or GPL Version 2] license." If you do not indicate a
26.35 +single choice of license, a recipient has the option to distribute
26.36 +your version of this file under either the CDDL, the GPL Version 2 or
26.37 +to extend the choice of license to its licensees as provided above.
26.38 +However, if you add GPL Version 2 code and therefore, elected the GPL
26.39 +Version 2 license, then the option applies only if the new code is
26.40 +made subject to such option by the copyright holder.
26.41 +
26.42 +Contributor(s):
26.43 +
26.44 +Portions Copyrighted 2014 Sun Microsystems, Inc.
26.45 +-->
26.46 +<html>
26.47 + <head>
26.48 + <title>Empty</title>
26.49 + <meta charset="UTF-8">
26.50 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
26.51 + </head>
26.52 + <body>
26.53 + </body>
26.54 +</html>
27.1 --- a/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java Tue Sep 09 13:59:54 2014 +0000
27.2 +++ b/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java Tue Sep 09 21:44:37 2014 +0200
27.3 @@ -957,6 +957,7 @@
27.4 //"Templates/GUIForms/JPanel.java", // NOI18N
27.5 "Templates/JUnit/SimpleJUnitTest.java", // NOI18N
27.6 "Templates/" + UIUtil.TEMPLATE_FOLDER + "/" + UIUtil.TEMPLATE_ACTION_ID,
27.7 + "Templates/" + UIUtil.TEMPLATE_FOLDER + "/newHTML",
27.8 "Templates/" + UIUtil.TEMPLATE_FOLDER + "/" + UIUtil.TEMPLATE_WINDOW_ID,
27.9 //"Templates/Other/properties.properties", // NOI18N
27.10 };
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/build.xml Tue Sep 09 21:44:37 2014 +0200
28.3 @@ -0,0 +1,8 @@
28.4 +<?xml version="1.0" encoding="UTF-8"?>
28.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
28.6 +<!-- for some information on what you could do (e.g. targets to override). -->
28.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
28.8 +<project name="org.netbeans.test.html4j" default="netbeans" basedir=".">
28.9 + <description>Builds, tests, and runs the project org.netbeans.test.html4j.</description>
28.10 + <import file="nbproject/build-impl.xml"/>
28.11 +</project>
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/manifest.mf Tue Sep 09 21:44:37 2014 +0200
29.3 @@ -0,0 +1,5 @@
29.4 +Manifest-Version: 1.0
29.5 +OpenIDE-Module: org.netbeans.test.html4j
29.6 +OpenIDE-Module-Localizing-Bundle: org/netbeans/test/html4j/Bundle.properties
29.7 +OpenIDE-Module-Specification-Version: 1.0
29.8 +
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/nbproject/build-impl.xml Tue Sep 09 21:44:37 2014 +0200
30.3 @@ -0,0 +1,42 @@
30.4 +<?xml version="1.0" encoding="UTF-8"?>
30.5 +<!--
30.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
30.7 +*** EDIT ../build.xml INSTEAD ***
30.8 +-->
30.9 +<project name="org.netbeans.html4j-impl" basedir="..">
30.10 + <fail message="Please build using Ant 1.7.1 or higher.">
30.11 + <condition>
30.12 + <not>
30.13 + <antversion atleast="1.7.1"/>
30.14 + </not>
30.15 + </condition>
30.16 + </fail>
30.17 + <property file="nbproject/private/platform-private.properties"/>
30.18 + <property file="nbproject/platform.properties"/>
30.19 + <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
30.20 + <attribute name="name"/>
30.21 + <attribute name="value"/>
30.22 + <sequential>
30.23 + <property name="@{name}" value="${@{value}}"/>
30.24 + </sequential>
30.25 + </macrodef>
30.26 + <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
30.27 + <attribute name="property"/>
30.28 + <attribute name="value"/>
30.29 + <sequential>
30.30 + <property name="@{property}" value="@{value}"/>
30.31 + </sequential>
30.32 + </macrodef>
30.33 + <property file="${user.properties.file}"/>
30.34 + <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
30.35 + <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
30.36 + <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
30.37 + <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
30.38 + <condition>
30.39 + <not>
30.40 + <contains string="${cluster.path.evaluated}" substring="platform"/>
30.41 + </not>
30.42 + </condition>
30.43 + </fail>
30.44 + <import file="${harness.dir}/build.xml"/>
30.45 +</project>
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
31.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/nbproject/genfiles.properties Tue Sep 09 21:44:37 2014 +0200
31.3 @@ -0,0 +1,8 @@
31.4 +build.xml.data.CRC32=c1e38ef0
31.5 +build.xml.script.CRC32=929f7de6
31.6 +build.xml.stylesheet.CRC32=a56c6a5b@2.66.1
31.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
31.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
31.9 +nbproject/build-impl.xml.data.CRC32=c1e38ef0
31.10 +nbproject/build-impl.xml.script.CRC32=ed781f5b
31.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.66.1
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
32.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/nbproject/platform.properties Tue Sep 09 21:44:37 2014 +0200
32.3 @@ -0,0 +1,23 @@
32.4 +cluster.path=\
32.5 + ${nbplatform.active.dir}/apisupport:\
32.6 + ${nbplatform.active.dir}/cnd:\
32.7 + ${nbplatform.active.dir}/dlight:\
32.8 + ${nbplatform.active.dir}/enterprise:\
32.9 + ${nbplatform.active.dir}/ergonomics:\
32.10 + ${nbplatform.active.dir}/extide:\
32.11 + ${nbplatform.active.dir}/extra:\
32.12 + ${nbplatform.active.dir}/groovy:\
32.13 + ${nbplatform.active.dir}/harness:\
32.14 + ${nbplatform.active.dir}/ide:\
32.15 + ${nbplatform.active.dir}/java:\
32.16 + ${nbplatform.active.dir}/javacard:\
32.17 + ${nbplatform.active.dir}/javafx:\
32.18 + ${nbplatform.active.dir}/mobility:\
32.19 + ${nbplatform.active.dir}/nb:\
32.20 + ${nbplatform.active.dir}/php:\
32.21 + ${nbplatform.active.dir}/platform:\
32.22 + ${nbplatform.active.dir}/profiler:\
32.23 + ${nbplatform.active.dir}/webcommon:\
32.24 + ${nbplatform.active.dir}/websvccommon
32.25 +nbjdk.active=default
32.26 +nbplatform.active=default
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
33.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
33.3 @@ -0,0 +1,2 @@
33.4 +javac.source=1.6
33.5 +javac.compilerargs=-Xlint -Xlint:-serial
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
34.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
34.3 @@ -0,0 +1,121 @@
34.4 +<?xml version="1.0" encoding="UTF-8"?>
34.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
34.6 + <type>org.netbeans.modules.apisupport.project</type>
34.7 + <configuration>
34.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
34.9 + <code-name-base>org.netbeans.test.html4j</code-name-base>
34.10 + <standalone/>
34.11 + <module-dependencies>
34.12 + <dependency>
34.13 + <code-name-base>net.java.html.json</code-name-base>
34.14 + <build-prerequisite/>
34.15 + <compile-dependency/>
34.16 + <run-dependency/>
34.17 + </dependency>
34.18 + <dependency>
34.19 + <code-name-base>net.java.html.boot</code-name-base>
34.20 + <build-prerequisite/>
34.21 + <compile-dependency/>
34.22 + <run-dependency/>
34.23 + </dependency>
34.24 + <dependency>
34.25 + <code-name-base>net.java.html</code-name-base>
34.26 + <build-prerequisite/>
34.27 + <compile-dependency/>
34.28 + <run-dependency/>
34.29 + </dependency>
34.30 + <dependency>
34.31 + <code-name-base>org.netbeans.core.multiview</code-name-base>
34.32 + <build-prerequisite/>
34.33 + <compile-dependency/>
34.34 + <run-dependency>
34.35 + <release-version>1</release-version>
34.36 + <specification-version>1.39.2</specification-version>
34.37 + </run-dependency>
34.38 + </dependency>
34.39 + <dependency>
34.40 + <code-name-base>org.openide.awt</code-name-base>
34.41 + <build-prerequisite/>
34.42 + <compile-dependency/>
34.43 + <run-dependency>
34.44 + <specification-version>7.61.2</specification-version>
34.45 + </run-dependency>
34.46 + </dependency>
34.47 + <dependency>
34.48 + <code-name-base>org.openide.dialogs</code-name-base>
34.49 + <build-prerequisite/>
34.50 + <compile-dependency/>
34.51 + <run-dependency>
34.52 + <specification-version>7.36.1</specification-version>
34.53 + </run-dependency>
34.54 + </dependency>
34.55 + <dependency>
34.56 + <code-name-base>org.openide.filesystems</code-name-base>
34.57 + <build-prerequisite/>
34.58 + <compile-dependency/>
34.59 + <run-dependency>
34.60 + <specification-version>8.10.1</specification-version>
34.61 + </run-dependency>
34.62 + </dependency>
34.63 + <dependency>
34.64 + <code-name-base>org.openide.loaders</code-name-base>
34.65 + <build-prerequisite/>
34.66 + <compile-dependency/>
34.67 + <run-dependency>
34.68 + <specification-version>7.56.2</specification-version>
34.69 + </run-dependency>
34.70 + </dependency>
34.71 + <dependency>
34.72 + <code-name-base>org.openide.nodes</code-name-base>
34.73 + <build-prerequisite/>
34.74 + <compile-dependency/>
34.75 + <run-dependency>
34.76 + <specification-version>7.38.1</specification-version>
34.77 + </run-dependency>
34.78 + </dependency>
34.79 + <dependency>
34.80 + <code-name-base>org.openide.text</code-name-base>
34.81 + <build-prerequisite/>
34.82 + <compile-dependency/>
34.83 + <run-dependency>
34.84 + <specification-version>6.61.1</specification-version>
34.85 + </run-dependency>
34.86 + </dependency>
34.87 + <dependency>
34.88 + <code-name-base>org.openide.util</code-name-base>
34.89 + <build-prerequisite/>
34.90 + <compile-dependency/>
34.91 + <run-dependency>
34.92 + <specification-version>8.37.1</specification-version>
34.93 + </run-dependency>
34.94 + </dependency>
34.95 + <dependency>
34.96 + <code-name-base>org.openide.util.lookup</code-name-base>
34.97 + <build-prerequisite/>
34.98 + <compile-dependency/>
34.99 + <run-dependency>
34.100 + <specification-version>8.24.1</specification-version>
34.101 + </run-dependency>
34.102 + </dependency>
34.103 + <dependency>
34.104 + <code-name-base>org.openide.windows</code-name-base>
34.105 + <build-prerequisite/>
34.106 + <compile-dependency/>
34.107 + <run-dependency>
34.108 + <specification-version>6.70.1</specification-version>
34.109 + </run-dependency>
34.110 + </dependency>
34.111 + </module-dependencies>
34.112 + <test-dependencies>
34.113 + <test-type>
34.114 + <name>unit</name>
34.115 + <test-dependency>
34.116 + <code-name-base>org.netbeans.libs.testng</code-name-base>
34.117 + <compile-dependency/>
34.118 + </test-dependency>
34.119 + </test-type>
34.120 + </test-dependencies>
34.121 + <public-packages/>
34.122 + </data>
34.123 + </configuration>
34.124 +</project>
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
35.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/src/org/netbeans/test/html4j/Bundle.properties Tue Sep 09 21:44:37 2014 +0200
35.3 @@ -0,0 +1,44 @@
35.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
35.5 +#
35.6 +# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
35.7 +#
35.8 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
35.9 +# Other names may be trademarks of their respective owners.
35.10 +#
35.11 +# The contents of this file are subject to the terms of either the GNU
35.12 +# General Public License Version 2 only ("GPL") or the Common
35.13 +# Development and Distribution License("CDDL") (collectively, the
35.14 +# "License"). You may not use this file except in compliance with the
35.15 +# License. You can obtain a copy of the License at
35.16 +# http://www.netbeans.org/cddl-gplv2.html
35.17 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
35.18 +# specific language governing permissions and limitations under the
35.19 +# License. When distributing the software, include this License Header
35.20 +# Notice in each file and include the License file at
35.21 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
35.22 +# particular file as subject to the "Classpath" exception as provided
35.23 +# by Oracle in the GPL Version 2 section of the License file that
35.24 +# accompanied this code. If applicable, add the following below the
35.25 +# License Header, with the fields enclosed by brackets [] replaced by
35.26 +# your own identifying information:
35.27 +# "Portions Copyrighted [year] [name of copyright owner]"
35.28 +#
35.29 +# Contributor(s):
35.30 +#
35.31 +# The Original Software is NetBeans. The Initial Developer of the Original
35.32 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
35.33 +# Microsystems, Inc. All Rights Reserved.
35.34 +#
35.35 +# If you wish your version of this file to be governed by only the CDDL
35.36 +# or only the GPL Version 2, indicate your decision by adding
35.37 +# "[Contributor] elects to include this software in this distribution
35.38 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
35.39 +# single choice of license, a recipient has the option to distribute
35.40 +# your version of this file under either the CDDL, the GPL Version 2 or
35.41 +# to extend the choice of license to its licensees as provided above.
35.42 +# However, if you add GPL Version 2 code and therefore, elected the GPL
35.43 +# Version 2 license, then the option applies only if the new code is
35.44 +# made subject to such option by the copyright holder.
35.45 +
35.46 +# manifest
35.47 +OpenIDE-Module-Name=Use HTML4J
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/src/org/netbeans/test/html4j/UseJSB.java Tue Sep 09 21:44:37 2014 +0200
36.3 @@ -0,0 +1,50 @@
36.4 +/*
36.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
36.6 + *
36.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
36.8 + *
36.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
36.10 + * Other names may be trademarks of their respective owners.
36.11 + *
36.12 + * The contents of this file are subject to the terms of either the GNU
36.13 + * General Public License Version 2 only ("GPL") or the Common
36.14 + * Development and Distribution License("CDDL") (collectively, the
36.15 + * "License"). You may not use this file except in compliance with the
36.16 + * License. You can obtain a copy of the License at
36.17 + * http://www.netbeans.org/cddl-gplv2.html
36.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
36.19 + * specific language governing permissions and limitations under the
36.20 + * License. When distributing the software, include this License Header
36.21 + * Notice in each file and include the License file at
36.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
36.23 + * particular file as subject to the "Classpath" exception as provided
36.24 + * by Oracle in the GPL Version 2 section of the License file that
36.25 + * accompanied this code. If applicable, add the following below the
36.26 + * License Header, with the fields enclosed by brackets [] replaced by
36.27 + * your own identifying information:
36.28 + * "Portions Copyrighted [year] [name of copyright owner]"
36.29 + *
36.30 + * If you wish your version of this file to be governed by only the CDDL
36.31 + * or only the GPL Version 2, indicate your decision by adding
36.32 + * "[Contributor] elects to include this software in this distribution
36.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
36.34 + * single choice of license, a recipient has the option to distribute
36.35 + * your version of this file under either the CDDL, the GPL Version 2 or
36.36 + * to extend the choice of license to its licensees as provided above.
36.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
36.38 + * Version 2 license, then the option applies only if the new code is
36.39 + * made subject to such option by the copyright holder.
36.40 + *
36.41 + * Contributor(s):
36.42 + *
36.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
36.44 + */
36.45 +
36.46 +package org.netbeans.test.html4j;
36.47 +
36.48 +import net.java.html.js.JavaScriptBody;
36.49 +
36.50 +public class UseJSB {
36.51 + @JavaScriptBody(args = { "x", "y" }, body = "return x + y;")
36.52 + public static native int plus(int x, int y);
36.53 +}
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37.2 +++ b/apisupport.ant/test/unit/data/example-external-projects/html4j/test/unit/src/org/netbeans/test/html4j/UseJSBTest.java Tue Sep 09 21:44:37 2014 +0200
37.3 @@ -0,0 +1,61 @@
37.4 +/*
37.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
37.6 + *
37.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
37.8 + *
37.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
37.10 + * Other names may be trademarks of their respective owners.
37.11 + *
37.12 + * The contents of this file are subject to the terms of either the GNU
37.13 + * General Public License Version 2 only ("GPL") or the Common
37.14 + * Development and Distribution License("CDDL") (collectively, the
37.15 + * "License"). You may not use this file except in compliance with the
37.16 + * License. You can obtain a copy of the License at
37.17 + * http://www.netbeans.org/cddl-gplv2.html
37.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
37.19 + * specific language governing permissions and limitations under the
37.20 + * License. When distributing the software, include this License Header
37.21 + * Notice in each file and include the License file at
37.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
37.23 + * particular file as subject to the "Classpath" exception as provided
37.24 + * by Oracle in the GPL Version 2 section of the License file that
37.25 + * accompanied this code. If applicable, add the following below the
37.26 + * License Header, with the fields enclosed by brackets [] replaced by
37.27 + * your own identifying information:
37.28 + * "Portions Copyrighted [year] [name of copyright owner]"
37.29 + *
37.30 + * If you wish your version of this file to be governed by only the CDDL
37.31 + * or only the GPL Version 2, indicate your decision by adding
37.32 + * "[Contributor] elects to include this software in this distribution
37.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
37.34 + * single choice of license, a recipient has the option to distribute
37.35 + * your version of this file under either the CDDL, the GPL Version 2 or
37.36 + * to extend the choice of license to its licensees as provided above.
37.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
37.38 + * Version 2 license, then the option applies only if the new code is
37.39 + * made subject to such option by the copyright holder.
37.40 + *
37.41 + * Contributor(s):
37.42 + *
37.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
37.44 + */
37.45 +
37.46 +package org.netbeans.test.html4j;
37.47 +
37.48 +import static org.testng.Assert.*;
37.49 +import org.testng.annotations.Test;
37.50 +
37.51 +/**
37.52 + *
37.53 + * @author Jaroslav Tulach
37.54 + */
37.55 +public class UseJSBTest {
37.56 +
37.57 + public UseJSBTest() {
37.58 + }
37.59 +
37.60 + @Test public void testPlus() {
37.61 + assertEquals(UseJSB.plus(40, 2), 42, "Meaning of everything");
37.62 + }
37.63 +
37.64 +}
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
38.2 +++ b/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/UseHtml4JavaTest.java Tue Sep 09 21:44:37 2014 +0200
38.3 @@ -0,0 +1,99 @@
38.4 +/*
38.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
38.6 + *
38.7 + * Copyright 2014 Oracle and/or its affiliates. All rights reserved.
38.8 + *
38.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
38.10 + * Other names may be trademarks of their respective owners.
38.11 + *
38.12 + * The contents of this file are subject to the terms of either the GNU
38.13 + * General Public License Version 2 only ("GPL") or the Common
38.14 + * Development and Distribution License("CDDL") (collectively, the
38.15 + * "License"). You may not use this file except in compliance with the
38.16 + * License. You can obtain a copy of the License at
38.17 + * http://www.netbeans.org/cddl-gplv2.html
38.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
38.19 + * specific language governing permissions and limitations under the
38.20 + * License. When distributing the software, include this License Header
38.21 + * Notice in each file and include the License file at
38.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
38.23 + * particular file as subject to the "Classpath" exception as provided
38.24 + * by Oracle in the GPL Version 2 section of the License file that
38.25 + * accompanied this code. If applicable, add the following below the
38.26 + * License Header, with the fields enclosed by brackets [] replaced by
38.27 + * your own identifying information:
38.28 + * "Portions Copyrighted [year] [name of copyright owner]"
38.29 + *
38.30 + * If you wish your version of this file to be governed by only the CDDL
38.31 + * or only the GPL Version 2, indicate your decision by adding
38.32 + * "[Contributor] elects to include this software in this distribution
38.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
38.34 + * single choice of license, a recipient has the option to distribute
38.35 + * your version of this file under either the CDDL, the GPL Version 2 or
38.36 + * to extend the choice of license to its licensees as provided above.
38.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
38.38 + * Version 2 license, then the option applies only if the new code is
38.39 + * made subject to such option by the copyright holder.
38.40 + *
38.41 + * Contributor(s):
38.42 + *
38.43 + * Portions Copyrighted 2014 Sun Microsystems, Inc.
38.44 + */
38.45 +package org.netbeans.modules.apisupport.project;
38.46 +
38.47 +import java.io.File;
38.48 +import static junit.framework.Assert.assertNotNull;
38.49 +import org.apache.tools.ant.module.api.support.ActionUtils;
38.50 +import org.netbeans.api.project.Project;
38.51 +import org.netbeans.api.project.ProjectManager;
38.52 +import org.openide.DialogDescriptor;
38.53 +import org.openide.DialogDisplayer;
38.54 +import org.openide.execution.ExecutorTask;
38.55 +import org.openide.filesystems.FileObject;
38.56 +import org.openide.filesystems.FileUtil;
38.57 +import org.openide.util.Lookup;
38.58 +
38.59 +/**
38.60 + *
38.61 + * @author Jaroslav Tulach <jtulach@netbeans.org>
38.62 + */
38.63 +public class UseHtml4JavaTest extends TestBase {
38.64 + static {
38.65 + System.setProperty("org.netbeans.core.startup.ModuleSystem.CULPRIT", "true");
38.66 + }
38.67 +
38.68 + private FileObject dir;
38.69 + public UseHtml4JavaTest(String name) {
38.70 + super(name);
38.71 + }
38.72 +
38.73 + @Override
38.74 + protected void setUp() throws Exception {
38.75 + clearWorkDir();
38.76 + super.setUp();
38.77 + System.setProperty("sync.project.execution", "true");
38.78 +// MockLookup.setLayersAndInstances(cgpi);
38.79 + InstalledFileLocatorImpl.registerDestDir(destDirF);
38.80 + ((DialogDisplayerImpl) Lookup.getDefault().lookup(DialogDisplayer.class)).reset();
38.81 + DialogDisplayerImpl.returnFromNotify(DialogDescriptor.NO_OPTION);
38.82 + File prjDir = new File(new File(getDataDir(), "example-external-projects"), "html4j");
38.83 + FileObject prj = FileUtil.toFileObject(prjDir);
38.84 + FileObject wrk = FileUtil.toFileObject(getWorkDir());
38.85 + dir = prj.copy(wrk, "html4j", null);
38.86 + }
38.87 +
38.88 +
38.89 +
38.90 + public void testCompileTheProject() throws Exception {
38.91 + Project prj = ProjectManager.getDefault().findProject(dir);
38.92 + assertNotNull("Project found for " + dir, prj);
38.93 + assertTrue("It is our project", prj instanceof NbModuleProject);
38.94 + ((NbModuleProject)prj).open();
38.95 + FileObject buildXML = dir.getFileObject("build.xml");
38.96 + assertNotNull("Ant script found", buildXML);
38.97 + final ExecutorTask task = ActionUtils.runTarget(buildXML, new String[]{"compile"}, null);
38.98 + task.waitFinished();
38.99 + assertEquals("Executed successfully", 0, task.result());
38.100 + assertNotNull("project was build", dir.getFileObject("build"));
38.101 + }
38.102 +}
38.103 \ No newline at end of file
39.1 --- a/apisupport.harness/nbproject/project.properties Tue Sep 09 13:59:54 2014 +0000
39.2 +++ b/apisupport.harness/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
39.3 @@ -102,6 +102,7 @@
39.4 org/netbeans/nbbuild/ParseManifest*.class,\
39.5 org/netbeans/nbbuild/ParseProjectXml*.class,\
39.6 org/netbeans/nbbuild/PathFileSet*.class,\
39.7 + org/netbeans/nbbuild/ProcessJsAnnotationsTask*.class,\
39.8 org/netbeans/nbbuild/ShorterPaths*.class,\
39.9 org/netbeans/nbbuild/SortSuiteModules*.class,\
39.10 org/netbeans/nbbuild/UpdateTracking*.class,\
40.1 --- a/apisupport.harness/taskdefs.properties Tue Sep 09 13:59:54 2014 +0000
40.2 +++ b/apisupport.harness/taskdefs.properties Tue Sep 09 21:44:37 2014 +0200
40.3 @@ -64,3 +64,4 @@
40.4 parsemanifest=org.netbeans.nbbuild.ParseManifest
40.5 autoupdate=org.netbeans.nbbuild.AutoUpdate
40.6 downloadbinaries=org.netbeans.nbbuild.extlibs.DownloadBinaries
40.7 +processjsannotation=org.netbeans.nbbuild.ProcessJsAnnotationsTask
41.1 --- a/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/layer.xml Tue Sep 09 13:59:54 2014 +0000
41.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/common/layer.xml Tue Sep 09 21:44:37 2014 +0200
41.3 @@ -63,6 +63,8 @@
41.4 <file name="javaHint.java" url="../javahint/javaHint.javx"/>
41.5 <file name="javaHintTestApp.java" url="../javahint/javaHintTestApp.javx"/>
41.6 <file name="javaHintTest.java" url="../javahint/javaHintTest.javx"/>
41.7 + <file name="HTML.html" url="../html/HTML.htmx"/>
41.8 + <file name="HTML.java" url="../html/HTML.javx"/>
41.9 <file name="template_myplugin-helpset.xml" url="../javahelp/template_myplugin-helpset.xml"/>
41.10 <file name="template_myplugin.xml" url="../javahelp/template_myplugin.hs"/>
41.11 <file name="template_myplugin-idx.xml" url="../javahelp/template_myplugin-idx.xml"/>
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/Bundle.properties Tue Sep 09 21:44:37 2014 +0200
42.3 @@ -0,0 +1,65 @@
42.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
42.5 +#
42.6 +# Copyright 2014 Oracle and/or its affiliates. All rights reserved.
42.7 +#
42.8 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
42.9 +# Other names may be trademarks of their respective owners.
42.10 +#
42.11 +# The contents of this file are subject to the terms of either the GNU
42.12 +# General Public License Version 2 only ("GPL") or the Common
42.13 +# Development and Distribution License("CDDL") (collectively, the
42.14 +# "License"). You may not use this file except in compliance with the
42.15 +# License. You can obtain a copy of the License at
42.16 +# http://www.netbeans.org/cddl-gplv2.html
42.17 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
42.18 +# specific language governing permissions and limitations under the
42.19 +# License. When distributing the software, include this License Header
42.20 +# Notice in each file and include the License file at
42.21 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
42.22 +# particular file as subject to the "Classpath" exception as provided
42.23 +# by Oracle in the GPL Version 2 section of the License file that
42.24 +# accompanied this code. If applicable, add the following below the
42.25 +# License Header, with the fields enclosed by brackets [] replaced by
42.26 +# your own identifying information:
42.27 +# "Portions Copyrighted [year] [name of copyright owner]"
42.28 +#
42.29 +# If you wish your version of this file to be governed by only the CDDL
42.30 +# or only the GPL Version 2, indicate your decision by adding
42.31 +# "[Contributor] elects to include this software in this distribution
42.32 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
42.33 +# single choice of license, a recipient has the option to distribute
42.34 +# your version of this file under either the CDDL, the GPL Version 2 or
42.35 +# to extend the choice of license to its licensees as provided above.
42.36 +# However, if you add GPL Version 2 code and therefore, elected the GPL
42.37 +# Version 2 license, then the option applies only if the new code is
42.38 +# made subject to such option by the copyright holder.
42.39 +#
42.40 +# Contributor(s):
42.41 +#
42.42 +# Portions Copyrighted 2014 Sun Microsystems, Inc.
42.43 +
42.44 +LBL_TCWizardTitle=Portable HTML UI
42.45 +
42.46 +LBL_NameLocation_Title=Name, Icon and Location
42.47 +LBL_ProjectName=&Project\:
42.48 +LBL_PackageName=Pac&kage\:
42.49 +LBL_CreatedFiles=&Created Files\:
42.50 +LBL_ModifiedFiles=&Modified Files\:
42.51 +LBL_Icon_Browse=Bro&wse...
42.52 +LBL_Icon=&Icon\:
42.53 +LBL_Prefix=Class &Name Prefix\:
42.54 +LBL_Select=Select
42.55 +ERR_Name_Prefix_Empty=Please specify Class Name Prefix.
42.56 +ERR_Name_Prefix_Invalid=Class Name Prefix is invalid.
42.57 +ERR_Icon_Invalid=Cannot find icon.
42.58 +ERR_Package_Invalid=Package is blank or malformed.
42.59 +ERR_ToBeCreateFileExists=The file {0} already exists.
42.60 +
42.61 +ACS_NameAndLocationPanel=Name, Icon and Location Panel
42.62 +ACS_CTL_PackageName=Package Name
42.63 +ACS_CTL_Icon=Icon for project template
42.64 +ACS_CTL_Prefix=Class Name prefix
42.65 +ACS_CTL_IconButton=Browse Button for selecting icon
42.66 +ACS_CTL_ProjectName=Project Name
42.67 +ACS_CTL_CreatedFilesValue=Created Files
42.68 +ACS_CTL_ModifiedFilesValue=Modified Files
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/HTML.htmx Tue Sep 09 21:44:37 2014 +0200
43.3 @@ -0,0 +1,24 @@
43.4 +<html>
43.5 + <head>
43.6 + <title>${TEMPLATENAME}</title>
43.7 + <meta charset="UTF-8">
43.8 + </head>
43.9 + <body>
43.10 + <div data-bind="template: templateName"></div>
43.11 +
43.12 + <script type="text/html" id="window">
43.13 + <input data-bind="value: text"></input>
43.14 + <button data-bind="click: showDialog, enable: text">Ask!</button>
43.15 + </script>
43.16 +
43.17 +
43.18 + <script type="text/html" id="dialog">
43.19 + <div><span data-bind="text: text"></span> How are you?</div>
43.20 + <-- you need to check the checkbox to enabled the OK button -->
43.21 + <input type="checkbox" data-bind="checked: ok">OK?<br>
43.22 + <-- enabled with checkbox is checked -->
43.23 + <button id='ok' hidden data-bind="enable: ok">Good</button>
43.24 + <button id='bad' hidden>Bad</button>
43.25 + </script>
43.26 + </body>
43.27 +</html>
43.28 \ No newline at end of file
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/HTML.javx Tue Sep 09 21:44:37 2014 +0200
44.3 @@ -0,0 +1,73 @@
44.4 +<#assign licenseFirst = "/*">
44.5 +<#assign licensePrefix = " * ">
44.6 +<#assign licenseLast = " */">
44.7 +<#include "${project.licensePath}">
44.8 +
44.9 +package ${PACKAGENAME};
44.10 +
44.11 +import net.java.html.json.Model;
44.12 +import net.java.html.json.Function;
44.13 +import net.java.html.json.Property;
44.14 +import net.java.html.json.ComputedProperty;
44.15 +import org.netbeans.api.html4j.OpenHTMLRegistration;
44.16 +import org.netbeans.api.html4j.HTMLDialog;
44.17 +import org.openide.util.NbBundle;
44.18 +import org.openide.awt.ActionID;
44.19 +import org.openide.awt.ActionReference;
44.20 +import org.openide.awt.ActionReferences;
44.21 +
44.22 +/**
44.23 + * HTML page which displays a window and also a dialog.
44.24 + */
44.25 +@Model(className="${TEMPLATENAME}", properties={
44.26 + @Property(name = "text", type = String.class)
44.27 +})
44.28 +public final class ${TEMPLATENAME}Cntrl {
44.29 + @ComputedProperty static String templateName() {
44.30 + return "window";
44.31 + }
44.32 +
44.33 + @Function static void showDialog(${TEMPLATENAME} model) {
44.34 + String reply = Pages.show${TEMPLATENAME}Dialog(model.getText());
44.35 + if ("OK".equals(reply)) {
44.36 + model.setText("Happy World!");
44.37 + } else {
44.38 + model.setText("Sad World!");
44.39 + }
44.40 + }
44.41 +
44.42 + @ActionID(
44.43 + category = "Tools",
44.44 + id = "${PACKAGENAME}.${TEMPLATENAME}"
44.45 + )
44.46 + @ActionReferences({
44.47 + @ActionReference(path = "Menu/Tools"),
44.48 + @ActionReference(path = "Toolbars/File"),
44.49 + })
44.50 + @NbBundle.Messages("CTL_${TEMPLATENAME}=Open HTML Hello World!")
44.51 + @OpenHTMLRegistration(
44.52 + url = "${TEMPLATENAME}.html",
44.53 + displayName = "#CTL_${TEMPLATENAME}"
44.54 + )
44.55 + public static ${TEMPLATENAME} onPageLoad() {
44.56 + return new ${TEMPLATENAME}("Hello World!").applyBindings();
44.57 + }
44.58 +
44.59 + //
44.60 + // dialog UI
44.61 + //
44.62 +
44.63 + @HTMLDialog(url="${TEMPLATENAME}.html") static void show${TEMPLATENAME}Dialog(String t) {
44.64 + new ${TEMPLATENAME}Dialog(t, false).applyBindings();
44.65 + }
44.66 +
44.67 + @Model(className="${TEMPLATENAME}Dialog", properties={
44.68 + @Property(name = "text", type = String.class),
44.69 + @Property(name = "ok", type = boolean.class),
44.70 + })
44.71 + static final class DialogCntrl {
44.72 + @ComputedProperty static String templateName() {
44.73 + return "dialog";
44.74 + }
44.75 + }
44.76 +}
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
45.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/HTMLIterator.java Tue Sep 09 21:44:37 2014 +0200
45.3 @@ -0,0 +1,380 @@
45.4 +/*
45.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
45.6 + *
45.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
45.8 + *
45.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
45.10 + * Other names may be trademarks of their respective owners.
45.11 + *
45.12 + * The contents of this file are subject to the terms of either the GNU
45.13 + * General Public License Version 2 only ("GPL") or the Common
45.14 + * Development and Distribution License("CDDL") (collectively, the
45.15 + * "License"). You may not use this file except in compliance with the
45.16 + * License. You can obtain a copy of the License at
45.17 + * http://www.netbeans.org/cddl-gplv2.html
45.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
45.19 + * specific language governing permissions and limitations under the
45.20 + * License. When distributing the software, include this License Header
45.21 + * Notice in each file and include the License file at
45.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
45.23 + * particular file as subject to the "Classpath" exception as provided
45.24 + * by Oracle in the GPL Version 2 section of the License file that
45.25 + * accompanied this code. If applicable, add the following below the
45.26 + * License Header, with the fields enclosed by brackets [] replaced by
45.27 + * your own identifying information:
45.28 + * "Portions Copyrighted [year] [name of copyright owner]"
45.29 + *
45.30 + * Contributor(s):
45.31 + *
45.32 + * The Original Software is NetBeans. The Initial Developer of the Original
45.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
45.34 + * Microsystems, Inc. All Rights Reserved.
45.35 + *
45.36 + * If you wish your version of this file to be governed by only the CDDL
45.37 + * or only the GPL Version 2, indicate your decision by adding
45.38 + * "[Contributor] elects to include this software in this distribution
45.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
45.40 + * single choice of license, a recipient has the option to distribute
45.41 + * your version of this file under either the CDDL, the GPL Version 2 or
45.42 + * to extend the choice of license to its licensees as provided above.
45.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
45.44 + * Version 2 license, then the option applies only if the new code is
45.45 + * made subject to such option by the copyright holder.
45.46 + */
45.47 +
45.48 +package org.netbeans.modules.apisupport.project.ui.wizard.html;
45.49 +
45.50 +import java.io.File;
45.51 +import java.io.IOException;
45.52 +import java.util.HashMap;
45.53 +import java.util.Map;
45.54 +import java.util.Set;
45.55 +import java.util.TreeMap;
45.56 +import java.util.TreeSet;
45.57 +import java.util.logging.Level;
45.58 +import java.util.logging.Logger;
45.59 +import org.netbeans.api.project.Project;
45.60 +import org.netbeans.api.templates.TemplateRegistration;
45.61 +import org.netbeans.modules.apisupport.project.api.UIUtil;
45.62 +import org.netbeans.modules.apisupport.project.api.Util;
45.63 +import org.netbeans.modules.apisupport.project.spi.NbModuleProvider;
45.64 +import org.netbeans.modules.apisupport.project.ui.wizard.common.BasicWizardIterator;
45.65 +import org.netbeans.modules.apisupport.project.ui.wizard.common.CreatedModifiedFiles;
45.66 +import org.openide.WizardDescriptor;
45.67 +import org.openide.filesystems.FileObject;
45.68 +import org.openide.filesystems.FileSystem;
45.69 +import org.openide.filesystems.FileUtil;
45.70 +import org.openide.modules.SpecificationVersion;
45.71 +import org.openide.util.NbBundle.Messages;
45.72 +
45.73 +/**
45.74 + * Wizard for creating new HTML based UI.
45.75 + *
45.76 + * @author Jaroslav Tulach
45.77 + */
45.78 +@TemplateRegistration(
45.79 + folder=UIUtil.TEMPLATE_FOLDER,
45.80 + id="newHTML",
45.81 + position=191,
45.82 + displayName="#template_html",
45.83 + iconBase="org/netbeans/modules/apisupport/project/ui/wizard/html/newHTML.png",
45.84 + description="newHTML.html",
45.85 + category=UIUtil.TEMPLATE_CATEGORY
45.86 +)
45.87 +@Messages("template_html=Portable HTML UI")
45.88 +public final class HTMLIterator extends BasicWizardIterator {
45.89 +
45.90 + private HTMLIterator.DataModel data;
45.91 +
45.92 + @Override
45.93 + public Set instantiate() throws IOException {
45.94 + CreatedModifiedFiles cmf = data.getCreatedModifiedFiles();
45.95 + cmf.run();
45.96 + return getCreatedFiles(cmf, data.getProject());
45.97 + }
45.98 +
45.99 + @Override
45.100 + protected BasicWizardIterator.Panel[] createPanels(WizardDescriptor wiz) {
45.101 + data = new HTMLIterator.DataModel(wiz);
45.102 + return new BasicWizardIterator.Panel[] {
45.103 + new NameAndLocationPanel(wiz, data)
45.104 + };
45.105 + }
45.106 +
45.107 + public @Override void uninitialize(WizardDescriptor wiz) {
45.108 + super.uninitialize(wiz);
45.109 + data = null;
45.110 + }
45.111 +
45.112 + static final class DataModel extends BasicWizardIterator.BasicDataModel {
45.113 + private String name;
45.114 + private String icon;
45.115 + private String mode;
45.116 + private boolean opened = false;
45.117 + private boolean keepPrefSize = false;
45.118 + private boolean slidingNotAllowed = false;
45.119 + private boolean closingNotAllowed = false;
45.120 + private boolean draggingNotAllowed = false;
45.121 + private boolean undockingNotAllowed = false;
45.122 + private boolean maximizationNotAllowed = false;
45.123 + private Map<String,String> newModes;
45.124 + private Set<String> existingModes;
45.125 + private boolean ignorePreviousRun = true;
45.126 +
45.127 + private CreatedModifiedFiles files;
45.128 +
45.129 + FileSystem sfs;
45.130 +
45.131 + DataModel(WizardDescriptor wiz) {
45.132 + super(wiz);
45.133 + }
45.134 +
45.135 + public CreatedModifiedFiles getCreatedModifiedFiles() {
45.136 + return getFiles();
45.137 + }
45.138 +
45.139 + public void setCreatedModifiedFiles(CreatedModifiedFiles files) {
45.140 + this.setFiles(files);
45.141 + }
45.142 +
45.143 + public String getName() {
45.144 + return name;
45.145 + }
45.146 +
45.147 + public void setName(String name) {
45.148 + this.name = name;
45.149 + }
45.150 +
45.151 + public CreatedModifiedFiles getFiles() {
45.152 + return files;
45.153 + }
45.154 +
45.155 + public void setFiles(CreatedModifiedFiles files) {
45.156 + this.files = files;
45.157 + }
45.158 +
45.159 + public String getIcon() {
45.160 + return icon;
45.161 + }
45.162 +
45.163 + public void setIcon(String icon) {
45.164 + this.icon = icon;
45.165 + }
45.166 +
45.167 + public String getMode() {
45.168 + return mode;
45.169 + }
45.170 +
45.171 + public void defineMode(String name, String definition) {
45.172 + if (newModes == null) {
45.173 + newModes = new TreeMap<String, String>();
45.174 + }
45.175 + newModes.put(name, definition);
45.176 + }
45.177 + void existingMode(String name) {
45.178 + if (existingModes == null) {
45.179 + existingModes = new TreeSet<String>();
45.180 + }
45.181 + existingModes.add(name);
45.182 + }
45.183 + boolean isExistingMode(String name) {
45.184 + return existingModes != null && existingModes.contains(name);
45.185 + }
45.186 +
45.187 + Map<String,String> getNewModes() {
45.188 + if (newModes == null) {
45.189 + return null;
45.190 + }
45.191 + TreeMap<String,String> copy = new TreeMap<String,String>(newModes);
45.192 + if (existingModes != null) {
45.193 + copy.keySet().removeAll(existingModes);
45.194 + }
45.195 + return copy.isEmpty() ? null : copy;
45.196 + }
45.197 +
45.198 + public boolean isIgnorePreviousRun() {
45.199 + return ignorePreviousRun;
45.200 + }
45.201 +
45.202 + public void setIgnorePreviousRun(boolean ignorePreviousRun) {
45.203 + this.ignorePreviousRun = ignorePreviousRun;
45.204 + }
45.205 +
45.206 + public void setMode(String mode) {
45.207 + this.mode = mode;
45.208 + }
45.209 +
45.210 + public boolean isOpened() {
45.211 + return opened;
45.212 + }
45.213 +
45.214 + public void setOpened(boolean opened) {
45.215 + this.opened = opened;
45.216 + }
45.217 +
45.218 + public boolean isKeepPrefSize() {
45.219 + return keepPrefSize;
45.220 + }
45.221 +
45.222 + public void setKeepPrefSize(boolean keepPrefSize) {
45.223 + this.keepPrefSize = keepPrefSize;
45.224 + }
45.225 +
45.226 + public boolean isClosingNotAllowed() {
45.227 + return closingNotAllowed;
45.228 + }
45.229 +
45.230 + public void setClosingNotAllowed(boolean closingNotAllowed) {
45.231 + this.closingNotAllowed = closingNotAllowed;
45.232 + }
45.233 +
45.234 + public boolean isDraggingNotAllowed() {
45.235 + return draggingNotAllowed;
45.236 + }
45.237 +
45.238 + public void setDraggingNotAllowed(boolean draggingNotAllowed) {
45.239 + this.draggingNotAllowed = draggingNotAllowed;
45.240 + }
45.241 +
45.242 + public boolean isMaximizationNotAllowed() {
45.243 + return maximizationNotAllowed;
45.244 + }
45.245 +
45.246 + public void setMaximizationNotAllowed(boolean maximizationNotAllowed) {
45.247 + this.maximizationNotAllowed = maximizationNotAllowed;
45.248 + }
45.249 +
45.250 + public boolean isSlidingNotAllowed() {
45.251 + return slidingNotAllowed;
45.252 + }
45.253 +
45.254 + public void setSlidingNotAllowed(boolean slidingNotAllowed) {
45.255 + this.slidingNotAllowed = slidingNotAllowed;
45.256 + }
45.257 +
45.258 + public boolean isUndockingNotAllowed() {
45.259 + return undockingNotAllowed;
45.260 + }
45.261 +
45.262 + public void setUndockingNotAllowed(boolean undockingNotAllowed) {
45.263 + this.undockingNotAllowed = undockingNotAllowed;
45.264 + }
45.265 + void setSFS(FileSystem sfs) {
45.266 + this.sfs = sfs;
45.267 + }
45.268 + }
45.269 +
45.270 + static void generateFileChanges(final DataModel model) {
45.271 + CreatedModifiedFiles fileChanges = new CreatedModifiedFiles(model.getProject());
45.272 + Project project = model.getProject();
45.273 + NbModuleProvider moduleInfo = model.getModuleInfo();
45.274 + final String name = model.getName();
45.275 + final String packageName = model.getPackageName();
45.276 + final String mode = model.getMode();
45.277 +
45.278 + try {
45.279 + SpecificationVersion current = model.getModuleInfo().getDependencyVersion("org.netbeans.api.html4j");
45.280 + } catch (IOException ex) {
45.281 + Logger.getLogger(HTMLIterator.class.getName()).log(Level.INFO, null, ex);
45.282 + }
45.283 +
45.284 + if (name != null) {
45.285 + Map<String,String> replaceTokens = new HashMap<String,String>();
45.286 + replaceTokens.put("TEMPLATENAME", name);//NOI18N
45.287 + replaceTokens.put("PACKAGENAME", packageName);//NOI18N
45.288 +
45.289 + // 0. move icon file if necessary
45.290 + String icon = model.getIcon();
45.291 + File fil = null;
45.292 + if (icon != null) {
45.293 + fil = new File(icon);
45.294 + if (!fil.exists()) {
45.295 + fil = null;
45.296 + }
45.297 + }
45.298 + // XXX this should be using addCreateIconOperation
45.299 + String relativeIconPath = null;
45.300 + if (fil != null) {
45.301 + FileObject fo = FileUtil.toFileObject(fil);
45.302 + if (!FileUtil.isParentOf(Util.getResourceDirectory(project), fo)) {
45.303 + String iconPath = getRelativePath(moduleInfo.getResourceDirectoryPath(false), packageName,
45.304 + "", fo.getNameExt()); //NOI18N
45.305 + fileChanges.add(fileChanges.createFile(iconPath, fo));
45.306 + relativeIconPath = packageName.replace('.', '/') + "/" + fo.getNameExt(); // NOI18N
45.307 + } else {
45.308 + relativeIconPath = FileUtil.getRelativePath(Util.getResourceDirectory(project), fo);
45.309 + }
45.310 + replaceTokens.put("ICONPATH", relativeIconPath);//NOI18N
45.311 + replaceTokens.put("COMMENTICON", "");//NOI18N
45.312 +
45.313 + } else {
45.314 + replaceTokens.put("ICONPATH", "SET/PATH/TO/ICON/HERE"); //NOI18N
45.315 + replaceTokens.put("COMMENTICON", "//");//NOI18N
45.316 + }
45.317 +
45.318 +
45.319 + // 2. update project dependencies
45.320 + replaceTokens.put("MODULENAME", moduleInfo.getCodeNameBase()); // NOI18N
45.321 + String specVersion = moduleInfo.getSpecVersion();
45.322 + replaceTokens.put("SPECVERSION", specVersion != null ? specVersion : "0"); // NOI18N
45.323 + fileChanges.add(fileChanges.addModuleDependency("org.netbeans.api.html4j")); //NOI18N
45.324 + fileChanges.add(fileChanges.addModuleDependency("net.java.html")); //NOI18N
45.325 + fileChanges.add(fileChanges.addModuleDependency("net.java.html.json")); //NOI18N
45.326 + fileChanges.add(fileChanges.addModuleDependency("net.java.html.js")); //NOI18N
45.327 + fileChanges.add(fileChanges.addModuleDependency("org.openide.util")); //NOI18N
45.328 + fileChanges.add(fileChanges.addModuleDependency("org.openide.awt")); //NOI18N
45.329 +
45.330 + // x. generate java classes
45.331 + final String tcName = getRelativePath(moduleInfo.getSourceDirectoryPath(), packageName,
45.332 + name, "Cntrl.java"); //NOI18N
45.333 + FileObject template = CreatedModifiedFiles.getTemplate(
45.334 + "HTML.java"
45.335 + );
45.336 + fileChanges.add(fileChanges.createFileWithSubstitutions(tcName, template, replaceTokens));
45.337 + // x. generate java classes
45.338 + final String tcFormName = getRelativePath(moduleInfo.getSourceDirectoryPath(), packageName,
45.339 + name, ".html"); //NOI18N
45.340 + template = CreatedModifiedFiles.getTemplate("HTML.html");//NOI18N
45.341 + fileChanges.add(fileChanges.createFileWithSubstitutions(tcFormName, template, replaceTokens));
45.342 + }
45.343 +
45.344 + model.setCreatedModifiedFiles(fileChanges);
45.345 + }
45.346 +
45.347 + private static String getRelativePath(String rootpath, String fullyQualifiedPackageName,
45.348 + String prefix, String postfix) {
45.349 + StringBuilder sb = new StringBuilder();
45.350 +
45.351 + sb.append(rootpath).append('/').append(fullyQualifiedPackageName.replace('.','/'))
45.352 + .append('/').append(prefix).append(postfix);
45.353 +
45.354 + return sb.toString();
45.355 + }
45.356 +
45.357 + static class CreateActionEntryOperation implements CreatedModifiedFiles.LayerOperation {
45.358 + private String name;
45.359 + private String packageName;
45.360 +
45.361 + public CreateActionEntryOperation(String actionname, String packageName) {
45.362 + this.packageName = packageName;
45.363 + this.name = actionname;
45.364 + }
45.365 +
45.366 + @Override
45.367 + public void run(FileSystem layer) throws IOException {
45.368 + FileObject folder = layer.getRoot().getFileObject("Actions/Window");// NOI18N
45.369 + if (folder == null) {
45.370 + folder = FileUtil.createFolder(layer.getRoot(), "Actions/Window"); // NOI18N
45.371 + }
45.372 + String instance = packageName.replace('.','-') + "-" + name; // NOI18N
45.373 + folder.createData(instance, "instance"); // NOI18N
45.374 + folder = layer.getRoot().getFileObject("Menu/Window");// NOI18N
45.375 + if (folder == null) {
45.376 + folder = FileUtil.createFolder(layer.getRoot(), "Menu/Window"); // NOI18N
45.377 + }
45.378 + FileObject file = folder.createData(name, "shadow"); // NOI18N
45.379 + file.setAttribute("originalFile", "Actions/Window/" + instance + ".instance"); // NOI18N
45.380 + }
45.381 + }
45.382 +
45.383 +}
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
46.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/NameAndLocationPanel.form Tue Sep 09 21:44:37 2014 +0200
46.3 @@ -0,0 +1,211 @@
46.4 +<?xml version="1.0" encoding="UTF-8" ?>
46.5 +
46.6 +<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
46.7 + <AuxValues>
46.8 + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
46.9 + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
46.10 + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
46.11 + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
46.12 + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
46.13 + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
46.14 + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
46.15 + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
46.16 + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
46.17 + </AuxValues>
46.18 +
46.19 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
46.20 + <SubComponents>
46.21 + <Component class="javax.swing.JLabel" name="lblPrefix">
46.22 + <Properties>
46.23 + <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
46.24 + <ComponentRef name="txtPrefix"/>
46.25 + </Property>
46.26 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
46.27 + <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/loader/Bundle.properties" key="LBL_Prefix" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
46.28 + </Property>
46.29 + </Properties>
46.30 + <Constraints>
46.31 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.32 + <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="0" insetsBottom="6" insetsRight="12" anchor="10" weightX="0.0" weightY="0.0"/>
46.33 + </Constraint>
46.34 + </Constraints>
46.35 + </Component>
46.36 + <Component class="javax.swing.JTextField" name="txtPrefix">
46.37 + <Constraints>
46.38 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.39 + <GridBagConstraints gridX="1" gridY="0" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
46.40 + </Constraint>
46.41 + </Constraints>
46.42 + </Component>
46.43 + <Component class="javax.swing.JLabel" name="lblIcon">
46.44 + <Properties>
46.45 + <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
46.46 + <ComponentRef name="txtIcon"/>
46.47 + </Property>
46.48 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
46.49 + <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/loader/Bundle.properties" key="LBL_Icon" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
46.50 + </Property>
46.51 + </Properties>
46.52 + <Constraints>
46.53 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.54 + <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="10" weightX="0.0" weightY="0.0"/>
46.55 + </Constraint>
46.56 + </Constraints>
46.57 + </Component>
46.58 + <Component class="javax.swing.JTextField" name="txtIcon">
46.59 + <Constraints>
46.60 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.61 + <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
46.62 + </Constraint>
46.63 + </Constraints>
46.64 + </Component>
46.65 + <Component class="javax.swing.JButton" name="btnIcon">
46.66 + <Properties>
46.67 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
46.68 + <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/loader/Bundle.properties" key="LBL_Icon_Browse" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
46.69 + </Property>
46.70 + </Properties>
46.71 + <Events>
46.72 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnIconActionPerformed"/>
46.73 + </Events>
46.74 + <Constraints>
46.75 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.76 + <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="12" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
46.77 + </Constraint>
46.78 + </Constraints>
46.79 + </Component>
46.80 + <Component class="javax.swing.JLabel" name="lblProjectName">
46.81 + <Properties>
46.82 + <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
46.83 + <ComponentRef name="txtProjectName"/>
46.84 + </Property>
46.85 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
46.86 + <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/librarydescriptor/Bundle.properties" key="LBL_ProjectName" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
46.87 + </Property>
46.88 + </Properties>
46.89 + <Constraints>
46.90 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.91 + <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="0" insetsBottom="6" insetsRight="12" anchor="10" weightX="0.0" weightY="0.0"/>
46.92 + </Constraint>
46.93 + </Constraints>
46.94 + </Component>
46.95 + <Component class="javax.swing.JTextField" name="txtProjectName">
46.96 + <Properties>
46.97 + <Property name="editable" type="boolean" value="false"/>
46.98 + </Properties>
46.99 + <AuxValues>
46.100 + <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new JTextField(ProjectUtils.getInformation(this.data.getProject()).getDisplayName());"/>
46.101 + </AuxValues>
46.102 + <Constraints>
46.103 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.104 + <GridBagConstraints gridX="1" gridY="2" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
46.105 + </Constraint>
46.106 + </Constraints>
46.107 + </Component>
46.108 + <Component class="javax.swing.JLabel" name="lblPackageName">
46.109 + <Properties>
46.110 + <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
46.111 + <ComponentRef name="comPackageName"/>
46.112 + </Property>
46.113 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
46.114 + <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/librarydescriptor/Bundle.properties" key="LBL_PackageName" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
46.115 + </Property>
46.116 + </Properties>
46.117 + <Constraints>
46.118 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.119 + <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="10" weightX="0.0" weightY="0.0"/>
46.120 + </Constraint>
46.121 + </Constraints>
46.122 + </Component>
46.123 + <Component class="javax.swing.JComboBox" name="comPackageName">
46.124 + <Properties>
46.125 + <Property name="editable" type="boolean" value="true"/>
46.126 + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
46.127 + <StringArray count="0"/>
46.128 + </Property>
46.129 + </Properties>
46.130 + <AuxValues>
46.131 + <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="WizardUtils.createPackageComboBox(data.getSourceRootGroup())"/>
46.132 + </AuxValues>
46.133 + <Constraints>
46.134 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.135 + <GridBagConstraints gridX="1" gridY="3" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
46.136 + </Constraint>
46.137 + </Constraints>
46.138 + </Component>
46.139 + <Component class="javax.swing.JLabel" name="createdFiles">
46.140 + <Properties>
46.141 + <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
46.142 + <ComponentRef name="createdFilesValue"/>
46.143 + </Property>
46.144 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
46.145 + <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/librarydescriptor/Bundle.properties" key="LBL_CreatedFiles" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
46.146 + </Property>
46.147 + </Properties>
46.148 + <Constraints>
46.149 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.150 + <GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="36" insetsLeft="0" insetsBottom="6" insetsRight="12" anchor="18" weightX="0.0" weightY="0.0"/>
46.151 + </Constraint>
46.152 + </Constraints>
46.153 + </Component>
46.154 + <Component class="javax.swing.JLabel" name="modifiedFiles">
46.155 + <Properties>
46.156 + <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
46.157 + <ComponentRef name="modifiedFilesValue"/>
46.158 + </Property>
46.159 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
46.160 + <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/librarydescriptor/Bundle.properties" key="LBL_ModifiedFiles" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
46.161 + </Property>
46.162 + </Properties>
46.163 + <Constraints>
46.164 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.165 + <GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="18" weightX="0.0" weightY="0.0"/>
46.166 + </Constraint>
46.167 + </Constraints>
46.168 + </Component>
46.169 + <Component class="javax.swing.JLabel" name="filler">
46.170 + <Constraints>
46.171 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.172 + <GridBagConstraints gridX="0" gridY="6" gridWidth="3" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
46.173 + </Constraint>
46.174 + </Constraints>
46.175 + </Component>
46.176 + <Component class="javax.swing.JTextArea" name="createdFilesValue">
46.177 + <Properties>
46.178 + <Property name="editable" type="boolean" value="false"/>
46.179 + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
46.180 + <Color blue="ee" green="ee" id="Label.background" palette="3" red="ee" type="palette"/>
46.181 + </Property>
46.182 + <Property name="columns" type="int" value="20"/>
46.183 + <Property name="rows" type="int" value="5"/>
46.184 + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
46.185 + <Border info="null"/>
46.186 + </Property>
46.187 + </Properties>
46.188 + <Constraints>
46.189 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.190 + <GridBagConstraints gridX="1" gridY="4" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="36" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
46.191 + </Constraint>
46.192 + </Constraints>
46.193 + </Component>
46.194 + <Component class="javax.swing.JTextArea" name="modifiedFilesValue">
46.195 + <Properties>
46.196 + <Property name="editable" type="boolean" value="false"/>
46.197 + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
46.198 + <Color blue="ee" green="ee" id="Label.background" palette="3" red="ee" type="palette"/>
46.199 + </Property>
46.200 + <Property name="columns" type="int" value="20"/>
46.201 + <Property name="rows" type="int" value="5"/>
46.202 + <Property name="toolTipText" type="java.lang.String" value="modifiedFilesValue"/>
46.203 + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
46.204 + <Border info="null"/>
46.205 + </Property>
46.206 + </Properties>
46.207 + <Constraints>
46.208 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46.209 + <GridBagConstraints gridX="1" gridY="5" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
46.210 + </Constraint>
46.211 + </Constraints>
46.212 + </Component>
46.213 + </SubComponents>
46.214 +</Form>
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
47.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/NameAndLocationPanel.java Tue Sep 09 21:44:37 2014 +0200
47.3 @@ -0,0 +1,372 @@
47.4 +/*
47.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
47.6 + *
47.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
47.8 + *
47.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
47.10 + * Other names may be trademarks of their respective owners.
47.11 + *
47.12 + * The contents of this file are subject to the terms of either the GNU
47.13 + * General Public License Version 2 only ("GPL") or the Common
47.14 + * Development and Distribution License("CDDL") (collectively, the
47.15 + * "License"). You may not use this file except in compliance with the
47.16 + * License. You can obtain a copy of the License at
47.17 + * http://www.netbeans.org/cddl-gplv2.html
47.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
47.19 + * specific language governing permissions and limitations under the
47.20 + * License. When distributing the software, include this License Header
47.21 + * Notice in each file and include the License file at
47.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
47.23 + * particular file as subject to the "Classpath" exception as provided
47.24 + * by Oracle in the GPL Version 2 section of the License file that
47.25 + * accompanied this code. If applicable, add the following below the
47.26 + * License Header, with the fields enclosed by brackets [] replaced by
47.27 + * your own identifying information:
47.28 + * "Portions Copyrighted [year] [name of copyright owner]"
47.29 + *
47.30 + * Contributor(s):
47.31 + *
47.32 + * The Original Software is NetBeans. The Initial Developer of the Original
47.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
47.34 + * Microsystems, Inc. All Rights Reserved.
47.35 + *
47.36 + * If you wish your version of this file to be governed by only the CDDL
47.37 + * or only the GPL Version 2, indicate your decision by adding
47.38 + * "[Contributor] elects to include this software in this distribution
47.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
47.40 + * single choice of license, a recipient has the option to distribute
47.41 + * your version of this file under either the CDDL, the GPL Version 2 or
47.42 + * to extend the choice of license to its licensees as provided above.
47.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
47.44 + * Version 2 license, then the option applies only if the new code is
47.45 + * made subject to such option by the copyright holder.
47.46 + */
47.47 +
47.48 +package org.netbeans.modules.apisupport.project.ui.wizard.html;
47.49 +
47.50 +import java.io.File;
47.51 +import javax.swing.JFileChooser;
47.52 +import javax.swing.JTextField;
47.53 +import javax.swing.event.DocumentEvent;
47.54 +import javax.swing.event.DocumentListener;
47.55 +import org.netbeans.api.project.ProjectUtils;
47.56 +import org.netbeans.modules.apisupport.project.api.UIUtil;
47.57 +import org.netbeans.modules.apisupport.project.ui.wizard.common.BasicWizardIterator;
47.58 +import org.netbeans.modules.apisupport.project.ui.wizard.common.WizardUtils;
47.59 +import org.openide.WizardDescriptor;
47.60 +import org.openide.util.HelpCtx;
47.61 +import org.openide.util.NbBundle;
47.62 +import org.openide.util.Utilities;
47.63 +
47.64 +/**
47.65 + * the second panel in topcomponent wizard.
47.66 + *
47.67 + * @author Milos Kleint
47.68 + */
47.69 +final class NameAndLocationPanel extends BasicWizardIterator.Panel {
47.70 +
47.71 + private HTMLIterator.DataModel data;
47.72 +
47.73 + /** Creates new NameAndLocationPanel */
47.74 + public NameAndLocationPanel(final WizardDescriptor setting, final HTMLIterator.DataModel data) {
47.75 + super(setting);
47.76 + this.data = data;
47.77 + initComponents();
47.78 + initAccessibility();
47.79 + putClientProperty("NewFileWizard_Title", getMessage("LBL_TCWizardTitle"));
47.80 +
47.81 + DocumentListener dListener = new UIUtil.DocumentAdapter() {
47.82 + public void insertUpdate(DocumentEvent e) {
47.83 + if (checkValidity()) {
47.84 + updateData();
47.85 + }
47.86 + }
47.87 + };
47.88 + txtPrefix.getDocument().addDocumentListener(dListener);
47.89 + txtIcon.getDocument().addDocumentListener(dListener);
47.90 +
47.91 + if (comPackageName.getEditor().getEditorComponent() instanceof JTextField) {
47.92 + JTextField txt = (JTextField)comPackageName.getEditor().getEditorComponent();
47.93 + txt.getDocument().addDocumentListener(dListener);
47.94 + }
47.95 + }
47.96 +
47.97 + protected void storeToDataModel() {
47.98 + updateData();
47.99 + }
47.100 +
47.101 + private void updateData() {
47.102 + data.setPackageName(comPackageName.getEditor().getItem().toString());
47.103 + String icon = txtIcon.getText().trim();
47.104 + data.setIcon(icon.length() == 0 ? (String)null : icon);
47.105 + data.setName(txtPrefix.getText().trim());
47.106 + HTMLIterator.generateFileChanges(data);
47.107 + createdFilesValue.setText(WizardUtils.generateTextAreaContent(
47.108 + data.getCreatedModifiedFiles().getCreatedPaths()));
47.109 + modifiedFilesValue.setText(WizardUtils.generateTextAreaContent(
47.110 + data.getCreatedModifiedFiles().getModifiedPaths()));
47.111 + //#68294 check if the paths for newly created files are valid or not..
47.112 + String[] invalid = data.getCreatedModifiedFiles().getInvalidPaths();
47.113 + if (invalid.length > 0) {
47.114 + setError(NbBundle.getMessage(NameAndLocationPanel.class, "ERR_ToBeCreateFileExists", invalid[0]));
47.115 + }
47.116 +
47.117 + }
47.118 +
47.119 + private void clearCreatedAndModifiedFilesTextArea() {
47.120 + createdFilesValue.setText(null);
47.121 + modifiedFilesValue.setText(null);
47.122 + }
47.123 +
47.124 + protected void readFromDataModel() {
47.125 + txtPrefix.setText(data.getName());
47.126 + txtIcon.setText(data.getIcon());
47.127 + if (data.getPackageName() != null) {
47.128 + comPackageName.setSelectedItem(data.getPackageName());
47.129 + }
47.130 + checkValidity();
47.131 + }
47.132 +
47.133 + protected String getPanelName() {
47.134 + return getMessage("LBL_NameLocation_Title");
47.135 + }
47.136 +
47.137 + private boolean checkValidity() {
47.138 + if (txtPrefix.getText().trim().length() == 0) {
47.139 + setInfo(getMessage("ERR_Name_Prefix_Empty"), false);
47.140 + clearCreatedAndModifiedFilesTextArea();
47.141 + return false;
47.142 + }
47.143 + if (!Utilities.isJavaIdentifier(txtPrefix.getText().trim())) {
47.144 + setError(getMessage("ERR_Name_Prefix_Invalid"));
47.145 + return false;
47.146 + }
47.147 + String path = txtIcon.getText().trim();
47.148 + if (path.length() != 0) {
47.149 + File fil = new File(path);
47.150 + if (!fil.exists()) {
47.151 + setError(NbBundle.getMessage(getClass(), "ERR_Icon_Invalid"));
47.152 + return false;
47.153 + }
47.154 + }
47.155 + String packageName = comPackageName.getEditor().getItem().toString().trim();
47.156 + if (packageName.length() == 0 || !WizardUtils.isValidPackageName(packageName)) {
47.157 + setError(NbBundle.getMessage(getClass(), "ERR_Package_Invalid"));
47.158 + return false;
47.159 + }
47.160 +
47.161 + markValid();
47.162 + return true;
47.163 + }
47.164 +
47.165 + protected HelpCtx getHelp() {
47.166 + return new HelpCtx(NameAndLocationPanel.class);
47.167 + }
47.168 +
47.169 + private static String getMessage(String key) {
47.170 + return NbBundle.getMessage(NameAndLocationPanel.class, key);
47.171 + }
47.172 +
47.173 + /** This method is called from within the constructor to
47.174 + * initialize the form.
47.175 + * WARNING: Do NOT modify this code. The content of this method is
47.176 + * always regenerated by the Form Editor.
47.177 + */
47.178 + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
47.179 + private void initComponents() {
47.180 + java.awt.GridBagConstraints gridBagConstraints;
47.181 +
47.182 + lblPrefix = new javax.swing.JLabel();
47.183 + txtPrefix = new javax.swing.JTextField();
47.184 + lblIcon = new javax.swing.JLabel();
47.185 + txtIcon = new javax.swing.JTextField();
47.186 + btnIcon = new javax.swing.JButton();
47.187 + lblProjectName = new javax.swing.JLabel();
47.188 + txtProjectName = new JTextField(ProjectUtils.getInformation(this.data.getProject()).getDisplayName());
47.189 + lblPackageName = new javax.swing.JLabel();
47.190 + comPackageName = WizardUtils.createPackageComboBox(data.getSourceRootGroup());
47.191 + createdFiles = new javax.swing.JLabel();
47.192 + modifiedFiles = new javax.swing.JLabel();
47.193 + filler = new javax.swing.JLabel();
47.194 + createdFilesValue = new javax.swing.JTextArea();
47.195 + modifiedFilesValue = new javax.swing.JTextArea();
47.196 +
47.197 + setLayout(new java.awt.GridBagLayout());
47.198 +
47.199 + lblPrefix.setLabelFor(txtPrefix);
47.200 + org.openide.awt.Mnemonics.setLocalizedText(lblPrefix, org.openide.util.NbBundle.getMessage(NameAndLocationPanel.class, "LBL_Prefix")); // NOI18N
47.201 + gridBagConstraints = new java.awt.GridBagConstraints();
47.202 + gridBagConstraints.gridx = 0;
47.203 + gridBagConstraints.gridy = 0;
47.204 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.205 + gridBagConstraints.insets = new java.awt.Insets(1, 0, 6, 12);
47.206 + add(lblPrefix, gridBagConstraints);
47.207 + gridBagConstraints = new java.awt.GridBagConstraints();
47.208 + gridBagConstraints.gridx = 1;
47.209 + gridBagConstraints.gridy = 0;
47.210 + gridBagConstraints.gridwidth = 2;
47.211 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.212 + gridBagConstraints.weightx = 1.0;
47.213 + gridBagConstraints.insets = new java.awt.Insets(1, 0, 6, 0);
47.214 + add(txtPrefix, gridBagConstraints);
47.215 +
47.216 + lblIcon.setLabelFor(txtIcon);
47.217 + org.openide.awt.Mnemonics.setLocalizedText(lblIcon, org.openide.util.NbBundle.getMessage(NameAndLocationPanel.class, "LBL_Icon")); // NOI18N
47.218 + gridBagConstraints = new java.awt.GridBagConstraints();
47.219 + gridBagConstraints.gridx = 0;
47.220 + gridBagConstraints.gridy = 1;
47.221 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.222 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
47.223 + add(lblIcon, gridBagConstraints);
47.224 + gridBagConstraints = new java.awt.GridBagConstraints();
47.225 + gridBagConstraints.gridx = 1;
47.226 + gridBagConstraints.gridy = 1;
47.227 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.228 + gridBagConstraints.weightx = 1.0;
47.229 + add(txtIcon, gridBagConstraints);
47.230 +
47.231 + org.openide.awt.Mnemonics.setLocalizedText(btnIcon, org.openide.util.NbBundle.getMessage(NameAndLocationPanel.class, "LBL_Icon_Browse")); // NOI18N
47.232 + btnIcon.addActionListener(new java.awt.event.ActionListener() {
47.233 + public void actionPerformed(java.awt.event.ActionEvent evt) {
47.234 + btnIconActionPerformed(evt);
47.235 + }
47.236 + });
47.237 + gridBagConstraints = new java.awt.GridBagConstraints();
47.238 + gridBagConstraints.gridx = 2;
47.239 + gridBagConstraints.gridy = 1;
47.240 + gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
47.241 + add(btnIcon, gridBagConstraints);
47.242 +
47.243 + lblProjectName.setLabelFor(txtProjectName);
47.244 + java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/apisupport/project/ui/wizard/librarydescriptor/Bundle"); // NOI18N
47.245 + org.openide.awt.Mnemonics.setLocalizedText(lblProjectName, bundle.getString("LBL_ProjectName")); // NOI18N
47.246 + gridBagConstraints = new java.awt.GridBagConstraints();
47.247 + gridBagConstraints.gridx = 0;
47.248 + gridBagConstraints.gridy = 2;
47.249 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.250 + gridBagConstraints.insets = new java.awt.Insets(18, 0, 6, 12);
47.251 + add(lblProjectName, gridBagConstraints);
47.252 +
47.253 + txtProjectName.setEditable(false);
47.254 + gridBagConstraints = new java.awt.GridBagConstraints();
47.255 + gridBagConstraints.gridx = 1;
47.256 + gridBagConstraints.gridy = 2;
47.257 + gridBagConstraints.gridwidth = 2;
47.258 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.259 + gridBagConstraints.weightx = 1.0;
47.260 + gridBagConstraints.insets = new java.awt.Insets(18, 0, 6, 0);
47.261 + add(txtProjectName, gridBagConstraints);
47.262 +
47.263 + lblPackageName.setLabelFor(comPackageName);
47.264 + org.openide.awt.Mnemonics.setLocalizedText(lblPackageName, bundle.getString("LBL_PackageName")); // NOI18N
47.265 + gridBagConstraints = new java.awt.GridBagConstraints();
47.266 + gridBagConstraints.gridx = 0;
47.267 + gridBagConstraints.gridy = 3;
47.268 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.269 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
47.270 + add(lblPackageName, gridBagConstraints);
47.271 +
47.272 + comPackageName.setEditable(true);
47.273 + gridBagConstraints = new java.awt.GridBagConstraints();
47.274 + gridBagConstraints.gridx = 1;
47.275 + gridBagConstraints.gridy = 3;
47.276 + gridBagConstraints.gridwidth = 2;
47.277 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.278 + gridBagConstraints.weightx = 1.0;
47.279 + add(comPackageName, gridBagConstraints);
47.280 +
47.281 + createdFiles.setLabelFor(createdFilesValue);
47.282 + org.openide.awt.Mnemonics.setLocalizedText(createdFiles, bundle.getString("LBL_CreatedFiles")); // NOI18N
47.283 + gridBagConstraints = new java.awt.GridBagConstraints();
47.284 + gridBagConstraints.gridx = 0;
47.285 + gridBagConstraints.gridy = 4;
47.286 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
47.287 + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
47.288 + gridBagConstraints.insets = new java.awt.Insets(36, 0, 6, 12);
47.289 + add(createdFiles, gridBagConstraints);
47.290 +
47.291 + modifiedFiles.setLabelFor(modifiedFilesValue);
47.292 + org.openide.awt.Mnemonics.setLocalizedText(modifiedFiles, bundle.getString("LBL_ModifiedFiles")); // NOI18N
47.293 + gridBagConstraints = new java.awt.GridBagConstraints();
47.294 + gridBagConstraints.gridx = 0;
47.295 + gridBagConstraints.gridy = 5;
47.296 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
47.297 + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
47.298 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
47.299 + add(modifiedFiles, gridBagConstraints);
47.300 + gridBagConstraints = new java.awt.GridBagConstraints();
47.301 + gridBagConstraints.gridx = 0;
47.302 + gridBagConstraints.gridy = 6;
47.303 + gridBagConstraints.gridwidth = 3;
47.304 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.305 + gridBagConstraints.weightx = 1.0;
47.306 + gridBagConstraints.weighty = 1.0;
47.307 + add(filler, gridBagConstraints);
47.308 +
47.309 + createdFilesValue.setEditable(false);
47.310 + createdFilesValue.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));
47.311 + createdFilesValue.setColumns(20);
47.312 + createdFilesValue.setRows(5);
47.313 + createdFilesValue.setBorder(null);
47.314 + gridBagConstraints = new java.awt.GridBagConstraints();
47.315 + gridBagConstraints.gridx = 1;
47.316 + gridBagConstraints.gridy = 4;
47.317 + gridBagConstraints.gridwidth = 2;
47.318 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.319 + gridBagConstraints.weightx = 1.0;
47.320 + gridBagConstraints.insets = new java.awt.Insets(36, 0, 6, 0);
47.321 + add(createdFilesValue, gridBagConstraints);
47.322 +
47.323 + modifiedFilesValue.setEditable(false);
47.324 + modifiedFilesValue.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));
47.325 + modifiedFilesValue.setColumns(20);
47.326 + modifiedFilesValue.setRows(5);
47.327 + modifiedFilesValue.setToolTipText("modifiedFilesValue");
47.328 + modifiedFilesValue.setBorder(null);
47.329 + gridBagConstraints = new java.awt.GridBagConstraints();
47.330 + gridBagConstraints.gridx = 1;
47.331 + gridBagConstraints.gridy = 5;
47.332 + gridBagConstraints.gridwidth = 2;
47.333 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
47.334 + gridBagConstraints.weightx = 1.0;
47.335 + add(modifiedFilesValue, gridBagConstraints);
47.336 + }// </editor-fold>//GEN-END:initComponents
47.337 +
47.338 + private void initAccessibility() {
47.339 + this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_NameAndLocationPanel"));
47.340 + comPackageName.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_PackageName"));
47.341 + txtIcon.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_Icon"));
47.342 + txtPrefix.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_Prefix"));
47.343 + btnIcon.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_IconButton"));
47.344 + txtProjectName.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ProjectName"));
47.345 + createdFilesValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_CreatedFilesValue"));
47.346 + modifiedFilesValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ModifiedFilesValue"));
47.347 + }
47.348 +
47.349 + private void btnIconActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIconActionPerformed
47.350 + JFileChooser chooser = WizardUtils.getIconFileChooser(txtIcon.getText());
47.351 + int ret = chooser.showDialog(this, getMessage("LBL_Select")); // NOI18N
47.352 + if (ret == JFileChooser.APPROVE_OPTION) {
47.353 + File file = chooser.getSelectedFile();
47.354 + txtIcon.setText(file.getAbsolutePath());
47.355 + }
47.356 + }//GEN-LAST:event_btnIconActionPerformed
47.357 +
47.358 + // Variables declaration - do not modify//GEN-BEGIN:variables
47.359 + private javax.swing.JButton btnIcon;
47.360 + private javax.swing.JComboBox comPackageName;
47.361 + private javax.swing.JLabel createdFiles;
47.362 + private javax.swing.JTextArea createdFilesValue;
47.363 + private javax.swing.JLabel filler;
47.364 + private javax.swing.JLabel lblIcon;
47.365 + private javax.swing.JLabel lblPackageName;
47.366 + private javax.swing.JLabel lblPrefix;
47.367 + private javax.swing.JLabel lblProjectName;
47.368 + private javax.swing.JLabel modifiedFiles;
47.369 + private javax.swing.JTextArea modifiedFilesValue;
47.370 + private javax.swing.JTextField txtIcon;
47.371 + private javax.swing.JTextField txtPrefix;
47.372 + private javax.swing.JTextField txtProjectName;
47.373 + // End of variables declaration//GEN-END:variables
47.374 +
47.375 +}
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
48.2 +++ b/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/newHTML.html Tue Sep 09 21:44:37 2014 +0200
48.3 @@ -0,0 +1,48 @@
48.4 +<!--
48.5 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
48.6 +
48.7 +Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
48.8 +
48.9 +
48.10 +The contents of this file are subject to the terms of either the GNU
48.11 +General Public License Version 2 only ("GPL") or the Common
48.12 +Development and Distribution License("CDDL") (collectively, the
48.13 +"License"). You may not use this file except in compliance with the
48.14 +License. You can obtain a copy of the License at
48.15 +http://www.netbeans.org/cddl-gplv2.html
48.16 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
48.17 +specific language governing permissions and limitations under the
48.18 +License. When distributing the software, include this License Header
48.19 +Notice in each file and include the License file at
48.20 +nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
48.21 +particular file as subject to the "Classpath" exception as provided
48.22 +by Sun in the GPL Version 2 section of the License file that
48.23 +accompanied this code. If applicable, add the following below the
48.24 +License Header, with the fields enclosed by brackets [] replaced by
48.25 +your own identifying information:
48.26 +"Portions Copyrighted [year] [name of copyright owner]"
48.27 +
48.28 +Contributor(s):
48.29 +
48.30 +The Original Software is NetBeans. The Initial Developer of the Original
48.31 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
48.32 +Microsystems, Inc. All Rights Reserved.
48.33 +
48.34 +If you wish your version of this file to be governed by only the CDDL
48.35 +or only the GPL Version 2, indicate your decision by adding
48.36 +"[Contributor] elects to include this software in this distribution
48.37 +under the [CDDL or GPL Version 2] license." If you do not indicate a
48.38 +single choice of license, a recipient has the option to distribute
48.39 +your version of this file under either the CDDL, the GPL Version 2 or
48.40 +to extend the choice of license to its licensees as provided above.
48.41 +However, if you add GPL Version 2 code and therefore, elected the GPL
48.42 +Version 2 license, then the option applies only if the new code is
48.43 +made subject to such option by the copyright holder.
48.44 +-->
48.45 +<html>
48.46 + <body>
48.47 + Generates action & skeletal HTML based UI that
48.48 + is easy to use in NetBeans as well as any HTML capable
48.49 + rendering client (browser, your phone, tablet, etc.).
48.50 + </body>
48.51 +</html>
49.1 Binary file apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/html/newHTML.png has changed
50.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
50.2 +++ b/nbbuild/antsrc/org/netbeans/nbbuild/ProcessJsAnnotationsTask.java Tue Sep 09 21:44:37 2014 +0200
50.3 @@ -0,0 +1,241 @@
50.4 +/**
50.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
50.6 + *
50.7 + * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
50.8 + *
50.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
50.10 + * Other names may be trademarks of their respective owners.
50.11 + *
50.12 + * The contents of this file are subject to the terms of either the GNU
50.13 + * General Public License Version 2 only ("GPL") or the Common
50.14 + * Development and Distribution License("CDDL") (collectively, the
50.15 + * "License"). You may not use this file except in compliance with the
50.16 + * License. You can obtain a copy of the License at
50.17 + * http://www.netbeans.org/cddl-gplv2.html
50.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
50.19 + * specific language governing permissions and limitations under the
50.20 + * License. When distributing the software, include this License Header
50.21 + * Notice in each file and include the License file at
50.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
50.23 + * particular file as subject to the "Classpath" exception as provided
50.24 + * by Oracle in the GPL Version 2 section of the License file that
50.25 + * accompanied this code. If applicable, add the following below the
50.26 + * License Header, with the fields enclosed by brackets [] replaced by
50.27 + * your own identifying information:
50.28 + * "Portions Copyrighted [year] [name of copyright owner]"
50.29 + *
50.30 + * Contributor(s):
50.31 + *
50.32 + * The Original Software is NetBeans. The Initial Developer of the Original
50.33 + * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
50.34 + *
50.35 + * If you wish your version of this file to be governed by only the CDDL
50.36 + * or only the GPL Version 2, indicate your decision by adding
50.37 + * "[Contributor] elects to include this software in this distribution
50.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
50.39 + * single choice of license, a recipient has the option to distribute
50.40 + * your version of this file under either the CDDL, the GPL Version 2 or
50.41 + * to extend the choice of license to its licensees as provided above.
50.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
50.43 + * Version 2 license, then the option applies only if the new code is
50.44 + * made subject to such option by the copyright holder.
50.45 + */
50.46 +package org.netbeans.nbbuild;
50.47 +
50.48 +import java.io.BufferedReader;
50.49 +import java.io.File;
50.50 +import java.io.FileInputStream;
50.51 +import java.io.FileNotFoundException;
50.52 +import java.io.FileOutputStream;
50.53 +import java.io.FileReader;
50.54 +import java.io.FileWriter;
50.55 +import java.io.IOException;
50.56 +import java.io.InputStream;
50.57 +import java.lang.reflect.Method;
50.58 +import java.net.MalformedURLException;
50.59 +import java.net.URL;
50.60 +import java.net.URLClassLoader;
50.61 +import java.util.ArrayList;
50.62 +import java.util.LinkedList;
50.63 +import java.util.List;
50.64 +import java.util.logging.Level;
50.65 +import java.util.logging.Logger;
50.66 +import org.apache.tools.ant.BuildException;
50.67 +import org.apache.tools.ant.Project;
50.68 +import org.apache.tools.ant.Task;
50.69 +import org.apache.tools.ant.types.Path;
50.70 +import org.apache.tools.ant.util.FileUtils;
50.71 +
50.72 +public final class ProcessJsAnnotationsTask extends Task {
50.73 + private File classes;
50.74 + private Path cp;
50.75 + private File asm;
50.76 +
50.77 + public ProcessJsAnnotationsTask() {
50.78 + }
50.79 +
50.80 + public void setClasses(File f) {
50.81 + classes = f;
50.82 + }
50.83 +
50.84 + public void setAsm(File f) {
50.85 + asm = f;
50.86 + }
50.87 +
50.88 + public Path createClasspath() {
50.89 + if (cp == null) {
50.90 + cp = new Path(getProject());
50.91 + }
50.92 + return cp.createPath();
50.93 + }
50.94 +
50.95 + @Override
50.96 + public void execute() throws BuildException {
50.97 + if (classes == null) {
50.98 + throw new BuildException("root of classes must be specified!");
50.99 + }
50.100 + File master = new File(new File(classes, "META-INF"), "net.java.html.js.classes");
50.101 + if (!master.exists()) {
50.102 + return;
50.103 + }
50.104 +
50.105 + LinkedList<URL> arr = new LinkedList<URL>();
50.106 + boolean foundAsm = false;
50.107 + for (String s : cp.list()) {
50.108 + final File f = FileUtils.getFileUtils().resolveFile(getProject().getBaseDir(), s);
50.109 + if (f != null) {
50.110 + if (f.getName().contains("asm")) {
50.111 + foundAsm = true;
50.112 + }
50.113 + try {
50.114 + arr.add(f.toURI().toURL());
50.115 + } catch (MalformedURLException ex) {
50.116 + throw new IllegalStateException(ex);
50.117 + }
50.118 + }
50.119 + }
50.120 + if (!foundAsm) {
50.121 + URL loc;
50.122 + if (asm == null || !asm.exists()) {
50.123 + throw new BuildException("Cannot find asm!");
50.124 + }
50.125 + try {
50.126 + loc = asm.toURI().toURL();
50.127 + } catch (MalformedURLException ex) {
50.128 + throw new BuildException(ex);
50.129 + }
50.130 + arr.addFirst(loc);
50.131 + }
50.132 + URLClassLoader l = new URLClassLoader(arr.toArray(new URL[arr.size()]));
50.133 + try {
50.134 + processClasses(l, master, classes);
50.135 + } catch (IOException ex) {
50.136 + throw new BuildException("Problem converting JavaScriptXXX annotations", ex);
50.137 + }
50.138 + }
50.139 +
50.140 + private void processClasses(ClassLoader l, File master, File f) throws IOException {
50.141 + if (!f.exists()) {
50.142 + return;
50.143 + }
50.144 + if (f.isDirectory()) {
50.145 + boolean classes = new File(f, "net.java.html.js.classes").exists();
50.146 + File[] arr = f.listFiles();
50.147 + if (arr != null) {
50.148 + for (File file : arr) {
50.149 + if (classes || file.isDirectory()) {
50.150 + processClasses(l, master, file);
50.151 + }
50.152 + }
50.153 + }
50.154 + return;
50.155 + }
50.156 +
50.157 + if (!f.getName().endsWith(".class")) {
50.158 + return;
50.159 + }
50.160 +
50.161 + byte[] arr = new byte[(int)f.length()];
50.162 + FileInputStream is = new FileInputStream(f);
50.163 + try {
50.164 + readArr(arr, is);
50.165 + } finally {
50.166 + is.close();
50.167 + }
50.168 +
50.169 + byte[] newArr = null;
50.170 + try {
50.171 + Class<?> fnUtils = l.loadClass("org.netbeans.html.boot.impl.FnUtils");
50.172 + Method transform = fnUtils.getMethod("transform", byte[].class, ClassLoader.class);
50.173 +
50.174 + newArr = (byte[]) transform.invoke(null, arr, l);
50.175 + if (newArr == null || newArr == arr) {
50.176 + return;
50.177 + }
50.178 + filterClass(new File(f.getParentFile(), "net.java.html.js.classes"), f.getName());
50.179 + filterClass(master, f.getName());
50.180 + } catch (Exception ex) {
50.181 + throw new BuildException("Can't process " + f, ex);
50.182 + }
50.183 + log("Processing " + f, Project.MSG_INFO);
50.184 + writeArr(f, newArr);
50.185 + }
50.186 +
50.187 + private void writeArr(File f, byte[] newArr) throws IOException, FileNotFoundException {
50.188 + FileOutputStream os = new FileOutputStream(f);
50.189 + try {
50.190 + os.write(newArr);
50.191 + } finally {
50.192 + os.close();
50.193 + }
50.194 + }
50.195 +
50.196 + private static void readArr(byte[] arr, InputStream is) throws IOException {
50.197 + int off = 0;
50.198 + while (off< arr.length) {
50.199 + int read = is.read(arr, off, arr.length - off);
50.200 + if (read == -1) {
50.201 + break;
50.202 + }
50.203 + off += read;
50.204 + }
50.205 + }
50.206 +
50.207 + private static void filterClass(File f, String className) throws IOException {
50.208 + if (!f.exists()) {
50.209 + return;
50.210 + }
50.211 + if (className.endsWith(".class")) {
50.212 + className = className.substring(0, className.length() - 6);
50.213 + }
50.214 +
50.215 + BufferedReader r = new BufferedReader(new FileReader(f));
50.216 + List<String> arr = new ArrayList<String>();
50.217 + boolean modified = false;
50.218 + for (;;) {
50.219 + String line = r.readLine();
50.220 + if (line == null) {
50.221 + break;
50.222 + }
50.223 + if (line.endsWith(className)) {
50.224 + modified = true;
50.225 + continue;
50.226 + }
50.227 + arr.add(line);
50.228 + }
50.229 + r.close();
50.230 +
50.231 + if (modified) {
50.232 + if (arr.isEmpty()) {
50.233 + f.delete();
50.234 + } else {
50.235 + FileWriter w = new FileWriter(f);
50.236 + for (String l : arr) {
50.237 + w.write(l);
50.238 + w.write("\n");
50.239 + }
50.240 + w.close();
50.241 + }
50.242 + }
50.243 + }
50.244 +}
51.1 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/DownloadBinaries.java Tue Sep 09 13:59:54 2014 +0000
51.2 +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/DownloadBinaries.java Tue Sep 09 21:44:37 2014 +0200
51.3 @@ -54,7 +54,6 @@
51.4 import java.io.OutputStream;
51.5 import java.math.BigInteger;
51.6 import java.net.HttpURLConnection;
51.7 -import java.net.MalformedURLException;
51.8 import java.net.URL;
51.9 import java.net.URLConnection;
51.10 import java.security.MessageDigest;
51.11 @@ -152,62 +151,27 @@
51.12 try {
51.13 InputStream is = new FileInputStream(manifest);
51.14 try {
51.15 - BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
51.16 - String line;
51.17 - while ((line = r.readLine()) != null) {
51.18 - if (line.startsWith("#")) {
51.19 - continue;
51.20 - }
51.21 - if (line.trim().length() == 0) {
51.22 - continue;
51.23 - }
51.24 - String[] hashAndFile = line.split(" ", 2);
51.25 - if (hashAndFile.length < 2) {
51.26 - throw new BuildException("Bad line '" + line + "' in " + manifest, getLocation());
51.27 - }
51.28 - String expectedHash = hashAndFile[0];
51.29 - String baseName = hashAndFile[1];
51.30 - File f = new File(manifest.getParentFile(), baseName);
51.31 - if (!clean) {
51.32 - if (!f.exists() || !hash(f).equals(expectedHash)) {
51.33 - log("Creating " + f);
51.34 - String cacheName = expectedHash + "-" + baseName;
51.35 - if (cache != null) {
51.36 - cache.mkdirs();
51.37 - File cacheFile = new File(cache, cacheName);
51.38 - if (!cacheFile.exists()) {
51.39 - download(cacheName, cacheFile, expectedHash);
51.40 - }
51.41 - if (f.isFile() && !f.delete()) {
51.42 - throw new BuildException("Could not delete " + f);
51.43 - }
51.44 - try {
51.45 - FileUtils.getFileUtils().copyFile(cacheFile, f);
51.46 - } catch (IOException x) {
51.47 - throw new BuildException("Could not copy " + cacheFile + " to " + f + ": " + x, x, getLocation());
51.48 - }
51.49 - } else {
51.50 - download(cacheName, f, expectedHash);
51.51 - }
51.52 + BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
51.53 + String line;
51.54 + while ((line = r.readLine()) != null) {
51.55 + if (line.startsWith("#")) {
51.56 + continue;
51.57 }
51.58 - String actualHash = hash(f);
51.59 - if (!actualHash.equals(expectedHash)) {
51.60 - throw new BuildException("File " + f + " requested by " + manifest + " to have hash " +
51.61 - expectedHash + " actually had hash " + actualHash, getLocation());
51.62 + if (line.trim().length() == 0) {
51.63 + continue;
51.64 }
51.65 - log("Have " + f + " with expected hash", Project.MSG_VERBOSE);
51.66 - } else {
51.67 - if (f.exists()) {
51.68 - String actualHash = hash(f);
51.69 - if (!actualHash.equals(expectedHash)) {
51.70 - throw new BuildException("File " + f + " requested by " + manifest + " to have hash " +
51.71 - expectedHash + " actually had hash " + actualHash, getLocation());
51.72 - }
51.73 - log("Deleting " + f);
51.74 - f.delete();
51.75 + String[] hashAndFile = line.split(" ", 2);
51.76 + if (hashAndFile.length < 2) {
51.77 + throw new BuildException("Bad line '" + line + "' in " + manifest, getLocation());
51.78 + }
51.79 +
51.80 +// if (hashAndFile[0].contains(":")) {
51.81 +// mavenFile(hashAndFile[0], hashAndFile[1], manifest);
51.82 +// } else
51.83 + {
51.84 + hashedFile(hashAndFile[0], hashAndFile[1], manifest);
51.85 }
51.86 }
51.87 - }
51.88 } finally {
51.89 is.close();
51.90 }
51.91 @@ -217,6 +181,78 @@
51.92 }
51.93 }
51.94 }
51.95 +
51.96 + private void mavenFile(String id, String baseName, File manifest) throws BuildException {
51.97 + String[] ids = id.split(":");
51.98 + if (ids.length != 3) {
51.99 + throw new BuildException("Expecting groupId:artifactId:version, but was " + id + " in " + manifest);
51.100 + }
51.101 +
51.102 + File f = new File(manifest.getParentFile(), baseName);
51.103 + if (clean || !f.exists()) {
51.104 + String cacheName = ids[0].replace('.', '/') + "/" +
51.105 + ids[1] + "/" + ids[2] + "/" + ids[1] + "-" + ids[2] + ".jar";
51.106 +
51.107 + File local = new File(new File(new File(new File(System.getProperty("user.home")), ".m2"), "repository"), cacheName.replace('/', File.separatorChar));
51.108 + final String url;
51.109 + if (local.exists()) {
51.110 + url = local.toURI().toString();
51.111 + } else {
51.112 + url = "http://central.maven.org/maven2/" + cacheName;
51.113 + }
51.114 + try {
51.115 + URL u = new URL(url);
51.116 + downloadFromServer(u, cacheName, f, null);
51.117 + } catch (IOException ex) {
51.118 + String msg = "Could not download " + url + " to " + f + ": " + cacheName;
51.119 + log(msg, Project.MSG_WARN);
51.120 + throw new BuildException(ex);
51.121 + }
51.122 + }
51.123 + }
51.124 +
51.125 + private void hashedFile(String expectedHash, String baseName, File manifest) throws BuildException {
51.126 + File f = new File(manifest.getParentFile(), baseName);
51.127 + if (!clean) {
51.128 + if (!f.exists() || !hash(f).equals(expectedHash)) {
51.129 + log("Creating " + f);
51.130 + String cacheName = expectedHash + "-" + baseName;
51.131 + if (cache != null) {
51.132 + cache.mkdirs();
51.133 + File cacheFile = new File(cache, cacheName);
51.134 + if (!cacheFile.exists()) {
51.135 + download(cacheName, cacheFile, expectedHash);
51.136 + }
51.137 + if (f.isFile() && !f.delete()) {
51.138 + throw new BuildException("Could not delete " + f);
51.139 + }
51.140 + try {
51.141 + FileUtils.getFileUtils().copyFile(cacheFile, f);
51.142 + } catch (IOException x) {
51.143 + throw new BuildException("Could not copy " + cacheFile + " to " + f + ": " + x, x, getLocation());
51.144 + }
51.145 + } else {
51.146 + download(cacheName, f, expectedHash);
51.147 + }
51.148 + }
51.149 + String actualHash = hash(f);
51.150 + if (!actualHash.equals(expectedHash)) {
51.151 + throw new BuildException("File " + f + " requested by " + manifest + " to have hash " +
51.152 + expectedHash + " actually had hash " + actualHash, getLocation());
51.153 + }
51.154 + log("Have " + f + " with expected hash", Project.MSG_VERBOSE);
51.155 + } else {
51.156 + if (f.exists()) {
51.157 + String actualHash = hash(f);
51.158 + if (!actualHash.equals(expectedHash)) {
51.159 + throw new BuildException("File " + f + " requested by " + manifest + " to have hash " +
51.160 + expectedHash + " actually had hash " + actualHash, getLocation());
51.161 + }
51.162 + log("Deleting " + f);
51.163 + f.delete();
51.164 + }
51.165 + }
51.166 + }
51.167
51.168 private void download(String cacheName, File destination, String expectedHash) {
51.169 if (server == null) {
51.170 @@ -224,55 +260,12 @@
51.171 }
51.172 Throwable firstProblem = null;
51.173 for (String prefix : server.split(" ")) {
51.174 - URL url;
51.175 + URL url = null;
51.176 try {
51.177 url = new URL(prefix + cacheName);
51.178 - } catch (MalformedURLException x) {
51.179 - throw new BuildException(x, getLocation());
51.180 - }
51.181 - try {
51.182 - URLConnection conn = url.openConnection();
51.183 - conn.connect();
51.184 - int code = HttpURLConnection.HTTP_OK;
51.185 - if (conn instanceof HttpURLConnection) {
51.186 - code = ((HttpURLConnection) conn).getResponseCode();
51.187 + if (downloadFromServer(url, cacheName, destination, expectedHash)) {
51.188 + return;
51.189 }
51.190 - if (code != HttpURLConnection.HTTP_OK) {
51.191 - log("Skipping download from " + url + " due to response code " + code, Project.MSG_VERBOSE);
51.192 - continue;
51.193 - }
51.194 - log("Downloading: " + url);
51.195 - InputStream is = conn.getInputStream();
51.196 - try {
51.197 - ByteArrayOutputStream baos = new ByteArrayOutputStream();
51.198 - try {
51.199 - byte[] buf = new byte[4096];
51.200 - int read;
51.201 - while ((read = is.read(buf)) != -1) {
51.202 - baos.write(buf, 0, read);
51.203 - }
51.204 - } catch (IOException x) {
51.205 - throw new BuildException(x); // should not happen
51.206 - }
51.207 - byte[] data = baos.toByteArray();
51.208 - String actualHash = hash(new ByteArrayInputStream(data));
51.209 - if (!expectedHash.equals(actualHash)) {
51.210 - throw new BuildException("Download of " + url + " produced content with hash " +
51.211 - actualHash + " when " + expectedHash + " was expected", getLocation());
51.212 - }
51.213 - OutputStream os = new FileOutputStream(destination);
51.214 - try {
51.215 - os.write(data);
51.216 - } catch (IOException x) {
51.217 - os.close();
51.218 - destination.delete();
51.219 - throw x;
51.220 - }
51.221 - os.close();
51.222 - } finally {
51.223 - is.close();
51.224 - }
51.225 - return;
51.226 } catch (IOException x) {
51.227 String msg = "Could not download " + url + " to " + destination + ": " + x;
51.228 log(msg, Project.MSG_WARN);
51.229 @@ -283,6 +276,54 @@
51.230 }
51.231 throw new BuildException("Could not download " + cacheName + " from " + server + ": " + firstProblem, firstProblem, getLocation());
51.232 }
51.233 +
51.234 + private boolean downloadFromServer(URL url, String cacheName, File destination, String expectedHash)
51.235 + throws IOException {
51.236 + URLConnection conn = url.openConnection();
51.237 + conn.connect();
51.238 + int code = HttpURLConnection.HTTP_OK;
51.239 + if (conn instanceof HttpURLConnection) {
51.240 + code = ((HttpURLConnection) conn).getResponseCode();
51.241 + }
51.242 + if (code != HttpURLConnection.HTTP_OK) {
51.243 + log("Skipping download from " + url + " due to response code " + code, Project.MSG_VERBOSE);
51.244 + return false;
51.245 + }
51.246 + log("Downloading: " + url);
51.247 + InputStream is = conn.getInputStream();
51.248 + try {
51.249 + ByteArrayOutputStream baos = new ByteArrayOutputStream();
51.250 + try {
51.251 + byte[] buf = new byte[4096];
51.252 + int read;
51.253 + while ((read = is.read(buf)) != -1) {
51.254 + baos.write(buf, 0, read);
51.255 + }
51.256 + } catch (IOException x) {
51.257 + throw new BuildException(x); // should not happen
51.258 + }
51.259 + byte[] data = baos.toByteArray();
51.260 + if (expectedHash != null) {
51.261 + String actualHash = hash(new ByteArrayInputStream(data));
51.262 + if (!expectedHash.equals(actualHash)) {
51.263 + throw new BuildException("Download of " + url + " produced content with hash "
51.264 + + actualHash + " when " + expectedHash + " was expected", getLocation());
51.265 + }
51.266 + }
51.267 + OutputStream os = new FileOutputStream(destination);
51.268 + try {
51.269 + os.write(data);
51.270 + } catch (IOException x) {
51.271 + os.close();
51.272 + destination.delete();
51.273 + throw x;
51.274 + }
51.275 + os.close();
51.276 + } finally {
51.277 + is.close();
51.278 + }
51.279 + return true;
51.280 + }
51.281
51.282 private String hash(File f) {
51.283 try {
52.1 --- a/nbbuild/build.properties Tue Sep 09 13:59:54 2014 +0000
52.2 +++ b/nbbuild/build.properties Tue Sep 09 21:44:37 2014 +0200
52.3 @@ -99,6 +99,7 @@
52.4 # List of modules that provide stable javadoc
52.5 config.javadoc.stable=\
52.6 api.annotations.common,\
52.7 + api.html4j,\
52.8 api.maven,\
52.9 autoupdate.services,\
52.10 autoupdate.ui,\
53.1 --- a/nbbuild/cluster.properties Tue Sep 09 13:59:54 2014 +0000
53.2 +++ b/nbbuild/cluster.properties Tue Sep 09 21:44:37 2014 +0200
53.3 @@ -179,6 +179,7 @@
53.4 nb.cluster.platform.depends=
53.5 nb.cluster.platform=\
53.6 api.annotations.common,\
53.7 + api.html4j,\
53.8 api.progress,\
53.9 api.search,\
53.10 api.visual,\
53.11 @@ -219,13 +220,22 @@
53.12 masterfs.macosx,\
53.13 masterfs.nio2,\
53.14 masterfs.windows,\
53.15 + net.java.html,\
53.16 + net.java.html.boot,\
53.17 + net.java.html.boot.fx,\
53.18 + net.java.html.boot.script,\
53.19 + net.java.html.geo,\
53.20 + net.java.html.json,\
53.21 + net.java.html.sound,\
53.22 netbinox,\
53.23 o.jdesktop.layout,\
53.24 o.n.bootstrap,\
53.25 o.n.core,\
53.26 + o.n.html.ko4j,\
53.27 o.n.swing.outline,\
53.28 o.n.swing.plaf,\
53.29 o.n.swing.tabcontrol,\
53.30 + o.objectweb.asm,\
53.31 openide.actions,\
53.32 openide.awt,\
53.33 openide.compat,\
54.1 --- a/nbbuild/default.xml Tue Sep 09 13:59:54 2014 +0000
54.2 +++ b/nbbuild/default.xml Tue Sep 09 21:44:37 2014 +0200
54.3 @@ -95,6 +95,9 @@
54.4 <taskdef name="parseprojectxml"
54.5 classname="org.netbeans.nbbuild.ParseProjectXml"
54.6 classpath="${nbantext.jar}"/>
54.7 + <taskdef name="processjsannotation"
54.8 + classname="org.netbeans.nbbuild.ProcessJsAnnotationsTask"
54.9 + classpath="${nbantext.jar}"/>
54.10 <taskdef name="jarwithmoduleattributes"
54.11 classname="org.netbeans.nbbuild.JarWithModuleAttributes"
54.12 classpath="${nbantext.jar}"/>
55.1 --- a/nbbuild/hudson/core-main Tue Sep 09 13:59:54 2014 +0000
55.2 +++ b/nbbuild/hudson/core-main Tue Sep 09 21:44:37 2014 +0200
55.3 @@ -70,6 +70,7 @@
55.4 maven.model,\
55.5 maven.osgi,\
55.6 nbjunit,\
55.7 +nbbrwsr,\
55.8 netbinox,\
55.9 o.apache.tools.ant.module,\
55.10 o.n.bootstrap,\
56.1 --- a/nbbuild/javadoctools/links.xml Tue Sep 09 13:59:54 2014 +0000
56.2 +++ b/nbbuild/javadoctools/links.xml Tue Sep 09 21:44:37 2014 +0200
56.3 @@ -223,3 +223,5 @@
56.4 <link href="${javadoc.docs.org-netbeans-modules-bugtracking}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-modules-bugtracking"/>
56.5 <link href="${javadoc.docs.org-netbeans-core-multitabs}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-core-multitabs"/>
56.6 <link href="${javadoc.docs.org-netbeans-api-maven}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-api-maven"/>
56.7 +<link href="${javadoc.docs.org-netbeans-api-html4j}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-api-html4j"/>
56.8 +<link href="http://bits.netbeans.org/html4j/0.9/" offline="false" />
57.1 --- a/nbbuild/javadoctools/properties.xml Tue Sep 09 13:59:54 2014 +0000
57.2 +++ b/nbbuild/javadoctools/properties.xml Tue Sep 09 21:44:37 2014 +0200
57.3 @@ -221,3 +221,4 @@
57.4 <property name="javadoc.docs.org-netbeans-modules-bugtracking" value="${javadoc.web.root}/org-netbeans-modules-bugtracking"/>
57.5 <property name="javadoc.docs.org-netbeans-core-multitabs" value="${javadoc.web.root}/org-netbeans-core-multitabs"/>
57.6 <property name="javadoc.docs.org-netbeans-api-maven" value="${javadoc.web.root}/org-netbeans-api-maven"/>
57.7 +<property name="javadoc.docs.org-netbeans-api-html4j" value="${javadoc.web.root}/org-netbeans-api-html4j"/>
58.1 --- a/nbbuild/javadoctools/replaces.xml Tue Sep 09 13:59:54 2014 +0000
58.2 +++ b/nbbuild/javadoctools/replaces.xml Tue Sep 09 21:44:37 2014 +0200
58.3 @@ -221,3 +221,4 @@
58.4 <replacefilter token="@org-netbeans-modules-bugtracking@" value="${javadoc.docs.org-netbeans-modules-bugtracking}"/>
58.5 <replacefilter token="@org-netbeans-core-multitabs@" value="${javadoc.docs.org-netbeans-core-multitabs}"/>
58.6 <replacefilter token="@org-netbeans-api-maven@" value="${javadoc.docs.org-netbeans-api-maven}"/>
58.7 +<replacefilter token="@org-netbeans-api-html4j@" value="${javadoc.docs.org-netbeans-api-html4j}"/>
59.1 --- a/nbbuild/templates/common.xml Tue Sep 09 13:59:54 2014 +0000
59.2 +++ b/nbbuild/templates/common.xml Tue Sep 09 21:44:37 2014 +0200
59.3 @@ -102,6 +102,10 @@
59.4 <tstamp>
59.5 <format property="module.build.started.time" pattern="yyyy-MM-dd'T'HH:mm:ss.SSSZ"/>
59.6 </tstamp>
59.7 + <condition property="asm.jar" value="${nbplatform.active.dir}/platform/modules/org-objectweb-asm.jar">
59.8 + <available file="${nbplatform.active.dir}/platform//modules/org-objectweb-asm.jar"/>
59.9 + </condition>
59.10 + <property name="asm.jar" location="${o.objectweb.asm.dir}/modules/org-objectweb-asm.jar"/>
59.11 </target>
59.12
59.13 <target name="-release.dir">
59.14 @@ -225,6 +229,9 @@
59.15 <copy todir="${build.classes.dir}">
59.16 <fileset dir="${src.dir}" excludes="${jar-excludes}"/>
59.17 </copy>
59.18 + <processjsannotation classes="${build.classes.dir}" asm="${asm.jar}">
59.19 + <classpath refid="cp"/>
59.20 + </processjsannotation>
59.21 </target>
59.22
59.23 <target name="compile-single" depends="init">
59.24 @@ -251,6 +258,9 @@
59.25 <compilerarg line="${javac.compilerargs}"/>
59.26 <processorpath refid="processor.cp"/>
59.27 </nb-javac>
59.28 + <processjsannotation classes="${build.classes.dir}" asm="${asm.jar}">
59.29 + <classpath refid="cp"/>
59.30 + </processjsannotation>
59.31 </target>
59.32
59.33 <target name="jar-prep" depends="init">
59.34 @@ -588,6 +598,9 @@
59.35 <compilerarg line="${javac.compilerargs}"/>
59.36 <processorpath refid="test.@{test.type}.cp"/>
59.37 </nb-javac>
59.38 + <processjsannotation classes="${build.test.@{test.type}.classes.dir}" asm="${asm.jar}">
59.39 + <classpath refid="test.@{test.type}.cp"/>
59.40 + </processjsannotation>
59.41 <copy todir="${build.test.@{test.type}.classes.dir}">
59.42 <fileset dir="${test.@{test.type}.src.dir}">
59.43 <exclude name="**/*.java"/>
59.44 @@ -627,6 +640,9 @@
59.45 <compilerarg line="${javac.compilerargs}"/>
59.46 <processorpath refid="test.@{test.type}.cp"/>
59.47 </nb-javac>
59.48 + <processjsannotation classes="${build.test.@{test.type}.classes.dir}" asm="${asm.jar}">
59.49 + <classpath refid="test.@{test.type}.cp"/>
59.50 + </processjsannotation>
59.51 <copy todir="${build.test.@{test.type}.classes.dir}">
59.52 <fileset dir="${test.@{test.type}.src.dir}">
59.53 <exclude name="**/*.java"/>
60.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
60.2 +++ b/net.java.html.boot.fx/build.xml Tue Sep 09 21:44:37 2014 +0200
60.3 @@ -0,0 +1,5 @@
60.4 +<?xml version="1.0" encoding="UTF-8"?>
60.5 +<project name="net.java.html.boot.fx" default="netbeans" basedir=".">
60.6 + <import file="../nbbuild/templates/projectized.xml"/>
60.7 + <target name="jar"/>
60.8 +</project>
61.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
61.2 +++ b/net.java.html.boot.fx/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
61.3 @@ -0,0 +1,1 @@
61.4 +29388BB216B2463DB0B7AD403392C0F7EA7A4260 net-java-html-boot-fx.jar
62.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
62.2 +++ b/net.java.html.boot.fx/manifest.mf Tue Sep 09 21:44:37 2014 +0200
62.3 @@ -0,0 +1,1 @@
62.4 +OpenIDE-Module: net.java.html.boot.fx
63.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
63.2 +++ b/net.java.html.boot.fx/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
63.3 @@ -0,0 +1,3 @@
63.4 +release.external/net-java-html-boot-fx.jar=modules/net-java-html-boot-fx.jar
63.5 +is.autoload=true
63.6 +nbm.module.author=Jaroslav Tulach
64.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
64.2 +++ b/net.java.html.boot.fx/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
64.3 @@ -0,0 +1,15 @@
64.4 +<?xml version="1.0" encoding="UTF-8"?>
64.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
64.6 + <type>org.netbeans.modules.apisupport.project</type>
64.7 + <configuration>
64.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
64.9 + <code-name-base>net.java.html.boot.fx</code-name-base>
64.10 + <module-dependencies/>
64.11 + <public-packages/>
64.12 + <class-path-extension>
64.13 + <runtime-relative-path>net-java-html-boot-fx.jar</runtime-relative-path>
64.14 + <binary-origin>external/net-java-html-boot-fx.jar</binary-origin>
64.15 + </class-path-extension>
64.16 + </data>
64.17 + </configuration>
64.18 +</project>
65.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
65.2 +++ b/net.java.html.boot.script/build.xml Tue Sep 09 21:44:37 2014 +0200
65.3 @@ -0,0 +1,5 @@
65.4 +<?xml version="1.0" encoding="UTF-8"?>
65.5 +<project name="net.java.html.boot.script" default="netbeans" basedir=".">
65.6 + <import file="../nbbuild/templates/projectized.xml"/>
65.7 + <target name="jar"/>
65.8 +</project>
66.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
66.2 +++ b/net.java.html.boot.script/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
66.3 @@ -0,0 +1,1 @@
66.4 +37B1B513D8E7A2689A92188DABE950E0D63176D3 net-java-html-boot-script.jar
67.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
67.2 +++ b/net.java.html.boot.script/manifest.mf Tue Sep 09 21:44:37 2014 +0200
67.3 @@ -0,0 +1,1 @@
67.4 +OpenIDE-Module: net.java.html.boot.script
68.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
68.2 +++ b/net.java.html.boot.script/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
68.3 @@ -0,0 +1,3 @@
68.4 +release.external/net-java-html-boot-script.jar=modules/net-java-html-boot-script.jar
68.5 +is.autoload=true
68.6 +nbm.module.author=Jaroslav Tulach
69.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
69.2 +++ b/net.java.html.boot.script/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
69.3 @@ -0,0 +1,15 @@
69.4 +<?xml version="1.0" encoding="UTF-8"?>
69.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
69.6 + <type>org.netbeans.modules.apisupport.project</type>
69.7 + <configuration>
69.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
69.9 + <code-name-base>net.java.html.boot.script</code-name-base>
69.10 + <module-dependencies/>
69.11 + <public-packages/>
69.12 + <class-path-extension>
69.13 + <runtime-relative-path>net-java-html-boot-script.jar</runtime-relative-path>
69.14 + <binary-origin>external/net-java-html-boot-script.jar</binary-origin>
69.15 + </class-path-extension>
69.16 + </data>
69.17 + </configuration>
69.18 +</project>
70.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
70.2 +++ b/net.java.html.boot/build.xml Tue Sep 09 21:44:37 2014 +0200
70.3 @@ -0,0 +1,5 @@
70.4 +<?xml version="1.0" encoding="UTF-8"?>
70.5 +<project name="net.java.html.boot" default="netbeans" basedir=".">
70.6 + <import file="../nbbuild/templates/projectized.xml"/>
70.7 + <target name="jar"/>
70.8 +</project>
71.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
71.2 +++ b/net.java.html.boot/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
71.3 @@ -0,0 +1,1 @@
71.4 +72B71E13ADC08732D8274083908D47ED9CC37B55 net-java-html-boot.jar
72.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
72.2 +++ b/net.java.html.boot/manifest.mf Tue Sep 09 21:44:37 2014 +0200
72.3 @@ -0,0 +1,1 @@
72.4 +OpenIDE-Module: net.java.html.boot
73.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
73.2 +++ b/net.java.html.boot/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
73.3 @@ -0,0 +1,3 @@
73.4 +release.external/net-java-html-boot.jar=modules/net-java-html-boot.jar
73.5 +is.autoload=true
73.6 +nbm.module.author=Jaroslav Tulach
74.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
74.2 +++ b/net.java.html.boot/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
74.3 @@ -0,0 +1,15 @@
74.4 +<?xml version="1.0" encoding="UTF-8"?>
74.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
74.6 + <type>org.netbeans.modules.apisupport.project</type>
74.7 + <configuration>
74.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
74.9 + <code-name-base>net.java.html.boot</code-name-base>
74.10 + <module-dependencies/>
74.11 + <public-packages/>
74.12 + <class-path-extension>
74.13 + <runtime-relative-path>net-java-html-boot.jar</runtime-relative-path>
74.14 + <binary-origin>external/net-java-html-boot.jar</binary-origin>
74.15 + </class-path-extension>
74.16 + </data>
74.17 + </configuration>
74.18 +</project>
75.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
75.2 +++ b/net.java.html.geo/build.xml Tue Sep 09 21:44:37 2014 +0200
75.3 @@ -0,0 +1,5 @@
75.4 +<?xml version="1.0" encoding="UTF-8"?>
75.5 +<project name="net.java.html.geo" default="netbeans" basedir=".">
75.6 + <import file="../nbbuild/templates/projectized.xml"/>
75.7 + <target name="jar"/>
75.8 +</project>
76.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
76.2 +++ b/net.java.html.geo/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
76.3 @@ -0,0 +1,1 @@
76.4 +51ADBD6B0FE548E15BD10AFC345CAD48589E960E net-java-html-geo.jar
77.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
77.2 +++ b/net.java.html.geo/manifest.mf Tue Sep 09 21:44:37 2014 +0200
77.3 @@ -0,0 +1,1 @@
77.4 +OpenIDE-Module: net.java.html.geo
78.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
78.2 +++ b/net.java.html.geo/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
78.3 @@ -0,0 +1,3 @@
78.4 +release.external/net-java-html-geo.jar=modules/net-java-html-geo.jar
78.5 +is.autoload=true
78.6 +nbm.module.author=Jaroslav Tulach
79.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
79.2 +++ b/net.java.html.geo/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
79.3 @@ -0,0 +1,15 @@
79.4 +<?xml version="1.0" encoding="UTF-8"?>
79.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
79.6 + <type>org.netbeans.modules.apisupport.project</type>
79.7 + <configuration>
79.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
79.9 + <code-name-base>net.java.html.geo</code-name-base>
79.10 + <module-dependencies/>
79.11 + <public-packages/>
79.12 + <class-path-extension>
79.13 + <runtime-relative-path>net-java-html-geo.jar</runtime-relative-path>
79.14 + <binary-origin>external/net-java-html-geo.jar</binary-origin>
79.15 + </class-path-extension>
79.16 + </data>
79.17 + </configuration>
79.18 +</project>
80.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
80.2 +++ b/net.java.html.json/build.xml Tue Sep 09 21:44:37 2014 +0200
80.3 @@ -0,0 +1,5 @@
80.4 +<?xml version="1.0" encoding="UTF-8"?>
80.5 +<project name="net.java.html.json" default="netbeans" basedir=".">
80.6 + <import file="../nbbuild/templates/projectized.xml"/>
80.7 + <target name="jar"/>
80.8 +</project>
81.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
81.2 +++ b/net.java.html.json/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
81.3 @@ -0,0 +1,1 @@
81.4 +D9E741F404CE0751B97A343A665666A441008E4F net-java-html-json.jar
82.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
82.2 +++ b/net.java.html.json/manifest.mf Tue Sep 09 21:44:37 2014 +0200
82.3 @@ -0,0 +1,1 @@
82.4 +OpenIDE-Module: net.java.html.json
83.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
83.2 +++ b/net.java.html.json/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
83.3 @@ -0,0 +1,3 @@
83.4 +release.external/net-java-html-json.jar=modules/net-java-html-json.jar
83.5 +is.autoload=true
83.6 +nbm.module.author=Jaroslav Tulach
84.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
84.2 +++ b/net.java.html.json/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
84.3 @@ -0,0 +1,15 @@
84.4 +<?xml version="1.0" encoding="UTF-8"?>
84.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
84.6 + <type>org.netbeans.modules.apisupport.project</type>
84.7 + <configuration>
84.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
84.9 + <code-name-base>net.java.html.json</code-name-base>
84.10 + <module-dependencies/>
84.11 + <public-packages/>
84.12 + <class-path-extension>
84.13 + <runtime-relative-path>net-java-html-json.jar</runtime-relative-path>
84.14 + <binary-origin>external/net-java-html-json.jar</binary-origin>
84.15 + </class-path-extension>
84.16 + </data>
84.17 + </configuration>
84.18 +</project>
85.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
85.2 +++ b/net.java.html.sound/build.xml Tue Sep 09 21:44:37 2014 +0200
85.3 @@ -0,0 +1,5 @@
85.4 +<?xml version="1.0" encoding="UTF-8"?>
85.5 +<project name="net.java.html.sound" default="netbeans" basedir=".">
85.6 + <import file="../nbbuild/templates/projectized.xml"/>
85.7 + <target name="jar"/>
85.8 +</project>
86.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
86.2 +++ b/net.java.html.sound/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
86.3 @@ -0,0 +1,1 @@
86.4 +A89F8D030A3BFCA10880C3274E86D683FCB92062 net-java-html-sound.jar
87.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
87.2 +++ b/net.java.html.sound/manifest.mf Tue Sep 09 21:44:37 2014 +0200
87.3 @@ -0,0 +1,1 @@
87.4 +OpenIDE-Module: net.java.html.sound
88.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
88.2 +++ b/net.java.html.sound/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
88.3 @@ -0,0 +1,3 @@
88.4 +release.external/net-java-html-sound.jar=modules/net-java-html-sound.jar
88.5 +is.autoload=true
88.6 +nbm.module.author=Jaroslav Tulach
89.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
89.2 +++ b/net.java.html.sound/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
89.3 @@ -0,0 +1,15 @@
89.4 +<?xml version="1.0" encoding="UTF-8"?>
89.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
89.6 + <type>org.netbeans.modules.apisupport.project</type>
89.7 + <configuration>
89.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
89.9 + <code-name-base>net.java.html.sound</code-name-base>
89.10 + <module-dependencies/>
89.11 + <public-packages/>
89.12 + <class-path-extension>
89.13 + <runtime-relative-path>net-java-html-sound.jar</runtime-relative-path>
89.14 + <binary-origin>external/net-java-html-sound.jar</binary-origin>
89.15 + </class-path-extension>
89.16 + </data>
89.17 + </configuration>
89.18 +</project>
90.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
90.2 +++ b/net.java.html/build.xml Tue Sep 09 21:44:37 2014 +0200
90.3 @@ -0,0 +1,5 @@
90.4 +<?xml version="1.0" encoding="UTF-8"?>
90.5 +<project name="net.java.html" default="netbeans" basedir=".">
90.6 + <import file="../nbbuild/templates/projectized.xml"/>
90.7 + <target name="jar"/>
90.8 +</project>
91.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
91.2 +++ b/net.java.html/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
91.3 @@ -0,0 +1,1 @@
91.4 +4C8F273EB7D02845F42CFBE3DE4EB2BA22AF6357 net-java-html.jar
92.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
92.2 +++ b/net.java.html/manifest.mf Tue Sep 09 21:44:37 2014 +0200
92.3 @@ -0,0 +1,1 @@
92.4 +OpenIDE-Module: net.java.html
93.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
93.2 +++ b/net.java.html/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
93.3 @@ -0,0 +1,3 @@
93.4 +release.external/net-java-html.jar=modules/net-java-html.jar
93.5 +is.autoload=true
93.6 +nbm.module.author=Jaroslav Tulach
94.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
94.2 +++ b/net.java.html/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
94.3 @@ -0,0 +1,15 @@
94.4 +<?xml version="1.0" encoding="UTF-8"?>
94.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
94.6 + <type>org.netbeans.modules.apisupport.project</type>
94.7 + <configuration>
94.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
94.9 + <code-name-base>net.java.html</code-name-base>
94.10 + <module-dependencies/>
94.11 + <public-packages/>
94.12 + <class-path-extension>
94.13 + <runtime-relative-path>net-java-html.jar</runtime-relative-path>
94.14 + <binary-origin>external/net-java-html.jar</binary-origin>
94.15 + </class-path-extension>
94.16 + </data>
94.17 + </configuration>
94.18 +</project>
95.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
95.2 +++ b/o.n.html.ko4j/build.xml Tue Sep 09 21:44:37 2014 +0200
95.3 @@ -0,0 +1,5 @@
95.4 +<?xml version="1.0" encoding="UTF-8"?>
95.5 +<project name="o.n.html.ko4j" default="netbeans" basedir=".">
95.6 + <import file="../nbbuild/templates/projectized.xml"/>
95.7 + <target name="jar"/>
95.8 +</project>
96.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
96.2 +++ b/o.n.html.ko4j/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
96.3 @@ -0,0 +1,1 @@
96.4 +8B5627E4907808B25628C64F2876B2E64ECDF750 ko4j.jar
97.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
97.2 +++ b/o.n.html.ko4j/manifest.mf Tue Sep 09 21:44:37 2014 +0200
97.3 @@ -0,0 +1,1 @@
97.4 +OpenIDE-Module: org.netbeans.html.ko4j
98.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
98.2 +++ b/o.n.html.ko4j/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
98.3 @@ -0,0 +1,3 @@
98.4 +release.external/ko4j.jar=modules/org-netbeans-html-ko4j.jar
98.5 +nbm.module.author=Jaroslav Tulach
98.6 +is.autoload=true
99.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
99.2 +++ b/o.n.html.ko4j/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
99.3 @@ -0,0 +1,15 @@
99.4 +<?xml version="1.0" encoding="UTF-8"?>
99.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
99.6 + <type>org.netbeans.modules.apisupport.project</type>
99.7 + <configuration>
99.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
99.9 + <code-name-base>org.netbeans.html.ko4j</code-name-base>
99.10 + <module-dependencies/>
99.11 + <public-packages/>
99.12 + <class-path-extension>
99.13 + <runtime-relative-path>org-netbeans-html-ko4j.jar</runtime-relative-path>
99.14 + <binary-origin>external/ko4j.jar</binary-origin>
99.15 + </class-path-extension>
99.16 + </data>
99.17 + </configuration>
99.18 +</project>
100.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
100.2 +++ b/o.objectweb.asm/build.xml Tue Sep 09 21:44:37 2014 +0200
100.3 @@ -0,0 +1,5 @@
100.4 +<?xml version="1.0" encoding="UTF-8"?>
100.5 +<project name="o.objectweb.asm" default="netbeans" basedir=".">
100.6 + <import file="../nbbuild/templates/projectized.xml"/>
100.7 + <target name="jar"/>
100.8 +</project>
101.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
101.2 +++ b/o.objectweb.asm/external/binaries-list Tue Sep 09 21:44:37 2014 +0200
101.3 @@ -0,0 +1,2 @@
101.4 +AD568238EE36A820BD6C6806807E8A14EA34684D org-ow2-asm.jar
101.5 +
102.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
102.2 +++ b/o.objectweb.asm/manifest.mf Tue Sep 09 21:44:37 2014 +0200
102.3 @@ -0,0 +1,1 @@
102.4 +OpenIDE-Module: org.objectweb.asm
103.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
103.2 +++ b/o.objectweb.asm/nbproject/project.properties Tue Sep 09 21:44:37 2014 +0200
103.3 @@ -0,0 +1,3 @@
103.4 +release.external/org-ow2-asm.jar=modules/org-objectweb-asm.jar
103.5 +is.autoload=true
103.6 +nbm.module.author=Jaroslav Tulach
104.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
104.2 +++ b/o.objectweb.asm/nbproject/project.xml Tue Sep 09 21:44:37 2014 +0200
104.3 @@ -0,0 +1,15 @@
104.4 +<?xml version="1.0" encoding="UTF-8"?>
104.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
104.6 + <type>org.netbeans.modules.apisupport.project</type>
104.7 + <configuration>
104.8 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
104.9 + <code-name-base>org.objectweb.asm</code-name-base>
104.10 + <module-dependencies/>
104.11 + <public-packages/>
104.12 + <class-path-extension>
104.13 + <runtime-relative-path>org-objectweb-asm.jar</runtime-relative-path>
104.14 + <binary-origin>external/org-ow2-asm.jar</binary-origin>
104.15 + </class-path-extension>
104.16 + </data>
104.17 + </configuration>
104.18 +</project>