*/
public class ArgsParser
{
- Vector<String> vargs = null;
+
+ // BH 2019 - new
+
+ public static final String NOCALCULATION = "nocalculation";
+
+ public static final String NOMENUBAR = "nomenubar";
+
+ public static final String NOSTATUS = "nostatus";
+
+ public static final String SHOWOVERVIEW = "showoverview";
+
+ //
+ public static final String ANNOTATIONS = "annotations";
+
+ public static final String COLOUR = "colour";
+
+ public static final String FEATURES = "features";
+
+ public static final String GROOVY = "groovy";
+
+ public static final String GROUPS = "groups";
+
+ public static final String HEADLESS = "headless";
+
+ public static final String JABAWS = "jabaws";
+
+ public static final String NOANNOTATION = "no-annotation";
+
+ public static final String NOANNOTATION2 = "noannotation"; // BH 2019.05.07
+
+ public static final String NODISPLAY = "nodisplay";
+
+ public static final String NOGUI = "nogui";
+
+ public static final String NONEWS = "nonews";
+
+ public static final String NOQUESTIONNAIRE = "noquestionnaire";
+
+ public static final String NOSORTBYTREE = "nosortbytree";
+
+ public static final String NOUSAGESTATS = "nousagestats";
+
+ public static final String OPEN = "open";
+
+ public static final String OPEN2 = "open2"; // BH added -- for applet
+ // compatibility; not fully
+ // implemented
+
+ public static final String PROPS = "props";
+
+ public static final String QUESTIONNAIRE = "questionnaire";
+
+ public static final String SETPROP = "setprop";
+
+ public static final String SORTBYTREE = "sortbytree";
+
+ public static final String TREE = "tree";
+
+ public static final String VDOC = "vdoc";
+
+ public static final String VSESS = "vsess";
+
+ private Vector<String> vargs = null;
+
+ private boolean isApplet;
+
+ private AppletParams appletParams;
+
+ public boolean isApplet()
+ {
+ return isApplet;
+ }
public ArgsParser(String[] args)
{
- vargs = new Vector<String>();
- for (int i = 0; i < args.length; i++)
+ vargs = new Vector<>();
+ isApplet = (args.length > 0 && args[0].startsWith("<applet"));
+ if (isApplet)
+ {
+ appletParams = AppletParams.getAppletParams(args, vargs);
+ }
+ else
{
- String arg = args[i].trim();
- if (arg.charAt(0) == '-')
+ for (int i = 0; i < args.length; i++)
{
- arg = arg.substring(1);
+ String arg = args[i].trim();
+ if (arg.charAt(0) == '-')
+ {
+ arg = arg.substring(1);
+ }
+ vargs.addElement(arg);
}
- vargs.addElement(arg);
}
}
return vargs.size();
}
+ public String getAppletValue(String key, String def)
+ {
+ String value;
+ return (appletParams == null ? null
+ : (value = appletParams.get(key.toLowerCase())) != null ? value
+ : def);
+ }
+
}