Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 92450 Details for
Bug 139589
Allow programmatic context for initially selected project in Generic Recorder Wizard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
Bugzilla_139589_patch.txt (text/plain), 15.23 KB, created by
Paul Slauenwhite
on 2008-03-13 11:13:20 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Paul Slauenwhite
Created:
2008-03-13 11:13:20 EDT
Size:
15.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.test.core >Index: src/org/eclipse/tptp/test/provisional/recorder/framework/AbstractRecorderExecOptionsProvider.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.core/src/org/eclipse/tptp/test/provisional/recorder/framework/AbstractRecorderExecOptionsProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractRecorderExecOptionsProvider.java >--- src/org/eclipse/tptp/test/provisional/recorder/framework/AbstractRecorderExecOptionsProvider.java 3 Feb 2006 15:09:16 -0000 1.2 >+++ src/org/eclipse/tptp/test/provisional/recorder/framework/AbstractRecorderExecOptionsProvider.java 13 Mar 2008 15:12:20 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -19,14 +19,19 @@ > /** > * Abstract extension of an IRecorderExecOptionsProvider. The following methods must > * be extended by using classes. >+ * <p/> > * public String getVMArgs(); >- * >+ * <p/> > * public String getClasspathEntries(); >- * >+ * <p/> > * public File[] getRecorderJars(); >- * >- * @author jnevicos >- * NOTE: This will be moved to a provisional package in TPTP 4.2 >+ * <p/> >+ * >+ * >+ * @author Paul E. Slauenwhite >+ * @author Jeffery Nevicosi >+ * @version March 13, 2008 >+ * @since February 1, 2006 > */ > public abstract class AbstractRecorderExecOptionsProvider implements > IRecorderExecOptionsProvider { >Index: src/org/eclipse/tptp/test/provisional/recorder/framework/IRecorderClientHelper.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.core/src/org/eclipse/tptp/test/provisional/recorder/framework/IRecorderClientHelper.java,v >retrieving revision 1.2 >diff -u -r1.2 IRecorderClientHelper.java >--- src/org/eclipse/tptp/test/provisional/recorder/framework/IRecorderClientHelper.java 3 Feb 2006 15:09:16 -0000 1.2 >+++ src/org/eclipse/tptp/test/provisional/recorder/framework/IRecorderClientHelper.java 13 Mar 2008 15:12:20 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -17,10 +17,15 @@ > * Interface for the recorder provider, IRecorderClientHelper. > * The RecorderClient (internal class which handles initializing & launching > * recorders) will call these methods at intervals during setup. >- * >+ * <p/> > * It is highly adviseable to extend (at least) the preSetup() method. >- * @author jnevicos >- * NOTE: This will be moved to a provisional package in TPTP 4.2 >+ * <p/> >+ * >+ * >+ * @author Paul E. Slauenwhite >+ * @author Jeffery Nevicosi >+ * @version March 13, 2008 >+ * @since February 1, 2006 > */ > public interface IRecorderClientHelper extends IRecorderProvider { > >#P org.eclipse.hyades.test.ui >Index: src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java,v >retrieving revision 1.15 >diff -u -r1.15 NewTestFromRecordingWizard.java >--- src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java 11 Mar 2008 20:37:38 -0000 1.15 >+++ src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java 13 Mar 2008 15:12:21 -0000 >@@ -300,11 +300,16 @@ > return null; > > } >+ > /* (non-Javadoc) > * @see org.eclipse.tptp.test.internal.recorder.ui.wizards.IGenericRecorderWizard#getRecorderObjectData(java.lang.String) > */ > public Object getRecorderObjectData(String key) { > >+ if(key.equals(IRecorderPageProvider.WIZARD_KEY_INITIAL_STRUCTURED_SELECTION)){ >+ return selection; >+ } >+ > if (page1 == null){ > return null; > } >Index: src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/IRecorderPageProvider.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/IRecorderPageProvider.java,v >retrieving revision 1.6 >diff -u -r1.6 IRecorderPageProvider.java >--- src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/IRecorderPageProvider.java 13 Mar 2008 11:50:14 -0000 1.6 >+++ src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/IRecorderPageProvider.java 13 Mar 2008 15:12:21 -0000 >@@ -11,17 +11,35 @@ > *******************************************************************************/ > package org.eclipse.tptp.test.provisional.recorder.ui.wizards; > >+import org.eclipse.hyades.test.core.testgen.TestGenerator; >+import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderProvider; > > /** > * A recorder provider which provides additional custom wizard pages to the generic > * recording wizard. >- * >+ * <p/> > * This provider is responsible for assembling the pages, collecting the page data, > * and providing a mechanism to provide this data to other providers. >- * @author jnevicos >+ * <p/> >+ * >+ * >+ * @author Paul E. Slauenwhite >+ * @author Jeffery Nevicosi >+ * @version March 13, 2008 >+ * @since February 1, 2006 > */ >-public interface IRecorderPageProvider extends IRecorderProvider { >+public interface IRecorderPageProvider extends IRecorderProvider { >+ >+ /** >+ * The default key string for defining the initial {@link IStructuredSelection} provided by the {@link IGenericRecorderWizard}. >+ * <p/> >+ * The {@link IGenericRecorderPage} pages provided by this {@link IRecorderPageProvider} can >+ * retrive the initial {@link IStructuredSelection} from the {@link IGenericRecorderWizard} by >+ * calling {@link IGenericRecorderWizard#getRecorderObjectData(IRecorderPageProvider.WIZARD_KEY_INITIAL_STRUCTURED_SELECTION)}, >+ * if the {@link IGenericRecorderWizard} provides an initial {@link IStructuredSelection}. >+ */ >+ public static final String WIZARD_KEY_INITIAL_STRUCTURED_SELECTION = "keyWizardStructuredSelection"; > > /** > * default key string for defining path to a recording file >Index: src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/TestsuiteLocationWizardPage.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/TestsuiteLocationWizardPage.java,v >retrieving revision 1.7 >diff -u -r1.7 TestsuiteLocationWizardPage.java >--- src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/TestsuiteLocationWizardPage.java 22 Mar 2007 14:42:14 -0000 1.7 >+++ src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/TestsuiteLocationWizardPage.java 13 Mar 2008 15:12:21 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,10 +13,17 @@ > > import org.eclipse.hyades.internal.execution.testgen.ui.wizards.FileLocationSelectionWizardpage; > import org.eclipse.hyades.test.ui.internal.resources.UiPluginResourceBundle; >+import org.eclipse.jface.viewers.IStructuredSelection; >+ > /** >- * A wizard page implementation for specifying the recorded test location >- * @author jnevicos >- * NOTE: This will be moved to a provisional package in TPTP 4.2 >+ * A wizard page implementation for specifying the recorded test location. >+ * <p/> >+ * >+ * >+ * @author Paul E. Slauenwhite >+ * @author Jeffery Nevicosi >+ * @version March 13, 2008 >+ * @since February 1, 2006 > */ > public class TestsuiteLocationWizardPage extends FileLocationSelectionWizardpage implements IGenericRecorderPage { > >@@ -38,7 +45,7 @@ > */ > public TestsuiteLocationWizardPage(IGenericRecorderWizard wizard, boolean bSaveLastSelected) > { >- super(bSaveLastSelected); >+ super(bSaveLastSelected, ((IStructuredSelection)(wizard.getRecorderObjectData(IRecorderPageProvider.WIZARD_KEY_INITIAL_STRUCTURED_SELECTION)))); > this.wizard = wizard; > setWizard(wizard); > } >Index: src-recorder/org/eclipse/tptp/test/provisional/recorder/messages/AbstractRecorderMessageProvider.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-recorder/org/eclipse/tptp/test/provisional/recorder/messages/AbstractRecorderMessageProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractRecorderMessageProvider.java >--- src-recorder/org/eclipse/tptp/test/provisional/recorder/messages/AbstractRecorderMessageProvider.java 2 May 2007 19:35:50 -0000 1.4 >+++ src-recorder/org/eclipse/tptp/test/provisional/recorder/messages/AbstractRecorderMessageProvider.java 13 Mar 2008 15:12:21 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -18,9 +18,14 @@ > import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderMessageProvider; > > /** >- * An abstract implementation of IRecorderMessageProvider >- * @author jnevicos >- * NOTE: This will be moved to a provisional package in TPTP 4.2 >+ * An abstract implementation of IRecorderMessageProvider. >+ * <p/> >+ * >+ * >+ * @author Paul E. Slauenwhite >+ * @author Jeffery Nevicosi >+ * @version March 13, 2008 >+ * @since February 1, 2006 > */ > public abstract class AbstractRecorderMessageProvider implements > IRecorderMessageProvider { >Index: src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/FileLocationSelectionWizardpage.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/FileLocationSelectionWizardpage.java,v >retrieving revision 1.15 >diff -u -r1.15 FileLocationSelectionWizardpage.java >--- src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/FileLocationSelectionWizardpage.java 3 May 2007 01:18:09 -0000 1.15 >+++ src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/FileLocationSelectionWizardpage.java 13 Mar 2008 15:12:21 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -54,8 +54,14 @@ > /** > * Abstract wizard page which can be extended by any wizard page which wants to provide controls for selecting file location > * and specifying file name. It provides the directory structure in a tree and allows filename to be entered. It keeps track of the >- * last selected file for any extender and restores that selection the next time the extender is instantiated >- * @author Ernest Jessee >+ * last selected file for any extender and restores that selection the next time the extender is instantiated. >+ * <p/> >+ * >+ * >+ * @author Paul E. Slauenwhite >+ * @author Ernest Jessee >+ * @version March 13, 2008 >+ * @since February 1, 2005 > */ > public abstract class FileLocationSelectionWizardpage extends WizardPage implements ITestGenWizardPage > { >@@ -68,7 +74,9 @@ > private Text selectedFileName; > > private boolean saveLastSelected = false; >- >+ >+ private IStructuredSelection selection = null; >+ > public abstract String getFileExtension(); > > public abstract String getFileNameLabel(); >@@ -188,12 +196,17 @@ > > public FileLocationSelectionWizardpage(boolean saveLastSelected) > { >+ this(saveLastSelected, null); >+ } >+ >+ public FileLocationSelectionWizardpage(boolean saveLastSelected, IStructuredSelection selection){ >+ > super(FileLocationSelectionWizardpage.class.getName()); >+ > this.saveLastSelected = saveLastSelected; >+ this.selection = selection; > } > >- >- > public void saveSettings() > { > if (saveLastSelected) >@@ -295,20 +308,20 @@ > > TestgenUIUtility.layoutControlInGrid(fileNameLabel,1,GridData.HORIZONTAL_ALIGN_END); > TestgenUIUtility.layoutControlInGrid(selectedFileName,1,GridData.HORIZONTAL_ALIGN_FILL|GridData.GRAB_HORIZONTAL); >+ > autoSelectProject(); > >- setPageComplete(true); >- >- >+ //Set focus on the file name text field if a directory has been selected and no file name has been selected: >+ if((selectedContainer != null) && (selectedFileName.getText().trim().length() == 0)){ >+ selectedFileName.setFocus(); >+ } > >- >+ setPageComplete(true); > } > catch (TestGenUIException e) > { >- e.printStackTrace(); >+ UiPlugin.logError(e); > } >- >- > } > > private String getPreviouslySelectedObject(ArrayList objectList) >@@ -421,25 +434,31 @@ > { > if (selectedContainer == null ) > { >- IProject[] projects = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getProjects(); >- IProject project = null; >- if (projects.length > 0) >- { >- int i = 0; >- project = projects[0]; >- while (!project.isOpen()) >+ >+ if(selection != null){ >+ ((StructuredViewer)(tree)).setSelection(selection); >+ } >+ else{ >+ >+ IProject[] projects = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getProjects(); >+ IProject project = null; >+ if (projects.length > 0) > { >- if (++i < projects.length) >- project = projects[i]; >- else >+ int i = 0; >+ project = projects[0]; >+ while (!project.isOpen()) > { >- project = projects[0]; >- break; >- } >- } >- ((StructuredViewer)tree).setSelection(new StructuredSelection(project)); >+ if (++i < projects.length) >+ project = projects[i]; >+ else >+ { >+ project = projects[0]; >+ break; >+ } >+ } >+ ((StructuredViewer)tree).setSelection(new StructuredSelection(project)); >+ } > } >- > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 139589
: 92450