Manage Legal Notices - Description
[habeas.git] / src / habeas / ManageNoticesDialog.java
index 611f02d..73d73fe 100644 (file)
@@ -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<Object> 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<Object> 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;