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
FieldsModifier and TypeFieldDescriptionprotected Compositeprotected IContentOutlinePageprotected TreeViewerprotected FeatureConfigprotected booleanprotected AdapterFactoryEditingDomainprotected ISelectionprotected FeatureDiagramprotected FeatureConfigFunctionalityprotected ICheckStateListenerprotected FeatureConfigprotected PropertySheetPageprotected Resourceprotected Objectprotected ISelectionChangedListenerprotected CheckboxTreeViewerFields inherited from class org.eclipse.ui.part.MultiPageEditorPart
PAGE_CONTAINER_SITEFields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUTFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidcreateContextMenuFor(StructuredViewer viewer) protected voidCreates the editor layout and contentprotected voidcreateNewConfigResource(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 voidprotected voidcreateResource(URI uri) Loads the resource-object through the editingDomainvoidcreateViewer(FeatureDiagram root) Creates a treeViewer of the given FeatureDiagramvoiddoSave(IProgressMonitor progressMonitor) voiddoSaveAs()protected voiddoSaveAs(URI uri, IEditorInput editorInput) protected voidfillContextMenu(IMenuManager manager) protected voidfirePropertyChange(int action) protected FeatureDiagramgetFeatureDiagram(Resource resource) Checks if the FeatureDiagram object can be accessed in the loaded resource and returns it if possibleprotected Resourceprotected ResourcehandleConfigCases(Resource resource) Handles the different cases for a loaded *.featuremodel-resource http://sdqweb.ipd.uka.de/mediawiki/images/6/61/Check_Cases.pngprotected voidhandleFileCases(String fileExtension, String path, String fileName) Handles the different file types for the loaded resource.voidinit(IEditorSite site, IEditorInput input) booleanisDirty()booleanvoidvoidsetSelection(ISelection selection) protected URIstartFileWizard(String fileName, String message) Starts a ResourceWizard to create a new Fileprotected URIstartOpenDialog(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, setPageTextMethods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartNameMethods 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, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
addSelectionChangedListenerin interfaceISelectionProvider
-
getSelection
- Specified by:
getSelectionin interfaceISelectionProvider
-
removeSelectionChangedListener
- Specified by:
removeSelectionChangedListenerin interfaceISelectionProvider
-
setSelection
- Specified by:
setSelectionin interfaceISelectionProvider
-
firePropertyChange
protected void firePropertyChange(int action) - Overrides:
firePropertyChangein classWorkbenchPart
-
getEditingDomain
- Specified by:
getEditingDomainin interfaceIEditingDomainProvider
-
createContextMenuFor
-
fillContextMenu
-
getActionBarContributor
- Generated class or method.
-
init
- Specified by:
initin interfaceIEditorPart- Overrides:
initin 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:
createPagesin 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:
isDirtyin interfaceISaveablePart- Overrides:
isDirtyin classMultiPageEditorPart
-
doSave
- Specified by:
doSavein interfaceISaveablePart- Specified by:
doSavein classEditorPart
-
doSaveAs
public void doSaveAs()- Specified by:
doSaveAsin interfaceISaveablePart- Specified by:
doSaveAsin classEditorPart
-
doSaveAs
- Generated class or method.
-
isSaveAsAllowed
public boolean isSaveAsAllowed()- Specified by:
isSaveAsAllowedin interfaceISaveablePart- Specified by:
isSaveAsAllowedin classEditorPart
-