Class SaveableComponentViewer

    • Field Detail

      • commandService

        protected org.eclipse.e4.core.commands.ECommandService commandService
    • Constructor Detail

      • SaveableComponentViewer

        protected SaveableComponentViewer​(Composite parent,
                                          MDirtyable dirty,
                                          org.eclipse.e4.core.commands.ECommandService commandService,
                                          EObject modelRepository)
        Parameters:
        parent - the container where the view is embedded
        dirty - the dirty state which indicates whether there were changes made in the viewer
        commandService - a service of the eclipse application in order to make the tree view saveable
        modelRepository - EObject which is shown in the view
    • Method Detail

      • addSelectionListener

        public abstract void addSelectionListener​(ESelectionService selectionService)
        Connects the current selected item in the view with the eclipse selectionservice
        Parameters:
        selectionService - of the eclipse project
      • updateResource

        protected Resource updateResource​(EObject model)
        Overrides:
        updateResource in class ComponentViewer
        Parameters:
        model - EMF Model of the shown data
        Returns:
        the resource using the resource set of the editing domain
      • undo

        public void undo()
        Undos one command on the command stack
      • undoAll

        public void undoAll()
        Undos every command on the command stack
      • redo

        public void redo()
        Redos one command on the command stack
      • save

        public void save​(MDirtyable dirty)
                  throws IOException
        Saves the current state of the view
        Parameters:
        dirty - describes whether the view was edited
        Throws:
        IOException - if the save operation fails
      • save

        public void save()
                  throws IOException
        Saves the current state of the view
        Throws:
        IOException - if the save operation fails
      • update

        public abstract void update​(EObject modelRepository)