|
Lines 10-16
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.ui.views.properties; |
11 |
package org.eclipse.ui.views.properties; |
| 12 |
|
12 |
|
| 13 |
import org.eclipse.core.runtime.Platform; |
|
|
| 14 |
import org.eclipse.jface.viewers.ISelection; |
13 |
import org.eclipse.jface.viewers.ISelection; |
| 15 |
import org.eclipse.swt.widgets.Composite; |
14 |
import org.eclipse.swt.widgets.Composite; |
| 16 |
import org.eclipse.ui.ISaveablePart; |
15 |
import org.eclipse.ui.ISaveablePart; |
|
Lines 19-24
Link Here
|
| 19 |
import org.eclipse.ui.IWorkbenchPage; |
18 |
import org.eclipse.ui.IWorkbenchPage; |
| 20 |
import org.eclipse.ui.IWorkbenchPart; |
19 |
import org.eclipse.ui.IWorkbenchPart; |
| 21 |
import org.eclipse.ui.PartInitException; |
20 |
import org.eclipse.ui.PartInitException; |
|
|
21 |
import org.eclipse.ui.internal.views.ViewsPlugin; |
| 22 |
import org.eclipse.ui.part.IContributedContentsView; |
22 |
import org.eclipse.ui.part.IContributedContentsView; |
| 23 |
import org.eclipse.ui.part.IPage; |
23 |
import org.eclipse.ui.part.IPage; |
| 24 |
import org.eclipse.ui.part.IPageBookViewPage; |
24 |
import org.eclipse.ui.part.IPageBookViewPage; |
|
Lines 115-128
Link Here
|
| 115 |
*/ |
115 |
*/ |
| 116 |
protected PageRec doCreatePage(IWorkbenchPart part) { |
116 |
protected PageRec doCreatePage(IWorkbenchPart part) { |
| 117 |
// Try to get a custom property sheet page. |
117 |
// Try to get a custom property sheet page. |
| 118 |
IPropertySheetPage page = (IPropertySheetPage) part |
118 |
IPropertySheetPage page = (IPropertySheetPage) ViewsPlugin.getAdapter(part, |
| 119 |
.getAdapter(IPropertySheetPage.class); |
119 |
IPropertySheetPage.class, false); |
| 120 |
if (page == null) { |
|
|
| 121 |
// Look for a declaratively-contributed adapter. |
| 122 |
// See bug 86362 [PropertiesView] Can not access AdapterFactory, when plugin is not loaded. |
| 123 |
page = (IPropertySheetPage) Platform.getAdapterManager() |
| 124 |
.loadAdapter(part, IPropertySheetPage.class.getName()); |
| 125 |
} |
| 126 |
if (page != null) { |
120 |
if (page != null) { |
| 127 |
if (page instanceof IPageBookViewPage) { |
121 |
if (page instanceof IPageBookViewPage) { |
| 128 |
initPage((IPageBookViewPage) page); |
122 |
initPage((IPageBookViewPage) page); |
|
Lines 180-187
Link Here
|
| 180 |
* adapter and if so, asks it for its contributing part. |
174 |
* adapter and if so, asks it for its contributing part. |
| 181 |
*/ |
175 |
*/ |
| 182 |
public void partActivated(IWorkbenchPart part) { |
176 |
public void partActivated(IWorkbenchPart part) { |
| 183 |
IContributedContentsView view = (IContributedContentsView) part |
177 |
// Look for a declaratively-contributed adapter - including not yet loaded adapter factories. |
| 184 |
.getAdapter(IContributedContentsView.class); |
178 |
// See bug 86362 [PropertiesView] Can not access AdapterFactory, when plugin is not loaded. |
|
|
179 |
IContributedContentsView view = (IContributedContentsView) ViewsPlugin.getAdapter(part, |
| 180 |
IContributedContentsView.class, true); |
| 185 |
IWorkbenchPart source = null; |
181 |
IWorkbenchPart source = null; |
| 186 |
if (view != null) { |
182 |
if (view != null) { |
| 187 |
source = view.getContributingPart(); |
183 |
source = view.getContributingPart(); |