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 155880 Details for
Bug 295003
[UI] Design and implement a EPartService API
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]
EPartService activate bug
bug295003-tests-patch-v2.txt (text/plain), 3.00 KB, created by
Remy Suen
on 2010-01-12 11:42:13 EST
(
hide
)
Description:
EPartService activate bug
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2010-01-12 11:42:13 EST
Size:
3.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.e4.ui.tests >Index: src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java,v >retrieving revision 1.3 >diff -u -r1.3 PartRenderingEngineTests.java >--- src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java 11 Jan 2010 16:23:33 -0000 1.3 >+++ src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java 12 Jan 2010 16:43:46 -0000 >@@ -21,8 +21,10 @@ > import org.eclipse.e4.ui.model.application.MPartSashContainer; > import org.eclipse.e4.ui.model.application.MPartStack; > import org.eclipse.e4.ui.model.application.MWindow; >+import org.eclipse.e4.ui.services.IServiceConstants; > import org.eclipse.e4.ui.workbench.swt.internal.E4Application; > import org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine; >+import org.eclipse.e4.workbench.modeling.EPartService; > import org.eclipse.e4.workbench.ui.IPresentationEngine; > import org.eclipse.e4.workbench.ui.internal.E4Workbench; > import org.eclipse.swt.widgets.Display; >@@ -96,6 +98,50 @@ > assertNotNull(window2.getWidget()); > } > >+ public void testEPartService_Activate() throws Exception { >+ // create a window with two parts >+ MWindow window = MApplicationFactory.eINSTANCE.createWindow(); >+ >+ MPart part = MApplicationFactory.eINSTANCE.createPart(); >+ window.getChildren().add(part); >+ part.setLabel(""); >+ part.setURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView"); >+ >+ MPart part2 = MApplicationFactory.eINSTANCE.createPart(); >+ part2.setLabel(""); >+ part2.setURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView"); >+ >+ window.getChildren().add(part2); >+ window.setActiveChild(part2); >+ >+ // add the window to the app >+ MApplication application = MApplicationFactory.eINSTANCE >+ .createApplication(); >+ application.getChildren().add(window); >+ application.setContext(appContext); >+ appContext.set(MApplication.class.getName(), application); >+ >+ wb = new E4Workbench(application, appContext); >+ // render >+ wb.createAndRunUI(window); >+ >+ IEclipseContext windowContext = window.getContext(); >+ >+ EPartService service = (EPartService) windowContext >+ .get(EPartService.class.getName()); >+ >+ // active part should be the second one >+ assertEquals(part2, windowContext.get(IServiceConstants.ACTIVE_PART)); >+ assertEquals(part2, service.getActivePart()); >+ >+ // activate the first one >+ service.activate(part); >+ >+ // active part should be the first one >+ assertEquals(part, windowContext.get(IServiceConstants.ACTIVE_PART)); >+ assertEquals(part, service.getActivePart()); >+ } >+ > private MWindow createWindowWithOneView(String partName) { > final MWindow window = MApplicationFactory.eINSTANCE.createWindow(); > window.setHeight(300);
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 295003
:
153159
|
153273
|
153815
|
155410
|
155599
| 155880 |
156933
|
157181
|
157513
|
157542