jButtonAdd.setBounds(2, 275, 115, 32);
jButtonAdd.setMnemonic(lang.getMnemonicChar());
jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_ARCHIVE_ADD"));
jButtonAdd.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
JDBArchive arch = new JDBArchive(Common.selectedHostID, Common.sessionID);
archID = JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Archive_ID_Input"));
if (archID != null) {
if (archID.equals("") == false) {
archID = archID.toUpperCase();
arch.clear();
if (arch.create(archID) == false) {
JUtility.errorBeep();
JOptionPane.showMessageDialog(Common.mainForm, arch.getErrorMessage(), lang.get("err_Error"), JOptionPane.ERROR_MESSAGE);
} else {
arch.update();
populateList("");
JLaunchMenu.runDialog("FRM_ADMIN_ARCHIVE_EDIT", archID);
populateList("");
}
}
}
}
});
}
{
jButtonDelete = new JButton4j(Common.icon_delete);
this.getContentPane().add(jButtonDelete);
jButtonDelete.setText(lang.get("btn_Delete"));
jButtonDelete.setBounds(236, 275, 115, 30);
jButtonDelete.setMnemonic(lang.getMnemonicChar());
jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_ARCHIVE_DELETE"));
jButtonDelete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
int row = jTable1.getSelectedRow();
if (row >= 0) {
archID = jTable1.getValueAt(row, 0).toString();
int n = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Archive_ID_Delete") + " " + archID + " ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
if (n == 0) {
JDBArchive c = new JDBArchive(Common.selectedHostID, Common.sessionID);
c.setArchiveID(archID);
c.delete();
populateList("");
}
}
}
});
}
{
jButtonPrint = new JButton4j(Common.icon_report);
this.getContentPane().add(jButtonPrint);
jButtonPrint.setText(lang.get("btn_Print"));
jButtonPrint.setBounds(587, 275, 115, 30);
jButtonPrint.setMnemonic(lang.getMnemonicChar());
jButtonPrint.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("RPT_ARCHIVE"));
jButtonPrint.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
JLaunchReport.runReport("RPT_ARCHIVE", null, "", null, "");
}
});
}
{
jButtonHelp = new JButton4j(Common.icon_help);
this.getContentPane().add(jButtonHelp);
jButtonHelp.setText(lang.get("btn_Help"));
jButtonHelp.setBounds(704, 275, 115, 30);
jButtonHelp.setMnemonic(lang.getMnemonicChar());
}
{
jButtonExcel = new JButton4j(Common.icon_XLS);
jButtonExcel.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
JDBArchive arch = new JDBArchive(Common.selectedHostID, Common.sessionID);
JExcel export = new JExcel();
buildSQL();
export.saveAs("archive.xls", arch.getArchiveDataResultSet(listStatement), Common.mainForm);
}
});
jButtonExcel.setText(lang.get("btn_Excel"));
jButtonExcel.setMnemonic(lang.getMnemonicChar());
jButtonExcel.setBounds(470, 275, 115, 30);
getContentPane().add(jButtonExcel);
}
JButton4j button4jRun = new JButton4j(Common.icon_execute);
button4jRun.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int row = jTable1.getSelectedRow();
if (row >= 0) {
archID = jTable1.getValueAt(row, 0).toString();
JDBArchive c = new JDBArchive(Common.selectedHostID, Common.sessionID);
c.runManual(archID);
//String test = c.reportData();
populateList(archID);
}
}
});