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 295003 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java (+369 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 ******************************************************************************/
11
package org.eclipse.e4.ui.tests.application;
12
13
import java.util.Collection;
14
15
import junit.framework.TestCase;
16
17
import org.eclipse.e4.core.services.IContributionFactory;
18
import org.eclipse.e4.core.services.IDisposable;
19
import org.eclipse.e4.core.services.context.IEclipseContext;
20
import org.eclipse.e4.ui.model.application.MApplication;
21
import org.eclipse.e4.ui.model.application.MApplicationFactory;
22
import org.eclipse.e4.ui.model.application.MElementContainer;
23
import org.eclipse.e4.ui.model.application.MPart;
24
import org.eclipse.e4.ui.model.application.MPartStack;
25
import org.eclipse.e4.ui.model.application.MWindow;
26
import org.eclipse.e4.ui.workbench.swt.internal.E4Application;
27
import org.eclipse.e4.workbench.modeling.EPartService;
28
import org.eclipse.e4.workbench.ui.IPresentationEngine;
29
30
public class EPartServiceTest extends TestCase {
31
32
	private IEclipseContext applicationContext;
33
34
	private IPresentationEngine engine;
35
36
	@Override
37
	protected void setUp() throws Exception {
38
		applicationContext = E4Application.createDefaultContext();
39
40
		IContributionFactory contributionFactory = (IContributionFactory) applicationContext
41
				.get(IContributionFactory.class.getName());
42
		Object newEngine = contributionFactory.create(getEngineURI(),
43
				applicationContext);
44
		assertTrue(newEngine instanceof IPresentationEngine);
45
		applicationContext.set(IPresentationEngine.class.getName(), newEngine);
46
47
		engine = (IPresentationEngine) newEngine;
48
49
		super.setUp();
50
	}
51
52
	protected String getEngineURI() {
53
		return "platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.application.HeadlessContextPresentationEngine"; //$NON-NLS-1$
54
	}
55
56
	@Override
57
	protected void tearDown() throws Exception {
58
		super.tearDown();
59
		if (applicationContext instanceof IDisposable) {
60
			((IDisposable) applicationContext).dispose();
61
		}
62
	}
63
64
	public void testFindPart_PartInWindow() {
65
		MApplication application = createApplication("partId");
66
67
		MWindow window = application.getChildren().get(0);
68
		engine.createGui(window);
69
70
		EPartService partService = (EPartService) window.getContext().get(
71
				EPartService.class.getName());
72
		MPart part = partService.findPart("partId");
73
		assertNotNull(part);
74
75
		MPartStack partStack = (MPartStack) window.getChildren().get(0);
76
		assertEquals(partStack.getChildren().get(0), part);
77
78
		part = partService.findPart("invalidPartId");
79
		assertNull(part);
80
	}
81
82
	public void testFindPart_PartNotInWindow() {
83
		MApplication application = createApplication("partId");
84
85
		MWindow window = application.getChildren().get(0);
86
		engine.createGui(window);
87
88
		EPartService partService = (EPartService) window.getContext().get(
89
				EPartService.class.getName());
90
		MPart part = partService.findPart("invalidPartId");
91
		assertNull(part);
92
	}
93
94
	public void testFindPart_PartInAnotherWindow() {
95
		MApplication application = createApplication(
96
				new String[] { "partInWindow1" },
97
				new String[] { "partInWindow2" });
98
99
		MWindow window1 = application.getChildren().get(0);
100
		MWindow window2 = application.getChildren().get(1);
101
102
		engine.createGui(window1);
103
		engine.createGui(window2);
104
105
		EPartService partService = (EPartService) window1.getContext().get(
106
				EPartService.class.getName());
107
		MPart part = partService.findPart("partInWindow2");
108
		assertNull(part);
109
		part = partService.findPart("partInWindow1");
110
		assertNotNull(part);
111
112
		MPartStack partStack = (MPartStack) window1.getChildren().get(0);
113
		assertEquals(partStack.getChildren().get(0), part);
114
115
		partService = (EPartService) window2.getContext().get(
116
				EPartService.class.getName());
117
		part = partService.findPart("partInWindow1");
118
		assertNull(part);
119
		part = partService.findPart("partInWindow2");
120
		assertNotNull(part);
121
122
		partStack = (MPartStack) window2.getChildren().get(0);
123
		assertEquals(partStack.getChildren().get(0), part);
124
	}
125
126
	public void testBringToTop_PartOnTop() {
127
		MApplication application = createApplication("partFront", "partBack");
128
129
		MWindow window = application.getChildren().get(0);
130
		MPartStack partStack = (MPartStack) window.getChildren().get(0);
131
		MPart partFront = partStack.getChildren().get(0);
132
		partStack.setActiveChild(partFront);
133
134
		engine.createGui(window);
135
136
		EPartService partService = (EPartService) window.getContext().get(
137
				EPartService.class.getName());
138
139
		partService.bringToTop(partFront);
140
		assertEquals(partStack.getActiveChild(), partFront);
141
	}
142
143
	public void testBringToTop_PartNotOnTop() {
144
		MApplication application = createApplication("partFront", "partBack");
145
146
		MWindow window = application.getChildren().get(0);
147
		MPartStack partStack = (MPartStack) window.getChildren().get(0);
148
		MPart partFront = partStack.getChildren().get(0);
149
		MPart partBack = partStack.getChildren().get(1);
150
		partStack.setActiveChild(partFront);
151
152
		engine.createGui(window);
153
154
		EPartService partService = (EPartService) window.getContext().get(
155
				EPartService.class.getName());
156
157
		partService.bringToTop(partBack);
158
		assertEquals(partStack.getActiveChild(), partBack);
159
	}
160
161
	public void testBringToTop_PartInAnotherWindow() {
162
		MApplication application = createApplication(new String[] {
163
				"partFrontA", "partBackA" }, new String[] { "partFrontB",
164
				"partBackB" });
165
166
		MWindow windowA = application.getChildren().get(0);
167
		MPartStack partStackA = (MPartStack) windowA.getChildren().get(0);
168
		MPart partFrontA = partStackA.getChildren().get(0);
169
		MPart partBackA = partStackA.getChildren().get(1);
170
		partStackA.setActiveChild(partFrontA);
171
172
		MWindow windowB = application.getChildren().get(1);
173
		MPartStack partStackB = (MPartStack) windowB.getChildren().get(0);
174
		MPart partFrontB = partStackB.getChildren().get(0);
175
		MPart partBackB = partStackB.getChildren().get(1);
176
		partStackB.setActiveChild(partFrontB);
177
178
		engine.createGui(windowA);
179
		engine.createGui(windowB);
180
181
		EPartService partServiceA = (EPartService) windowA.getContext().get(
182
				EPartService.class.getName());
183
		EPartService partServiceB = (EPartService) windowB.getContext().get(
184
				EPartService.class.getName());
185
186
		partServiceA.bringToTop(partBackB);
187
		assertEquals(partStackA.getActiveChild(), partFrontA);
188
		assertEquals(partStackB.getActiveChild(), partFrontB);
189
190
		partServiceB.bringToTop(partBackA);
191
		assertEquals(partStackA.getActiveChild(), partFrontA);
192
		assertEquals(partStackB.getActiveChild(), partFrontB);
193
194
		partServiceA.bringToTop(partBackA);
195
		assertEquals(partStackA.getActiveChild(), partBackA);
196
		assertEquals(partStackB.getActiveChild(), partFrontB);
197
198
		partServiceB.bringToTop(partBackB);
199
		assertEquals(partStackA.getActiveChild(), partBackA);
200
		assertEquals(partStackB.getActiveChild(), partBackB);
201
	}
202
203
	public void testGetParts_Empty() {
204
		MApplication application = createApplication(1, new String[1][0]);
205
		MWindow window = application.getChildren().get(0);
206
207
		engine.createGui(window);
208
209
		EPartService partService = (EPartService) window.getContext().get(
210
				EPartService.class.getName());
211
		Collection<MPart> parts = partService.getParts();
212
		assertNotNull(parts);
213
		assertEquals(0, parts.size());
214
	}
215
216
	public void testGetParts_OneWindow() {
217
		MApplication application = createApplication("partId", "partId2");
218
		MWindow window = application.getChildren().get(0);
219
		MPartStack partStack = (MPartStack) window.getChildren().get(0);
220
221
		engine.createGui(window);
222
223
		EPartService partService = (EPartService) window.getContext().get(
224
				EPartService.class.getName());
225
		Collection<MPart> parts = partService.getParts();
226
		assertNotNull(parts);
227
		assertEquals(2, parts.size());
228
		assertTrue(parts.containsAll(partStack.getChildren()));
229
	}
230
231
	public void testGetParts_TwoWindows() {
232
		MApplication application = createApplication(new String[] { "partId",
233
				"partId2" }, new String[] { "partIA", "partIdB", "partIdC" });
234
235
		MWindow windowA = application.getChildren().get(0);
236
		MWindow windowB = application.getChildren().get(1);
237
238
		engine.createGui(windowA);
239
		engine.createGui(windowB);
240
241
		EPartService partServiceA = (EPartService) windowA.getContext().get(
242
				EPartService.class.getName());
243
		EPartService partServiceB = (EPartService) windowB.getContext().get(
244
				EPartService.class.getName());
245
246
		MPartStack partStackA = (MPartStack) windowA.getChildren().get(0);
247
		MPartStack partStackB = (MPartStack) windowB.getChildren().get(0);
248
249
		Collection<MPart> partsA = partServiceA.getParts();
250
		Collection<MPart> partsB = partServiceB.getParts();
251
252
		assertNotNull(partsA);
253
		assertEquals(2, partsA.size());
254
		assertTrue(partsA.containsAll(partStackA.getChildren()));
255
256
		assertNotNull(partsB);
257
		assertEquals(3, partsB.size());
258
		assertTrue(partsB.containsAll(partStackB.getChildren()));
259
260
		for (MPart partA : partsA) {
261
			assertFalse(partsB.contains(partA));
262
		}
263
	}
264
265
	public void testIsVisible_ViewVisible() {
266
		MApplication application = createApplication("partId");
267
268
		MWindow window = application.getChildren().get(0);
269
		MPartStack partStack = (MPartStack) window.getChildren().get(0);
270
		MPart part = partStack.getChildren().get(0);
271
		partStack.setActiveChild(part);
272
273
		engine.createGui(window);
274
275
		EPartService partService = (EPartService) window.getContext().get(
276
				EPartService.class.getName());
277
		assertTrue(partService.isPartVisible(part));
278
	}
279
280
	public void testIsVisible_ViewNotVisible() {
281
		MApplication application = createApplication("partId", "partId2");
282
283
		MWindow window = application.getChildren().get(0);
284
		MPartStack partStack = (MPartStack) window.getChildren().get(0);
285
		partStack.setActiveChild(partStack.getChildren().get(0));
286
287
		engine.createGui(window);
288
289
		MPart part = partStack.getChildren().get(1);
290
291
		EPartService partService = (EPartService) window.getContext().get(
292
				EPartService.class.getName());
293
		assertFalse(partService.isPartVisible(part));
294
	}
295
296
	public void testIsVisible_ViewInAnotherWindow() {
297
		MApplication application = createApplication(new String[] {
298
				"partFrontA", "partBackA" }, new String[] { "partFrontB",
299
				"partBackB" });
300
301
		MWindow windowA = application.getChildren().get(0);
302
		MPartStack partStackA = (MPartStack) windowA.getChildren().get(0);
303
		MPart partFrontA = partStackA.getChildren().get(0);
304
		MPart partBackA = partStackA.getChildren().get(1);
305
		partStackA.setActiveChild(partFrontA);
306
307
		MWindow windowB = application.getChildren().get(1);
308
		MPartStack partStackB = (MPartStack) windowB.getChildren().get(0);
309
		MPart partFrontB = partStackB.getChildren().get(0);
310
		MPart partBackB = partStackB.getChildren().get(1);
311
		partStackB.setActiveChild(partFrontB);
312
313
		engine.createGui(windowA);
314
		engine.createGui(windowB);
315
316
		EPartService partServiceA = (EPartService) windowA.getContext().get(
317
				EPartService.class.getName());
318
		EPartService partServiceB = (EPartService) windowB.getContext().get(
319
				EPartService.class.getName());
320
321
		assertTrue(partServiceA.isPartVisible(partFrontA));
322
		assertFalse(partServiceA.isPartVisible(partBackA));
323
		assertFalse(partServiceA.isPartVisible(partFrontB));
324
		assertFalse(partServiceA.isPartVisible(partBackB));
325
326
		assertFalse(partServiceB.isPartVisible(partFrontA));
327
		assertFalse(partServiceB.isPartVisible(partBackA));
328
		assertTrue(partServiceB.isPartVisible(partFrontB));
329
		assertFalse(partServiceB.isPartVisible(partBackB));
330
	}
331
332
	private MApplication createApplication(String partId) {
333
		return createApplication(new String[] { partId });
334
	}
335
336
	private MApplication createApplication(String... partIds) {
337
		return createApplication(new String[][] { partIds });
338
	}
339
340
	private MApplication createApplication(String[]... partIds) {
341
		return createApplication(partIds.length, partIds);
342
	}
343
344
	private MApplication createApplication(int windows, String[][] partIds) {
345
		MApplication application = MApplicationFactory.eINSTANCE
346
				.createApplication();
347
348
		for (int i = 0; i < windows; i++) {
349
			MWindow window = MApplicationFactory.eINSTANCE.createWindow();
350
			application.getChildren().add(window);
351
352
			MPartStack partStack = MApplicationFactory.eINSTANCE
353
					.createPartStack();
354
			window.getChildren().add(partStack);
355
356
			for (int j = 0; j < partIds[i].length; j++) {
357
				MPart part = MApplicationFactory.eINSTANCE.createPart();
358
				part.setId(partIds[i][j]);
359
				partStack.getChildren().add(part);
360
			}
361
		}
362
363
		applicationContext.set(MApplication.class.getName(), application);
364
		applicationContext.set(MElementContainer.class.getName(), application);
365
		application.setContext(applicationContext);
366
367
		return application;
368
	}
369
}
(-)src/org/eclipse/e4/ui/tests/application/HeadlessContextPresentationEngine.java (+3 lines)
Lines 112-117 Link Here
112
				createdContext.declareModifiable(variable);
112
				createdContext.declareModifiable(variable);
113
			}
