1
2
3
4 package org.telscenter.pas.steps;
5
6 import java.awt.Component;
7 import java.util.List;
8 import java.util.logging.Logger;
9
10 import javax.swing.JDialog;
11 import javax.swing.JLabel;
12 import javax.swing.JPanel;
13 import javax.swing.JTabbedPane;
14
15 import org.telscenter.pas.beans.IWorkReporter;
16 import org.telscenter.pas.service.INoteService;
17 import org.telscenter.pas.ui.dialog.PasDialogManager;
18 import org.telscenter.pas.ui.dialog.PasMessageDialogUI;
19 import org.telscenter.pas.ui.dialog.PasNoteMessageDialogUI;
20 import org.telscenter.pas.ui.frames.PasFrame;
21
22 import com.lowagie.text.pdf.PdfPCell;
23
24 /***
25 * Implement of the Pas step type, <i>Notes</i>.
26 *
27 * @author turadg
28 */
29 public class Note extends Assessment implements INoteStep {
30
31 private static final long serialVersionUID = 1L;
32
33 private transient INoteService noteService;
34
35 NoteUI noteUI;
36
37 public Note() {
38 }
39
40 public String getType() {
41 return "Note";
42 }
43
44 public Component getComponent() {
45 noteUI = new NoteUI(this);
46 return noteUI;
47 }
48
49 public JDialog showNoteSaveCheckDialog() {
50 final PasNoteMessageDialogUI ui = new PasNoteMessageDialogUI(noteUI
51 .getSaveAction());
52
53
54 ui.setMessage("Do you want to save this note before closing?");
55 return PasDialogManager.showPasMessageDialog("Alert", ui
56 .createDialogPanel(), null, true);
57 }
58
59 public JDialog showNotePartsCheckDialog() {
60 final PasMessageDialogUI ui = new PasMessageDialogUI(true);
61
62
63 ui.setMessage("You should complete all note parts before saving");
64 return PasDialogManager.showPasMessageDialog("Warning", ui
65 .createDialogPanel(), null, true);
66 }
67
68 public JDialog showNoteAlreadyOpenDialog() {
69 return this.showNoteAlreadyOpenDialog(null);
70 }
71
72 /***
73 * @return the noteUI
74 */
75 public INoteUI getNoteUI() {
76 return noteUI;
77 }
78
79 /***
80 * @see org.telscenter.pas.steps.INoteStep#showNoteAlreadyOpenDialog(org.telscenter.pas.ui.frames.PasFrame)
81 */
82 public JDialog showNoteAlreadyOpenDialog(PasFrame pasFrame) {
83 final PasMessageDialogUI ui = new PasMessageDialogUI(true);
84
85
86 ui.setMessage("You can only have one note open at a time.");
87 return PasDialogManager.showPasMessageDialog("Warning", ui
88 .createDialogPanel(), null, true);
89
90 }
91
92 }