< prev index next >

src/java.base/share/classes/sun/launcher/LauncherHelper.java

Print this page
rev 17241 : [mq]: 8180286-0.patch


 346 
 347     /**
 348      * A private helper method to get a localized message and also
 349      * apply any arguments that we might pass.
 350      */
 351     private static String getLocalizedMessage(String key, Object... args) {
 352         String msg = ResourceBundleHolder.RB.getString(key);
 353         return (args != null) ? MessageFormat.format(msg, args) : msg;
 354     }
 355 
 356     /**
 357      * The java -help message is split into 3 parts, an invariant, followed
 358      * by a set of platform dependent variant messages, finally an invariant
 359      * set of lines.
 360      * This method initializes the help message for the first time, and also
 361      * assembles the invariant header part of the message.
 362      */
 363     static void initHelpMessage(String progname) {
 364         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.header",
 365                 (progname == null) ? "java" : progname ));
 366         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.datamodel",
 367                 32));
 368         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.datamodel",
 369                 64));
 370     }
 371 
 372     /**
 373      * Appends the vm selection messages to the header, already created.
 374      * initHelpSystem must already be called.
 375      */
 376     static void appendVmSelectMessage(String vm1, String vm2) {
 377         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.vmselect",
 378                 vm1, vm2));
 379     }
 380 
 381     /**
 382      * Appends the vm synoym message to the header, already created.
 383      * initHelpSystem must be called before using this method.
 384      */
 385     static void appendVmSynonymMessage(String vm1, String vm2) {
 386         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.hotspot",
 387                 vm1, vm2));
 388     }
 389 




 346 
 347     /**
 348      * A private helper method to get a localized message and also
 349      * apply any arguments that we might pass.
 350      */
 351     private static String getLocalizedMessage(String key, Object... args) {
 352         String msg = ResourceBundleHolder.RB.getString(key);
 353         return (args != null) ? MessageFormat.format(msg, args) : msg;
 354     }
 355 
 356     /**
 357      * The java -help message is split into 3 parts, an invariant, followed
 358      * by a set of platform dependent variant messages, finally an invariant
 359      * set of lines.
 360      * This method initializes the help message for the first time, and also
 361      * assembles the invariant header part of the message.
 362      */
 363     static void initHelpMessage(String progname) {
 364         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.header",
 365                 (progname == null) ? "java" : progname ));




 366     }
 367 
 368     /**
 369      * Appends the vm selection messages to the header, already created.
 370      * initHelpSystem must already be called.
 371      */
 372     static void appendVmSelectMessage(String vm1, String vm2) {
 373         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.vmselect",
 374                 vm1, vm2));
 375     }
 376 
 377     /**
 378      * Appends the vm synoym message to the header, already created.
 379      * initHelpSystem must be called before using this method.
 380      */
 381     static void appendVmSynonymMessage(String vm1, String vm2) {
 382         outBuf = outBuf.append(getLocalizedMessage("java.launcher.opt.hotspot",
 383                 vm1, vm2));
 384     }
 385 


< prev index next >