Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 205093 | Differences between
and this patch

Collapse All | Expand All

(-)src-ui/org/eclipse/tptp/test/tools/api/internal/ui/recording/APIRecordingLaunchConfigurationPage.java (-5 / +6 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2006, 2007 IBM Corporation and others.
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 22-28 Link Here
22
import org.eclipse.swt.widgets.Listener;
22
import org.eclipse.swt.widgets.Listener;
23
import org.eclipse.swt.widgets.Text;
23
import org.eclipse.swt.widgets.Text;
24
import org.eclipse.tptp.test.tools.api.internal.resources.Messages;
24
import org.eclipse.tptp.test.tools.api.internal.resources.Messages;
25
import org.eclipse.tptp.test.tools.api.internal.ui.test.generation.TPTPJUnitTestSuiteGenerationPane;
25
import org.eclipse.tptp.test.tools.api.internal.ui.test.generation.TPTPJUnitTestSuiteOptionalGenerationPane;
26
import org.eclipse.tptp.test.tools.api.internal.ui.util.APIRecordingConstants;
26
import org.eclipse.tptp.test.tools.api.internal.ui.util.APIRecordingConstants;
27
import org.eclipse.tptp.trace.ui.provisional.launcher.IConfigurationPage;
27
import org.eclipse.tptp.trace.ui.provisional.launcher.IConfigurationPage;
28
import org.eclipse.tptp.trace.ui.provisional.launcher.IStatusListener;
28
import org.eclipse.tptp.trace.ui.provisional.launcher.IStatusListener;
Lines 33-51 Link Here
33
 * 
33
 * 
34
 * 
34
 * 
35
 * @author      Paul E. Slauenwhite
35
 * @author      Paul E. Slauenwhite
36
 * @version     November 15, 2006
36
 * @author      Tony Wang
37
 * @version     February 28, 2008
37
 * @since       September 6, 2006
38
 * @since       September 6, 2006
38
 * @provisional
39
 * @provisional
39
 */
40
 */
40
public class APIRecordingLaunchConfigurationPage implements IConfigurationPage {
41
public class APIRecordingLaunchConfigurationPage implements IConfigurationPage {
41
42
42
	private IStatusListener statusListener = null;
43
	private IStatusListener statusListener = null;
43
	private TPTPJUnitTestSuiteGenerationPane testGenerationPane = null;
44
	private TPTPJUnitTestSuiteOptionalGenerationPane testGenerationPane = null;
44
	private ILaunchConfiguration launchConfiguration = null;
45
	private ILaunchConfiguration launchConfiguration = null;
45
	
46
	
46
	public void createControl(Composite parent) {
47
	public void createControl(Composite parent) {
47
		
48
		
48
		testGenerationPane  = new TPTPJUnitTestSuiteGenerationPane(parent);
49
		testGenerationPane  = new TPTPJUnitTestSuiteOptionalGenerationPane(parent);
49
		
50
		
50
		Listener listener = new Listener(){
51
		Listener listener = new Listener(){
51
    		
52
    		
(-)src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPane.java (-44 / +14 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2006, 2007 IBM Corporation and others.
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 21-27 Link Here
21
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.events.SelectionAdapter;
22
import org.eclipse.swt.events.SelectionAdapter;
23
import org.eclipse.swt.events.SelectionEvent;
23
import org.eclipse.swt.events.SelectionEvent;
24
import org.eclipse.swt.graphics.Color;
25
import org.eclipse.swt.layout.GridData;
24
import org.eclipse.swt.layout.GridData;
26
import org.eclipse.swt.layout.GridLayout;
25
import org.eclipse.swt.layout.GridLayout;
27
import org.eclipse.swt.widgets.Button;
26
import org.eclipse.swt.widgets.Button;
Lines 37-51 Link Here
37
 * 
36
 * 
38
 * 
37
 * 
39
 * @author  Paul E. Slauenwhite
38
 * @author  Paul E. Slauenwhite
40
 * @version November 15, 2006
39
 * @author  Tony Wang
40
 * @version February 28, 2008
41
 * @since   September 7, 2006
41
 * @since   September 7, 2006
42
 * @provisional
42
 * @provisional
43
 */
43
 */
44
public class TPTPJUnitTestSuiteGenerationPane extends Composite {
44
public class TPTPJUnitTestSuiteGenerationPane extends Composite {
45
	
45
	
46
	private Text testSuiteLocationText = null;
46
	protected Text testSuiteLocationText = null;
47
	private Combo testSuiteGeneratorCombo = null;
47
	protected Combo testSuiteGeneratorCombo = null;
48
	private Button testSuiteLocationButton = null;
48
	protected Button testSuiteLocationButton = null;
49
49
50
	public TPTPJUnitTestSuiteGenerationPane(Composite parent){		
50
	public TPTPJUnitTestSuiteGenerationPane(Composite parent){		
51
		this(parent, SWT.SHADOW_NONE);		
51
		this(parent, SWT.SHADOW_NONE);		
Lines 66-85 Link Here
66
		return testSuiteLocationText;
66
		return testSuiteLocationText;
67
	}
67
	}
68
68
69
	public void init(){
69
	protected void buildPane(){
70
 
71
	    testSuiteGeneratorCombo.select(0);
72
		
73
		testSuiteLocationText.setEnabled(false);
74
		testSuiteLocationText.setText("");
75
76
		//Work-around: Set the text field's background color to gray since disabled/enabled un-editable text fields have a gray background, by default.
77
	    testSuiteLocationText.setBackground(((Color)(testSuiteGeneratorCombo.getData("Background"))));	    			
78
79
		testSuiteLocationButton.setEnabled(false);		
80
	}
81
82
	private void buildPane(){
83
		
70
		
84
		setLayout(new GridLayout());
71
		setLayout(new GridLayout());
85
		setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
72
		setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Lines 99-124 Link Here
99
	    
86
	    
100
	    testSuiteGeneratorCombo = new Combo(testGroup, SWT.READ_ONLY);
87
	    testSuiteGeneratorCombo = new Combo(testGroup, SWT.READ_ONLY);
101
	    testSuiteGeneratorCombo.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).grab(true, false).create());
88
	    testSuiteGeneratorCombo.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).grab(true, false).create());
102
	    testSuiteGeneratorCombo.add("Do not generate test suite");
103
	    testSuiteGeneratorCombo.add("TPTP JUnit Test Suite Generator");
89
	    testSuiteGeneratorCombo.add("TPTP JUnit Test Suite Generator");
104
	    testSuiteGeneratorCombo.addSelectionListener(new SelectionAdapter() {
90
		testSuiteGeneratorCombo.select(0);
105
			
106
	    	public void widgetSelected(SelectionEvent e) {	    		
107
	    		
108
	    		if(testSuiteGeneratorCombo.getSelectionIndex() != 0){
109
		    	
110
	    			testSuiteLocationButton.setEnabled(true);
111
		    		
112
	    			testSuiteLocationText.setEnabled(true);
113
	    			
114
	    			//Work-around: Set the text field's background color to white since disabled/enabled un-editable text fields have a gray background, by default.
115
	    		    testSuiteLocationText.setBackground(testSuiteGeneratorCombo.getBackground());	    			
116
	    		}	    		
117
	    		else{
118
	    			init();
119
	    		}
120
			}		
121
		});
122
91
123
	    //TODO: Create extension point for user-defined test suite generators:
92
	    //TODO: Create extension point for user-defined test suite generators:
124
//	    IConfigurationElement[] elements = 
93
//	    IConfigurationElement[] elements = 
Lines 134-142 Link Here
134
	    testSuiteLocationText = new Text(testGroup, SWT.SINGLE | SWT.BORDER);
103
	    testSuiteLocationText = new Text(testGroup, SWT.SINGLE | SWT.BORDER);
135
	    testSuiteLocationText.setEditable(false);
104
	    testSuiteLocationText.setEditable(false);
136
	    testSuiteLocationText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).create());
105
	    testSuiteLocationText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).create());
137
	    
106
138
	    //Work-around: Persist the text field's background original color since disabled/enabled un-editable text fields have a gray background, by default.
107
		//Work-around: Persist the text field's background original color since disabled/enabled un-editable text fields have a gray background, by default.
139
	    testSuiteLocationText.setData("Background",testSuiteLocationText.getBackground());
108
	    testSuiteLocationText.setData("Background", testSuiteLocationText.getBackground());
109
110
	    //Work-around: Set the text field's background color to white since disabled/enabled un-editable text fields have a gray background, by default.
111
		testSuiteLocationText.setBackground(testSuiteGeneratorCombo.getBackground());    			
140
112
141
	    testSuiteLocationButton = new Button(testGroup, SWT.PUSH);
113
	    testSuiteLocationButton = new Button(testGroup, SWT.PUSH);
142
	    testSuiteLocationButton.setText("Browse...");
114
	    testSuiteLocationButton.setText("Browse...");
Lines 180-187 Link Here
180
			}
152
			}
181
		});
