|
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 15-20
Link Here
|
| 15 |
|
15 |
|
| 16 |
import org.eclipse.core.runtime.IConfigurationElement; |
16 |
import org.eclipse.core.runtime.IConfigurationElement; |
| 17 |
import org.eclipse.hyades.models.common.configuration.CFGArtifact; |
17 |
import org.eclipse.hyades.models.common.configuration.CFGArtifact; |
|
|
18 |
import org.eclipse.hyades.models.common.facades.behavioral.ITestSuite; |
| 18 |
import org.eclipse.hyades.test.ui.editor.form.util.WidgetFactory; |
19 |
import org.eclipse.hyades.test.ui.editor.form.util.WidgetFactory; |
| 19 |
import org.eclipse.hyades.test.ui.internal.editor.form.ArtifactForm; |
20 |
import org.eclipse.hyades.test.ui.internal.editor.form.ArtifactForm; |
| 20 |
import org.eclipse.hyades.test.ui.internal.editor.form.ConfigurableObjectOverviewForm; |
21 |
import org.eclipse.hyades.test.ui.internal.editor.form.ConfigurableObjectOverviewForm; |
|
Lines 22-34
Link Here
|
| 22 |
import org.eclipse.hyades.test.ui.internal.resources.UiPluginResourceBundle; |
23 |
import org.eclipse.hyades.test.ui.internal.resources.UiPluginResourceBundle; |
| 23 |
import org.eclipse.jface.viewers.IStructuredSelection; |
24 |
import org.eclipse.jface.viewers.IStructuredSelection; |
| 24 |
|
25 |
|
| 25 |
|
|
|
| 26 |
/** |
26 |
/** |
| 27 |
* Hyades configurable object editor extension that is suitable for all |
27 |
* Hyades configurable object editor extension that is suitable for all |
| 28 |
* {@link org.eclipse.hyades.models.common.configuration.CFGArtifact} objects. |
28 |
* {@link org.eclipse.hyades.models.common.configuration.CFGArtifact} objects. |
|
|
29 |
* <p/> |
| 30 |
* |
| 29 |
* |
31 |
* |
| 30 |
* @author bjiang |
32 |
* @author Bianca Xue Jiang |
| 31 |
* @since 3.0 |
33 |
* @author Paul E. Slauenwhite |
|
|
34 |
* @version April 16, 2008 |
| 35 |
* @since February 1, 2005 |
| 32 |
*/ |
36 |
*/ |
| 33 |
public class ArtifactEditorExtension extends ConfigurableObjectEditorExtension |
37 |
public class ArtifactEditorExtension extends ConfigurableObjectEditorExtension |
| 34 |
{ |
38 |
{ |
|
Lines 38-56
Link Here
|
| 38 |
private static final int PAGE_TEST_ASSETS = 1; |
42 |
private static final int PAGE_TEST_ASSETS = 1; |
| 39 |
private TestAssetsForm testAssetsForm; |
43 |
private TestAssetsForm testAssetsForm; |
| 40 |
|
44 |
|
| 41 |
/** |
|
|
| 42 |
* @see org.eclipse.hyades.ui.util.IDisposable#dispose() |
| 43 |
*/ |
| 44 |
public void dispose() |
| 45 |
{ |
| 46 |
if(testAssetsForm != null) |
| 47 |
{ |
| 48 |
testAssetsForm.dispose(); |
| 49 |
testAssetsForm = null; |
| 50 |
} |
| 51 |
super.dispose(); |
| 52 |
} |
| 53 |
|
| 54 |
protected IConfigurationElement[] collectPropertyGroupExtensions() |
45 |
protected IConfigurationElement[] collectPropertyGroupExtensions() |
| 55 |
{ |
46 |
{ |
| 56 |
IConfigurationElement[] extensions = super.collectPropertyGroupExtensions(); |
47 |
IConfigurationElement[] extensions = super.collectPropertyGroupExtensions(); |
|
Lines 75-80
Link Here
|
| 75 |
} |
66 |
} |
| 76 |
return registeredExtensions; |
67 |
return registeredExtensions; |
| 77 |
} |
68 |
} |
|
|
69 |
|
| 70 |
/** |
| 71 |
* @see org.eclipse.hyades.ui.util.IDisposable#dispose() |
| 72 |
*/ |
| 73 |
public void dispose() |
| 74 |
{ |
| 75 |
if(testAssetsForm != null) |
| 76 |
{ |
| 77 |
testAssetsForm.dispose(); |
| 78 |
testAssetsForm = null; |
| 79 |
} |
| 80 |
super.dispose(); |
| 81 |
} |
| 78 |
|
82 |
|
| 79 |
/** |
83 |
/** |
| 80 |
* @see org.eclipse.hyades.ui.editor.IEditorExtension#createPages() |
84 |
* @see org.eclipse.hyades.ui.editor.IEditorExtension#createPages() |
|
Lines 136-139
Link Here
|
| 136 |
else |
140 |
else |
| 137 |
return super.getSelection(); |
141 |
return super.getSelection(); |
| 138 |
} |
142 |
} |
|
|
143 |
|
| 144 |
/* (non-Javadoc) |
| 145 |
* @see org.eclipse.hyades.ui.editor.EditorExtension#setSelection(org.eclipse.jface.viewers.IStructuredSelection) |
| 146 |
*/ |
| 147 |
public void setSelection(IStructuredSelection structuredSelection){ |
| 148 |
|
| 149 |
if(structuredSelection.getFirstElement() instanceof ITestSuite){ |
| 150 |
|
| 151 |
if(PAGE_TEST_ASSETS < getHyadesEditorPart().getPageCount()){ |
| 152 |
|
| 153 |
getHyadesEditorPart().setActivePage(PAGE_TEST_ASSETS); |
| 154 |
testAssetsForm.selectReveal(structuredSelection); |
| 155 |
} |
| 156 |
} |
| 157 |
else{ |
| 158 |
super.setSelection(structuredSelection); |
| 159 |
} |
| 160 |
} |
| 139 |
} |
161 |
} |