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 90773 Details for
Bug 205093
API Recorder's Generate Test Suite dialog does not select a default selection.
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]
Whole Changes in defect 205093
patch205093.txt (text/plain), 15.14 KB, created by
Tony Wang
on 2008-02-26 13:12:17 EST
(
hide
)
Description:
Whole Changes in defect 205093
Filename:
MIME Type:
Creator:
Tony Wang
Created:
2008-02-26 13:12:17 EST
Size:
15.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.test.tools.api >Index: src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPane.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.tools.api/src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPane.java,v >retrieving revision 1.5 >diff -u -r1.5 TPTPJUnitTestSuiteGenerationPane.java >--- src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPane.java 19 Apr 2007 18:43:36 -0000 1.5 >+++ src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPane.java 26 Feb 2008 18:09:05 -0000 >@@ -46,6 +46,7 @@ > private Text testSuiteLocationText = null; > private Combo testSuiteGeneratorCombo = null; > private Button testSuiteLocationButton = null; >+ > > public TPTPJUnitTestSuiteGenerationPane(Composite parent){ > this(parent, SWT.SHADOW_NONE); >@@ -61,22 +62,24 @@ > public Combo getTestSuiteGeneratorCombo() { > return testSuiteGeneratorCombo; > } >+ > > public Text getTestSuiteLocationText() { > return testSuiteLocationText; > } >- >+ >+ > public void init(){ > >- testSuiteGeneratorCombo.select(0); >+ testSuiteGeneratorCombo.select(0); > >- testSuiteLocationText.setEnabled(false); >+ testSuiteLocationText.setEnabled(true); > testSuiteLocationText.setText(""); > >- //Work-around: Set the text field's background color to gray since disabled/enabled un-editable text fields have a gray background, by default. >- testSuiteLocationText.setBackground(((Color)(testSuiteGeneratorCombo.getData("Background")))); >+ //Work-around: Set the text field's background color to white since disabled/enabled un-editable text fields have a gray background, by default. >+ testSuiteLocationText.setBackground(testSuiteGeneratorCombo.getBackground()); > >- testSuiteLocationButton.setEnabled(false); >+ testSuiteLocationButton.setEnabled(true); > } > > private void buildPane(){ >@@ -99,27 +102,30 @@ > > testSuiteGeneratorCombo = new Combo(testGroup, SWT.READ_ONLY); > testSuiteGeneratorCombo.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).grab(true, false).create()); >- testSuiteGeneratorCombo.add("Do not generate test suite"); > testSuiteGeneratorCombo.add("TPTP JUnit Test Suite Generator"); >- testSuiteGeneratorCombo.addSelectionListener(new SelectionAdapter() { >+ >+ >+// testSuiteGeneratorCombo.addSelectionListener(new SelectionAdapter() { > >- public void widgetSelected(SelectionEvent e) { >- >- if(testSuiteGeneratorCombo.getSelectionIndex() != 0){ >- >- testSuiteLocationButton.setEnabled(true); >+// public void widgetSelected(SelectionEvent e) { > >- testSuiteLocationText.setEnabled(true); >- >- //Work-around: Set the text field's background color to white since disabled/enabled un-editable text fields have a gray background, by default. >- testSuiteLocationText.setBackground(testSuiteGeneratorCombo.getBackground()); >- } >- else{ >- init(); >- } >- } >- }); >- >+// if(testSuiteGeneratorCombo.getSelectionIndex() != 0){ >+ >+// testSuiteLocationButton.setEnabled(true); >+ >+// testSuiteLocationText.setEnabled(true); >+ >+ //Work-around: Set the text field's background color to white since disabled/enabled un-editable text fields have a gray background, by default. >+// testSuiteLocationText.setBackground(testSuiteGeneratorCombo.getBackground()); >+// } >+// else{ >+// init(); >+// } >+// } >+// }); >+ >+ >+ > //TODO: Create extension point for user-defined test suite generators: > // IConfigurationElement[] elements = > // Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.hyades.test.core.TestGenerator"); >@@ -185,3 +191,4 @@ > layout(false,true); > } > } >+ >Index: src-ui/org/eclipse/tptp/test/tools/api/internal/ui/recording/APIRecordingLaunchConfigurationPage.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.tools.api/src-ui/org/eclipse/tptp/test/tools/api/internal/ui/recording/APIRecordingLaunchConfigurationPage.java,v >retrieving revision 1.6 >diff -u -r1.6 APIRecordingLaunchConfigurationPage.java >--- src-ui/org/eclipse/tptp/test/tools/api/internal/ui/recording/APIRecordingLaunchConfigurationPage.java 19 Apr 2007 18:43:36 -0000 1.6 >+++ src-ui/org/eclipse/tptp/test/tools/api/internal/ui/recording/APIRecordingLaunchConfigurationPage.java 26 Feb 2008 18:09:04 -0000 >@@ -22,7 +22,7 @@ > import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Text; > import org.eclipse.tptp.test.tools.api.internal.resources.Messages; >-import org.eclipse.tptp.test.tools.api.internal.ui.test.generation.TPTPJUnitTestSuiteGenerationPane; >+import org.eclipse.tptp.test.tools.api.internal.ui.test.generation.TPTPJUnitTestSuiteGenerationPaneAPI; > import org.eclipse.tptp.test.tools.api.internal.ui.util.APIRecordingConstants; > import org.eclipse.tptp.trace.ui.provisional.launcher.IConfigurationPage; > import org.eclipse.tptp.trace.ui.provisional.launcher.IStatusListener; >@@ -40,12 +40,12 @@ > public class APIRecordingLaunchConfigurationPage implements IConfigurationPage { > > private IStatusListener statusListener = null; >- private TPTPJUnitTestSuiteGenerationPane testGenerationPane = null; >+ private TPTPJUnitTestSuiteGenerationPaneAPI testGenerationPane = null; > private ILaunchConfiguration launchConfiguration = null; > > public void createControl(Composite parent) { > >- testGenerationPane = new TPTPJUnitTestSuiteGenerationPane(parent); >+ testGenerationPane = new TPTPJUnitTestSuiteGenerationPaneAPI(parent); > > Listener listener = new Listener(){ > >@@ -83,6 +83,7 @@ > Combo testSuiteGeneratorCombo = testGenerationPane.getTestSuiteGeneratorCombo(); > testSuiteGeneratorCombo.addListener(SWT.Selection, listener); > >+ > try { > > testSuiteLocationText.setText(launchConfiguration.getAttribute(APIRecordingConstants.LAUNCH_CONFIGURATION_ATTRIBUTE_KEY_TEST_SUITE_LOCATION, "")); >Index: src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/wizards/GenerateTPTPJUnitTestSuiteWizardPageOne.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.tools.api/src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/wizards/GenerateTPTPJUnitTestSuiteWizardPageOne.java,v >retrieving revision 1.5 >diff -u -r1.5 GenerateTPTPJUnitTestSuiteWizardPageOne.java >--- src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/wizards/GenerateTPTPJUnitTestSuiteWizardPageOne.java 19 Apr 2007 18:43:36 -0000 1.5 >+++ src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/wizards/GenerateTPTPJUnitTestSuiteWizardPageOne.java 26 Feb 2008 18:09:05 -0000 >@@ -91,6 +91,9 @@ > Combo testSuiteGeneratorCombo = testGenerationPane.getTestSuiteGeneratorCombo(); > testSuiteGeneratorCombo.addListener(SWT.Selection, listener); > >+ //Fire the selection event to set the messages in the wizard/dialog: >+ listener.handleEvent(null); >+ > setControl(testGenerationPane); > } > >Index: src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPaneAPI.java >=================================================================== >RCS file: src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPaneAPI.java >diff -N src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPaneAPI.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-ui/org/eclipse/tptp/test/tools/api/internal/ui/test/generation/TPTPJUnitTestSuiteGenerationPaneAPI.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,187 @@ >+/********************************************************************** >+ * Copyright (c) 2006, 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: TPTPJUnitTestSuiteGenerationPane.java,v 1.5 2007/04/19 18:43:36 paules Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.test.tools.api.internal.ui.test.generation; >+ >+import java.util.Collections; >+ >+import org.eclipse.core.resources.IFile; >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.Path; >+import org.eclipse.emf.common.ui.dialogs.WorkspaceResourceDialog; >+import org.eclipse.jface.layout.GridDataFactory; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Combo; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Group; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Text; >+ >+/** >+ * TPTP JUnit test suite generation pane. >+ * <p> >+ * >+ * >+ * @author Paul E. Slauenwhite >+ * @version November 15, 2006 >+ * @since September 7, 2006 >+ * @provisional >+ */ >+public class TPTPJUnitTestSuiteGenerationPaneAPI extends Composite { >+ >+ private Text testSuiteLocationText = null; >+ private Combo testSuiteGeneratorCombo = null; >+ private Button testSuiteLocationButton = null; >+ >+ public TPTPJUnitTestSuiteGenerationPaneAPI(Composite parent){ >+ this(parent, SWT.SHADOW_NONE); >+ } >+ >+ public TPTPJUnitTestSuiteGenerationPaneAPI(Composite parent, int style){ >+ >+ super(parent, style); >+ >+ buildPane(); >+ } >+ >+ public Combo getTestSuiteGeneratorCombo() { >+ return testSuiteGeneratorCombo; >+ } >+ >+ public Text getTestSuiteLocationText() { >+ return testSuiteLocationText; >+ } >+ >+ public void init(){ >+ >+ testSuiteGeneratorCombo.select(0); >+ >+ testSuiteLocationText.setEnabled(false); >+ testSuiteLocationText.setText(""); >+ >+ //Work-around: Set the text field's background color to gray since disabled/enabled un-editable text fields have a gray background, by default. >+ testSuiteLocationText.setBackground(((Color)(testSuiteGeneratorCombo.getData("Background")))); >+ >+ testSuiteLocationButton.setEnabled(false); >+ } >+ >+ private void buildPane(){ >+ >+ setLayout(new GridLayout()); >+ setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 3; >+ layout.horizontalSpacing = 5; >+ layout.verticalSpacing = 10; >+ >+ Group testGroup = new Group(this, SWT.SHADOW_ETCHED_IN); >+ testGroup.setLayout(layout); >+ testGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ testGroup.setText("Test suite generator and location"); >+ >+ Label testSuiteGeneratorLabel = new Label(testGroup, SWT.NONE); >+ testSuiteGeneratorLabel.setText("Generator: "); >+ >+ testSuiteGeneratorCombo = new Combo(testGroup, SWT.READ_ONLY); >+ testSuiteGeneratorCombo.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).grab(true, false).create()); >+ testSuiteGeneratorCombo.add("Do not generate test suite"); >+ testSuiteGeneratorCombo.add("TPTP JUnit Test Suite Generator"); >+ testSuiteGeneratorCombo.addSelectionListener(new SelectionAdapter() { >+ >+ public void widgetSelected(SelectionEvent e) { >+ >+ if(testSuiteGeneratorCombo.getSelectionIndex() != 0){ >+ >+ testSuiteLocationButton.setEnabled(true); >+ >+ testSuiteLocationText.setEnabled(true); >+ >+ //Work-around: Set the text field's background color to white since disabled/enabled un-editable text fields have a gray background, by default. >+ testSuiteLocationText.setBackground(testSuiteGeneratorCombo.getBackground()); >+ } >+ else{ >+ init(); >+ } >+ } >+ }); >+ >+ //TODO: Create extension point for user-defined test suite generators: >+// IConfigurationElement[] elements = >+// Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.hyades.test.core.TestGenerator"); >+// for(int i = 0; i < elements.length; i++) { >+// String name = elements[i].getAttribute("name"); >+// testSuiteGeneratorCombo.add(name); >+// } >+ >+ Label testSuiteLocationLabel = new Label(testGroup, SWT.NONE); >+ testSuiteLocationLabel.setText("Location: "); >+ >+ testSuiteLocationText = new Text(testGroup, SWT.SINGLE | SWT.BORDER); >+ testSuiteLocationText.setEditable(false); >+ testSuiteLocationText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).create()); >+ >+ //Work-around: Persist the text field's background original color since disabled/enabled un-editable text fields have a gray background, by default. >+ testSuiteLocationText.setData("Background",testSuiteLocationText.getBackground()); >+ >+ testSuiteLocationButton = new Button(testGroup, SWT.PUSH); >+ testSuiteLocationButton.setText("Browse..."); >+ >+ testSuiteLocationButton.addSelectionListener(new SelectionAdapter() { >+ >+ public void widgetSelected(SelectionEvent e) { >+ >+ //TODO: Use standard Eclipse/TPTP dialog: >+ //TODO: Only select Java and Pluign projects. >+ //TODO: Use UIUtil.validateJavaFileName and UIUtil.validateOSFileName: >+ //TODO: Check for existing file and do not allow user to overwrite: >+ //TODO: Create new directory?: >+ IPath path = null; >+ String testSuiteLocationPath = testSuiteLocationText.getText().trim(); >+ >+ if((testSuiteLocationPath.length() > 0) && (Path.EMPTY.isValidPath(testSuiteLocationPath))){ >+ path = new Path(testSuiteLocationPath); >+ } >+ >+ //TODO: If project does not exist, only set file name: >+ //TODO: Set text field to "" if file is null and cancel is selected: >+ IFile testSuiteLocationFile = WorkspaceResourceDialog.openNewFile( >+ testSuiteLocationButton.getParent().getShell(), >+ "Test Suite", >+ "Select a test suite location under a Java project:", >+ path, >+ Collections.EMPTY_LIST); >+ >+ if(testSuiteLocationFile != null){ >+ >+ testSuiteLocationPath = testSuiteLocationFile.getFullPath().toString(); >+ >+ if(!testSuiteLocationPath.endsWith(".testsuite")){ >+ testSuiteLocationText.setText(testSuiteLocationPath.concat(".testsuite")); >+ } >+ else{ >+ testSuiteLocationText.setText(testSuiteLocationPath); >+ } >+ } >+ } >+ }); >+ >+ init(); >+ >+ layout(false,true); >+ } >+}
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 205093
:
90674
|
90773
|
90992