153
		});
182
	    
154
	    
183
	    init();
184
	    
185
	    layout(false,true);
155
	    layout(false,true);
186
	}	
156
	}	
187
}
157
}
(-)src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/wizards/GenerateTPTPJUnitTestSuiteWizardPageOne.java (+3 lines)
Lines 91-96 Link Here
91
		Combo testSuiteGeneratorCombo = testGenerationPane.getTestSuiteGeneratorCombo();
91
		Combo testSuiteGeneratorCombo = testGenerationPane.getTestSuiteGeneratorCombo();
92
		testSuiteGeneratorCombo.addListener(SWT.Selection, listener);
92
		testSuiteGeneratorCombo.addListener(SWT.Selection, listener);
93
		
93
		
94
		//Fire the selection event to set the messages in the wizard/dialog:
95
		listener.handleEvent(null);
96
		
94
		setControl(testGenerationPane);
97
		setControl(testGenerationPane);
95
	}
98
	}
96
	
99
	
(-)src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteOptionalGenerationPane.java (+77 lines)
Added Link Here
1
/**********************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * $Id$
8
 * 
9
 * Contributors: 
10
 * IBM - Initial API and implementation
11
 **********************************************************************/
12
package org.eclipse.tptp.test.tools.api.internal.ui.test.generation;
13
14
import org.eclipse.swt.events.SelectionAdapter;
15
import org.eclipse.swt.events.SelectionEvent;
16
import org.eclipse.swt.graphics.Color;
17
import org.eclipse.swt.widgets.Composite;
18
19
/**
20
 * TPTP JUnit test suite optional generation pane.
21
 * <p>
22
 * 
23
 * 
24
 * @author  Paul E. Slauenwhite
25
 * @author  Tony Wang
26
 * @version February 28, 2008
27
 * @since   February 28, 2008
28
 * @provisional
29
 */
