--- old/modules/jdk.packager/src/main/java/com/sun/javafx/tools/ant/Application.java 2016-11-02 13:32:19.419563854 -0400 +++ /dev/null 2016-10-31 09:37:02.128008072 -0400 @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.javafx.tools.ant; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import com.sun.javafx.tools.packager.HtmlParam; -import com.sun.javafx.tools.packager.Param; -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.types.DataType; -import org.apache.tools.ant.types.Reference; - -/** - * Basic application descriptor. - *

- * Defines main components of application and default set of parameters. - * - * - * Examples: - *

- *    <info vendor="Uncle Joe" description="Test program"/>
- * 
- * - * @ant.type name="application" category="javafx" - */ -public class Application extends DataType implements Cloneable { - String mainClass = null; - String module = null; - String preloaderClass = null; - String name = null; - List parameters = new LinkedList(); - List htmlParameters = new LinkedList(); - public List arguments = new LinkedList(); - String fallbackApp = null; - String id = null; - boolean embeddedIntoSwing = false; - String version = null; - Boolean daemon = null; - - public void setVersion(String v) { - version = v; - } - - public void setToolkit(String v) { - embeddedIntoSwing = "swing".equalsIgnoreCase(v); - } - - public void setName(String v) { - name = v; - } - - public Param createParam() { - Param p = new Param(); - parameters.add(p); - return p; - } - - public void setParams(Properties props) { - if (props != null) { - for (Map.Entry en : props.entrySet()) { - Param p = new Param(); - p.setName((String)en.getKey()); - p.setValue((String)en.getValue()); - parameters.add(p); - } - } - } - - public class Argument { - private String value; - - public void addText(String value) { - this.value = value; - } - - public String getValue() { - return this.value; - } - } - - public Argument createArgument() { - Argument a = new Argument(); - arguments.add(a); - return a; - } - - List getArguments() { - List lst = new LinkedList(); - for(Argument a: arguments) { - lst.add(a.value); - } - return lst; - } - - public Object clone() { - try { - Application result = (Application) super.clone(); - return result; - } catch (CloneNotSupportedException e) { - throw new BuildException(e); - } - } - - public HtmlParam createHtmlParam() { - HtmlParam p = new HtmlParam(); - htmlParameters.add(p); - return p; - } - - /** - * Application id that can be used to obtain Javascript reference to the application in HTML. - * Same id can be also used to refer to application object in the ant task (using refid). - * - * @ant.not-required - */ - public void setId(String id) { - this.id = id; - } - - @Override - public void setRefid(Reference id) { - this.id = id.getRefId(); - super.setRefid(id); - } - - /** - * Main application class. - * - * @ant.required - */ - public void setMainClass(String v) { - mainClass = v; - } - - /** - * Module containing the application class. - * - * @ant.not-required Default is to not bundle as a modular application. - */ - public String getModule() { - return this.module; - } - - /** - * Module containing the application class. - * - * @ant.not-required Default is to not bundle as a modular application. - */ - public void setModule(String value) { - this.module = value; - } - - /** - * Preloader class to be used. - * - * @ant.not-required Default is preloader shipped in JavaFX Runtime. - */ - public void setPreloaderClass(String v) { - preloaderClass = v; - } - - /** - * Is this class a daemon/service? - * - * @ant.not-required Default is false, i.e. an interactive app - */ - public void setDaemon(boolean b) { - daemon = b; - } - - //return instance that actually has data. Could be referenced object ... - public Application get() { - return isReference() ? - (Application) getRefid().getReferencedObject() : this; - } - - public void selfcheck() { - if (get().mainClass == null) { - throw new BuildException("Application main class is required."); - } - } - - @Override - public String toString() { - return "Application[id=" + id + ", mainClass=" + mainClass + "]"; - } -} --- /dev/null 2016-10-31 09:37:02.128008072 -0400 +++ new/modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/Application.java 2016-11-02 13:32:19.263567398 -0400 @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.javafx.tools.ant; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import com.sun.javafx.tools.packager.HtmlParam; +import com.sun.javafx.tools.packager.Param; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.types.DataType; +import org.apache.tools.ant.types.Reference; + +/** + * Basic application descriptor. + *

+ * Defines main components of application and default set of parameters. + * + * + * Examples: + *

+ *    <info vendor="Uncle Joe" description="Test program"/>
+ * 
+ * + * @ant.type name="application" category="javafx" + */ +public class Application extends DataType implements Cloneable { + String mainClass = null; + String module = null; + String preloaderClass = null; + String name = null; + List parameters = new LinkedList(); + List htmlParameters = new LinkedList(); + public List arguments = new LinkedList(); + String fallbackApp = null; + String id = null; + boolean embeddedIntoSwing = false; + String version = null; + Boolean daemon = null; + + public void setVersion(String v) { + version = v; + } + + public void setToolkit(String v) { + embeddedIntoSwing = "swing".equalsIgnoreCase(v); + } + + public void setName(String v) { + name = v; + } + + public Param createParam() { + Param p = new Param(); + parameters.add(p); + return p; + } + + public void setParams(Properties props) { + if (props != null) { + for (Map.Entry en : props.entrySet()) { + Param p = new Param(); + p.setName((String)en.getKey()); + p.setValue((String)en.getValue()); + parameters.add(p); + } + } + } + + public class Argument { + private String value; + + public void addText(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } + } + + public Argument createArgument() { + Argument a = new Argument(); + arguments.add(a); + return a; + } + + List getArguments() { + List lst = new LinkedList(); + for(Argument a: arguments) { + lst.add(a.value); + } + return lst; + } + + public Object clone() { + try { + Application result = (Application) super.clone(); + return result; + } catch (CloneNotSupportedException e) { + throw new BuildException(e); + } + } + + public HtmlParam createHtmlParam() { + HtmlParam p = new HtmlParam(); + htmlParameters.add(p); + return p; + } + + /** + * Application id that can be used to obtain Javascript reference to the application in HTML. + * Same id can be also used to refer to application object in the ant task (using refid). + * + * @ant.not-required + */ + public void setId(String id) { + this.id = id; + } + + @Override + public void setRefid(Reference id) { + this.id = id.getRefId(); + super.setRefid(id); + } + + /** + * Main application class. + * + * @ant.required + */ + public void setMainClass(String v) { + mainClass = v; + } + + /** + * Module containing the application class. + * + * @ant.not-required Default is to not bundle as a modular application. + */ + public String getModule() { + return this.module; + } + + /** + * Module containing the application class. + * + * @ant.not-required Default is to not bundle as a modular application. + */ + public void setModule(String value) { + this.module = value; + } + + /** + * Preloader class to be used. + * + * @ant.not-required Default is preloader shipped in JavaFX Runtime. + */ + public void setPreloaderClass(String v) { + preloaderClass = v; + } + + /** + * Is this class a daemon/service? + * + * @ant.not-required Default is false, i.e. an interactive app + */ + public void setDaemon(boolean b) { + daemon = b; + } + + //return instance that actually has data. Could be referenced object ... + public Application get() { + return isReference() ? + (Application) getRefid().getReferencedObject() : this; + } + + public void selfcheck() { + if (get().mainClass == null) { + throw new BuildException("Application main class is required."); + } + } + + @Override + public String toString() { + return "Application[id=" + id + ", mainClass=" + mainClass + "]"; + } +}