1 | public class IncludeControllerGui extends AbstractControllerGui↵ | | 1 | public class HTMLReportWriterGui extends Abstract↵
|
2 | // implements UnsharedComponent↵ | | |
|
3 | {↵ | | |
|
|
4 | private FilePanel includePanel = ↵ | | |
|
5 | new ↵ | | 2 | ReportGui {↵
|
|
6 | FilePanel(↵ | | 3 | ReportFilePanel outputDirectory = new ReportFilePanel(↵
|
7 | JMeterUtils.getResString("include_path"), ".jmx"); //$NON-NLS-1$ //$NON-NLS-2$↵ | | 4 | JMeterUtils.getResString("↵
|
|
8 | /**↵ | | |
|
9 | * Initializes the gui panel for the ModuleController instance.↵ | | |
|
10 | */↵ | | |
|
11 | public IncludeControllerGui() {↵ | | 5 | report_output_directory"), "*");↵
|
| | | 6 | ↵
|
| | | 7 | public HTMLReportWriterGui() {↵
|
| | | 8 | super();↵
|
12 | init();↵ | | 9 | init();↵
|
13 | }↵ | | 10 | }↵
|
| | | 11 | ↵
|
14 | public String getLabelResource() {↵ | | 12 | public String getLabelResource() {↵
|
15 | return "include_controller";//$NON-NLS-1$↵ | | 13 | return "↵
|
16 | }↵ | | |
|
|
17 | /*↵ | | |
|
18 | * (non-Javadoc)↵ | | |
|
19 | * ↵ | | |
|
20 | * @see ↵ | | 14 | report_writer_html";↵
|
| | | 15 | }↵
|
| | | 16 | ↵
|
| | | 17 | public JPopupMenu createPopupMenu() {↵
|
| | | 18 | JPopupMenu pop = new JPopupMenu();↵
|
21 | org.apache.jmeter.gui.JMeterGUIComponent#configure(TestElement)↵ | | 19 | ReportMenuFactory.addFileMenu(pop);↵
|
| | | 20 | ReportMenuFactory.addEditMenu(pop,true);↵
|
| | | 21 | return pop;↵
|
| | | 22 | }↵
|
| | | 23 | ↵
|
| | | 24 | /**↵
|
| | | 25 | * init creates the necessary gui stuff.↵
|
22 | */↵ | | 26 | */↵
|
23 | public void configure(TestElement el) {↵ | | 27 | p↵
|
24 | super.configure(el);↵ | | |
|
25 | IncludeController controller = (IncludeController) el;↵ | | |
|
26 | this.includePanel.setFilename(controller.getIncludePath()↵ | | 28 | rivate void init() {// called from ctor, so must not be overridable↵
|
| | | 29 | setLayout(new BorderLayout(10, 10));↵
|
| | | 30 | setBorder(makeBorder());↵
|
| | | 31 | setBackground(Color.white);↵
|
| | | 32 | ↵
|
| | | 33 | JPanel pane = new JPanel();↵
|
| | | 34 | pane.setLayout(new BorderLayout(10,10));↵
|
| | | 35 | pane.setBackground(Color.white);↵
|
| | | 36 | pane.add(this.getNamePanel(),BorderLayout.NORTH);↵
|
| | | 37 | ↵
|
| | | 38 | outputDirectory.setBackground(Color.white);↵
|
|
| | | 39 | pane.add(outputDirectory,BorderLayout.SOUTH);↵
|
27 | );↵ | | 40 | add(pane,BorderLayout.NORTH);↵
|
28 | }↵ | | 41 | }↵
|
|
29 | /*↵ | | 42 | ↵
|
30 | * (non-Javadoc)↵ | | 43 | /* (non-Javadoc)↵
|
31 | * ↵ | | 44 | ↵
|
32 | * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()↵ | | 45 | * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()↵
|
33 | */↵ | | 46 | */↵
|
34 | public TestElement createTestElement() {↵ | | 47 | public TestElement createTestElement() {↵
|
35 | IncludeController mc = new IncludeController();↵ | | 48 | ↵
|
36 | configure↵ | | 49 | HTMLReportWriter element = new HTMLReportWriter();↵
|
37 | TestElement(mc);↵ | | 50 | modifyTestElement(element);↵
|
38 | return mc;↵ | | 51 | return element;↵
|
39 | }↵ | | 52 | }↵
|
|
40 | /*↵ | | 53 | /*↵
|
41 | * (non-Javadoc)↵ | | 54 | (non-Javadoc)↵
|
42 | * ↵ | | 55 | ↵
|
43 | * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)↵ | | 56 | * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(org.apache.jmeter.testelement.TestElement)↵
|
44 | */↵ | | 57 | */↵
|
45 | public void modifyTestElement(TestElement element) {↵ | | 58 | public void modifyTestElement(TestElement element) {↵
|
46 | configureTestElement(element);↵ | | 59 | this.configureTestElement(element);↵
|
47 | IncludeController controller = (IncludeController)element;↵ | | |
|
48 | controller.setIncludePath(this.includePanel.getFilename());↵ | | |
|
49 | }↵ | | |
|
50 | ↵ | | |
|
51 | /**↵ | | |
|
52 | * Implements JMeterGUIComponent.clearGui↵ | | |
|
53 | */↵ | | |
|
54 | public void clearGui() {↵ | | |
|
55 | super.clearGui();↵ | | |
|
56 | includePanel.clearGui();↵ | | |
|
57 | }↵ | | |
|
|
58 | public JPopupMenu createPopupMenu() {↵ | | |
|
59 | JPopupMenu menu = new JPopupMenu();↵ | | |
|
60 | JMenu addMenu = MenuFactory.makeMenus(new String[] {↵ | | |
|
61 | MenuFactory.CONFIG_ELEMENTS, ↵ | | |
|
62 | MenuFactory.ASSERTIONS,↵ | | |
|
63 | MenuFactory.TIMERS, ↵ | | |
|
64 | MenuFactory.LISTENERS, ↵ | | |
|
65 | }, JMeterUtils.getResString("add"), // $NON-NLS-1$↵ | | |
|
66 | ActionNames.ADD);↵ | | |
|
67 | menu.add(addMenu);↵ | | |
|
68 | MenuFactory.addEditMenu(menu, true);↵ | | |
|
69 | MenuFa↵ | | 60 | HTMLReportWriter wr = (HTMLReportWriter)element;↵
|
| | | 61 | wr.setTargetDirectory(outputDirectory.getFilename());↵
|
| | | 62 | }↵
|
|
| | | 63 | public void configure(TestElement element) {↵
|
| | | 64 | super.configure(element);↵
|
| | | 65 | HTMLReportWriter wr = (HTMLReportWriter)element;↵
|
70 | ctory.addFileMenu(menu);↵ | | 66 | outputDirectory.setFile↵
|
71 | return menu;↵ | | |
|
72 | }↵ | | |
|
|
73 | private void init() {↵ | | |
|
74 | setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));↵ | | |
|
75 | setBorder(makeBorder());↵ | | |
|
76 | add(makeTitlePanel());↵ | | 67 | name(wr.getTargetDirectory());↵
|
|
77 | add(includePanel);↵ | | 68 |
|
78 | | | | |