30
public class TPTPJUnitTestSuiteOptionalGenerationPane extends TPTPJUnitTestSuiteGenerationPane {
31
32
	public TPTPJUnitTestSuiteOptionalGenerationPane(Composite parent){		
33
		super(parent);		
34
	}
35
36
	public TPTPJUnitTestSuiteOptionalGenerationPane(Composite parent, int style){
37
		super(parent, style);
38
	}
39
40
	protected void buildPane(){
41
42
		super.buildPane();
43
44
		testSuiteGeneratorCombo.add("Do not generate test suite", 0);
45
	    testSuiteGeneratorCombo.addSelectionListener(new SelectionAdapter() {
46
47
			public void widgetSelected(SelectionEvent e) {	    		
48
49
				if(testSuiteGeneratorCombo.getSelectionIndex() != 0){
50
51
					testSuiteLocationButton.setEnabled(true);
52
53
					testSuiteLocationText.setEnabled(true);
54
55
					//Work-around: Set the text field's background color to white since disabled/enabled un-editable text fields have a gray background, by default.
56
					testSuiteLocationText.setBackground(testSuiteGeneratorCombo.getBackground());    			
57
				}	    		
58
				else{
59
					init();
60
				}
61
			}	
62
		});
63
	    
64
	    init();
65
	}	
66
67
	private void init(){
68
69
		testSuiteLocationText.setText("");
70
71
		//Work-around: Set the text field's background color to gray, persisted as the text field's background original color since disabled/enabled un-editable text fields have a gray background, by default.
72
	    testSuiteLocationText.setBackground(((Color)(testSuiteLocationText.getData("Background"))));	    			
73
		testSuiteLocationText.setEnabled(false);
74
75
		testSuiteLocationButton.setEnabled(false);		
76
	}
77
}

Return to bug 205093