modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WindowsBundlerParam.java

Print this page
rev 6889 : RT-36724 - JavaFX Packager Renaming
Summary: Move java code around to new packages.


   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
  23  * questions.
  24  */
  25 
  26 package com.oracle.bundlers.windows;
  27 
  28 import com.oracle.bundlers.StandardBundlerParam;
  29 import com.sun.javafx.tools.packager.Log;
  30 import com.sun.javafx.tools.packager.bundlers.IOUtils;
  31 import com.sun.javafx.tools.packager.bundlers.RelativeFileSet;
  32 
  33 import java.io.ByteArrayOutputStream;
  34 import java.io.File;
  35 import java.io.IOException;
  36 import java.io.PrintStream;
  37 import java.util.Map;
  38 import java.util.ResourceBundle;
  39 import java.util.function.BiFunction;
  40 import java.util.function.Function;
  41 import java.util.regex.Matcher;
  42 import java.util.regex.Pattern;
  43 
  44 
  45 public class WindowsBundlerParam<T> extends StandardBundlerParam<T> {
  46     
  47     private static final ResourceBundle I18N = ResourceBundle.getBundle("com.oracle.bundlers.windows.WindowsBundlerParam");
  48     
  49     public WindowsBundlerParam(String name, String description, String id, Class<T> valueType, Function<Map<String, ? super Object>, T> defaultValueFunction, BiFunction<String, Map<String, ? super Object>, T> stringConverter) {
  50         super(name, description, id, valueType, defaultValueFunction, stringConverter);
  51     }
  52 
  53     public static final StandardBundlerParam<String> MENU_GROUP =
  54             new StandardBundlerParam<>(
  55                     I18N.getString("param.menu-group.name"),
  56                     I18N.getString("param.menu-group.description"),
  57                     "win.menuGroup",
  58                     String.class,
  59                     params -> params.containsKey(VENDOR.getID())
  60                             ? VENDOR.fetchFrom(params)
  61                             : params.containsKey(CATEGORY.getID())
  62                             ? CATEGORY.fetchFrom(params)
  63                             : I18N.getString("param.menu-group.default"),
  64                     (s, p) -> s
  65             );
  66 
  67     public static final StandardBundlerParam<Boolean> BIT_ARCH_64 =




   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
  23  * questions.
  24  */
  25 
  26 package com.oracle.tools.packager.windows;
  27 
  28 import com.oracle.tools.packager.StandardBundlerParam;
  29 import com.oracle.tools.packager.Log;
  30 import com.oracle.tools.packager.IOUtils;
  31 import com.oracle.tools.packager.RelativeFileSet;
  32 
  33 import java.io.ByteArrayOutputStream;
  34 import java.io.File;
  35 import java.io.IOException;
  36 import java.io.PrintStream;
  37 import java.util.Map;
  38 import java.util.ResourceBundle;
  39 import java.util.function.BiFunction;
  40 import java.util.function.Function;
  41 import java.util.regex.Matcher;
  42 import java.util.regex.Pattern;
  43 
  44 
  45 public class WindowsBundlerParam<T> extends StandardBundlerParam<T> {
  46     
  47     private static final ResourceBundle I18N = ResourceBundle.getBundle(WindowsBundlerParam.class.getName());
  48     
  49     public WindowsBundlerParam(String name, String description, String id, Class<T> valueType, Function<Map<String, ? super Object>, T> defaultValueFunction, BiFunction<String, Map<String, ? super Object>, T> stringConverter) {
  50         super(name, description, id, valueType, defaultValueFunction, stringConverter);
  51     }
  52 
  53     public static final StandardBundlerParam<String> MENU_GROUP =
  54             new StandardBundlerParam<>(
  55                     I18N.getString("param.menu-group.name"),
  56                     I18N.getString("param.menu-group.description"),
  57                     "win.menuGroup",
  58                     String.class,
  59                     params -> params.containsKey(VENDOR.getID())
  60                             ? VENDOR.fetchFrom(params)
  61                             : params.containsKey(CATEGORY.getID())
  62                             ? CATEGORY.fetchFrom(params)
  63                             : I18N.getString("param.menu-group.default"),
  64                     (s, p) -> s
  65             );
  66 
  67     public static final StandardBundlerParam<Boolean> BIT_ARCH_64 =