public void stop() { super.stop(); exchanger.setStopped(true); MessagePanes.showInfoDialog( LoanMemberDataExchangeScreen.this, props.getProperty("stopped.text"), getLocale()); }
protected void run() { exchanger = new LoanMemberDatabaseExchange( txfImageURL.getText(), librarySelectedList, loanGroupSelectedList, (Location) cmbLocations.getSelectedItem(), props, cbUseUniqueNameToFindUser.isSelected(), cbIsOrg.isSelected(), cbIsUniversity.isSelected(), cbUseProfileSetting.isSelected()); try { exchanger.setProgressListener(new EchangeProgressListener(this)); exchanger.exchange( con, txfProfileDatabase.getText(), txfMultimediaDatabase.getText(), Long.valueOf(txfFromMemberNo.getText()), Long.valueOf(txfToMemberNo.getText()), txfImageURL.getText()); MessagePanes.showInfoDialog( LoanMemberDataExchangeScreen.this, props.getProperty("successful-exchange.text"), getLocale()); } catch (SQLException e) { if (con == null) { System.err.println("Could not establish connection"); MessagePanes.showErrorDialog( LoanMemberDataExchangeScreen.this, props.getProperty("invalid-connection.text"), getLocale()); } else { MessagePanes.showErrorDialog( LoanMemberDataExchangeScreen.this, props.getProperty("system-error.text"), getLocale()); } e.printStackTrace(); } catch (ImagePathException e) { MessagePanes.showErrorDialog( LoanMemberDataExchangeScreen.this, props.getProperty("not-valid--image-path.text") + "\n " + props.getProperty("test-file-exist1.text") + StringUtils.rtlString("test.pim") + props.getProperty("test-file-exist2.text"), getLocale()); e.printStackTrace(); } catch (Throwable e) { e.printStackTrace(); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } } else { System.err.println("Could not establish connection"); MessagePanes.showErrorDialog( LoanMemberDataExchangeScreen.this, props.getProperty("invalid-connection.text"), getLocale()); } // setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }