|
Lines 125-133
Link Here
|
| 125 |
categoryTreeViewer.setLabelProvider(new WorkbenchLabelProvider()); |
125 |
categoryTreeViewer.setLabelProvider(new WorkbenchLabelProvider()); |
| 126 |
categoryTreeViewer.setSorter(NewWizardCollectionSorter.INSTANCE); |
126 |
categoryTreeViewer.setSorter(NewWizardCollectionSorter.INSTANCE); |
| 127 |
categoryTreeViewer.addSelectionChangedListener(this); |
127 |
categoryTreeViewer.addSelectionChangedListener(this); |
| 128 |
if (wizardCategories.getParent(wizardCategories) == null) |
128 |
if (wizardCategories.getParent(wizardCategories) == null) { |
| 129 |
categoryTreeViewer.setInput(wizardCategories); |
129 |
categoryTreeViewer.setInput(wizardCategories); |
| 130 |
else |
130 |
} else |
| 131 |
categoryTreeViewer.setInput(new RootElementProxy(wizardCategories)); |
131 |
categoryTreeViewer.setInput(new RootElementProxy(wizardCategories)); |
| 132 |
tree.setFont(wizardFont); |
132 |
tree.setFont(wizardFont); |
| 133 |
|
133 |
|
|
Lines 248-257
Link Here
|
| 248 |
if (currentSelection != selectedCategory) { |
248 |
if (currentSelection != selectedCategory) { |
| 249 |
page.selectWizardNode(null); |
249 |
page.selectWizardNode(null); |
| 250 |
wizardSelectionViewer.setInput(selectedCategory); |
250 |
wizardSelectionViewer.setInput(selectedCategory); |
| 251 |
if(selectedCategory instanceof WizardCollectionElement){ |
251 |
if (selectedCategory instanceof WizardCollectionElement) { |
| 252 |
Object[] children = ((WizardCollectionElement) selectedCategory).getWizards(); |
252 |
Object[] children = |
| 253 |
if(children.length == 1) |
253 |
((WizardCollectionElement) selectedCategory).getWizards(); |
| 254 |
selectWizard(children[0]); |
254 |
if (children.length == 1) |
|
|
255 |
selectWizard(children[0]); |
| 255 |
} |
256 |
} |
| 256 |
} |
257 |
} |
| 257 |
} |
258 |
} |
|
Lines 425-431
Link Here
|
| 425 |
|
426 |
|
| 426 |
public RootElementProxy(WizardCollectionElement element) { |
427 |
public RootElementProxy(WizardCollectionElement element) { |
| 427 |
super(); |
428 |
super(); |
| 428 |
elements = new WizardCollectionElement[] { element }; |
429 |
//If the element has no wizard then it is an empty category |
|
|
430 |
//and we should collapse |
| 431 |
if (element.getWizards().length == 0) { |
| 432 |
Object[] children = element.getChildren(); |
| 433 |
elements = new WizardCollectionElement[children.length]; |
| 434 |
System.arraycopy(children, 0, elements, 0, elements.length); |
| 435 |
} else |
| 436 |
elements = new WizardCollectionElement[] { element }; |
| 429 |
} |
437 |
} |
| 430 |
|
438 |
|
| 431 |
public Object getAdapter(Class adapter) { |
439 |
public Object getAdapter(Class adapter) { |