Ejemplo n.º 1
0
  private void changeComponent(final int comp) {
    String sql = "Update experimentcomponent set component = " + comp + " where id = " + compID;

    // Initialize the service remote procedure call
    if (databaseAccessSvc == null) {
      databaseAccessSvc = GWT.create(DatabaseAccess.class);
    }

    AsyncCallback<String> callback =
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {}

          public void onSuccess(String result) {

            if (comp > 0) {
              WebWOZWizard.changeVisiblility(6);
            } else {
              WebWOZWizard.changeVisiblility(7);
            }
            reloadSettings();

            checkVisibility();
          }
        };

    databaseAccessSvc.storeData(sql, callback);
  }
Ejemplo n.º 2
0
  private void changeLang(int type) {

    String sql = "";

    switch (type) {
      case 1:
        sql =
            "Update experiment set mtoutsrc = '"
                + srcLangList.getValue(srcLangList.getSelectedIndex())
                + "' where id = "
                + expId;
        mtoSrc = srcLangList.getValue(srcLangList.getSelectedIndex());
        break;
      case 2:
        sql =
            "Update experiment set mtouttrg = '"
                + trgLangList.getValue(trgLangList.getSelectedIndex())
                + "' where id = "
                + expId;
        mtoTrg = trgLangList.getValue(trgLangList.getSelectedIndex());
        break;

      default:
        break;
    }

    // Initialize the service remote procedure call
    if (databaseAccessSvc == null) {
      databaseAccessSvc = GWT.create(DatabaseAccess.class);
    }

    AsyncCallback<String> callback =
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {}

          public void onSuccess(String result) {
            reloadSettings();
          }
        };

    databaseAccessSvc.storeData(sql, callback);
  }
Ejemplo n.º 3
0
  public void turnOffComponent() {
    String sql =
        "Update experimentcomponent set component = 0 and componentmode = 0 where id = " + compID;

    // Initialize the service remote procedure call
    if (databaseAccessSvc == null) {
      databaseAccessSvc = GWT.create(DatabaseAccess.class);
    }

    AsyncCallback<String> callback =
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {}

          public void onSuccess(String result) {
            reloadLTCs();
            compList.setItemSelected(0, true);
            checkVisibility();
          }
        };

    databaseAccessSvc.storeData(sql, callback);
  }