public class GDEMenuParser
extends java.lang.Object
Constructor and Description |
---|
GDEMenuParser()
Creates a new instance of GDEMenuParser.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
createGDEButton(java.lang.String label,
java.lang.String command,
boolean closeWindow)
This method fills in more information about the buttons in GDE.
|
static void |
readGDEMenuFile(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> menu,
java.io.File file)
This function loads a GDE formatted menu file into the program.
|
static java.util.Map<java.lang.String,java.lang.Object> |
readGDEMenuFile(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> menu,
java.lang.String menuName,
java.io.File file,
java.lang.String filename,
java.util.List<java.lang.String> systems)
This function loads a GDE formatted menu file, and converts it into a
PCD code hashmap.
|
public static void readGDEMenuFile(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> menu, java.io.File file)
menu
- hash map to read the gde menu file contents intofile
- the file to read.public static java.util.Map<java.lang.String,java.lang.Object> readGDEMenuFile(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> menu, java.lang.String menuName, java.io.File file, java.lang.String filename, java.util.List<java.lang.String> systems)
This function loads a GDE formatted menu file, and converts it into a PCD code hashmap. The PCD hashmap will be at least 3 levels deep. The first hashmap level will contain the menu names as keys, and an ordered hashmap of menu items for that menu as the value. The second level (the hashmap of menu items) has the menu item names as its keys, and an ordered hashmap of the menu item's widgets as its values. The third level has the widget variable names (prefaced by 'var "' and ended by '"') as its keys, and an ordered hashmap of thevariable/widget's fields as its values. There is a fourth level in the case of list widgets. List widgets have a 'choices' field which contains a hashmap of choices as its value. The choices hashmap uses the keys as the name to display to the user (for selection), and the values to use for command line substitution as its values. (NOTE: this was chosen to ensure that there are no duplicates presented to the user, while allowing multiple options to yield the same command line substitution -- which is not preferred, but still quite acceptable.)
NOTE: the first level refers to the key/value pair of the returned object, while the second level refers to the key/value pair of the hashmap stored as a value in the first level.
menuName
- the name of the current heading.file
- the file to read.public static java.util.Map<java.lang.String,java.lang.Object> createGDEButton(java.lang.String label, java.lang.String command, boolean closeWindow)
label
- the text to display for the button - Run or Helpcommand
- the command to execute by clicking on the buttoncloseWindow
- whether or not the program parameters dialog box
should be closed by clicking on the button (true for
run, false for help)Copyright © 2008-2022 University of Manitoba.