Package de.uka.ipd.sdq.featureinstance
Class FeatureModelInstanceEditor
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.ui.part.MultiPageEditorPart
de.uka.ipd.sdq.featureinstance.FeatureModelInstanceEditor
- All Implemented Interfaces:
IAdaptable
,IExecutableExtension
,IEditingDomainProvider
,IPageChangeProvider
,ISelectionProvider
,IEditorPart
,ISaveablePart
,IWorkbenchPart
,IWorkbenchPart2
,IWorkbenchPart3
,IWorkbenchPartOrientation
public class FeatureModelInstanceEditor
extends MultiPageEditorPart
implements ISelectionProvider, IEditingDomainProvider
-
Field Summary
Modifier and TypeFieldDescriptionprotected Composite
protected IContentOutlinePage
protected TreeViewer
protected FeatureConfig
protected boolean
protected AdapterFactoryEditingDomain
protected ISelection
protected FeatureDiagram
protected FeatureConfigFunctionality
protected ICheckStateListener
protected FeatureConfig
protected PropertySheetPage
protected Resource
protected Object
protected ISelectionChangedListener
protected CheckboxTreeViewer
Fields inherited from class org.eclipse.ui.part.MultiPageEditorPart
PAGE_CONTAINER_SITE
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
createContextMenuFor
(StructuredViewer viewer) protected void
Creates the editor layout and contentprotected void
createNewConfigResource
(URI newResourceURI, FeatureDiagram featureDiagram, FeatureConfig defaultRef) Creates a new Configuration-Resource with the given newResourceURI corresponding to the given featureDiagram Overrides the old (*.featuremodel) resource-objectprotected void
protected void
createResource
(URI uri) Loads the resource-object through the editingDomainvoid
createViewer
(FeatureDiagram root) Creates a treeViewer of the given FeatureDiagramvoid
doSave
(IProgressMonitor progressMonitor) void
doSaveAs()
protected void
doSaveAs
(URI uri, IEditorInput editorInput) protected void
fillContextMenu
(IMenuManager manager) protected void
firePropertyChange
(int action) protected FeatureDiagram
getFeatureDiagram
(Resource resource) Checks if the FeatureDiagram object can be accessed in the loaded resource and returns it if possibleprotected Resource
protected Resource
handleConfigCases
(Resource resource) Handles the different cases for a loaded *.featuremodel-resource http://sdqweb.ipd.uka.de/mediawiki/images/6/61/Check_Cases.pngprotected void
handleFileCases
(String fileExtension, String path, String fileName) Handles the different file types for the loaded resource.void
init
(IEditorSite site, IEditorInput input) boolean
isDirty()
boolean
void
void
setSelection
(ISelection selection) protected URI
startFileWizard
(String fileName, String message) Starts a ResourceWizard to create a new Fileprotected URI
startOpenDialog
(String fileName) Starts a LoadResourceDialogMethods inherited from class org.eclipse.ui.part.MultiPageEditorPart
activateSite, addPage, addPage, addPage, addPage, addPageChangedListener, createContainer, createItem, createPageContainer, createPartControl, createSite, deactivateSite, dispose, findEditors, getActiveEditor, getActivePage, getAdapter, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageSite, getPageText, getSelectedPage, handlePropertyChange, initializePageSwitching, pageChange, removePage, removePageChangedListener, setActiveEditor, setActivePage, setControl, setFocus, setPageImage, setPageText
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
-
Field Details
-
selectionChangedListener
-
editorSelection
-
editingDomain
-
treeViewer
-
propertySheetPage
-
listener
-
resource
-
featureDiagram
-
root
-
contentOutlineViewer
-
contentOutlinePage
-
dirtyFlag
protected boolean dirtyFlag -
defaultConfig
-
overridesConfig
-
functions
-
comp
-
-
Constructor Details
-
FeatureModelInstanceEditor
public FeatureModelInstanceEditor()
-
-
Method Details
-
addSelectionChangedListener
- Specified by:
addSelectionChangedListener
in interfaceISelectionProvider
-
getSelection
- Specified by:
getSelection
in interfaceISelectionProvider
-
removeSelectionChangedListener
- Specified by:
removeSelectionChangedListener
in interfaceISelectionProvider
-
setSelection
- Specified by:
setSelection
in interfaceISelectionProvider
-
firePropertyChange
protected void firePropertyChange(int action) - Overrides:
firePropertyChange
in classWorkbenchPart
-
getEditingDomain
- Specified by:
getEditingDomain
in interfaceIEditingDomainProvider
-
createContextMenuFor
-
fillContextMenu
-
getActionBarContributor
- Generated class or method.
-
init
- Specified by:
init
in interfaceIEditorPart
- Overrides:
init
in classMultiPageEditorPart
- Throws:
PartInitException
-
createResource
Loads the resource-object through the editingDomain -
getResource
- Returns:
- Returns the resource-object
-
startFileWizard
Starts a ResourceWizard to create a new File- Parameters:
fileName
- The default filename- Returns:
- Returns the URI of the new file or null, if dialog was cancelled
-
startOpenDialog
Starts a LoadResourceDialog- Parameters:
fileName
- The default filename- Returns:
- Returns the URI selected by the user in the dialog or null if no file was selected or the dialog cancelled
-
createNewConfigResource
protected void createNewConfigResource(URI newResourceURI, FeatureDiagram featureDiagram, FeatureConfig defaultRef) Creates a new Configuration-Resource with the given newResourceURI corresponding to the given featureDiagram Overrides the old (*.featuremodel) resource-object- Parameters:
newResourceURI
- The URI for the new ResourcefeatureDiagram
- A FeatureDiagram-object to which the new Configuration should referencedefaultRef
- A reference to the defaultConfig object or null, if none exists
-
getFeatureDiagram
Checks if the FeatureDiagram object can be accessed in the loaded resource and returns it if possible- Parameters:
resource
- The resource from which the FeatureDiagram-object can be accessed (a *.featuremodel-file)- Returns:
- Returns a FeatureDiagram-object or null, if it can be accessed (e.g. no *.featuremodel-file)
-
handleFileCases
Handles the different file types for the loaded resource.- Parameters:
fileExtension
- The file extension of the loaded resourcepath
- The complete path to the file including the fileNamefileName
- The filename
-
handleConfigCases
Handles the different cases for a loaded *.featuremodel-resource http://sdqweb.ipd.uka.de/mediawiki/images/6/61/Check_Cases.png- Parameters:
resource
- The resource in which the configuration object should be stored- Returns:
- The resource object which stores the (prop. new) overrides config object
-
createPages
protected void createPages()- Specified by:
createPages
in classMultiPageEditorPart
-
createEditor
protected void createEditor()Creates the editor layout and content -
createViewer
Creates a treeViewer of the given FeatureDiagram- Parameters:
root
- The FeatureDiagram-object which shall be displayed
-
isDirty
public boolean isDirty()- Specified by:
isDirty
in interfaceISaveablePart
- Overrides:
isDirty
in classMultiPageEditorPart
-
doSave
- Specified by:
doSave
in interfaceISaveablePart
- Specified by:
doSave
in classEditorPart
-
doSaveAs
public void doSaveAs()- Specified by:
doSaveAs
in interfaceISaveablePart
- Specified by:
doSaveAs
in classEditorPart
-
doSaveAs
- Generated class or method.
-
isSaveAsAllowed
public boolean isSaveAsAllowed()- Specified by:
isSaveAsAllowed
in interfaceISaveablePart
- Specified by:
isSaveAsAllowed
in classEditorPart
-