1 | {↵ | | 1 | {↵
|
2 | /**↵ | | 2 | /**↵
|
3 | * This method should be overriden with a domain-specific implementation ↵ | | 3 | * This method should be overriden with a domain-specific implementation ↵
|
4 | * that returns the inputs to be added, e.g., by querying the user with a dialog.↵ | | 4 | * that returns the inputs to be added, e.g., by querying the user with a dialog.↵
|
5 | */↵ | | 5 | */↵
|
6 | protected Collection<?> getBottomsToAdd()↵ | | 6 | protected Collection<?> getTopsToAdd()↵
|
7 | {↵ | | 7 | {↵
|
8 | return null;↵ | | 8 | return null;↵
|
9 | }↵ | | 9 | }↵
|
|
10 | /**↵ | | 10 | /**↵
|
11 | * This action ignores the selection.↵ | | 11 | * This action ignores the selection.↵
|
12 | */↵ | | 12 | */↵
|
13 | @Override↵ | | 13 | @Override↵
|
14 | public void selectionChanged(IAction action, ISelection selection) ↵ | | 14 | public void selectionChanged(IAction action, ISelection selection) ↵
|
15 | {↵ | | 15 | {↵
|
16 | // Do nothing↵ | | 16 | // Do nothing↵
|
17 | }↵ | | 17 | }↵
|
|
18 | @Override↵ | | 18 | @Override↵
|
19 | public void run(IAction action)↵ | | 19 | public void run(IAction action)↵
|
20 | {↵ | | 20 | {↵
|
21 | Collection<?> additions = getBottomsToAdd();↵ | | 21 | Collection<?> additions = getTopsToAdd();↵
|
22 | MappingRoot mappingRoot = ((MappingDomain)editingDomain).getMappingRoot();↵ | | 22 | MappingRoot mappingRoot = ((MappingDomain)editingDomain).getMappingRoot();↵
|
23 | command = AddCommand.create↵ | | 23 | command = AddCommand.create↵
|
24 | (editingDomain, ↵ | | 24 | (editingDomain, ↵
|
25 | mappingRoot, ↵ | | 25 | mappingRoot, ↵
|
26 | mappingRoot.isTopToBottom() ?↵ | | 26 | mappingRoot.isTopToBottom() ?↵
|
27 | //mappingRoot.ePackageMapping().getMapping_Outputs() :↵ | | 27 | //mappingRoot.ePackageMapping().getMapping_Inputs() :↵
|
28 | //mappingRoot.ePackageMapping().getMapping_Inputs(),↵ | | 28 | //mappingRoot.ePackageMapping().getMapping_Outputs(),↵
|
29 | MappingPackage.eINSTANCE.getMapping_Outputs() :↵ | | 29 | MappingPackage.eINSTANCE.getMapping_Inputs() :↵
|
30 | MappingPackage.eINSTANCE.getMapping_Inputs(),↵ | | 30 | MappingPackage.eINSTANCE.getMapping_Outputs(),↵
|
31 | additions);↵ | | 31 | additions);↵
|
|
32 | super.run(action);↵ | | 32 | super.run(action);↵
|
33 | }↵ | | 33 | }↵
|
|
34 | @Override↵ | | 34 | @Override↵
|
35 | public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart)↵ | | 35 | public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart)↵
|
36 | {↵ | | 36 | {↵
|
37 | super.setActiveWorkbenchPart(workbenchPart);↵ | | 37 | super.setActiveWorkbenchPart(workbenchPart);↵
|
38 | action.setEnabled(true); | | 38 | action.setEnabled(true);
|