View | Details | Raw Unified | Return to bug 416620
Collapse All | Expand All

(-)a/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java (+15 lines)
Lines 107-117 Link Here
107
	 * @since 2.0
107
	 * @since 2.0
108
	 */
108
	 */
109
	protected Shell getShell() {
109
	protected Shell getShell() {
110
		if (parentShellHasChanged()) {
111
			// parent-Shell has changed, e.g. by detaching Eclipse View/Editor
112
			shell.dispose();
113
			shell = null;
114
		}
110
		if (shell == null) {
115
		if (shell == null) {
111
			shell = createShell();
116
			shell = createShell();
112
			hookShellListeners();
117
			hookShellListeners();
113
		}
118
		}
114
		return shell;
119
		return shell;
120
	}
121
122
	private boolean parentShellHasChanged() {
123
		if (shell == null)
124
			return false;
125
		if (shell.isDisposed())
126
			return true;
127
		return (shell.getParent() != control.getShell());
115
	}
128
	}
116
129
117
	/**
130
	/**
Lines 135-140 Link Here
135
	 * @since 2.0
148
	 * @since 2.0
136
	 */
149
	 */
137
	protected LightweightSystem getLightweightSystem() {
150
	protected LightweightSystem getLightweightSystem() {
151
		if (parentShellHasChanged())
152
			lws = null;
138
		if (lws == null) {
153
		if (lws == null) {
139
			lws = createLightweightSystem();
154
			lws = createLightweightSystem();
140
			lws.setControl(getShell());
155
			lws.setControl(getShell());

Return to bug 416620