Class GenerateEcoreEditorJavaCodeAction

  • All Implemented Interfaces:
    IToolbarAction

    public class GenerateEcoreEditorJavaCodeAction
    extends GenerateJavaCodeAction
    The ToolbarAction allowing the User to generate Java code from the EcoreEditor.
    Author:
    Alexandra Buzila
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canExecute​(java.lang.Object object)  
      org.eclipse.jface.action.Action getAction​(java.lang.Object currentObject, org.eclipse.jface.viewers.ISelectionProvider selectionProvider)
      Returns the action to add to the toolbar.
      protected org.eclipse.emf.ecore.EPackage getEPackage​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      Returns the first EPackage object found in the first resource of the given ResourceSet.
      protected org.eclipse.emf.codegen.ecore.genmodel.GenModel getGenModel​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      Returns the first GenModel object found in the first of the given ResourceSet.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GenerateEcoreEditorJavaCodeAction

        public GenerateEcoreEditorJavaCodeAction()
    • Method Detail

      • canExecute

        public boolean canExecute​(java.lang.Object object)
        Specified by:
        canExecute in interface IToolbarAction
        Overrides:
        canExecute in class GenerateJavaCodeAction
        Parameters:
        object - the currently edited object of the editor
        Returns:
        true, if the Action can be executed for the provided input
      • getAction

        public org.eclipse.jface.action.Action getAction​(java.lang.Object currentObject,
                                                         org.eclipse.jface.viewers.ISelectionProvider selectionProvider)
        Description copied from interface: IToolbarAction
        Returns the action to add to the toolbar.
        Specified by:
        getAction in interface IToolbarAction
        Overrides:
        getAction in class GenerateJavaCodeAction
        Parameters:
        currentObject - the currently edited object of the editor
        selectionProvider - the selection provider
        Returns:
        the action
      • getGenModel

        protected org.eclipse.emf.codegen.ecore.genmodel.GenModel getGenModel​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
        Description copied from class: GenerateJavaCodeAction
        Returns the first GenModel object found in the first of the given ResourceSet.
        Overrides:
        getGenModel in class GenerateJavaCodeAction
        Parameters:
        resourceSet - the ResourceSet to check
        Returns:
        the GenModel or null if none was found
      • getEPackage

        protected org.eclipse.emf.ecore.EPackage getEPackage​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
        Returns the first EPackage object found in the first resource of the given ResourceSet.
        Parameters:
        resourceSet - the ResourceSet to check
        Returns:
        the EPackage or null if none was found