KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > reporters > gui > ResultActionGui


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/reporters/gui/ResultActionGui.java,v 1.3 2004/03/05 01:34:53 sebb Exp $
2
/*
3  * Copyright 2003-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.reporters.gui;
20
21 import java.awt.BorderLayout JavaDoc;
22
23 import javax.swing.Box JavaDoc;
24
25 import org.apache.jmeter.reporters.ResultAction;
26 import org.apache.jmeter.gui.OnErrorPanel;
27 import org.apache.jmeter.processor.gui.AbstractPostProcessorGui;
28 import org.apache.jmeter.testelement.OnErrorTestElement;
29 import org.apache.jmeter.testelement.TestElement;
30
31 /**
32  * Create a Result Action Test Element
33  *
34  * @version $Revision: 1.3 $ Last updated: $Date: 2004/03/05 01:34:53 $
35  */

36 public class ResultActionGui extends AbstractPostProcessorGui
37 {
38     
39     private OnErrorPanel errorPanel;
40    
41     public ResultActionGui()
42     {
43         super();
44         init();
45     }
46
47     /**
48      * @see org.apache.jmeter.gui.JMeterGUIComponent#getStaticLabel()
49      */

50     public String JavaDoc getLabelResource()
51     {
52         return "resultaction_title";
53     }
54     
55     /**
56      * @see org.apache.jmeter.gui.JMeterGUIComponent#configure(TestElement)
57      */

58     public void configure(TestElement el)
59     {
60         super.configure(el);
61         errorPanel.configure(((OnErrorTestElement)el).getErrorAction());
62     }
63
64     /**
65      * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()
66      */

67     public TestElement createTestElement()
68     {
69         ResultAction resultAction = new ResultAction();
70         modifyTestElement(resultAction);
71         return resultAction;
72     }
73
74     /**
75      * Modifies a given TestElement to mirror the data in the gui components.
76      * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
77      */

78     public void modifyTestElement(TestElement te)
79     {
80         super.configureTestElement(te);
81         ((OnErrorTestElement) te).setErrorAction(errorPanel.getOnErrorSetting());
82     }
83     
84     private void init()
85     {
86         setLayout(new BorderLayout JavaDoc());
87         setBorder(makeBorder());
88         Box JavaDoc box = Box.createVerticalBox();
89         box.add(makeTitlePanel());
90         errorPanel = new OnErrorPanel();
91         box.add(errorPanel);
92         add(box,BorderLayout.NORTH);
93     }
94 }
95
Popular Tags