Manage Legal Notices - Description
[habeas.git] / src / habeas / ManageNoticesDialog.java
index c23923e..73d73fe 100644 (file)
@@ -5,12 +5,11 @@
  */
 package habeas;
 
+import java.awt.Frame;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
 import java.util.ArrayList;
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
+import java.util.Date;
 import javax.swing.table.DefaultTableModel;
 
 /**
@@ -48,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("");
@@ -112,10 +120,27 @@ public class ManageNoticesDialog extends javax.swing.JDialog {
         int selid = getSelectedNotice ();
         if (selid == -1) return;
         
-        System.out.println (selid);
+        DraftStatusDialog frm = new DraftStatusDialog((Frame) this.getParent(), true);
+        ArrayList<Object> notice = Utility.getNoticeDetails (selid);
+        if (notice == null) return;
+
+        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
      */
@@ -160,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;