X-Git-Url: https://harishankar.org/repos/?p=habeas.git;a=blobdiff_plain;f=src%2Fhabeas%2FManageNoticesDialog.java;fp=src%2Fhabeas%2FManageNoticesDialog.java;h=73d73fe46d97525b1f8fa872f13fb974fd9ea12d;hp=611f02db9870cabca23cc2a7019ccbf3990a2132;hb=fdaede7966b1cfd8a38dcc51fa8ec60420b842b4;hpb=988965ad5c97f63eeb48b8e44a82cccb032bf591 diff --git a/src/habeas/ManageNoticesDialog.java b/src/habeas/ManageNoticesDialog.java index 611f02d..73d73fe 100644 --- a/src/habeas/ManageNoticesDialog.java +++ b/src/habeas/ManageNoticesDialog.java @@ -9,6 +9,7 @@ import java.awt.Frame; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.Date; import javax.swing.table.DefaultTableModel; /** @@ -46,10 +47,19 @@ public class ManageNoticesDialog extends javax.swing.JDialog { private void initComponents() { popMenu = new javax.swing.JPopupMenu(); + menuDescription = new javax.swing.JMenuItem(); menuDraftStatus = new javax.swing.JMenuItem(); jScrollPane1 = new javax.swing.JScrollPane(); tableNotices = new javax.swing.JTable(); + menuDescription.setText("Description..."); + menuDescription.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuDescriptionActionPerformed(evt); + } + }); + popMenu.add(menuDescription); + menuDraftStatus.setMnemonic('D'); menuDraftStatus.setText("Draft Status..."); menuDraftStatus.setToolTipText(""); @@ -114,12 +124,23 @@ public class ManageNoticesDialog extends javax.swing.JDialog { ArrayList notice = Utility.getNoticeDetails (selid); if (notice == null) return; - frm.setDraftStatus((boolean)notice.get(4), (boolean)notice.get(5)); - frm.setSelectedNotice (selid); + frm.setFields(selid, (boolean)notice.get(4), (boolean)notice.get(5)); frm.setVisible(true); }//GEN-LAST:event_menuDraftStatusActionPerformed + private void menuDescriptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuDescriptionActionPerformed + // TODO add your handling code here: + int selid = getSelectedNotice(); + if (selid == -1) return; + DescriptionDialog frm = new DescriptionDialog((Frame)this.getParent(), true); + ArrayList notice = Utility.getNoticeDetails(selid); + if (notice == null) return; + frm.setFields(selid, (String)notice.get(0), (String)notice.get(1), (Date)notice.get(2)); + frm.setVisible(true); + populateNotices(); + }//GEN-LAST:event_menuDescriptionActionPerformed + /** * @param args the command line arguments */ @@ -164,6 +185,7 @@ public class ManageNoticesDialog extends javax.swing.JDialog { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JMenuItem menuDescription; private javax.swing.JMenuItem menuDraftStatus; private javax.swing.JPopupMenu popMenu; private javax.swing.JTable tableNotices;