Exemplo n.º 1
0
  @Override
  public void close() {
    if (!ok) return;

    super.close();
    gui.set(MainOptions.TEXTINDEX, txtindex.isSelected());
    gui.set(MainOptions.ATTRINDEX, atvindex.isSelected());
    gui.set(MainOptions.FTINDEX, ftxindex.isSelected());
    general.setOptions();
    ft.setOptions();
  }
Exemplo n.º 2
0
  @Override
  public void close() {
    if (!ok) return;

    super.close();
    gui.set(MainOptions.TEXTINDEX, textindex.isSelected());
    gui.set(MainOptions.ATTRINDEX, attrindex.isSelected());
    gui.set(MainOptions.TOKENINDEX, tokenindex.isSelected());
    gui.set(MainOptions.FTINDEX, ftindex.isSelected());
    general.setOptions();
    options.setOptions(null);
    for (final DialogIndex di : index) di.setOptions();
  }
Exemplo n.º 3
0
  @Override
  public void action(final Object comp) {
    final boolean valid = general.action(comp, true);
    ft.action(ftxindex.isSelected());

    // ...must be located before remaining checks
    if (comp == general.browse || comp == general.input) dbname.setText(general.dbname);

    final String nm = dbname.getText().trim();
    ok = valid && !nm.isEmpty();

    String inf = valid ? ok ? null : ENTER_DB_NAME : RES_NOT_FOUND;
    Msg icon = Msg.ERROR;
    if (ok) {
      ok = Databases.validName(nm);
      if (ok) gui.gopts.set(GUIOptions.DBNAME, nm);

      if (!ok) {
        // name of database is invalid
        inf = Util.info(INVALID_X, NAME);
      } else if (general.input.getText().trim().isEmpty()) {
        // database will be empty
        inf = EMPTY_DB;
        icon = Msg.WARN;
      } else if (db.contains(nm)) {
        // old database will be overwritten
        inf = OVERWRITE_DB;
        icon = Msg.WARN;
      }
    }

    general.info.setText(inf, icon);
    enableOK(buttons, B_OK, ok);
  }
Exemplo n.º 4
0
 @Override
 public void action(final Object cmp) {
   creds.setText(TRANSLATION + COLS + creds(lang.getSelectedItem().toString()));
   if (cmp == names) {
     gui.gprop.set(GUIProp.SHOWNAME, names.isSelected());
     gui.notify.layout();
   }
   final int mh = hitsAsProperty();
   label.setText(mh == -1 ? ALL : Integer.toString(mh));
 }
Exemplo n.º 5
0
  @Override
  public void close() {
    final MainProp mprop = gui.context.mprop;
    mprop.set(MainProp.LANG, lang.getSelectedItem().toString());

    // new database path: close existing database
    final String dbpath = path.getText();
    if (!mprop.get(MainProp.DBPATH).equals(dbpath)) gui.execute(new Close());
    mprop.set(MainProp.DBPATH, dbpath);
    mprop.write();

    final int mh = hitsAsProperty();
    gui.context.prop.set(Prop.MAXHITS, mh);

    final GUIProp gprop = gui.gprop;
    gprop.set(GUIProp.MOUSEFOCUS, focus.isSelected());
    gprop.set(GUIProp.SIMPLEFD, simpfd.isSelected());
    gprop.set(GUIProp.JAVALOOK, javalook.isSelected());
    gprop.set(GUIProp.MAXHITS, mh);
    gprop.write();
    dispose();
  }