1 | class MyContentOutlinePage extends ContentOutlinePage↵ | | 1 | class MyContentOutlinePage extends ContentOutlinePage↵
|
2 | {↵ | | 2 | {↵
|
3 | @Override↵ | | 3 | @Override↵
|
4 | public void createControl(Composite parent)↵ | | 4 | public void createControl(Composite parent)↵
|
5 | {↵ | | 5 | {↵
|
6 | super.createControl(parent);↵ | | 6 | super.createControl(parent);↵
|
7 | contentOutlineViewer = getTreeViewer();↵ | | 7 | contentOutlineViewer = getTreeViewer();↵
|
8 | contentOutlineViewer.addSelectionChangedListener(this);↵ | | 8 | contentOutlineViewer.addSelectionChangedListener(this);↵
|
|
9 | // Set up the tree viewer.↵ | | 9 | // Set up the tree viewer.↵
|
10 | //↵ | | 10 | //↵
|
11 | contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));↵ | | 11 | contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));↵
|
12 | contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));↵ | | 12 | contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));↵
|
13 | contentOutlineViewer.setInput(editingDomain.getResourceSet());↵ | | 13 | contentOutlineViewer.setInput(editingDomain.getResourceSet());↵
|
|
14 | // Make sure our popups work.↵ | | 14 | // Make sure our popups work.↵
|
15 | //↵ | | 15 | //↵
|
16 | createContextMenuFor(contentOutlineViewer);↵ | | 16 | createContextMenuFor(contentOutlineViewer);↵
|
|
17 | if (!editingDomain.getResourceSet().getResources().isEmpty())↵ | | 17 | if (!editingDomain.getResourceSet().getResources().isEmpty())↵
|
18 | {↵ | | 18 | {↵
|
19 | // Select the root object in the view.↵ | | 19 | // Select the root object in the view.↵
|
20 | //↵ | | 20 | //↵
|
21 | contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);↵ | | 21 | contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);↵
|
22 | }↵ | | 22 | }↵
|
23 | }↵ | | 23 | }↵
|
|
24 | @Override↵ | | 24 | @Override↵
|
25 | public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager)↵ | | 25 | public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager)↵
|
26 | {↵ | | 26 | {↵
|
27 | super.makeContributions(menuManager, toolBarManager, statusLineManager);↵ | | 27 | super.makeContributions(menuManager, toolBarManager, statusLineManager);↵
|
28 | contentOutlineStatusLineManager = statusLineManager;↵ | | 28 | contentOutlineStatusLineManager = statusLineManager;↵
|
29 | }↵ | | 29 | }↵
|
|
30 | @Override↵ | | 30 | @Override↵
|
31 | public void setActionBars(IActionBars actionBars)↵ | | 31 | public void setActionBars(IActionBars actionBars)↵
|
32 | {↵ | | 32 | {↵
|
33 | super.setActionBars(actionBars);↵ | | 33 | super.setActionBars(actionBars);↵
|
34 | getActionBarContributor().shareGlobalActions(this, actionBars);↵ | | 34 | getActionBarContributor().shareGlobalActions(this, actionBars);↵
|
35 | | | 35 |
|