コード例 #1
0
 /**
  * Returns the windows arguments for launching a specified browser.
  *
  * <p>Depending on the forceNewWindow boolean, the args may also contain the args to force a new
  * window.
  *
  * @param protocol String
  * @param winbrowser WindowsBrowser
  * @param urlString String
  * @param forceNewWindow boolean
  * @return String[]
  */
 private String getCommandArgs(
     String protocol, WindowsBrowser winbrowser, String urlString, boolean forceNewWindow) {
   String commandArgs =
       LaunchingUtils.replaceArgs(
           commandsTargettedBrowser, winbrowser.getBrowserApplicationName(), urlString);
   String args = "";
   if (forceNewWindow) {
     args = winbrowser.getForceNewWindowArgs();
   }
   commandArgs = commandArgs.replaceAll("<args>", args);
   int pathLoc = commandArgs.indexOf("<path>");
   if (pathLoc > 0) {
     StringBuffer buf = new StringBuffer();
     buf.append(commandArgs.substring(0, pathLoc));
     buf.append(winbrowser.getPathToExe());
     buf.append(commandArgs.substring(pathLoc + 6));
     commandArgs = buf.toString();
   }
   return commandArgs; // .split("[ ]");
 }
コード例 #2
0
 /**
  * Returns the windows arguments for launching a default browser.
  *
  * @param protocol String
  * @param urlString String
  * @return String[]
  */
 private String[] getCommandArgs(String protocol, String urlString) {
   String commandArgs = LaunchingUtils.replaceArgs(commandsDefaultBrowser, null, urlString);
   return commandArgs.split("[ ]");
 }