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 319392
Collapse All | Expand All

(-)src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java (-1 / +25 lines)
Lines 115-121 Link Here
115
				Activator.trace(Policy.DEBUG_RENDERER, "visible -> true", null); //$NON-NLS-1$
115
				Activator.trace(Policy.DEBUG_RENDERER, "visible -> true", null); //$NON-NLS-1$
116
116
117
				// Note that the 'createGui' protocol calls 'childAdded'
117
				// Note that the 'createGui' protocol calls 'childAdded'
118
				createGui(changedElement);
118
				Widget w = (Widget) createGui(changedElement);
119
				if (w instanceof Control && !(w instanceof Shell)) {
120
					fixZOrder(changedElement);
121
				}
119
			} else {
122
			} else {
120
				Activator
123
				Activator
121
						.trace(Policy.DEBUG_RENDERER, "visible -> false", null); //$NON-NLS-1$
124
						.trace(Policy.DEBUG_RENDERER, "visible -> false", null); //$NON-NLS-1$
Lines 183-188 Link Here
183
					// NOTE: createGui will call 'childAdded' if successful
186
					// NOTE: createGui will call 'childAdded' if successful
184
					Widget w = (Widget) createGui(added);
187
					Widget w = (Widget) createGui(added);
185
					if (w instanceof Control && !(w instanceof Shell)) {
188
					if (w instanceof Control && !(w instanceof Shell)) {
189
						fixZOrder(added);
186
						((Control) w).getShell().layout(
190
						((Control) w).getShell().layout(
187
								new Control[] { (Control) w }, SWT.DEFER);
191
								new Control[] { (Control) w }, SWT.DEFER);
188
					}
192
					}
Lines 239-244 Link Here
239
		this.factoryUrl = factoryUrl;
243
		this.factoryUrl = factoryUrl;
240
	}
244
	}
241
245
246
	protected void fixZOrder(MUIElement element) {
247
		MElementContainer<MUIElement> parent = element.getParent();
248
		if (parent == null || !(element.getWidget() instanceof Control))
249
			return;
250
251
		Control elementCtrl = (Control) element.getWidget();
252
		Control prevCtrl = null;
253
		for (MUIElement kid : parent.getChildren()) {
254
			if (kid == element) {
255
				if (prevCtrl != null)
256
					elementCtrl.moveBelow(prevCtrl);
257
				else
258
					elementCtrl.moveAbove(null);
259
				return;
260
			} else if (kid.getWidget() instanceof Control) {
261
				prevCtrl = (Control) kid.getWidget();
262
			}
263
		}
264
	}
265
242
	/**
266
	/**
243
	 * Initialize a part renderer from the extension point.
267
	 * Initialize a part renderer from the extension point.
244
	 * 
268
	 * 

Return to bug 319392