EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.featuremodel.presentation]

COVERAGE SUMMARY FOR SOURCE FILE [featuremodelEditor.java]

nameclass, %method, %block, %line, %
featuremodelEditor.java0%   (0/26)0%   (0/120)0%   (0/2637)0%   (0/588)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class featuremodelEditor0%   (0/1)0%   (0/47)0%   (0/1754)0%   (0/419)
access$0 (featuremodelEditor): Composite 0%   (0/1)0%   (0/3)0%   (0/1)
access$1 (featuremodelEditor, int): void 0%   (0/1)0%   (0/4)0%   (0/1)
addSelectionChangedListener (ISelectionChangedListener): void 0%   (0/1)0%   (0/6)0%   (0/2)
analyzeResourceProblems (Resource, Exception): Diagnostic 0%   (0/1)0%   (0/57)0%   (0/19)
createContextMenuFor (StructuredViewer): void 0%   (0/1)0%   (0/62)0%   (0/12)
createModel (): void 0%   (0/1)0%   (0/52)0%   (0/12)
createPages (): void 0%   (0/1)0%   (0/497)0%   (0/96)
dispose (): void 0%   (0/1)0%   (0/40)0%   (0/12)
doSave (IProgressMonitor): void 0%   (0/1)0%   (0/47)0%   (0/13)
doSaveAs (): void 0%   (0/1)0%   (0/34)0%   (0/8)
doSaveAs (URI, IEditorInput): void 0%   (0/1)0%   (0/33)0%   (0/9)
featuremodelEditor (): void 0%   (0/1)0%   (0/59)0%   (0/17)
firePropertyChange (int): void 0%   (0/1)0%   (0/4)0%   (0/2)
getActionBarContributor (): EditingDomainActionBarContributor 0%   (0/1)0%   (0/5)0%   (0/1)
getActionBars (): IActionBars 0%   (0/1)0%   (0/4)0%   (0/1)
getAdapter (Class): Object 0%   (0/1)0%   (0/29)0%   (0/7)
getAdapterFactory (): AdapterFactory 0%   (0/1)0%   (0/3)0%   (0/1)
getContentOutlinePage (): IContentOutlinePage 0%   (0/1)0%   (0/19)0%   (0/5)
getEditingDomain (): EditingDomain 0%   (0/1)0%   (0/3)0%   (0/1)
getPropertySheetPage (): IPropertySheetPage 0%   (0/1)0%   (0/22)0%   (0/5)
getSelection (): ISelection 0%   (0/1)0%   (0/3)0%   (0/1)
getString (String): String 0%   (0/1)0%   (0/4)0%   (0/1)
getString (String, Object): String 0%   (0/1)0%   (0/10)0%   (0/1)
getViewer (): Viewer 0%   (0/1)0%   (0/3)0%   (0/1)
gotoMarker (IMarker): void 0%   (0/1)0%   (0/37)0%   (0/10)
handleActivate (): void 0%   (0/1)0%   (0/56)0%   (0/15)
handleChangedResources (): void 0%   (0/1)0%   (0/77)0%   (0/17)
handleContentOutlineSelection (ISelection): void 0%   (0/1)0%   (0/66)0%   (0/14)
handleDirtyConflict (): boolean 0%   (0/1)0%   (0/9)0%   (0/5)
hideTabs (): void 0%   (0/1)0%   (0/31)0%   (0/7)
init (IEditorSite, IEditorInput): void 0%   (0/1)0%   (0/24)0%   (0/7)
initializeEditingDomain (): void 0%   (0/1)0%   (0/58)0%   (0/11)
isDirty (): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
isPersisted (Resource): boolean 0%   (0/1)0%   (0/20)0%   (0/7)
isSaveAsAllowed (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
menuAboutToShow (IMenuManager): void 0%   (0/1)0%   (0/7)0%   (0/2)
pageChange (int): void 0%   (0/1)0%   (0/12)0%   (0/4)
removeSelectionChangedListener (ISelectionChangedListener): void 0%   (0/1)0%   (0/6)0%   (0/2)
setCurrentViewer (Viewer): void 0%   (0/1)0%   (0/41)0%   (0/11)
setCurrentViewerPane (ViewerPane): void 0%   (0/1)0%   (0/20)0%   (0/6)
setFocus (): void 0%   (0/1)0%   (0/14)0%   (0/4)
setSelection (ISelection): void 0%   (0/1)0%   (0/26)0%   (0/5)
setSelectionToViewer (Collection): void 0%   (0/1)0%   (0/20)0%   (0/6)
setStatusLineManager (ISelection): void 0%   (0/1)0%   (0/60)0%   (0/15)
showOutlineView (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
showTabs (): void 0%   (0/1)0%   (0/32)0%   (0/7)
updateProblemIndication (): void 0%   (0/1)0%   (0/125)0%   (0/33)
     
class featuremodelEditor$10%   (0/1)0%   (0/6)0%   (0/61)0%   (0/17)
featuremodelEditor$1 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
partActivated (IWorkbenchPart): void 0%   (0/1)0%   (0/51)0%   (0/11)
partBroughtToTop (IWorkbenchPart): void 0%   (0/1)0%   (0/1)0%   (0/1)
partClosed (IWorkbenchPart): void 0%   (0/1)0%   (0/1)0%   (0/1)
partDeactivated (IWorkbenchPart): void 0%   (0/1)0%   (0/1)0%   (0/1)
partOpened (IWorkbenchPart): void 0%   (0/1)0%   (0/1)0%   (0/1)
     
class featuremodelEditor$100%   (0/1)0%   (0/3)0%   (0/20)0%   (0/6)
createViewer (Composite): Viewer 0%   (0/1)0%   (0/5)0%   (0/1)
featuremodelEditor$10 (featuremodelEditor, IWorkbenchPage, IWorkbenchPart): void 0%   (0/1)0%   (0/8)0%   (0/2)
requestActivation (): void 0%   (0/1)0%   (0/7)0%   (0/3)
     
class featuremodelEditor$110%   (0/1)0%   (0/3)0%   (0/20)0%   (0/6)
createViewer (Composite): Viewer 0%   (0/1)0%   (0/5)0%   (0/1)
featuremodelEditor$11 (featuremodelEditor, IWorkbenchPage, IWorkbenchPart): void 0%   (0/1)0%   (0/8)0%   (0/2)
requestActivation (): void 0%   (0/1)0%   (0/7)0%   (0/3)
     
class featuremodelEditor$120%   (0/1)0%   (0/3)0%   (0/20)0%   (0/6)
createViewer (Composite): Viewer 0%   (0/1)0%   (0/5)0%   (0/1)
featuremodelEditor$12 (featuremodelEditor, IWorkbenchPage, IWorkbenchPart): void 0%   (0/1)0%   (0/8)0%   (0/2)
requestActivation (): void 0%   (0/1)0%   (0/7)0%   (0/3)
     
class featuremodelEditor$130%   (0/1)0%   (0/2)0%   (0/11)0%   (0/4)
featuremodelEditor$13 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
run (): void 0%   (0/1)0%   (0/5)0%   (0/2)
     
class featuremodelEditor$140%   (0/1)0%   (0/2)0%   (0/22)0%   (0/8)
controlResized (ControlEvent): void 0%   (0/1)0%   (0/13)0%   (0/5)
featuremodelEditor$14 (featuremodelEditor): void 0%   (0/1)0%   (0/9)0%   (0/3)
     
class featuremodelEditor$150%   (0/1)0%   (0/2)0%   (0/10)0%   (0/4)
featuremodelEditor$15 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
run (): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class featuremodelEditor$160%   (0/1)0%   (0/2)0%   (0/12)0%   (0/4)
featuremodelEditor$16 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
selectionChanged (SelectionChangedEvent): void 0%   (0/1)0%   (0/6)0%   (0/2)
     
class featuremodelEditor$170%   (0/1)0%   (0/3)0%   (0/25)0%   (0/8)
featuremodelEditor$17 (featuremodelEditor, AdapterFactoryEditingDomain): void 0%   (0/1)0%   (0/7)0%   (0/2)
setActionBars (IActionBars): void 0%   (0/1)0%   (0/10)0%   (0/3)
setSelectionToViewer (List): void 0%   (0/1)0%   (0/8)0%   (0/3)
     
class featuremodelEditor$180%   (0/1)0%   (0/2)0%   (0/77)0%   (0/13)
execute (IProgressMonitor): void 0%   (0/1)0%   (0/68)0%   (0/11)
featuremodelEditor$18 (featuremodelEditor, Map): void 0%   (0/1)0%   (0/9)0%   (0/2)
     
class featuremodelEditor$1MyContentOutlinePage0%   (0/1)0%   (0/4)0%   (0/96)0%   (0/17)
createControl (Composite): void 0%   (0/1)0%   (0/70)0%   (0/10)
featuremodelEditor$1MyContentOutlinePage (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/1)
makeContributions (IMenuManager, IToolBarManager, IStatusLineManager): void 0%   (0/1)0%   (0/10)0%   (0/3)
setActionBars (IActionBars): void 0%   (0/1)0%   (0/10)0%   (0/3)
     
class featuremodelEditor$20%   (0/1)0%   (0/5)0%   (0/71)0%   (0/19)
access$0 (featuremodelEditor$2): featuremodelEditor 0%   (0/1)0%   (0/3)0%   (0/1)
featuremodelEditor$2 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
notifyChanged (Notification): void 0%   (0/1)0%   (0/54)0%   (0/13)
setTarget (Resource): void 0%   (0/1)0%   (0/4)0%   (0/2)
unsetTarget (Resource): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class featuremodelEditor$2$10%   (0/1)0%   (0/2)0%   (0/11)0%   (0/4)
featuremodelEditor$2$1 (featuremodelEditor$2): void 0%   (0/1)0%   (0/6)0%   (0/2)
run (): void 0%   (0/1)0%   (0/5)0%   (0/2)
     
class featuremodelEditor$30%   (0/1)0%   (0/3)0%   (0/56)0%   (0/14)
access$0 (featuremodelEditor$3): featuremodelEditor 0%   (0/1)0%   (0/3)0%   (0/1)
featuremodelEditor$3 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
resourceChanged (IResourceChangeEvent): void 0%   (0/1)0%   (0/47)0%   (0/12)
     
class featuremodelEditor$3$10%   (0/1)0%   (0/2)0%   (0/35)0%   (0/6)
featuremodelEditor$3$1 (featuremodelEditor$3, featuremodelEditor$3$1ResourceD... 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/26)0%   (0/4)
     
class featuremodelEditor$3$1ResourceDeltaVisitor0%   (0/1)0%   (0/4)0%   (0/81)0%   (0/16)
featuremodelEditor$3$1ResourceDeltaVisitor (featuremodelEditor$3): void 0%   (0/1)0%   (0/22)0%   (0/4)
getChangedResources (): Collection 0%   (0/1)0%   (0/3)0%   (0/1)
getRemovedResources (): Collection 0%   (0/1)0%   (0/3)0%   (0/1)
visit (IResourceDelta): boolean 0%   (0/1)0%   (0/53)0%   (0/10)
     
class featuremodelEditor$3$20%   (0/1)0%   (0/2)0%   (0/33)0%   (0/6)
featuremodelEditor$3$2 (featuremodelEditor$3, featuremodelEditor$3$1ResourceD... 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/24)0%   (0/4)
     
class featuremodelEditor$40%   (0/1)0%   (0/3)0%   (0/20)0%   (0/5)
access$0 (featuremodelEditor$4): featuremodelEditor 0%   (0/1)0%   (0/3)0%   (0/1)
commandStackChanged (EventObject): void 0%   (0/1)0%   (0/11)0%   (0/3)
featuremodelEditor$4 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
     
class featuremodelEditor$4$10%   (0/1)0%   (0/2)0%   (0/46)0%   (0/9)
featuremodelEditor$4$1 (featuremodelEditor$4, EventObject): void 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/37)0%   (0/7)
     
class featuremodelEditor$50%   (0/1)0%   (0/2)0%   (0/25)0%   (0/5)
featuremodelEditor$5 (featuremodelEditor, Collection): void 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/16)0%   (0/3)
     
