- static private void fullTestTable() throws IOException {
- final Table<String> table = new Table<String>("Column 1", "Column 2",
- "Column 3");
- table.getTableModel().addRow("1", "2", "3");
- table.setSelectAction(new Runnable() {
- @Override
- public void run() {
- List<String> data = table.getTableModel().getRow(
- table.getSelectedRow());
- for (int i = 0; i < data.size(); i++) {
- System.out.println(data.get(i));
+ /**
+ * Start the application.
+ *
+ * @param args
+ * the parameters (see <tt>--help</tt> to know which are
+ * supported)
+ */
+ public static void main(String[] args) {
+ Boolean textMode = null;
+ boolean noMoreParams = false;
+ boolean filesTried = false;
+
+ // get the "system default" language to help translate the --help
+ // message if needed
+ String language = null;
+ transService = new Trans(language);
+
+ List<String> files = new LinkedList<String>();
+ for (int index = 0; index < args.length; index++) {
+ String arg = args[index];
+ if (!noMoreParams && arg.equals("--")) {
+ noMoreParams = true;
+ } else if (!noMoreParams && arg.equals("--help")) {
+ System.out
+ .println("TODO: implement some help text.\n"
+ + "Usable switches:\n"
+ + "\t--: stop looking for switches\n"
+ + "\t--help: this here thingy\n"
+ + "\t--lang LANGUAGE: choose the language, for instance en_GB\n"
+ + "\t--tui: force pure text mode even if swing treminal is available\n"
+ + "\t--gui: force swing terminal mode\n"
+ + "\t--noutf: force non-utf8 mode if you need it\n"
+ + "\t--config DIRECTORY: force the given directory as a CONFIG_DIR\n"
+ + "everyhing else is either a file to open or a directory to open\n"
+ + "(we will only open 1st level files in given directories)\n");
+ return;
+ } else if (!noMoreParams && arg.equals("--tui")) {
+ textMode = true;
+ } else if (!noMoreParams && arg.equals("--gui")) {
+ textMode = false;
+ } else if (!noMoreParams && arg.equals("--noutf")) {
+ UiColors.getInstance().setUnicode(false);
+ } else if (!noMoreParams && arg.equals("--lang")) {
+ index++;
+ if (index < args.length)
+ language = args[index];
+ transService = new Trans(language);
+ } else if (!noMoreParams && arg.equals("--config")) {
+ index++;
+ if (index < args.length) {
+ Bundles.setDirectory(args[index]);
+ transService = new Trans(language);