X-Git-Url: https://harishankar.org/repos/?p=habeas.git;a=blobdiff_plain;f=src%2Fhabeas%2FManageNoticesDialog.java;fp=src%2Fhabeas%2FManageNoticesDialog.java;h=5ccdb15c67df55366c86af68a710fd0687d30f50;hp=1836c70ce96eff3c3a5f79350af488caf79d5371;hb=67bb9fdd9ae3818a92a528d14d82baae0d483508;hpb=5b12182f8ba1ad6811d37ba582095b45a34fde2f diff --git a/src/habeas/ManageNoticesDialog.java b/src/habeas/ManageNoticesDialog.java index 1836c70..5ccdb15 100644 --- a/src/habeas/ManageNoticesDialog.java +++ b/src/habeas/ManageNoticesDialog.java @@ -53,6 +53,7 @@ public class ManageNoticesDialog extends javax.swing.JDialog { menuDispatchDetails = new javax.swing.JMenuItem(); menuBillDetails = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JPopupMenu.Separator(); + menuView = new javax.swing.JMenuItem(); menuDelete = new javax.swing.JMenuItem(); jScrollPane1 = new javax.swing.JScrollPane(); tableNotices = new javax.swing.JTable(); @@ -104,6 +105,15 @@ public class ManageNoticesDialog extends javax.swing.JDialog { popMenu.add(menuBillDetails); popMenu.add(jSeparator1); + menuView.setMnemonic('V'); + menuView.setText("View..."); + menuView.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuViewActionPerformed(evt); + } + }); + popMenu.add(menuView); + menuDelete.setText("Delete"); menuDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -234,6 +244,29 @@ public class ManageNoticesDialog extends javax.swing.JDialog { populateNotices(); } }//GEN-LAST:event_menuDeleteActionPerformed + + private void menuViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuViewActionPerformed + // TODO add your handling code here: + int selid = getSelectedNotice(); + if (selid == -1) return; + ArrayList notice = Utility.getNoticeDetails(selid); + if (notice == null) return; + + ViewNoticeDialog frm = new ViewNoticeDialog( + (Frame)this.getParent(), true); + frm.setFields (selid, (String)notice.get(0), + (String)notice.get(1), (Date)notice.get(2), + (String)notice.get(16), (boolean)notice.get(4), + (boolean)notice.get(5), (boolean)notice.get(6), + (Date)notice.get(7), (String)notice.get(8), + (boolean)notice.get(9), (Date)notice.get(10), + (String)notice.get(11), (int)notice.get(12), + (Date)notice.get(13), (boolean)notice.get(14), + (String)notice.get(15)); + frm.setVisible(true); + + + }//GEN-LAST:event_menuViewActionPerformed private static final String ERROR_DELETING = "Error in deleting"; private static final String CONFIRM_DELETE = "Are you sure you wish to delete?"; @@ -288,6 +321,7 @@ public class ManageNoticesDialog extends javax.swing.JDialog { private javax.swing.JMenuItem menuDescription; private javax.swing.JMenuItem menuDispatchDetails; private javax.swing.JMenuItem menuDraftStatus; + private javax.swing.JMenuItem menuView; private javax.swing.JPopupMenu popMenu; private javax.swing.JTable tableNotices; // End of variables declaration//GEN-END:variables