1 | if (selection instanceof IStructuredSelection)↵ | | 1 | if (selection instanceof IStructuredSelection)↵
|
2 | {↵ | | 2 | {↵
|
3 | Object object = ((IStructuredSelection)selection).getFirstElement();↵ | | 3 | Object object = ((IStructuredSelection)selection).getFirstElement();↵
|
4 | if (object instanceof EClass)↵ | | 4 | if (object instanceof IFile)↵
|
5 | {↵ | | 5 | {↵
|
6 | eClass = (EClass)object;↵ | | 6 | file = (IFile)object;↵
|
|
7 | action.setEnabled(!eClass.isAbstract(↵ | | 7 | action.setEnabled↵
|
| | | 8 | (action.getId().indexOf("XML") != -1 ||↵
|
| | | 9 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey↵
|
8 | ));↵ | | 10 | (file.getFullPath().getFileExtension()));↵
|
9 | return;↵ | | 11 | return;↵
|
10 | }↵ | | 12 | }↵
|
11 | }↵ | | 13 | }↵
|
12 | eClass = null;↵ | | 14 | file = null;↵
|
13 | action.setEnabled(false); | | 15 | action.setEnabled(false);
|