1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.jameleon.ui;
20
21 import java.util.Map;
22
23 import javax.swing.JFrame;
24
25 import net.sf.jameleon.data.AbstractDataDrivableTag;
26 import net.sf.jameleon.event.DataDrivableEvent;
27
28 public class DataDrivableDebugDialog extends DebugDialog{
29
30 private DataDrivableEvent ddEvent;
31
32 public DataDrivableDebugDialog(Object source, JFrame rootFrame, TestCaseResultsPane tcrf, String title){
33 super(source, rootFrame, tcrf, title);
34 }
35
36 /***
37 * Sets the source where the data is pulled and where the data
38 * needs to be changed if any values are changed in the table.
39 * @param source - The tag that represents this debug dialog
40 */
41 protected void setBreakPointSource(Object source){
42 ddEvent = (DataDrivableEvent)source;
43 }
44
45 /***
46 * Gets the key-value pairs that are set via this tag
47 * @return the key-value pairs that are set via this tag
48 */
49 protected Map getAttributes(){
50 return ddEvent.getRowData();
51 }
52
53 /***
54 * Gets the description that shows up in the dialog box
55 * @return the description that shows up in the dialog box
56 */
57 protected String getTagDescription(){
58 String tagName = "data-drivable tag";
59 if (ddEvent.getSource() instanceof AbstractDataDrivableTag) {
60 tagName = ((AbstractDataDrivableTag)ddEvent.getSource()).getTagDescription();
61 }
62 return tagName;
63 }
64
65 /***
66 * Changes the value of the given attribute's name real-time
67 * @param attributeName - The name of the attribute to change
68 * @param newValue - The new value to set the attribute to
69 */
70 protected void setNewAttributeValue(String attributeName, String newValue){
71 getAttributes().put(attributeName, newValue);
72 }
73
74 }