113
			}
114
114
115
			if (element instanceof MElementContainer<?>) {
116
				createdContext.set(MElementContainer.class.getName(), element);
117
			}
115
			mcontext.setContext(createdContext);
118
			mcontext.setContext(createdContext);
116
		}
119
		}
117
120
(-)src/org/eclipse/e4/ui/tests/application/StartupTestSuite.java (+1 lines)
Lines 19-24 Link Here
19
	public static Test suite() {
19
	public static Test suite() {
20
		TestSuite suite = new StartupTestSuite();
20
		TestSuite suite = new StartupTestSuite();
21
21
22
		suite.addTestSuite(EPartServiceTest.class);
22
		suite.addTestSuite(HeadlessContactsDemoTest.class);
23
		suite.addTestSuite(HeadlessContactsDemoTest.class);
23
		suite.addTestSuite(HeadlessPhotoDemoTest.class);
24
		suite.addTestSuite(HeadlessPhotoDemoTest.class);
24
25
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 25-29 Link Here
25
 org.eclipse.e4.workbench.ui.behaviors,
25
 org.eclipse.e4.workbench.ui.behaviors,
26
 org.eclipse.e4.workbench.ui.internal;x-friends:="org.eclipse.e4.ui.workbench.fragment,org.eclipse.e4.ui.workbench.renderers.swt"
26
 org.eclipse.e4.workbench.ui.internal;x-friends:="org.eclipse.e4.ui.workbench.fragment,org.eclipse.e4.ui.workbench.renderers.swt"
27
Bundle-Activator: org.eclipse.e4.workbench.ui.internal.Activator
27
Bundle-Activator: org.eclipse.e4.workbench.ui.internal.Activator
28
Service-Component: OSGI-INF/progress.xml
28
Service-Component: OSGI-INF/progress.xml, OSGI-INF/partService.xml
29
Import-Package: javax.inject;version="1.0.0"
29
Import-Package: javax.inject;version="1.0.0"
(-)OSGI-INF/partService.xml (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.ui.workbench.partService">
3
   <implementation class="org.eclipse.e4.workbench.ui.internal.PartServiceCreationFunction"/>
4
   <service>
5
      <provide interface="org.eclipse.e4.core.services.context.IContextFunction"/>
6
   </service>
7
   <property name="service.context.key" type="String" value="org.eclipse.e4.workbench.modeling.EPartService"/>
8
</scr:component>
(-)build.properties (-1 / +1 lines)
Lines 4-8 Link Here
4
               plugin.xml,\
4
               plugin.xml,\
5
               .options,\
5
               .options,\
6
               OSGI-INF/
6
               OSGI-INF/
7
source.. = src/
8
src.includes = schema/
7
src.includes = schema/
8
source.. = src/
(-)src/org/eclipse/e4/workbench/modeling/EPartService.java (+34 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 ******************************************************************************/
11
package org.eclipse.e4.workbench.modeling;
12
13
import java.util.Collection;
14
import org.eclipse.e4.ui.model.application.MPart;
15
16
public interface EPartService {
17
18
	public void activate(MPart part);
19
20
	public void bringToTop(MPart part);
21
22
	public MPart findPart(String id);
23
24
	public Collection<MPart> getParts();
25
26
	public MPart getActivePart();
27
	
28
	public boolean isPartVisible(MPart part);
29
30
	// public MPart showPart(String id);
31
	//
32
	// public MPart showPart(MPart part);
33
34
}
(-)src/org/eclipse/e4/workbench/ui/internal/PartServiceCreationFunction.java (+35 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 ******************************************************************************/
11
12
package org.eclipse.e4.workbench.ui.internal;
13
14
import org.eclipse.e4.core.services.context.IEclipseContext;
15
import org.eclipse.e4.core.services.context.spi.ContextFunction;
16
import org.eclipse.e4.core.services.context.spi.ContextInjectionFactory;
17
18
/**
19
 *
20
 */
21
public class PartServiceCreationFunction extends ContextFunction {
22
23
	/*
24
	 * (non-Javadoc)
25
	 * 
26
	 * @see
27
	 * org.eclipse.e4.core.services.context.spi.ContextFunction#compute(org.eclipse.e4.core.services
28
	 * .context.IEclipseContext, java.lang.Object[])
29
	 */
30
	@Override
31
	public Object compute(IEclipseContext context, Object[] arguments) {
32
		return ContextInjectionFactory.make(PartServiceImpl.class, context);
33
	}
34
35
}
(-)src/org/eclipse/e4/workbench/ui/internal/PartServiceImpl.java (+137 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 ******************************************************************************/
11
package org.eclipse.e4.workbench.ui.internal;
12
13
import java.util.ArrayList;
14
import java.util.Collection;
15
import javax.inject.Inject;
16
import org.eclipse.e4.ui.model.application.MContext;
17
import org.eclipse.e4.ui.model.application.MElementContainer;
18
import org.eclipse.e4.ui.model.application.MPart;
19
import org.eclipse.e4.ui.model.application.MUIElement;
20
import org.eclipse.e4.workbench.modeling.EPartService;
21
22
public class PartServiceImpl implements EPartService {
23
24
	@Inject
25
	private MElementContainer<MUIElement> elementContainer;
26
27
	protected MContext getParentWithContext(MUIElement part) {
28
		MElementContainer<MUIElement> parent = part.getParent();
29
		while (parent != null) {
30
			if (parent instanceof MContext) {
31
				if (((MContext) parent).getContext() != null)
32
					return (MContext) parent;
33
			}
34
			parent = parent.getParent();
35
		}
36
		return null;
37
	}
38
39
	public void bringToTop(MPart part) {
40
		if (isInContainer(part)) {
41
			internalBringToTop(part);
42
		}
43
	}
44
45
	private void internalBringToTop(MPart part) {
46
		MElementContainer<MUIElement> parent = part.getParent();
47
		if (parent.getActiveChild() != part) {
48
			parent.setActiveChild(part);
49
		}
50
	}
51
52
	public MPart findPart(String id) {
53
		return findPart(elementContainer, id);
54
	}
55
56
	public Collection<MPart> getParts() {
57
		return getParts(new ArrayList<MPart>(), elementContainer);
58
	}
59
60
	private Collection<MPart> getParts(Collection<MPart> parts,
61
			MElementContainer<?> elementContainer) {
62
		for (Object child : elementContainer.getChildren()) {
63
			if (child instanceof MPart) {
64
				parts.add((MPart) child);
65
			} else if (child instanceof MElementContainer<?>) {
66
				getParts(parts, (MElementContainer<?>) child);
67
			}
68
		}
69
		return parts;
70
	}
71
72
	public boolean isPartVisible(MPart part) {
73
		if (isInContainer(part)) {
74
			MElementContainer<MUIElement> parent = part.getParent();
75
			return parent.getActiveChild() == part;
76
		}
77
		return false;
78
	}
79
80
	private MPart findPart(MElementContainer<?> container, String id) {
81
		for (Object object : container.getChildren()) {
82
			if (object instanceof MPart) {
83
				MPart part = (MPart) object;
84
				if (id.equals(part.getId())) {
85
					return part;
86
				}
87
			} else if (object instanceof MElementContainer<?>) {
88
				MPart part = findPart((MElementContainer<?>) object, id);
89
				if (part != null) {
90
					return part;
91
				}
92
			}
93
		}
94
95
		return null;
96
	}
97
98
	private boolean isInContainer(MPart part) {
99
		return isInContainer(elementContainer, part);
100
	}
101
102
	private boolean isInContainer(MElementContainer<?> container, MPart part) {
103
		for (Object object : container.getChildren()) {
104
			if (object == part) {
105
				return true;
106
			} else if (object instanceof MElementContainer<?>) {
107
				if (isInContainer((MElementContainer<?>) object, part)) {
108
					return true;
109
				}
110
			}
111
		}
112
113
		return false;
114
	}
115
116
	/*
117
	 * (non-Javadoc)
118
	 * 
119
	 * @see
120
	 * org.eclipse.e4.workbench.modeling.EPartService#activate(org.eclipse.e4.ui.model.application
121
	 * .MPart)
122
	 */
123
	public void activate(MPart part) {
124
		// TODO Auto-generated method stub
125
126
	}
127
128
	/*
129
	 * (non-Javadoc)
130
	 * 
131
	 * @see org.eclipse.e4.workbench.modeling.EPartService#getActivePart()
132
	 */
133
	public MPart getActivePart() {
134
		// TODO Auto-generated method stub
135
		return null;
136
	}
137
}
(-)src/org/eclipse/e4/workbench/ui/renderers/swt/WBWRenderer.java (-2 / +2 lines)
Lines 109-116 Link Here
109
			}
109
			}
110
		};
110
		};
111
111
112
		eventBroker.subscribe(UIEvents.buildTopic(
112
		eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIItem.TOPIC,
113
				UIEvents.UIItem.TOPIC,
114
				UIEvents.ALL_ATTRIBUTES), shellUpdater);
113
				UIEvents.ALL_ATTRIBUTES), shellUpdater);
