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 Composite
comp
protected IContentOutlinePage
contentOutlinePage
protected TreeViewer
contentOutlineViewer
protected FeatureConfig
defaultConfig
protected boolean
dirtyFlag
protected AdapterFactoryEditingDomain
editingDomain
protected ISelection
editorSelection
protected FeatureDiagram
featureDiagram
protected FeatureConfigFunctionality
functions
protected ICheckStateListener
listener
protected FeatureConfig
overridesConfig
protected PropertySheetPage
propertySheetPage
protected Resource
resource
protected Object
root
protected ISelectionChangedListener
selectionChangedListener
protected CheckboxTreeViewer
treeViewer
-
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 void
addSelectionChangedListener(ISelectionChangedListener listener)
protected void
createContextMenuFor(StructuredViewer viewer)
protected void
createEditor()
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
createPages()
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)
EditingDomainActionBarContributor
getActionBarContributor()
EditingDomain
getEditingDomain()
protected FeatureDiagram
getFeatureDiagram(Resource resource)
Checks if the FeatureDiagram object can be accessed in the loaded resource and returns it if possibleprotected Resource
getResource()
ISelection
getSelection()
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
isSaveAsAllowed()
void
removeSelectionChangedListener(ISelectionChangedListener listener)
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 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:
addSelectionChangedListener
in interfaceISelectionProvider
-
getSelection
public ISelection getSelection()
- Specified by:
getSelection
in interfaceISelectionProvider
-
removeSelectionChangedListener
public void removeSelectionChangedListener(ISelectionChangedListener listener)
- Specified by:
removeSelectionChangedListener
in interfaceISelectionProvider
-
setSelection
public void setSelection(ISelection selection)
- Specified by:
setSelection
in interfaceISelectionProvider
-
firePropertyChange
protected void firePropertyChange(int action)
- Overrides:
firePropertyChange
in classWorkbenchPart
-
getEditingDomain
public EditingDomain getEditingDomain()
- Specified by:
getEditingDomain
in 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:
init
in interfaceIEditorPart
- Overrides:
init
in 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:
createPages
in 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:
isDirty
in interfaceISaveablePart
- Overrides:
isDirty
in classMultiPageEditorPart
-
doSave
public void doSave(IProgressMonitor progressMonitor)
- 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
protected void doSaveAs(URI uri, IEditorInput editorInput)
- Generated class or method.
-
isSaveAsAllowed
public boolean isSaveAsAllowed()
- Specified by:
isSaveAsAllowed
in interfaceISaveablePart
- Specified by:
isSaveAsAllowed
in classEditorPart
-
-