class featuremodelEditor$60%   (0/1)0%   (0/2)0%   (0/12)0%   (0/4)
featuremodelEditor$6 (featuremodelEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
selectionChanged (SelectionChangedEvent): void 0%   (0/1)0%   (0/6)0%   (0/2)
     
class featuremodelEditor$70%   (0/1)0%   (0/3)0%   (0/28)0%   (0/8)
createViewer (Composite): Viewer 0%   (0/1)0%   (0/13)0%   (0/3)
featuremodelEditor$7 (featuremodelEditor, IWorkbenchPage, IWorkbenchPart): void 0%   (0/1)0%   (0/8)0%   (0/2)
requestActivation (): void 0%   (0/1)0%   (0/7)0%   (0/3)
     
class featuremodelEditor$80%   (0/1)0%   (0/3)0%   (0/28)0%   (0/8)
createViewer (Composite): Viewer 0%   (0/1)0%   (0/13)0%   (0/3)
featuremodelEditor$8 (featuremodelEditor, IWorkbenchPage, IWorkbenchPart): void 0%   (0/1)0%   (0/8)0%   (0/2)
requestActivation (): void 0%   (0/1)0%   (0/7)0%   (0/3)
     
class featuremodelEditor$90%   (0/1)0%   (0/3)0%   (0/20)0%   (0/6)
createViewer (Composite): Viewer 0%   (0/1)0%   (0/5)0%   (0/1)
featuremodelEditor$9 (featuremodelEditor, IWorkbenchPage, IWorkbenchPart): void 0%   (0/1)0%   (0/8)0%   (0/2)
requestActivation (): void 0%   (0/1)0%   (0/7)0%   (0/3)
     
class featuremodelEditor$ReverseAdapterFactoryContentProvider0%   (0/1)0%   (0/5)0%   (0/43)0%   (0/10)
featuremodelEditor$ReverseAdapterFactoryContentProvider (featuremodelEditor, ... 0%   (0/1)0%   (0/7)0%   (0/3)
getChildren (Object): Object [] 0%   (0/1)0%   (0/12)0%   (0/2)
getElements (Object): Object [] 0%   (0/1)0%   (0/12)0%   (0/2)
getParent (Object): Object 0%   (0/1)0%   (0/2)0%   (0/1)
hasChildren (Object): boolean 0%   (0/1)0%   (0/10)0%   (0/2)

1/**
2 * <copyright>
3 * </copyright>
4 *
5 * $Id$
6 */
7package de.uka.ipd.sdq.featuremodel.presentation;
8 
9 
10import java.io.IOException;
11import java.io.InputStream;
12 
13import java.util.ArrayList;
14import java.util.Collection;
15import java.util.Collections;
16import java.util.EventObject;
17import java.util.HashMap;
18import java.util.Iterator;
19import java.util.LinkedHashMap;
20import java.util.List;
21import java.util.Map;
22 
23import org.eclipse.core.resources.IFile;
24import org.eclipse.core.resources.IMarker;
25import org.eclipse.core.resources.IResource;
26import org.eclipse.core.resources.IResourceChangeEvent;
27import org.eclipse.core.resources.IResourceChangeListener;
28import org.eclipse.core.resources.IResourceDelta;
29import org.eclipse.core.resources.IResourceDeltaVisitor;
30import org.eclipse.core.resources.ResourcesPlugin;
31 
32import org.eclipse.core.runtime.CoreException;
33import org.eclipse.core.runtime.IPath;
34import org.eclipse.core.runtime.IProgressMonitor;
35import org.eclipse.core.runtime.NullProgressMonitor;
36 
37import org.eclipse.jface.action.IMenuListener;
38import org.eclipse.jface.action.IMenuManager;
39import org.eclipse.jface.action.IStatusLineManager;
40import org.eclipse.jface.action.IToolBarManager;
41import org.eclipse.jface.action.MenuManager;
42import org.eclipse.jface.action.Separator;
43 
44import org.eclipse.jface.dialogs.MessageDialog;
45import org.eclipse.jface.dialogs.ProgressMonitorDialog;
46 
47import org.eclipse.jface.viewers.ColumnWeightData;
48import org.eclipse.jface.viewers.ISelection;
49import org.eclipse.jface.viewers.ISelectionChangedListener;
50import org.eclipse.jface.viewers.ISelectionProvider;
51import org.eclipse.jface.viewers.IStructuredSelection;
52import org.eclipse.jface.viewers.ListViewer;
53import org.eclipse.jface.viewers.SelectionChangedEvent;
54import org.eclipse.jface.viewers.StructuredSelection;
55import org.eclipse.jface.viewers.StructuredViewer;
56import org.eclipse.jface.viewers.TableLayout;
57import org.eclipse.jface.viewers.TableViewer;
58import org.eclipse.jface.viewers.TreeViewer;
59import org.eclipse.jface.viewers.Viewer;
60 
61import org.eclipse.swt.SWT;
62 
63import org.eclipse.swt.custom.CTabFolder;
64 
65import org.eclipse.swt.dnd.DND;
66import org.eclipse.swt.dnd.Transfer;
67 
68import org.eclipse.swt.events.ControlAdapter;
69import org.eclipse.swt.events.ControlEvent;
70 
71import org.eclipse.swt.graphics.Point;
72 
73import org.eclipse.swt.layout.FillLayout;
74 
75import org.eclipse.swt.widgets.Composite;
76import org.eclipse.swt.widgets.Menu;
77import org.eclipse.swt.widgets.Table;
78import org.eclipse.swt.widgets.TableColumn;
79import org.eclipse.swt.widgets.Tree;
80import org.eclipse.swt.widgets.TreeColumn;
81 
82import org.eclipse.ui.IActionBars;
83import org.eclipse.ui.IEditorInput;
84import org.eclipse.ui.IEditorPart;
85import org.eclipse.ui.IEditorSite;
86import org.eclipse.ui.IPartListener;
87import org.eclipse.ui.IWorkbenchPart;
88import org.eclipse.ui.PartInitException;
89 
90import org.eclipse.ui.dialogs.SaveAsDialog;
91 
92import org.eclipse.ui.ide.IGotoMarker;
93 
94import org.eclipse.ui.part.FileEditorInput;
95import org.eclipse.ui.part.MultiPageEditorPart;
96 
97import org.eclipse.ui.views.contentoutline.ContentOutline;
98import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
99import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
100 
101import org.eclipse.ui.views.properties.IPropertySheetPage;
102import org.eclipse.ui.views.properties.PropertySheet;
103import org.eclipse.ui.views.properties.PropertySheetPage;
104 
105import org.eclipse.emf.common.command.BasicCommandStack;
106import org.eclipse.emf.common.command.Command;
107import org.eclipse.emf.common.command.CommandStack;
108import org.eclipse.emf.common.command.CommandStackListener;
109 
110import org.eclipse.emf.common.notify.AdapterFactory;
111import org.eclipse.emf.common.notify.Notification;
112 
113import org.eclipse.emf.common.ui.MarkerHelper;
114import org.eclipse.emf.common.ui.ViewerPane;
115 
116import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
117 
118import org.eclipse.emf.common.ui.viewer.IViewerProvider;
119 
120import org.eclipse.emf.common.util.BasicDiagnostic;
121import org.eclipse.emf.common.util.Diagnostic;
122import org.eclipse.emf.common.util.URI;
123 
124import org.eclipse.emf.ecore.EObject;
125import org.eclipse.emf.ecore.EValidator;
126 
127import org.eclipse.emf.ecore.resource.Resource;
128import org.eclipse.emf.ecore.resource.ResourceSet;
129 
130import org.eclipse.emf.ecore.util.EContentAdapter;
131import org.eclipse.emf.ecore.util.EcoreUtil;
132 
133import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
134import org.eclipse.emf.edit.domain.EditingDomain;
135import org.eclipse.emf.edit.domain.IEditingDomainProvider;
136 
137import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
138import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
139import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
140 
141import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
142 
143import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
144 
145import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
146 
147import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
148import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
149import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
150 
151import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
152import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
153import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
154 
155import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
156import org.eclipse.emf.edit.ui.util.EditUIUtil;
157 
158import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
159 
160import de.uka.ipd.sdq.featuremodel.provider.featuremodelItemProviderAdapterFactory;
161 
162import de.uka.ipd.sdq.identifier.provider.IdentifierItemProviderAdapterFactory;
163 
164import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
165 
166import org.eclipse.ui.actions.WorkspaceModifyOperation;
167 
168 
169/**
170 * This is an example of a featuremodel model editor.
171 * <!-- begin-user-doc -->
172 * <!-- end-user-doc -->
173 * @generated
174 */
175public class featuremodelEditor
176        extends MultiPageEditorPart
177        implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
178        /**
179         * This keeps track of the editing domain that is used to track all changes to the model.
180         * <!-- begin-user-doc -->
181         * <!-- end-user-doc -->
182         * @generated
183         */
184        protected AdapterFactoryEditingDomain editingDomain;
185 
186        /**
187         * This is the one adapter factory used for providing views of the model.
188         * <!-- begin-user-doc -->
189         * <!-- end-user-doc -->
190         * @generated
191         */
192        protected ComposedAdapterFactory adapterFactory;
193 
194        /**
195         * This is the content outline page.
196         * <!-- begin-user-doc -->
197         * <!-- end-user-doc -->
198         * @generated
199         */
200        protected IContentOutlinePage contentOutlinePage;
201 
202        /**
203         * This is a kludge...
204         * <!-- begin-user-doc -->
205         * <!-- end-user-doc -->
206         * @generated
207         */
208        protected IStatusLineManager contentOutlineStatusLineManager;
209 
210        /**
211         * This is the content outline page's viewer.
212         * <!-- begin-user-doc -->
213         * <!-- end-user-doc -->
214         * @generated
215         */
216        protected TreeViewer contentOutlineViewer;
217 
218        /**
219         * This is the property sheet page.
220         * <!-- begin-user-doc -->
221         * <!-- end-user-doc -->
222         * @generated
223         */
224        protected PropertySheetPage propertySheetPage;
225 
226        /**
227         * This is the viewer that shadows the selection in the content outline.
228         * The parent relation must be correctly defined for this to work.
229         * <!-- begin-user-doc -->
230         * <!-- end-user-doc -->
231         * @generated
232         */
233        protected TreeViewer selectionViewer;
234 
235        /**
236         * This inverts the roll of parent and child in the content provider and show parents as a tree.
237         * <!-- begin-user-doc -->
238         * <!-- end-user-doc -->
239         * @generated
240         */
241        protected TreeViewer parentViewer;
242 
243        /**
244         * This shows how a tree view works.
245         * <!-- begin-user-doc -->
246         * <!-- end-user-doc -->
247         * @generated
248         */
249        protected TreeViewer treeViewer;
250 
251        /**
252         * This shows how a list view works.
253         * A list viewer doesn't support icons.
254         * <!-- begin-user-doc -->
255         * <!-- end-user-doc -->
256         * @generated
257         */
258        protected ListViewer listViewer;
259 
260        /**
261         * This shows how a table view works.
262         * A table can be used as a list with icons.
263         * <!-- begin-user-doc -->
264         * <!-- end-user-doc -->
265         * @generated
266         */
267        protected TableViewer tableViewer;
268 
269        /**
270         * This shows how a tree view with columns works.
271         * <!-- begin-user-doc -->
272         * <!-- end-user-doc -->
273         * @generated
274         */
275        protected TreeViewer treeViewerWithColumns;
276 
277        /**
278         * This keeps track of the active viewer pane, in the book.
279         * <!-- begin-user-doc -->
280         * <!-- end-user-doc -->
281         * @generated
282         */
283        protected ViewerPane currentViewerPane;
284 
285        /**
286         * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
287         * <!-- begin-user-doc -->
288         * <!-- end-user-doc -->
289         * @generated
290         */
291        protected Viewer currentViewer;
292 
293        /**
294         * This listens to which ever viewer is active.
295         * <!-- begin-user-doc -->
296         * <!-- end-user-doc -->
297         * @generated
298         */
299        protected ISelectionChangedListener selectionChangedListener;
300 
301        /**
302         * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
303         * <!-- begin-user-doc -->
304         * <!-- end-user-doc -->
305         * @generated
306         */
307        protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
308 
309        /**
310         * This keeps track of the selection of the editor as a whole.
311         * <!-- begin-user-doc -->
312         * <!-- end-user-doc -->
313         * @generated
314         */
315        protected ISelection editorSelection = StructuredSelection.EMPTY;
316 
317        /**
318         * The MarkerHelper is responsible for creating workspace resource markers presented
319         * in Eclipse's Problems View.
320         * <!-- begin-user-doc -->
321         * <!-- end-user-doc -->
322         * @generated
323         */
324        protected MarkerHelper markerHelper = new EditUIMarkerHelper();
325 
326        /**
327         * This listens for when the outline becomes active
328         * <!-- begin-user-doc -->
329         * <!-- end-user-doc -->
330         * @generated
331         */
332        protected IPartListener partListener =
333                new IPartListener() {
334                        public void partActivated(IWorkbenchPart p) {
335                                if (p instanceof ContentOutline) {
336                                        if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
337                                                getActionBarContributor().setActiveEditor(featuremodelEditor.this);
338 
339                                                setCurrentViewer(contentOutlineViewer);
340                                        }
341                                }
342                                else if (p instanceof PropertySheet) {
343                                        if (((PropertySheet)p).getCurrentPage() == propertySheetPage) {
344                                                getActionBarContributor().setActiveEditor(featuremodelEditor.this);
345                                                handleActivate();
346                                        }
347                                }
348                                else if (p == featuremodelEditor.this) {
349                                        handleActivate();
350                                }
351                        }
352                        public void partBroughtToTop(IWorkbenchPart p) {
353                                // Ignore.
354                        }
355                        public void partClosed(IWorkbenchPart p) {
356                                // Ignore.
357                        }
358                        public void partDeactivated(IWorkbenchPart p) {
359                                // Ignore.
360                        }
361                        public void partOpened(IWorkbenchPart p) {
362                                // Ignore.
363                        }
364                };
365 
366        /**
367         * Resources that have been removed since last activation.
368         * <!-- begin-user-doc -->
369         * <!-- end-user-doc -->
370         * @generated
371         */
372        protected Collection<Resource> removedResources = new ArrayList<Resource>();
373 
374        /**
375         * Resources that have been changed since last activation.
376         * <!-- begin-user-doc -->
377         * <!-- end-user-doc -->
378         * @generated
379         */
380        protected Collection<Resource> changedResources = new ArrayList<Resource>();
381 
382        /**
383         * Resources that have been saved.
384         * <!-- begin-user-doc -->
385         * <!-- end-user-doc -->
386         * @generated
387         */
388        protected Collection<Resource> savedResources = new ArrayList<Resource>();
389 
390        /**
391         * Map to store the diagnostic associated with a resource.
392         * <!-- begin-user-doc -->
393         * <!-- end-user-doc -->
394         * @generated
395         */
396        protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
397 
398        /**
399         * Controls whether the problem indication should be updated.
400         * <!-- begin-user-doc -->
401         * <!-- end-user-doc -->
402         * @generated
403         */
404        protected boolean updateProblemIndication = true;
405 
406        /**
407         * Adapter used to update the problem indication when resources are demanded loaded.
408         * <!-- begin-user-doc -->
409         * <!-- end-user-doc -->
410         * @generated
411         */
412        protected EContentAdapter problemIndicationAdapter = 
413                new EContentAdapter() {
414                        @Override
415                        public void notifyChanged(Notification notification) {
416                                if (notification.getNotifier() instanceof Resource) {
417                                        switch (notification.getFeatureID(Resource.class)) {
418                                                case Resource.RESOURCE__IS_LOADED:
419                                                case Resource.RESOURCE__ERRORS:
420                                                case Resource.RESOURCE__WARNINGS: {
421                                                        Resource resource = (Resource)notification.getNotifier();
422                                                        Diagnostic diagnostic = analyzeResourceProblems(resource, null);
423                                                        if (diagnostic.getSeverity() != Diagnostic.OK) {
424                                                                resourceToDiagnosticMap.put(resource, diagnostic);
425                                                        }
426                                                        else {
427                                                                resourceToDiagnosticMap.remove(resource);
428                                                        }
429 
430                                                        if (updateProblemIndication) {
431                                                                getSite().getShell().getDisplay().asyncExec
432                                                                        (new Runnable() {
433                                                                                 public void run() {
434                                                                                         updateProblemIndication();
435                                                                                 }
436                                                                         });
437                                                        }
438                                                        break;
439                                                }
440                                        }
441                                }
442                                else {
443                                        super.notifyChanged(notification);
444                                }
445                        }
446 
447                        @Override
448                        protected void setTarget(Resource target) {
449                                basicSetTarget(target);
450                        }
451 
452                        @Override
453                        protected void unsetTarget(Resource target) {
454                                basicUnsetTarget(target);
455                        }
456                };
457 
458        /**
459         * This listens for workspace changes.
460         * <!-- begin-user-doc -->
461         * <!-- end-user-doc -->
462         * @generated
463         */
464        protected IResourceChangeListener resourceChangeListener =
465                new IResourceChangeListener() {
466                        public void resourceChanged(IResourceChangeEvent event) {
467                                IResourceDelta delta = event.getDelta();
468                                try {
469                                        class ResourceDeltaVisitor implements IResourceDeltaVisitor {
470                                                protected ResourceSet resourceSet = editingDomain.getResourceSet();
471                                                protected Collection<Resource> changedResources = new ArrayList<Resource>();
472                                                protected Collection<Resource> removedResources = new ArrayList<Resource>();
473 
474                                                public boolean visit(IResourceDelta delta) {
475                                                        if (delta.getResource().getType() == IResource.FILE) {
476                                                                if (delta.getKind() == IResourceDelta.REMOVED ||
477                                                                    delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
478                                                                        Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
479                                                                        if (resource != null) {
480                                                                                if (delta.getKind() == IResourceDelta.REMOVED) {
481                                                                                        removedResources.add(resource);
482                                                                                }
483                                                                                else if (!savedResources.remove(resource)) {
484                                                                                        changedResources.add(resource);
485                                                                                }
486                                                                        }
487                                                                }
488                                                        }
489 
490                                                        return true;
491                                                }
492 
493                                                public Collection<Resource> getChangedResources() {
494                                                        return changedResources;
495                                                }
496 
497                                                public Collection<Resource> getRemovedResources() {
498                                                        return removedResources;
499                                                }
500                                        }
501 
502                                        final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
503                                        delta.accept(visitor);
504 
505                                        if (!visitor.getRemovedResources().isEmpty()) {
506                                                getSite().getShell().getDisplay().asyncExec
507                                                        (new Runnable() {
508                                                                 public void run() {
509                                                                         removedResources.addAll(visitor.getRemovedResources());
510                                                                         if (!isDirty()) {
511                                                                                 getSite().getPage().closeEditor(featuremodelEditor.this, false);
512                                                                         }
513                                                                 }
514                                                         });
515                                        }
516 
517                                        if (!visitor.getChangedResources().isEmpty()) {
518                                                getSite().getShell().getDisplay().asyncExec
519                                                        (new Runnable() {
520                                                                 public void run() {
521                                                                         changedResources.addAll(visitor.getChangedResources());
522                                                                         if (getSite().getPage().getActiveEditor() == featuremodelEditor.this) {
523                                                                                 handleActivate();
524                                                                         }
525                                                                 }
526                                                         });
527                                        }
528                                }
529                                catch (CoreException exception) {
530                                        FeaturemodelEditorPlugin.INSTANCE.log(exception);
531                                }
532                        }
533                };
534 
535        /**
536         * Handles activation of the editor or it's associated views.
537         * <!-- begin-user-doc -->
538         * <!-- end-user-doc -->
539         * @generated
540         */
541        protected void handleActivate() {
542                // Recompute the read only state.
543                //
544                if (editingDomain.getResourceToReadOnlyMap() != null) {
545                  editingDomain.getResourceToReadOnlyMap().clear();
546 
547                  // Refresh any actions that may become enabled or disabled.
548                  //
549                  setSelection(getSelection());
550                }
551 
552                if (!removedResources.isEmpty()) {
553                        if (handleDirtyConflict()) {
554                                getSite().getPage().closeEditor(featuremodelEditor.this, false);
555                        }
556                        else {
557                                removedResources.clear();
558                                changedResources.clear();
559                                savedResources.clear();
560                        }
561                }
562                else if (!changedResources.isEmpty()) {
563                        changedResources.removeAll(savedResources);
564                        handleChangedResources();
565                        changedResources.clear();
566                        savedResources.clear();
567                }
568        }
569 
570        /**
571         * Handles what to do with changed resources on activation.
572         * <!-- begin-user-doc -->
573         * <!-- end-user-doc -->
574         * @generated
575         */
576        protected void handleChangedResources() {
577                if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
578                        if (isDirty()) {
579                                changedResources.addAll(editingDomain.getResourceSet().getResources());
580                        }
581                        editingDomain.getCommandStack().flush();
582 
583                        updateProblemIndication = false;
584                        for (Resource resource : changedResources) {
585                                if (resource.isLoaded()) {
586                                        resource.unload();
587                                        try {
588                                                resource.load(Collections.EMPTY_MAP);
589                                        }
590                                        catch (IOException exception) {
591                                                if (!resourceToDiagnosticMap.containsKey(resource)) {
592                                                        resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
593                                                }
594                                        }
595                                }
596                        }
597 
598                        if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
599                                setSelection(StructuredSelection.EMPTY);
600                        }
601 
602                        updateProblemIndication = true;
603                        updateProblemIndication();
604                }
605        }
606  
607        /**
608         * Updates the problems indication with the information described in the specified diagnostic.
609         * <!-- begin-user-doc -->
610         * <!-- end-user-doc -->
611         * @generated
612         */
613        protected void updateProblemIndication() {
614                if (updateProblemIndication) {
615                        BasicDiagnostic diagnostic =
616                                new BasicDiagnostic
617                                        (Diagnostic.OK,
618                                         "de.uka.ipd.sdq.featuremodel.editor",
619                                         0,
620                                         null,
621                                         new Object [] { editingDomain.getResourceSet() });
622                        for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
623                                if (childDiagnostic.getSeverity() != Diagnostic.OK) {
624                                        diagnostic.add(childDiagnostic);
625                                }
626                        }
627 
628                        int lastEditorPage = getPageCount() - 1;
629                        if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
630                                ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
631                                if (diagnostic.getSeverity() != Diagnostic.OK) {
632                                        setActivePage(lastEditorPage);
633                                }
634                        }
635                        else if (diagnostic.getSeverity() != Diagnostic.OK) {
636                                ProblemEditorPart problemEditorPart = new ProblemEditorPart();
637                                problemEditorPart.setDiagnostic(diagnostic);
638                                problemEditorPart.setMarkerHelper(markerHelper);
639                                try {
640                                        addPage(++lastEditorPage, problemEditorPart, getEditorInput());
641                                        setPageText(lastEditorPage, problemEditorPart.getPartName());
642                                        setActivePage(lastEditorPage);
643                                        showTabs();
644                                }
645                                catch (PartInitException exception) {
646                                        FeaturemodelEditorPlugin.INSTANCE.log(exception);
647                                }
648                        }
649 
650                        if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
651                                markerHelper.deleteMarkers(editingDomain.getResourceSet());
652                                if (diagnostic.getSeverity() != Diagnostic.OK) {
653                                        try {
654                                                markerHelper.createMarkers(diagnostic);
655                                        }
656                                        catch (CoreException exception) {
657                                                FeaturemodelEditorPlugin.INSTANCE.log(exception);
658                                        }
659                                }
660                        }
661                }
662        }
663 
664        /**
665         * Shows a dialog that asks if conflicting changes should be discarded.
666         * <!-- begin-user-doc -->
667         * <!-- end-user-doc -->
668         * @generated
669         */
670        protected boolean handleDirtyConflict() {
671                return
672                        MessageDialog.openQuestion
673                                (getSite().getShell(),
674                                 getString("_UI_FileConflict_label"),
675                                 getString("_WARN_FileConflict"));
676        }
677 
678        /**
679         * This creates a model editor.
680         * <!-- begin-user-doc -->
681         * <!-- end-user-doc -->
682         * @generated
683         */
684        public featuremodelEditor() {
685                super();
686                initializeEditingDomain();
687        }
688 
689        /**
690         * This sets up the editing domain for the model editor.
691         * <!-- begin-user-doc -->
692         * <!-- end-user-doc -->
693         * @generated
694         */
695        protected void initializeEditingDomain() {
696                // Create an adapter factory that yields item providers.
697                //
698                adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
699 
700                adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
701                adapterFactory.addAdapterFactory(new featuremodelItemProviderAdapterFactory());
702                adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
703                adapterFactory.addAdapterFactory(new IdentifierItemProviderAdapterFactory());
704                adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
705 
706                // Create the command stack that will notify this editor as commands are executed.
707                //
708                BasicCommandStack commandStack = new BasicCommandStack();
709 
710                // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
711                //
712                commandStack.addCommandStackListener
713                        (new CommandStackListener() {
714                                 public void commandStackChanged(final EventObject event) {
715                                         getContainer().getDisplay().asyncExec
716                                                 (new Runnable() {
717                                                          public void run() {
718                                                                  firePropertyChange(IEditorPart.PROP_DIRTY);
719 
720                                                                  // Try to select the affected objects.
721                                                                  //
722                                                                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
723                                                                  if (mostRecentCommand != null) {
724                                                                          setSelectionToViewer(mostRecentCommand.getAffectedObjects());
725                                                                  }
726                                                                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
727                                                                          propertySheetPage.refresh();
728                                                                  }
729                                                          }
730                                                  });
731                                 }
732                         });
733 
734                // Create the editing domain with a special command stack.
735                //
736                editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
737        }
738 
739        /**
740         * This is here for the listener to be able to call it.
741         * <!-- begin-user-doc -->
742         * <!-- end-user-doc -->
743         * @generated
744         */
745                        @Override
746        protected void firePropertyChange(int action) {
747                super.firePropertyChange(action);
748        }
749 
750        /**
751         * This sets the selection into whichever viewer is active.
752         * <!-- begin-user-doc -->
753         * <!-- end-user-doc -->
754         * @generated
755         */
756        public void setSelectionToViewer(Collection<?> collection) {
757                final Collection<?> theSelection = collection;
758                // Make sure it's okay.
759                //
760                if (theSelection != null && !theSelection.isEmpty()) {
761                        Runnable runnable =
762                                new Runnable() {
763                                        public void run() {
764                                                // Try to select the items in the current content viewer of the editor.
765                                                //
766                                                if (currentViewer != null) {
767                                                        currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
768                                                }
769                                        }
770                                };
771                        getSite().getShell().getDisplay().asyncExec(runnable);
772                }
773        }
774 
775        /**
776         * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
777         * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
778         * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
779         * <!-- begin-user-doc -->
780         * <!-- end-user-doc -->
781         * @generated
782         */
783        public EditingDomain getEditingDomain() {
784                return editingDomain;
785        }
786 
787        /**
788         * <!-- begin-user-doc -->
789         * <!-- end-user-doc -->
790         * @generated
791         */
792        public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
793                /**
794                 * <!-- begin-user-doc -->
795                 * <!-- end-user-doc -->
796                 * @generated
797                 */
798                public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
799                        super(adapterFactory);
800                }
801 
802                /**
803                 * <!-- begin-user-doc -->
804                 * <!-- end-user-doc -->
805                 * @generated
806                 */
807                @Override
808                public Object [] getElements(Object object) {
809                        Object parent = super.getParent(object);
810                        return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
811                }
812 
813                /**
814                 * <!-- begin-user-doc -->
815                 * <!-- end-user-doc -->
816                 * @generated
817                 */
818                @Override
819                public Object [] getChildren(Object object) {
820                        Object parent = super.getParent(object);
821                        return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
822                }
823 
824                /**
825                 * <!-- begin-user-doc -->
826                 * <!-- end-user-doc -->
827                 * @generated
828                 */
829                @Override
830                public boolean hasChildren(Object object) {
831                        Object parent = super.getParent(object);
832                        return parent != null;
833                }
834 
835                /**
836                 * <!-- begin-user-doc -->
837                 * <!-- end-user-doc -->
838                 * @generated
839                 */
840                @Override
841                public Object getParent(Object object) {
842                        return null;
843                }
844        }
845 
846        /**
847         * <!-- begin-user-doc -->
848         * <!-- end-user-doc -->
849         * @generated
850         */
851        public void setCurrentViewerPane(ViewerPane viewerPane) {
852                if (currentViewerPane != viewerPane) {
853                        if (currentViewerPane != null) {
854                                currentViewerPane.showFocus(false);
855                        }
856                        currentViewerPane = viewerPane;
857                }
858                setCurrentViewer(currentViewerPane.getViewer());
859        }
860 
861        /**
862         * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
863         * is the current one.
864         * <!-- begin-user-doc -->
865         * <!-- end-user-doc -->
866         * @generated
867         */
868        public void setCurrentViewer(Viewer viewer) {
869                // If it is changing...
870                //
871                if (currentViewer != viewer) {
872                        if (selectionChangedListener == null) {
873                                // Create the listener on demand.
874                                //
875                                selectionChangedListener =
876                                        new ISelectionChangedListener() {
877                                                // This just notifies those things that are affected by the section.
878                                                //
879                                                public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
880                                                        setSelection(selectionChangedEvent.getSelection());
881                                                }
882                                        };
883                        }
884 
885                        // Stop listening to the old one.
886                        //
887                        if (currentViewer != null) {
888                                currentViewer.removeSelectionChangedListener(selectionChangedListener);
889                        }
890 
891                        // Start listening to the new one.
892                        //
893                        if (viewer != null) {
894                                viewer.addSelectionChangedListener(selectionChangedListener);
895                        }
896 
897                        // Remember it.
898                        //
899                        currentViewer = viewer;
900 
901                        // Set the editors selection based on the current viewer's selection.
902                        //
903                        setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
904                }
905        }
906 
907        /**
908         * This returns the viewer as required by the {@link IViewerProvider} interface.
909         * <!-- begin-user-doc -->
910         * <!-- end-user-doc -->
911         * @generated
912         */
913        public Viewer getViewer() {
914                return currentViewer;
915        }
916 
917        /**
918         * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
919         * <!-- begin-user-doc -->
920         * <!-- end-user-doc -->
921         * @generated
922         */
923        protected void createContextMenuFor(StructuredViewer viewer) {
924                MenuManager contextMenu = new MenuManager("#PopUp");
925                contextMenu.add(new Separator("additions"));
926                contextMenu.setRemoveAllWhenShown(true);
927                contextMenu.addMenuListener(this);
928                Menu menu= contextMenu.createContextMenu(viewer.getControl());
929                viewer.getControl().setMenu(menu);
930                getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
931 
932                int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
933                Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
934                viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
935                viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
936        }
937 
938        /**
939         * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
940         * <!-- begin-user-doc -->
941         * <!-- end-user-doc -->
942         * @generated
943         */
944        public void createModel() {
945                URI resourceURI = EditUIUtil.getURI(getEditorInput());
946                Exception exception = null;
947                Resource resource = null;
948                try {
949                        // Load the resource through the editing domain.
950                        //
951                        resource = editingDomain.getResourceSet().getResource(resourceURI, true);
952                }
953                catch (Exception e) {
954                        exception = e;
955                        resource = editingDomain.getResourceSet().getResource(resourceURI, false);
956                }
957 
958                Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
959                if (diagnostic.getSeverity() != Diagnostic.OK) {
960                        resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
961                }
962                editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
963        }
964 
965        /**
966         * Returns a diagnostic describing the errors and warnings listed in the resource
967         * and the specified exception (if any).
968         * <!-- begin-user-doc -->
969         * <!-- end-user-doc -->
970         * @generated
971         */
972        public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
973                if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
974                        BasicDiagnostic basicDiagnostic =
975                                new BasicDiagnostic
976                                        (Diagnostic.ERROR,
977                                         "de.uka.ipd.sdq.featuremodel.editor",
978                                         0,
979                                         getString("_UI_CreateModelError_message", resource.getURI()),
980                                         new Object [] { exception == null ? (Object)resource : exception });
981                        basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
982                        return basicDiagnostic;
983                }
984                else if (exception != null) {
985                        return
986                                new BasicDiagnostic
987                                        (Diagnostic.ERROR,
988                                         "de.uka.ipd.sdq.featuremodel.editor",
989                                         0,
990                                         getString("_UI_CreateModelError_message", resource.getURI()),
991                                         new Object[] { exception });
992                }
993                else {
994                        return Diagnostic.OK_INSTANCE;
995                }
996        }
997 
998        /**
999         * This is the method used by the framework to install your own controls.
1000         * <!-- begin-user-doc -->
1001         * <!-- end-user-doc -->
1002         * @generated
1003         */
1004        @Override
1005        public void createPages() {
1006                // Creates the model from the editor input
1007                //
1008                createModel();
1009 
1010                // Only creates the other pages if there is something that can be edited
1011                //
1012                if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
1013                        // Create a page for the selection tree view.
1014                        //
1015                        {
1016                                ViewerPane viewerPane =
1017                                        new ViewerPane(getSite().getPage(), featuremodelEditor.this) {
1018                                                @Override
1019                                                public Viewer createViewer(Composite composite) {
1020                                                        Tree tree = new Tree(composite, SWT.MULTI);
1021                                                        TreeViewer newTreeViewer = new TreeViewer(tree);
1022                                                        return newTreeViewer;
1023                                                }
1024                                                @Override
1025                                                public void requestActivation() {
1026                                                        super.requestActivation();
1027                                                        setCurrentViewerPane(this);
1028                                                }
1029                                        };
1030                                viewerPane.createControl(getContainer());
1031 
1032                                selectionViewer = (TreeViewer)viewerPane.getViewer();
1033                                selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
1034 
1035                                selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
1036                                selectionViewer.setInput(editingDomain.getResourceSet());
1037                                selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
1038                                viewerPane.setTitle(editingDomain.getResourceSet());
1039 
1040                                new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
1041 
1042                                createContextMenuFor(selectionViewer);
1043                                int pageIndex = addPage(viewerPane.getControl());
1044                                setPageText(pageIndex, getString("_UI_SelectionPage_label"));
1045                        }
1046 
1047                        // Create a page for the parent tree view.
1048                        //
1049                        {
1050                                ViewerPane viewerPane =
1051                                        new ViewerPane(getSite().getPage(), featuremodelEditor.this) {
1052                                                @Override
1053                                                public Viewer createViewer(Composite composite) {
1054                                                        Tree tree = new Tree(composite, SWT.MULTI);
1055                                                        TreeViewer newTreeViewer = new TreeViewer(tree);
1056                                                        return newTreeViewer;
1057                                                }
1058                                                @Override
1059                                                public void requestActivation() {
1060                                                        super.requestActivation();
1061                                                        setCurrentViewerPane(this);
1062                                                }
1063                                        };
1064                                viewerPane.createControl(getContainer());
1065 
1066                                parentViewer = (TreeViewer)viewerPane.getViewer();
1067                                parentViewer.setAutoExpandLevel(30);
1068                                parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
1069                                parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
1070 
1071                                createContextMenuFor(parentViewer);
1072                                int pageIndex = addPage(viewerPane.getControl());
1073                                setPageText(pageIndex, getString("_UI_ParentPage_label"));
1074                        }
1075 
1076                        // This is the page for the list viewer
1077                        //
1078                        {
1079                                ViewerPane viewerPane =
1080                                        new ViewerPane(getSite().getPage(), featuremodelEditor.this) {
1081                                                @Override
1082                                                public Viewer createViewer(Composite composite) {
1083                                                        return new ListViewer(composite);
1084                                                }
1085                                                @Override
1086                                                public void requestActivation() {
1087                                                        super.requestActivation();
1088                                                        setCurrentViewerPane(this);
1089                                                }
1090                                        };
1091                                viewerPane.createControl(getContainer());
1092                                listViewer = (ListViewer)viewerPane.getViewer();
1093                                listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
1094                                listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
1095 
1096                                createContextMenuFor(listViewer);
1097                                int pageIndex = addPage(viewerPane.getControl());
1098                                setPageText(pageIndex, getString("_UI_ListPage_label"));
1099                        }
1100 
1101                        // This is the page for the tree viewer
1102                        //
1103                        {
1104                                ViewerPane viewerPane =
1105                                        new ViewerPane(getSite().getPage(), featuremodelEditor.this) {
1106                                                @Override
1107                                                public Viewer createViewer(Composite composite) {
1108                                                        return new TreeViewer(composite);
1109                                                }
1110                                                @Override
1111                                                public void requestActivation() {
1112                                                        super.requestActivation();
1113                                                        setCurrentViewerPane(this);
1114                                                }
1115                                        };
1116                                viewerPane.createControl(getContainer());
1117                                treeViewer = (TreeViewer)viewerPane.getViewer();
1118                                treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
1119                                treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
1120 
1121                                new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
1122 
1123                                createContextMenuFor(treeViewer);
1124                                int pageIndex = addPage(viewerPane.getControl());
1125                                setPageText(pageIndex, getString("_UI_TreePage_label"));
1126                        }
1127 
1128                        // This is the page for the table viewer.
1129                        //
1130                        {
1131                                ViewerPane viewerPane =
1132                                        new ViewerPane(getSite().getPage(), featuremodelEditor.this) {
1133                                                @Override
1134                                                public Viewer createViewer(Composite composite) {
1135                                                        return new TableViewer(composite);
1136                                                }
1137                                                @Override
1138                                                public void requestActivation() {
1139                                                        super.requestActivation();
1140                                                        setCurrentViewerPane(this);
1141                                                }
1142                                        };
1143                                viewerPane.createControl(getContainer());
1144                                tableViewer = (TableViewer)viewerPane.getViewer();
1145 
1146                                Table table = tableViewer.getTable();
1147                                TableLayout layout = new TableLayout();
1148                                table.setLayout(layout);
1149                                table.setHeaderVisible(true);
1150                                table.setLinesVisible(true);
1151 
1152                                TableColumn objectColumn = new TableColumn(table, SWT.NONE);
1153                                layout.addColumnData(new ColumnWeightData(3, 100, true));
1154                                objectColumn.setText(getString("_UI_ObjectColumn_label"));
1155                                objectColumn.setResizable(true);
1156 
1157                                TableColumn selfColumn = new TableColumn(table, SWT.NONE);
1158                                layout.addColumnData(new ColumnWeightData(2, 100, true));
1159                                selfColumn.setText(getString("_UI_SelfColumn_label"));
1160                                selfColumn.setResizable(true);
1161 
1162                                tableViewer.setColumnProperties(new String [] {"a", "b"});
1163                                tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
1164                                tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
1165 
1166                                createContextMenuFor(tableViewer);
1167                                int pageIndex = addPage(viewerPane.getControl());
1168                                setPageText(pageIndex, getString("_UI_TablePage_label"));
1169                        }
1170 
1171                        // This is the page for the table tree viewer.
1172                        //
1173                        {
1174                                ViewerPane viewerPane =
1175                                        new ViewerPane(getSite().getPage(), featuremodelEditor.this) {
1176                                                @Override
1177                                                public Viewer createViewer(Composite composite) {
1178                                                        return new TreeViewer(composite);
1179                                                }
1180                                                @Override
1181                                                public void requestActivation() {
1182                                                        super.requestActivation();
1183                                                        setCurrentViewerPane(this);
1184                                                }
1185                                        };
1186                                viewerPane.createControl(getContainer());
1187 
1188                                treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
1189 
1190                                Tree tree = treeViewerWithColumns.getTree();
1191                                tree.setLayoutData(new FillLayout());
1192                                tree.setHeaderVisible(true);
1193                                tree.setLinesVisible(true);
1194 
1195                                TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
1196                                objectColumn.setText(getString("_UI_ObjectColumn_label"));
1197                                objectColumn.setResizable(true);
1198                                objectColumn.setWidth(250);
1199 
1200                                TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
1201                                selfColumn.setText(getString("_UI_SelfColumn_label"));
1202                                selfColumn.setResizable(true);
1203                                selfColumn.setWidth(200);
1204 
1205                                treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
1206                                treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
1207                                treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
1208 
1209                                createContextMenuFor(treeViewerWithColumns);
1210                                int pageIndex = addPage(viewerPane.getControl());
1211                                setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
1212                        }
1213 
1214                        getSite().getShell().getDisplay().asyncExec
1215                                (new Runnable() {
1216                                         public void run() {
1217                                                 setActivePage(0);
1218                                         }
1219                                 });
1220                }
1221 
1222                // Ensures that this editor will only display the page's tab
1223                // area if there are more than one page
1224                //
1225                getContainer().addControlListener
1226                        (new ControlAdapter() {
1227                                boolean guard = false;
1228                                @Override
1229                                public void controlResized(ControlEvent event) {
1230                                        if (!guard) {
1231                                                guard = true;
1232                                                hideTabs();
1233                                                guard = false;
1234                                        }
1235                                }
1236                         });
1237 
1238                getSite().getShell().getDisplay().asyncExec
1239                        (new Runnable() {
1240                                 public void run() {
1241                                         updateProblemIndication();
1242                                 }
1243                         });
1244        }
1245 
1246        /**
1247         * If there is just one page in the multi-page editor part,
1248         * this hides the single tab at the bottom.
1249         * <!-- begin-user-doc -->
1250         * <!-- end-user-doc -->
1251         * @generated
1252         */
1253        protected void hideTabs() {
1254                if (getPageCount() <= 1) {
1255                        setPageText(0, "");
1256                        if (getContainer() instanceof CTabFolder) {
1257                                ((CTabFolder)getContainer()).setTabHeight(1);
1258                                Point point = getContainer().getSize();
1259                                getContainer().setSize(point.x, point.y + 6);
1260                        }
1261                }
1262        }
1263 
1264        /**
1265         * If there is more than one page in the multi-page editor part,
1266         * this shows the tabs at the bottom.
1267         * <!-- begin-user-doc -->
1268         * <!-- end-user-doc -->
1269         * @generated
1270         */
1271        protected void showTabs() {
1272                if (getPageCount() > 1) {
1273                        setPageText(0, getString("_UI_SelectionPage_label"));
1274                        if (getContainer() instanceof CTabFolder) {
1275                                ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
1276                                Point point = getContainer().getSize();
1277                                getContainer().setSize(point.x, point.y - 6);
1278                        }
1279                }
1280        }
1281 
1282        /**
1283         * This is used to track the active viewer.
1284         * <!-- begin-user-doc -->
1285         * <!-- end-user-doc -->
1286         * @generated
1287         */
1288        @Override
1289        protected void pageChange(int pageIndex) {
1290                super.pageChange(pageIndex);
1291 
1292                if (contentOutlinePage != null) {
1293                        handleContentOutlineSelection(contentOutlinePage.getSelection());
1294                }
1295        }
1296 
1297        /**
1298         * This is how the framework determines which interfaces we implement.
1299         * <!-- begin-user-doc -->
1300         * <!-- end-user-doc -->
1301         * @generated
1302         */
1303        @SuppressWarnings("unchecked")
1304        @Override
1305        public Object getAdapter(Class key) {
1306                if (key.equals(IContentOutlinePage.class)) {
1307                        return showOutlineView() ? getContentOutlinePage() : null;
1308                }
1309                else if (key.equals(IPropertySheetPage.class)) {
1310                        return getPropertySheetPage();
1311                }
1312                else if (key.equals(IGotoMarker.class)) {
1313                        return this;
1314                }
1315                else {
1316                        return super.getAdapter(key);
1317                }
1318        }
1319 
1320        /**
1321         * This accesses a cached version of the content outliner.
1322         * <!-- begin-user-doc -->
1323         * <!-- end-user-doc -->
1324         * @generated
1325         */
1326        public IContentOutlinePage getContentOutlinePage() {
1327                if (contentOutlinePage == null) {
1328                        // The content outline is just a tree.
1329                        //
1330                        class MyContentOutlinePage extends ContentOutlinePage {
1331                                @Override
1332                                public void createControl(Composite parent) {
1333                                        super.createControl(parent);
1334                                        contentOutlineViewer = getTreeViewer();
1335                                        contentOutlineViewer.addSelectionChangedListener(this);
1336 
1337                                        // Set up the tree viewer.
1338                                        //
1339                                        contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
1340                                        contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
1341                                        contentOutlineViewer.setInput(editingDomain.getResourceSet());
1342 
1343                                        // Make sure our popups work.
1344                                        //
1345                                        createContextMenuFor(contentOutlineViewer);
1346 
1347                                        if (!editingDomain.getResourceSet().getResources().isEmpty()) {
1348                                          // Select the root object in the view.
1349                                          //
1350                                          contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
1351                                        }
1352                                }
1353 
1354                                @Override
1355                                public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
1356                                        super.makeContributions(menuManager, toolBarManager, statusLineManager);
1357                                        contentOutlineStatusLineManager = statusLineManager;
1358                                }
1359 
1360                                @Override
1361                                public void setActionBars(IActionBars actionBars) {
1362                                        super.setActionBars(actionBars);
1363                                        getActionBarContributor().shareGlobalActions(this, actionBars);
1364                                }
1365                        }
1366 
1367                        contentOutlinePage = new MyContentOutlinePage();
1368 
1369                        // Listen to selection so that we can handle it is a special way.
1370                        //
1371                        contentOutlinePage.addSelectionChangedListener
1372                                (new ISelectionChangedListener() {
1373                                         // This ensures that we handle selections correctly.
1374                                         //
1375                                         public void selectionChanged(SelectionChangedEvent event) {
1376                                                 handleContentOutlineSelection(event.getSelection());
1377                                         }
1378                                 });
1379                }
1380 
1381                return contentOutlinePage;
1382        }
1383 
1384        /**
1385         * This accesses a cached version of the property sheet.
1386         * <!-- begin-user-doc -->
1387         * <!-- end-user-doc -->
1388         * @generated
1389         */
1390        public IPropertySheetPage getPropertySheetPage() {
1391                if (propertySheetPage == null) {
1392                        propertySheetPage =
1393                                new ExtendedPropertySheetPage(editingDomain) {
1394                                        @Override
1395                                        public void setSelectionToViewer(List<?> selection) {
1396                                                featuremodelEditor.this.setSelectionToViewer(selection);
1397                                                featuremodelEditor.this.setFocus();
1398                                        }
1399 
1400                                        @Override
1401                                        public void setActionBars(IActionBars actionBars) {
1402                                                super.setActionBars(actionBars);
1403                                                getActionBarContributor().shareGlobalActions(this, actionBars);
1404                                        }
1405                                };
1406                        propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
1407                }
1408 
1409                return propertySheetPage;
1410        }
1411 
1412        /**
1413         * This deals with how we want selection in the outliner to affect the other views.
1414         * <!-- begin-user-doc -->
1415         * <!-- end-user-doc -->
1416         * @generated
1417         */
1418        public void handleContentOutlineSelection(ISelection selection) {
1419                if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
1420                        Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
1421                        if (selectedElements.hasNext()) {
1422                                // Get the first selected element.
1423                                //
1424                                Object selectedElement = selectedElements.next();
1425 
1426                                // If it's the selection viewer, then we want it to select the same selection as this selection.
1427                                //
1428                                if (currentViewerPane.getViewer() == selectionViewer) {
1429                                        ArrayList<Object> selectionList = new ArrayList<Object>();
1430                                        selectionList.add(selectedElement);
1431                                        while (selectedElements.hasNext()) {
1432                                                selectionList.add(selectedElements.next());
1433                                        }
1434 
1435                                        // Set the selection to the widget.
1436                                        //
1437                                        selectionViewer.setSelection(new StructuredSelection(selectionList));
1438                                }
1439                                else {
1440                                        // Set the input to the widget.
1441                                        //
1442                                        if (currentViewerPane.getViewer().getInput() != selectedElement) {
1443                                                currentViewerPane.getViewer().setInput(selectedElement);
1444                                                currentViewerPane.setTitle(selectedElement);
1445                                        }
1446                                }
1447                        }
1448                }
1449        }
1450 
1451        /**
1452         * This is for implementing {@link IEditorPart} and simply tests the command stack.
1453         * <!-- begin-user-doc -->
1454         * <!-- end-user-doc -->
1455         * @generated
1456         */
1457        @Override
1458        public boolean isDirty() {
1459                return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
1460        }
1461 
1462        /**
1463         * This is for implementing {@link IEditorPart} and simply saves the model file.
1464         * <!-- begin-user-doc -->
1465         * <!-- end-user-doc -->
1466         * @generated
1467         */
1468        @Override
1469        public void doSave(IProgressMonitor progressMonitor) {
1470                // Save only resources that have actually changed.
1471                //
1472                final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
1473                saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
1474 
1475                // Do the work within an operation because this is a long running activity that modifies the workbench.
1476                //
1477                WorkspaceModifyOperation operation =
1478                        new WorkspaceModifyOperation() {
1479                                // This is the method that gets invoked when the operation runs.
1480                                //
1481                                @Override
1482                                public void execute(IProgressMonitor monitor) {
1483                                        // Save the resources to the file system.
1484                                        //
1485                                        boolean first = true;
1486                                        for (Resource resource : editingDomain.getResourceSet().getResources()) {
1487                                                if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
1488                                                        try {
1489                                                                long timeStamp = resource.getTimeStamp();
1490                                                                resource.save(saveOptions);
1491                                                                if (resource.getTimeStamp() != timeStamp) {
1492                                                                        savedResources.add(resource);
1493                                                                }
1494                                                        }
1495                                                        catch (Exception exception) {
1496                                                                resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
1497                                                        }
1498                                                        first = false;
1499                                                }
1500                                        }
1501                                }
1502                        };
1503 
1504                updateProblemIndication = false;
1505                try {
1506                        // This runs the options, and shows progress.
1507                        //
1508                        new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
1509 
1510                        // Refresh the necessary state.
1511                        //
1512                        ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
1513                        firePropertyChange(IEditorPart.PROP_DIRTY);
1514                }
1515                catch (Exception exception) {
1516                        // Something went wrong that shouldn't.
1517                        //
1518                        FeaturemodelEditorPlugin.INSTANCE.log(exception);
1519                }
1520                updateProblemIndication = true;
1521                updateProblemIndication();
1522        }
1523 
1524        /**
1525         * This returns whether something has been persisted to the URI of the specified resource.
1526         * The implementation uses the URI converter from the editor's resource set to try to open an input stream. 
1527         * <!-- begin-user-doc -->
1528         * <!-- end-user-doc -->
1529         * @generated
1530         */
1531        protected boolean isPersisted(Resource resource) {
1532                boolean result = false;
1533                try {
1534                        InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
1535                        if (stream != null) {
1536                                result = true;
1537                                stream.close();
1538                        }
1539                }
1540                catch (IOException e) {
1541                        // Ignore
1542                }
1543                return result;
1544        }
1545 
1546        /**
1547         * This always returns true because it is not currently supported.
1548         * <!-- begin-user-doc -->
1549         * <!-- end-user-doc -->
1550         * @generated
1551         */
1552        @Override
1553        public boolean isSaveAsAllowed() {
1554                return true;
1555        }
1556 
1557        /**
1558         * This also changes the editor's input.
1559         * <!-- begin-user-doc -->
1560         * <!-- end-user-doc -->
1561         * @generated
1562         */
1563        @Override
1564        public void doSaveAs() {
1565                SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
1566                saveAsDialog.open();
1567                IPath path = saveAsDialog.getResult();
1568                if (path != null) {
1569                        IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
1570                        if (file != null) {
1571                                doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
1572                        }
1573                }
1574        }
1575 
1576        /**
1577         * <!-- begin-user-doc -->
1578         * <!-- end-user-doc -->
1579         * @generated
1580         */
1581        protected void doSaveAs(URI uri, IEditorInput editorInput) {
1582                (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
1583                setInputWithNotify(editorInput);
1584                setPartName(editorInput.getName());
1585                IProgressMonitor progressMonitor =
1586                        getActionBars().getStatusLineManager() != null ?
1587                                getActionBars().getStatusLineManager().getProgressMonitor() :
1588                                new NullProgressMonitor();
1589                doSave(progressMonitor);
1590        }
1591 
1592        /**
1593         * <!-- begin-user-doc -->
1594         * <!-- end-user-doc -->
1595         * @generated
1596         */
1597        public void gotoMarker(IMarker marker) {
1598                try {
1599                        if (marker.getType().equals(EValidator.MARKER)) {
1600                                String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
1601                                if (uriAttribute != null) {
1602                                        URI uri = URI.createURI(uriAttribute);
1603                                        EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
1604                                        if (eObject != null) {
1605                                          setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
1606                                        }
1607                                }
1608                        }
1609                }
1610                catch (CoreException exception) {
1611                        FeaturemodelEditorPlugin.INSTANCE.log(exception);
1612                }
1613        }
1614 
1615        /**
1616         * This is called during startup.
1617         * <!-- begin-user-doc -->
1618         * <!-- end-user-doc -->
1619         * @generated
1620         */
1621        @Override
1622        public void init(IEditorSite site, IEditorInput editorInput) {
1623                setSite(site);
1624                setInputWithNotify(editorInput);
1625                setPartName(editorInput.getName());
1626                site.setSelectionProvider(this);
1627                site.getPage().addPartListener(partListener);
1628                ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
1629        }
1630 
1631        /**
1632         * <!-- begin-user-doc -->
1633         * <!-- end-user-doc -->
1634         * @generated
1635         */
1636        @Override
1637        public void setFocus() {
1638                if (currentViewerPane != null) {
1639                        currentViewerPane.setFocus();
1640                }
1641                else {
1642                        getControl(getActivePage()).setFocus();
1643                }
1644        }
1645 
1646        /**
1647         * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
1648         * <!-- begin-user-doc -->
1649         * <!-- end-user-doc -->
1650         * @generated
1651         */
1652        public void addSelectionChangedListener(ISelectionChangedListener listener) {
1653                selectionChangedListeners.add(listener);
1654        }
1655 
1656        /**
1657         * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
1658         * <!-- begin-user-doc -->
1659         * <!-- end-user-doc -->
1660         * @generated
1661         */
1662        public void removeSelectionChangedListener(ISelectionChangedListener listener) {
1663                selectionChangedListeners.remove(listener);
1664        }
1665 
1666        /**
1667         * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
1668         * <!-- begin-user-doc -->
1669         * <!-- end-user-doc -->
1670         * @generated
1671         */
1672        public ISelection getSelection() {
1673                return editorSelection;
1674        }
1675 
1676        /**
1677         * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
1678         * Calling this result will notify the listeners.
1679         * <!-- begin-user-doc -->
1680         * <!-- end-user-doc -->
1681         * @generated
1682         */
1683        public void setSelection(ISelection selection) {
1684                editorSelection = selection;
1685 
1686                for (ISelectionChangedListener listener : selectionChangedListeners) {
1687                        listener.selectionChanged(new SelectionChangedEvent(this, selection));
1688                }
1689                setStatusLineManager(selection);
1690        }
1691 
1692        /**
1693         * <!-- begin-user-doc -->
1694         * <!-- end-user-doc -->
1695         * @generated
1696         */
1697        public void setStatusLineManager(ISelection selection) {
1698                IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
1699                        contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
1700 
1701                if (statusLineManager != null) {
1702                        if (selection instanceof IStructuredSelection) {
1703                                Collection<?> collection = ((IStructuredSelection)selection).toList();
1704                                switch (collection.size()) {
1705                                        case 0: {
1706                                                statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
1707                                                break;
1708                                        }
1709                                        case 1: {
1710                                                String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
1711                                                statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
1712                                                break;
1713                                        }
1714                                        default: {
1715                                                statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
1716                                                break;
1717                                        }
1718                                }
1719                        }
1720                        else {
1721                                statusLineManager.setMessage("");
1722                        }
1723                }
1724        }
1725 
1726        /**
1727         * This looks up a string in the plugin's plugin.properties file.
1728         * <!-- begin-user-doc -->
1729         * <!-- end-user-doc -->
1730         * @generated
1731         */
1732        private static String getString(String key) {
1733                return FeaturemodelEditorPlugin.INSTANCE.getString(key);
1734        }
1735 
1736        /**
1737         * This looks up a string in plugin.properties, making a substitution.
1738         * <!-- begin-user-doc -->
1739         * <!-- end-user-doc -->
1740         * @generated
1741         */
1742        private static String getString(String key, Object s1) {
1743                return FeaturemodelEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
1744        }
1745 
1746        /**
1747         * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
1748         * <!-- begin-user-doc -->
1749         * <!-- end-user-doc -->
1750         * @generated
1751         */
1752        public void menuAboutToShow(IMenuManager menuManager) {
1753                ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
1754        }
1755 
1756        /**
1757         * <!-- begin-user-doc -->
1758         * <!-- end-user-doc -->
1759         * @generated
1760         */
1761        public EditingDomainActionBarContributor getActionBarContributor() {
1762                return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
1763        }
1764 
1765        /**
1766         * <!-- begin-user-doc -->
1767         * <!-- end-user-doc -->
1768         * @generated
1769         */
1770        public IActionBars getActionBars() {
1771                return getActionBarContributor().getActionBars();
1772        }
1773 
1774        /**
1775         * <!-- begin-user-doc -->
1776         * <!-- end-user-doc -->
1777         * @generated
1778         */
1779        public AdapterFactory getAdapterFactory() {
1780                return adapterFactory;
1781        }
1782 
1783        /**
1784         * <!-- begin-user-doc -->
1785         * <!-- end-user-doc -->
1786         * @generated
1787         */
1788        @Override
1789        public void dispose() {
1790                updateProblemIndication = false;
1791 
1792                ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
1793 
1794                getSite().getPage().removePartListener(partListener);
1795 
1796                adapterFactory.dispose();
1797 
1798                if (getActionBarContributor().getActiveEditor() == this) {
1799                        getActionBarContributor().setActiveEditor(null);
1800                }
1801 
1802                if (propertySheetPage != null) {
1803                        propertySheetPage.dispose();
1804                }
1805 
1806                if (contentOutlinePage != null) {
1807                        contentOutlinePage.dispose();
1808                }
1809 
1810                super.dispose();
1811        }
1812 
1813        /**
1814         * Returns whether the outline view should be presented to the user.
1815         * <!-- begin-user-doc -->
1816         * <!-- end-user-doc -->
1817         * @generated
1818         */
1819        protected boolean showOutlineView() {
1820                return true;
1821        }
1822}

[all classes][de.uka.ipd.sdq.featuremodel.presentation]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov