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 139589
Collapse All | Expand All

(-)src/org/eclipse/tptp/test/provisional/recorder/framework/AbstractRecorderExecOptionsProvider.java (-6 / +11 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
2
 * Copyright (c) 2005, 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 19-32 Link Here
19
/**
19
/**
20
 * Abstract extension of an IRecorderExecOptionsProvider. The following methods must
20
 * Abstract extension of an IRecorderExecOptionsProvider. The following methods must
21
 * be extended by using classes.
21
 * be extended by using classes.
22
 * <p/>
22
 * 	public String getVMArgs();
23
 * 	public String getVMArgs();
23
 *	
24
 * <p/>	
24
 *	public String getClasspathEntries();
25
 *	public String getClasspathEntries();
25
 *	
26
 * <p/>	
26
 *	public File[] getRecorderJars();
27
 *	public File[] getRecorderJars();
27
 *
28
 * <p/>
28
 * @author jnevicos
29
 * 
29
 * NOTE: This will be moved to a provisional package in TPTP 4.2
30
 * 
31
 * @author  Paul E. Slauenwhite
32
 * @author  Jeffery Nevicosi
33
 * @version March 13, 2008
34
 * @since   February 1, 2006
30
 */
35
 */
31
public abstract class AbstractRecorderExecOptionsProvider implements
36
public abstract class AbstractRecorderExecOptionsProvider implements
32
		IRecorderExecOptionsProvider {
37
		IRecorderExecOptionsProvider {
(-)src/org/eclipse/tptp/test/provisional/recorder/framework/IRecorderClientHelper.java (-4 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
2
 * Copyright (c) 2005, 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 17-26 Link Here
17
 * Interface for the recorder provider, IRecorderClientHelper.
17
 * Interface for the recorder provider, IRecorderClientHelper.
18
 * The RecorderClient (internal class which handles initializing & launching 
18
 * The RecorderClient (internal class which handles initializing & launching 
19
 * recorders) will call these methods at intervals during setup.
19
 * recorders) will call these methods at intervals during setup.
20
 * 
20
 * <p/>
21
 *  It is highly adviseable to extend (at least) the preSetup() method.
21
 *  It is highly adviseable to extend (at least) the preSetup() method.
22
 * @author jnevicos
22
 *  <p/>
23
 * NOTE: This will be moved to a provisional package in TPTP 4.2
23
 * 
24
 * 
25
 * @author  Paul E. Slauenwhite
26
 * @author  Jeffery Nevicosi
27
 * @version March 13, 2008
28
 * @since   February 1, 2006
24
 */
29
 */
25
public interface IRecorderClientHelper  extends IRecorderProvider {
30
public interface IRecorderClientHelper  extends IRecorderProvider {
26
31
(-)src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java (+5 lines)
Lines 300-310 Link Here
300
		return null;
300
		return null;
301
		
301
		
302
	}
302
	}
303
	
303
	/* (non-Javadoc)
304
	/* (non-Javadoc)
304
	 * @see org.eclipse.tptp.test.internal.recorder.ui.wizards.IGenericRecorderWizard#getRecorderObjectData(java.lang.String)
305
	 * @see org.eclipse.tptp.test.internal.recorder.ui.wizards.IGenericRecorderWizard#getRecorderObjectData(java.lang.String)
305
	 */
306
	 */
306
	public Object getRecorderObjectData(String key) {
307
	public Object getRecorderObjectData(String key) {
307
		
308
		
309
		if(key.equals(IRecorderPageProvider.WIZARD_KEY_INITIAL_STRUCTURED_SELECTION)){
310
			return selection;
311
		}
312
		
308
		if (page1 == null){
313
		if (page1 == null){
309
			return null;
314
			return null;
310
		}
315
		}
(-)src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/IRecorderPageProvider.java (-3 / +21 lines)
Lines 11-27 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.tptp.test.provisional.recorder.ui.wizards;
12
package org.eclipse.tptp.test.provisional.recorder.ui.wizards;
13
13
14
import org.eclipse.hyades.test.core.testgen.TestGenerator;
15
import org.eclipse.jface.viewers.IStructuredSelection;
14
import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderProvider;
16
import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderProvider;
15
17
16
/**
18
/**
17
 * A recorder provider which provides additional custom wizard pages to the generic
19
 * A recorder provider which provides additional custom wizard pages to the generic
18
 * recording wizard.
20
 * recording wizard.
19
 * 
21
 * <p/>
20
 * This provider is responsible for assembling the pages, collecting the page data,
22
 * This provider is responsible for assembling the pages, collecting the page data,
21
 * and providing a mechanism to provide this data to other providers.
23
 * and providing a mechanism to provide this data to other providers.
22
 * @author jnevicos
24
 * <p/>
25
 * 
26
 * 
27
 * @author  Paul E. Slauenwhite
28
 * @author  Jeffery Nevicosi
29
 * @version March 13, 2008
30
 * @since   February 1, 2006
23
 */
31
 */
24
public interface IRecorderPageProvider  extends IRecorderProvider {
32
public interface IRecorderPageProvider extends IRecorderProvider {
33
34
	/**
35
	 * The default key string for defining the initial {@link IStructuredSelection} provided by the {@link IGenericRecorderWizard}.
36
	 * <p/>
37
	 * The {@link IGenericRecorderPage} pages provided by this {@link IRecorderPageProvider} can 
38
	 * retrive the initial {@link IStructuredSelection} from the {@link IGenericRecorderWizard} by
39
	 * calling {@link IGenericRecorderWizard#getRecorderObjectData(IRecorderPageProvider.WIZARD_KEY_INITIAL_STRUCTURED_SELECTION)}, 
40
	 * if the {@link IGenericRecorderWizard} provides an initial {@link IStructuredSelection}.
41
	 */
42
	public static final String WIZARD_KEY_INITIAL_STRUCTURED_SELECTION = "keyWizardStructuredSelection";
25
43
26
	/**
44
	/**
27
	 * default key string for defining path to a recording file
45
	 * default key string for defining path to a recording file
(-)src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/TestsuiteLocationWizardPage.java (-5 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 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 13-22 Link Here
13
13
14
import org.eclipse.hyades.internal.execution.testgen.ui.wizards.FileLocationSelectionWizardpage;
14
import org.eclipse.hyades.internal.execution.testgen.ui.wizards.FileLocationSelectionWizardpage;
15
import org.eclipse.hyades.test.ui.internal.resources.UiPluginResourceBundle;
15
import org.eclipse.hyades.test.ui.internal.resources.UiPluginResourceBundle;
16
import org.eclipse.jface.viewers.IStructuredSelection;
17
16
/**
18
/**
17
 * A wizard page implementation for specifying the recorded test location
19
 * A wizard page implementation for specifying the recorded test location.
18
 * @author jnevicos
20
 * <p/>
19
 * NOTE: This will be moved to a provisional package in TPTP 4.2
21
 * 
22
 * 
23
 * @author  Paul E. Slauenwhite
24
 * @author  Jeffery Nevicosi
25
 * @version March 13, 2008
26
 * @since   February 1, 2006
20
 */
27
 */
21
public class TestsuiteLocationWizardPage extends FileLocationSelectionWizardpage implements IGenericRecorderPage {
28
public class TestsuiteLocationWizardPage extends FileLocationSelectionWizardpage implements IGenericRecorderPage {
22
29
Lines 38-44 Link Here
38
	 */
45
	 */
39
	public TestsuiteLocationWizardPage(IGenericRecorderWizard wizard, boolean bSaveLastSelected)
46
	public TestsuiteLocationWizardPage(IGenericRecorderWizard wizard, boolean bSaveLastSelected)
40
	{
47
	{
41
		super(bSaveLastSelected);
48
		super(bSaveLastSelected, ((IStructuredSelection)(wizard.getRecorderObjectData(IRecorderPageProvider.WIZARD_KEY_INITIAL_STRUCTURED_SELECTION))));
42
		this.wizard = wizard;
49
		this.wizard = wizard;
43
		setWizard(wizard);
50
		setWizard(wizard);
44
	}
51
	}
(-)src-recorder/org/eclipse/tptp/test/provisional/recorder/messages/AbstractRecorderMessageProvider.java (-4 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 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 18-26 Link Here
18
import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderMessageProvider;
18
import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderMessageProvider;
19
19
20
/**
20
/**
21
 * An abstract implementation of IRecorderMessageProvider
21
 * An abstract implementation of IRecorderMessageProvider.
22
 * @author jnevicos
22
 * <p/>
23
 * NOTE: This will be moved to a provisional package in TPTP 4.2
23
 * 
24
 * 
25
 * @author  Paul E. Slauenwhite
26
 * @author  Jeffery Nevicosi
27
 * @version March 13, 2008
28
 * @since   February 1, 2006
24
 */
29
 */
25
public abstract class AbstractRecorderMessageProvider implements
30
public abstract class AbstractRecorderMessageProvider implements
26
		IRecorderMessageProvider {
31
		IRecorderMessageProvider {
(-)src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/FileLocationSelectionWizardpage.java (-29 / +48 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 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 54-61 Link Here
54
/**
54
/**
55
 * Abstract wizard page which can be extended by any wizard page which wants to provide controls for selecting file location
55
 * Abstract wizard page which can be extended by any wizard page which wants to provide controls for selecting file location
56
 * and specifying file name.  It provides the directory structure in a tree and allows filename to be entered. It keeps track of the 
56
 * and specifying file name.  It provides the directory structure in a tree and allows filename to be entered. It keeps track of the 
57
 * last selected file for any extender and restores that selection the next time the extender is instantiated
57
 * last selected file for any extender and restores that selection the next time the extender is instantiated.
58
 * @author Ernest Jessee
58
 * <p/>
59
 * 
60
 * 
61
 * @author  Paul E. Slauenwhite
62
 * @author  Ernest Jessee
63
 * @version March 13, 2008
64
 * @since   February 1, 2005
59
 */
65
 */
60
public abstract class FileLocationSelectionWizardpage extends WizardPage implements ITestGenWizardPage
66
public abstract class FileLocationSelectionWizardpage extends WizardPage implements ITestGenWizardPage
61
{
67
{
Lines 68-74 Link Here
68
	private Text selectedFileName;
74
	private Text selectedFileName;
69
75
70
	private boolean saveLastSelected = false;
76
	private boolean saveLastSelected = false;
71
	
77
78
	private IStructuredSelection selection = null;
79
72
	public abstract String getFileExtension();
80
	public abstract String getFileExtension();
73
	
81
	
74
	public abstract String getFileNameLabel();
82
	public abstract String getFileNameLabel();
Lines 188-199 Link Here
188
196
189
	public FileLocationSelectionWizardpage(boolean saveLastSelected)
197
	public FileLocationSelectionWizardpage(boolean saveLastSelected)
190
	{
198
	{
199
		this(saveLastSelected, null);
200
	}
201
	
202
	public FileLocationSelectionWizardpage(boolean saveLastSelected, IStructuredSelection selection){
203
		
191
		super(FileLocationSelectionWizardpage.class.getName());
204
		super(FileLocationSelectionWizardpage.class.getName());
205
		
192
		this.saveLastSelected = saveLastSelected;
206
		this.saveLastSelected = saveLastSelected;
207
		this.selection = selection;
193
	}
208
	}
194
	
209
	
195
	
196
	
197
	public void saveSettings()
210
	public void saveSettings()
198
	{	
211
	{	
199
		if (saveLastSelected)
212
		if (saveLastSelected)
Lines 295-314 Link Here
295
			
308
			
296
			TestgenUIUtility.layoutControlInGrid(fileNameLabel,1,GridData.HORIZONTAL_ALIGN_END);
309
			TestgenUIUtility.layoutControlInGrid(fileNameLabel,1,GridData.HORIZONTAL_ALIGN_END);
297
			TestgenUIUtility.layoutControlInGrid(selectedFileName,1,GridData.HORIZONTAL_ALIGN_FILL|GridData.GRAB_HORIZONTAL);
310
			TestgenUIUtility.layoutControlInGrid(selectedFileName,1,GridData.HORIZONTAL_ALIGN_FILL|GridData.GRAB_HORIZONTAL);
311
298
			autoSelectProject();
312
			autoSelectProject();
299
			
313
			
300
			setPageComplete(true);
314
			//Set focus on the file name text field if a directory has been selected and no file name has been selected:
301
			
315
			if((selectedContainer != null) && (selectedFileName.getText().trim().length() == 0)){
302
			
316
				selectedFileName.setFocus();
317
			}			
303
			
318
			
304
						
319
			setPageComplete(true);
305
		}
320
		}
306
		catch (TestGenUIException e)
321
		catch (TestGenUIException e)
307
		{
322
		{
308
			e.printStackTrace();
323
			UiPlugin.logError(e);
309
		}
324
		}
310
		
311
		
312
	}
325
	}
313
326
314
	private String getPreviouslySelectedObject(ArrayList objectList)
327
	private String getPreviouslySelectedObject(ArrayList objectList)
Lines 421-445 Link Here
421
	{
434
	{
422
		if (selectedContainer == null )
435
		if (selectedContainer == null )
423
		{ 
436
		{ 
424
			IProject[] projects = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getProjects();
437
			
425
			IProject project = null;
438
			if(selection != null){
426
			if (projects.length > 0)
439
				((StructuredViewer)(tree)).setSelection(selection);
427
			{
440
			}
428
				int i = 0;
441
			else{
429
				project = projects[0];
442
				
430
				while (!project.isOpen())
443
				IProject[] projects = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getProjects();
444
				IProject project = null;
445
				if (projects.length > 0)
431
				{
446
				{
432
					if (++i < projects.length)
447
					int i = 0;
433
						project = projects[i];
448
					project = projects[0];
434
					else
449
					while (!project.isOpen())
435
					{
450
					{
436
						project = projects[0];
451
						if (++i < projects.length)
437
						break;
452
							project = projects[i];
438
					}
453
						else
439
				}				
454
						{
440
				((StructuredViewer)tree).setSelection(new StructuredSelection(project));
455
							project = projects[0];
456
							break;
457
						}
458
					}				
459
					((StructuredViewer)tree).setSelection(new StructuredSelection(project));
460
				}
441
			}
461
			}
442
	
443
		}
462
		}
444
	}
463
	}
445
	
464
	

Return to bug 139589