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
Fields Modifier and Type Field Description protected Compositecompprotected IContentOutlinePagecontentOutlinePageprotected TreeViewercontentOutlineViewerprotected FeatureConfigdefaultConfigprotected booleandirtyFlagprotected AdapterFactoryEditingDomaineditingDomainprotected ISelectioneditorSelectionprotected FeatureDiagramfeatureDiagramprotected FeatureConfigFunctionalityfunctionsprotected ICheckStateListenerlistenerprotected FeatureConfigoverridesConfigprotected PropertySheetPagepropertySheetPageprotected Resourceresourceprotected Objectrootprotected ISelectionChangedListenerselectionChangedListenerprotected CheckboxTreeViewertreeViewer-
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
Constructors Constructor Description FeatureModelInstanceEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelectionChangedListener(ISelectionChangedListener listener)protected voidcreateContextMenuFor(StructuredViewer viewer)protected voidcreateEditor()Creates 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 voidcreatePages()protected 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)EditingDomainActionBarContributorgetActionBarContributor()EditingDomaingetEditingDomain()protected FeatureDiagramgetFeatureDiagram(Resource resource)Checks if the FeatureDiagram object can be accessed in the loaded resource and returns it if possibleprotected ResourcegetResource()ISelectiongetSelection()protected 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()booleanisSaveAsAllowed()voidremoveSelectionChangedListener(ISelectionChangedListener listener)voidsetSelection(ISelection selection)protected URIstartFileWizard(String fileName, String message)Starts a ResourceWizard to create a new Fileprotected URIstartOpenDialog(String fileName)Starts a LoadResourceDialog-
Methods 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 Detail
-
selectionChangedListener
protected ISelectionChangedListener selectionChangedListener
-
editorSelection
protected ISelection editorSelection
-
editingDomain
protected AdapterFactoryEditingDomain editingDomain
-
treeViewer
protected CheckboxTreeViewer treeViewer
-
propertySheetPage
protected PropertySheetPage propertySheetPage
-
listener
protected ICheckStateListener listener
-
resource
protected Resource resource
-
featureDiagram
protected FeatureDiagram featureDiagram
-
root
protected Object root
-
contentOutlineViewer
protected TreeViewer contentOutlineViewer
-
contentOutlinePage
protected IContentOutlinePage contentOutlinePage
-
dirtyFlag
protected boolean dirtyFlag
-
defaultConfig
protected FeatureConfig defaultConfig
-
overridesConfig
protected FeatureConfig overridesConfig
-
functions
protected FeatureConfigFunctionality functions
-
comp
protected Composite comp
-
-
Method Detail
-
addSelectionChangedListener
public void addSelectionChangedListener(ISelectionChangedListener listener)
- Specified by:
addSelectionChangedListenerin interfaceISelectionProvider
-
getSelection
public ISelection getSelection()
- Specified by:
getSelectionin interfaceISelectionProvider
-
removeSelectionChangedListener
public void removeSelectionChangedListener(ISelectionChangedListener listener)
- Specified by:
removeSelectionChangedListenerin interfaceISelectionProvider
-
setSelection
public void setSelection(ISelection selection)
- Specified by:
setSelectionin interfaceISelectionProvider
-
firePropertyChange
protected void firePropertyChange(int action)
- Overrides:
firePropertyChangein classWorkbenchPart
-
getEditingDomain
public EditingDomain getEditingDomain()
- Specified by:
getEditingDomainin interfaceIEditingDomainProvider
-
createContextMenuFor
protected void createContextMenuFor(StructuredViewer viewer)
-
fillContextMenu
protected void fillContextMenu(IMenuManager manager)
-
getActionBarContributor
public EditingDomainActionBarContributor getActionBarContributor()
- Generated class or method.
-
init
public void init(IEditorSite site, IEditorInput input) throws PartInitException
- Specified by:
initin interfaceIEditorPart- Overrides:
initin classMultiPageEditorPart- Throws:
PartInitException
-
createResource
protected void createResource(URI uri)
Loads the resource-object through the editingDomain
-
getResource
protected Resource getResource()
- Returns:
- Returns the resource-object
-
startFileWizard
protected URI startFileWizard(String fileName, String message)
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
protected URI startOpenDialog(String fileName)
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
protected FeatureDiagram getFeatureDiagram(Resource resource)
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
protected void handleFileCases(String fileExtension, String path, String fileName)
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
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.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
public void createViewer(FeatureDiagram root)
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
public void doSave(IProgressMonitor progressMonitor)
- Specified by:
doSavein interfaceISaveablePart- Specified by:
doSavein classEditorPart
-
doSaveAs
public void doSaveAs()
- Specified by:
doSaveAsin interfaceISaveablePart- Specified by:
doSaveAsin classEditorPart
-
doSaveAs
protected void doSaveAs(URI uri, IEditorInput editorInput)
- Generated class or method.
-
isSaveAsAllowed
public boolean isSaveAsAllowed()
- Specified by:
isSaveAsAllowedin interfaceISaveablePart- Specified by:
isSaveAsAllowedin classEditorPart
-
-