115
	}
114
	}
116
115
Lines 148-153 Link Here
148
		// set up context
147
		// set up context
149
		IEclipseContext localContext = getContext(wbwModel);
148
		IEclipseContext localContext = getContext(wbwModel);
150
		localContext.set(IContextConstants.DEBUG_STRING, "MWindow"); //$NON-NLS-1$
149
		localContext.set(IContextConstants.DEBUG_STRING, "MWindow"); //$NON-NLS-1$
150
		localContext.set(MElementContainer.class.getName(), wbwModel);
151
		parentContext.set(IContextConstants.ACTIVE_CHILD, localContext);
151
		parentContext.set(IContextConstants.ACTIVE_CHILD, localContext);
152
152
153
		// Add the shell into the WBW's context
153
		// Add the shell into the WBW's context
(-)src/org/eclipse/e4/ui/workbench/swt/internal/E4Application.java (+2 lines)
Lines 26-31 Link Here
26
import org.eclipse.e4.core.services.context.spi.IContextConstants;
26
import org.eclipse.e4.core.services.context.spi.IContextConstants;
27
import org.eclipse.e4.ui.internal.services.ActiveContextsFunction;
27
import org.eclipse.e4.ui.internal.services.ActiveContextsFunction;
28
import org.eclipse.e4.ui.model.application.MApplication;
28
import org.eclipse.e4.ui.model.application.MApplication;
29
import org.eclipse.e4.ui.model.application.MElementContainer;
29
import org.eclipse.e4.ui.model.application.MPart;
30
import org.eclipse.e4.ui.model.application.MPart;
30
import org.eclipse.e4.ui.services.IServiceConstants;
31
import org.eclipse.e4.ui.services.IServiceConstants;
31
import org.eclipse.e4.ui.services.IStylingEngine;
32
import org.eclipse.e4.ui.services.IStylingEngine;
Lines 65-70 Link Here
65
66
66
		// Set the app's context after adding itself
67
		// Set the app's context after adding itself
67
		appContext.set(MApplication.class.getName(), appModel);
68
		appContext.set(MApplication.class.getName(), appModel);
69
		appContext.set(MElementContainer.class.getName(), appModel);
68
		appModel.setContext(appContext);
70
		appModel.setContext(appContext);
69
71
70
		// Parse out parameters from both the command line and/or the product
72
		// Parse out parameters from both the command line and/or the product

Return to bug 295003