Lines 24-30
Link Here
|
24 |
import org.eclipse.core.runtime.Platform; |
24 |
import org.eclipse.core.runtime.Platform; |
25 |
import org.eclipse.core.runtime.Status; |
25 |
import org.eclipse.core.runtime.Status; |
26 |
import org.eclipse.jface.viewers.ILabelProvider; |
26 |
import org.eclipse.jface.viewers.ILabelProvider; |
27 |
import org.eclipse.jface.viewers.ISelection; |
27 |
import org.eclipse.jface.viewers.IStructuredSelection; |
28 |
import org.eclipse.ui.IWorkbenchPart; |
28 |
import org.eclipse.ui.IWorkbenchPart; |
29 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewPlugin; |
29 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewPlugin; |
30 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewStatusCodes; |
30 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewStatusCodes; |
Lines 32-37
Link Here
|
32 |
import org.eclipse.ui.views.properties.tabbed.IActionProvider; |
32 |
import org.eclipse.ui.views.properties.tabbed.IActionProvider; |
33 |
import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor; |
33 |
import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor; |
34 |
import org.eclipse.ui.views.properties.tabbed.ISectionDescriptorProvider; |
34 |
import org.eclipse.ui.views.properties.tabbed.ISectionDescriptorProvider; |
|
|
35 |
import org.eclipse.ui.views.properties.tabbed.ISelectionConverter; |
35 |
import org.eclipse.ui.views.properties.tabbed.ITypeMapper; |
36 |
import org.eclipse.ui.views.properties.tabbed.ITypeMapper; |
36 |
|
37 |
|
37 |
/** |
38 |
/** |
Lines 68-73
Link Here
|
68 |
private static final String ATT_LABEL_PROVIDER = "labelProvider"; //$NON-NLS-1$ |
69 |
private static final String ATT_LABEL_PROVIDER = "labelProvider"; //$NON-NLS-1$ |
69 |
|
70 |
|
70 |
private static final String ATT_ACTION_PROVIDER = "actionProvider"; //$NON-NLS-1$ |
71 |
private static final String ATT_ACTION_PROVIDER = "actionProvider"; //$NON-NLS-1$ |
|
|
72 |
|
73 |
private static final String ATT_SELECTION_CONVERTER = "selectionConverter"; //$NON-NLS-1$ |
71 |
|
74 |
|
72 |
private static final String TOP = "top"; //$NON-NLS-1$ |
75 |
private static final String TOP = "top"; //$NON-NLS-1$ |
73 |
|
76 |
|
Lines 80-85
Link Here
|
80 |
protected ILabelProvider labelProvider; |
83 |
protected ILabelProvider labelProvider; |
81 |
|
84 |
|
82 |
protected IActionProvider actionProvider; |
85 |
protected IActionProvider actionProvider; |
|
|
86 |
|
87 |
protected ISelectionConverter selectionConverter; |
83 |
|
88 |
|
84 |
protected ITypeMapper typeMapper; |
89 |
protected ITypeMapper typeMapper; |
85 |
|
90 |
|
Lines 117-122
Link Here
|
117 |
typeMapper = (ITypeMapper) configurationElement |
122 |
typeMapper = (ITypeMapper) configurationElement |
118 |
.createExecutableExtension(ATT_TYPE_MAPPER); |
123 |
.createExecutableExtension(ATT_TYPE_MAPPER); |
119 |
} |
124 |
} |
|
|
125 |
if (configurationElement.getAttribute(ATT_SELECTION_CONVERTER) != null) { |
126 |
selectionConverter = (ISelectionConverter) configurationElement |
127 |
.createExecutableExtension(ATT_SELECTION_CONVERTER); |
128 |
} |
120 |
} catch (CoreException exception) { |
129 |
} catch (CoreException exception) { |
121 |
handleConfigurationError(id, exception); |
130 |
handleConfigurationError(id, exception); |
122 |
} |
131 |
} |
Lines 234-240
Link Here
|
234 |
* input. The descriptors are sorted using the afterPage attribute. |
243 |
* input. The descriptors are sorted using the afterPage attribute. |
235 |
*/ |
244 |
*/ |
236 |
public TabDescriptor[] getTabDescriptors(IWorkbenchPart part, |
245 |
public TabDescriptor[] getTabDescriptors(IWorkbenchPart part, |
237 |
ISelection selection) { |
246 |
IStructuredSelection selection) { |
238 |
if (selection == null || selection.isEmpty()) { |
247 |
if (selection == null || selection.isEmpty()) { |
239 |
return EMPTY_DESCRIPTOR_ARRAY; |
248 |
return EMPTY_DESCRIPTOR_ARRAY; |
240 |
} |
249 |
} |
Lines 250-256
Link Here
|
250 |
* given input. |
259 |
* given input. |
251 |
*/ |
260 |
*/ |
252 |
protected TabDescriptor[] filterTabDescriptors(TabDescriptor[] descriptors, |
261 |
protected TabDescriptor[] filterTabDescriptors(TabDescriptor[] descriptors, |
253 |
IWorkbenchPart part, ISelection selection) { |
262 |
IWorkbenchPart part, IStructuredSelection selection) { |
254 |
List result = new ArrayList(); |
263 |
List result = new ArrayList(); |
255 |
for (int i = 0; i < descriptors.length; i++) { |
264 |
for (int i = 0; i < descriptors.length; i++) { |
256 |
TabDescriptor descriptor = adaptDescriptorFor(descriptors[i], part, |
265 |
TabDescriptor descriptor = adaptDescriptorFor(descriptors[i], part, |
Lines 271-277
Link Here
|
271 |
* do not apply to the given input object. |
280 |
* do not apply to the given input object. |
272 |
*/ |
281 |
*/ |
273 |
protected TabDescriptor adaptDescriptorFor(TabDescriptor target, |
282 |
protected TabDescriptor adaptDescriptorFor(TabDescriptor target, |
274 |
IWorkbenchPart part, ISelection selection) { |
283 |
IWorkbenchPart part, IStructuredSelection selection) { |
275 |
List filteredSectionDescriptors = new ArrayList(); |
284 |
List filteredSectionDescriptors = new ArrayList(); |
276 |
List descriptors = target.getSectionDescriptors(); |
285 |
List descriptors = target.getSectionDescriptors(); |
277 |
for (Iterator iter = descriptors.iterator(); iter.hasNext();) { |
286 |
for (Iterator iter = descriptors.iterator(); iter.hasNext();) { |
Lines 452-457
Link Here
|
452 |
public IActionProvider getActionProvider() { |
461 |
public IActionProvider getActionProvider() { |
453 |
return actionProvider; |
462 |
return actionProvider; |
454 |
} |
463 |
} |
|
|
464 |
|
465 |
/** |
466 |
* Gets the structured selection provider for the contributor. |
467 |
* |
468 |
* @return the structured selection provider for the contributor. |
469 |
*/ |
470 |
public ISelectionConverter getSelectionConverter() { |
471 |
return selectionConverter; |
472 |
} |
455 |
|
473 |
|
456 |
/** |
474 |
/** |
457 |
* Sets the section descriptor provider for the contributor. |
475 |
* Sets the section descriptor provider for the contributor. |