Class FeatureModelInstanceEditor

All Implemented Interfaces:
IAdaptable, IExecutableExtension, IEditingDomainProvider, IPageChangeProvider, ISelectionProvider, IEditorPart, ISaveablePart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation

public class FeatureModelInstanceEditor extends MultiPageEditorPart implements ISelectionProvider, IEditingDomainProvider
  • Field Details

  • Constructor Details

    • FeatureModelInstanceEditor

      public FeatureModelInstanceEditor()
  • Method Details

    • addSelectionChangedListener

      public void addSelectionChangedListener(ISelectionChangedListener listener)
      Specified by:
      addSelectionChangedListener in interface ISelectionProvider
    • getSelection

      public ISelection getSelection()
      Specified by:
      getSelection in interface ISelectionProvider
    • removeSelectionChangedListener

      public void removeSelectionChangedListener(ISelectionChangedListener listener)
      Specified by:
      removeSelectionChangedListener in interface ISelectionProvider
    • setSelection

      public void setSelection(ISelection selection)
      Specified by:
      setSelection in interface ISelectionProvider
    • firePropertyChange

      protected void firePropertyChange(int action)
      Overrides:
      firePropertyChange in class WorkbenchPart
    • getEditingDomain

      public EditingDomain getEditingDomain()
      Specified by:
      getEditingDomain in interface IEditingDomainProvider
    • 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 interface IEditorPart
      Overrides:
      init in class MultiPageEditorPart
      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 Resource
      featureDiagram - A FeatureDiagram-object to which the new Configuration should reference
      defaultRef - 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 resource
      path - The complete path to the file including the fileName
      fileName - 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 class MultiPageEditorPart
    • 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 interface ISaveablePart
      Overrides:
      isDirty in class MultiPageEditorPart
    • doSave

      public void doSave(IProgressMonitor progressMonitor)
      Specified by:
      doSave in interface ISaveablePart
      Specified by:
      doSave in class EditorPart
    • doSaveAs

      public void doSaveAs()
      Specified by:
      doSaveAs in interface ISaveablePart
      Specified by:
      doSaveAs in class EditorPart
    • doSaveAs

      protected void doSaveAs(URI uri, IEditorInput editorInput)
      Generated class or method.
    • isSaveAsAllowed

      public boolean isSaveAsAllowed()
      Specified by:
      isSaveAsAllowed in interface ISaveablePart
      Specified by:
      isSaveAsAllowed in class EditorPart