Esempio n. 1
0
  public boolean saveRdbData(Object dsId, RdbDataId rdbId, boolean dialog) {
    boolean success = false;
    if (!mapper.isConnection()) {
      connectionDialog.setVisible(true);
    }
    if (mapper.isConnection()) {

      // If no dialog requested try a direct save.
      if (!dialog) {
        try {
          success = mapper.saveRdbData(dsId, rdbId);
        } catch (Exception exception) {
          JOptionPane.showMessageDialog(
              guiContext, exception.getMessage(), "Database error", JOptionPane.ERROR_MESSAGE);
        }
      }
      // If not saved yet bring up saveas dialog.
      if (!success) {
        groupDialog.setLoadMode(false);
        groupDialog.setDsId(dsId);
        groupDialog.setRdbDataId(rdbId);
        groupDialog.setVisible(true);
        success = groupDialog.isSuccess();
      }
    }
    return success;
  }
Esempio n. 2
0
 public DBData loadRdbData(Object dsId) {
   if (!mapper.isConnection()) {
     connectionDialog.setVisible(true);
   }
   if (mapper.isConnection()) {
     groupDialog.setLoadMode(true);
     groupDialog.setDsId(dsId);
     groupDialog.setRdbDataId(new RdbDataId());
     groupDialog.setVisible(true);
     return groupDialog.getData();
   }
   return null;
 }