public class IncludeControllerGui extends AbstractControllerGui // implements UnsharedComponent { private FilePanel includePanel = new FilePanel(JMeterUtils.getResString("include_path"), ".jmx"); //$NON-NLS-1$ //$NON-NLS-2$ /** * Initializes the gui panel for the ModuleController instance. */ public IncludeControllerGui() { init(); } public String getLabelResource() { return "include_controller";//$NON-NLS-1$ } /* * (non-Javadoc) * * @see org.apache.jmeter.gui.JMeterGUIComponent#configure(TestElement) */ public void configure(TestElement el) { super.configure(el); IncludeController controller = (IncludeController) el; this.includePanel.setFilename(controller.getIncludePath()); } /* * (non-Javadoc) * * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement() */ public TestElement createTestElement() { IncludeController mc = new IncludeController(); configureTestElement(mc); return mc; } /* * (non-Javadoc) * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ public void modifyTestElement(TestElement element) { configureTestElement(element); IncludeController controller = (IncludeController)element; controller.setIncludePath(this.includePanel.getFilename()); } /** * Implements JMeterGUIComponent.clearGui */ public void clearGui() { super.clearGui(); includePanel.clearGui(); } public JPopupMenu createPopupMenu() { JPopupMenu menu = new JPopupMenu(); JMenu addMenu = MenuFactory.makeMenus(new String[] { MenuFactory.CONFIG_ELEMENTS, MenuFactory.ASSERTIONS, MenuFactory.TIMERS, MenuFactory.LISTENERS, }, JMeterUtils.getResString("add"), // $NON-NLS-1$ ActionNames.ADD); menu.add(addMenu); MenuFactory.addEditMenu(menu, true); MenuFactory.addFileMenu(menu); return menu; } private void init() { setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP)); setBorder(makeBorder()); add(makeTitlePanel()); add(includePanel);
public class HTMLReportWriterGui extends AbstractReportGui { ReportFilePanel outputDirectory = new ReportFilePanel( JMeterUtils.getResString("report_output_directory"), "*"); public HTMLReportWriterGui() { super(); init(); } public String getLabelResource() { return "report_writer_html"; } public JPopupMenu createPopupMenu() { JPopupMenu pop = new JPopupMenu(); ReportMenuFactory.addFileMenu(pop); ReportMenuFactory.addEditMenu(pop,true); return pop; } /** * init creates the necessary gui stuff. */ private void init() {// called from ctor, so must not be overridable setLayout(new BorderLayout(10, 10)); setBorder(makeBorder()); setBackground(Color.white); JPanel pane = new JPanel(); pane.setLayout(new BorderLayout(10,10)); pane.setBackground(Color.white); pane.add(this.getNamePanel(),BorderLayout.NORTH); outputDirectory.setBackground(Color.white); pane.add(outputDirectory,BorderLayout.SOUTH); add(pane,BorderLayout.NORTH); } /* (non-Javadoc) * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement() */ public TestElement createTestElement() { HTMLReportWriter element = new HTMLReportWriter(); modifyTestElement(element); return element; } /* (non-Javadoc) * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(org.apache.jmeter.testelement.TestElement) */ public void modifyTestElement(TestElement element) { this.configureTestElement(element); HTMLReportWriter wr = (HTMLReportWriter)element; wr.setTargetDirectory(outputDirectory.getFilename()); } public void configure(TestElement element) { super.configure(element); HTMLReportWriter wr = (HTMLReportWriter)element; outputDirectory.setFilename(wr.getTargetDirectory());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/IncludeControllerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/writers/gui/HTMLReportWriterGui.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
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
	
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0