modules/jdk.packager/src/main/java/com/sun/javafx/tools/packager/bundlers/BundleParams.java

Print this page


   1 /*
   2  * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  86     public static final String PARAM_LICENSE_TYPE           = "licenseType"; // String
  87 
  88     /* File(s) with license. Format is OS/bundler specific */
  89     public static final String PARAM_LICENSE_FILE          = "licenseFile"; // List<String>
  90 
  91     /* user or system level install.
  92        null means "default" */
  93     public static final String PARAM_SYSTEM_WIDE            = "systemWide"; // Boolean
  94 
  95     /* service/daemon install.
  96        null means "default" */
  97     public static final String PARAM_SERVICE_HINT           = "serviceHint"; // Boolean
  98 
  99 
 100     /* Main application class. Not used directly but used to derive default values */
 101     public static final String PARAM_APPLICATION_CLASS      = "applicationClass"; // String
 102 
 103     /* Adds a dialog to let the user choose a directory where the product will be installed. */
 104     public static final String PARAM_INSTALLDIR_CHOOSER     = "installdirChooser"; // Boolean
 105 



 106     /**
 107      * create a new bundle with all default values
 108      */
 109     public BundleParams() {
 110         params = new HashMap<>();
 111     }
 112 
 113     /**
 114      * Create a bundle params with a copy of the params
 115      * @param params map of initial parameters to be copied in.
 116      */
 117     public BundleParams(Map<String, ?> params) {
 118         this.params = new HashMap<>(params);
 119     }
 120 
 121     public void addAllBundleParams(Map<String, ? super Object> p) {
 122         params.putAll(p);
 123     }
 124 
 125     public <C> C fetchParam(BundlerParamInfo<C> paramInfo) {


 265         }
 266         licenseFiles.add(path);
 267     }
 268 
 269     public Boolean getSystemWide() {
 270         return fetchParam(SYSTEM_WIDE);
 271     }
 272 
 273     public void setSystemWide(Boolean b) {
 274         putUnlessNull(PARAM_SYSTEM_WIDE, b);
 275     }
 276 
 277     public void setServiceHint(Boolean b) {
 278         putUnlessNull(PARAM_SERVICE_HINT, b);
 279     }
 280 
 281     public void setInstalldirChooser(Boolean b) {
 282         putUnlessNull(PARAM_INSTALLDIR_CHOOSER, b);
 283     }
 284 




 285     public void setSignBundle(Boolean b) { putUnlessNull(SIGN_BUNDLE.getID(), b); }
 286 
 287     public boolean isShortcutHint() {
 288         return fetchParam(SHORTCUT_HINT);
 289     }
 290 
 291     public void setShortcutHint(Boolean v) {
 292         putUnlessNull(PARAM_SHORTCUT, v);
 293     }
 294 
 295     public boolean isMenuHint() {
 296         return fetchParam(MENU_HINT);
 297     }
 298 
 299     public void setMenuHint(Boolean v) {
 300         putUnlessNull(PARAM_MENU, v);
 301     }
 302 
 303     public String getName() {
 304         return fetchParam(APP_NAME);


   1 /*
   2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  86     public static final String PARAM_LICENSE_TYPE           = "licenseType"; // String
  87 
  88     /* File(s) with license. Format is OS/bundler specific */
  89     public static final String PARAM_LICENSE_FILE          = "licenseFile"; // List<String>
  90 
  91     /* user or system level install.
  92        null means "default" */
  93     public static final String PARAM_SYSTEM_WIDE            = "systemWide"; // Boolean
  94 
  95     /* service/daemon install.
  96        null means "default" */
  97     public static final String PARAM_SERVICE_HINT           = "serviceHint"; // Boolean
  98 
  99 
 100     /* Main application class. Not used directly but used to derive default values */
 101     public static final String PARAM_APPLICATION_CLASS      = "applicationClass"; // String
 102 
 103     /* Adds a dialog to let the user choose a directory where the product will be installed. */
 104     public static final String PARAM_INSTALLDIR_CHOOSER     = "installdirChooser"; // Boolean
 105     
 106     /* Prevents from launching multiple instances of application.  */
 107     public static final String PARAM_SINGLETON              = "singleton"; // Boolean
 108 
 109     /**
 110      * create a new bundle with all default values
 111      */
 112     public BundleParams() {
 113         params = new HashMap<>();
 114     }
 115 
 116     /**
 117      * Create a bundle params with a copy of the params
 118      * @param params map of initial parameters to be copied in.
 119      */
 120     public BundleParams(Map<String, ?> params) {
 121         this.params = new HashMap<>(params);
 122     }
 123 
 124     public void addAllBundleParams(Map<String, ? super Object> p) {
 125         params.putAll(p);
 126     }
 127 
 128     public <C> C fetchParam(BundlerParamInfo<C> paramInfo) {


 268         }
 269         licenseFiles.add(path);
 270     }
 271 
 272     public Boolean getSystemWide() {
 273         return fetchParam(SYSTEM_WIDE);
 274     }
 275 
 276     public void setSystemWide(Boolean b) {
 277         putUnlessNull(PARAM_SYSTEM_WIDE, b);
 278     }
 279 
 280     public void setServiceHint(Boolean b) {
 281         putUnlessNull(PARAM_SERVICE_HINT, b);
 282     }
 283 
 284     public void setInstalldirChooser(Boolean b) {
 285         putUnlessNull(PARAM_INSTALLDIR_CHOOSER, b);
 286     }
 287 
 288     public void setSingleton(Boolean b) {
 289         putUnlessNull(PARAM_SINGLETON, b);
 290     }
 291 
 292     public void setSignBundle(Boolean b) { putUnlessNull(SIGN_BUNDLE.getID(), b); }
 293 
 294     public boolean isShortcutHint() {
 295         return fetchParam(SHORTCUT_HINT);
 296     }
 297 
 298     public void setShortcutHint(Boolean v) {
 299         putUnlessNull(PARAM_SHORTCUT, v);
 300     }
 301 
 302     public boolean isMenuHint() {
 303         return fetchParam(MENU_HINT);
 304     }
 305 
 306     public void setMenuHint(Boolean v) {
 307         putUnlessNull(PARAM_MENU, v);
 308     }
 309 
 310     public String getName() {
 311         return fetchParam(APP_NAME);