Class AbstractExportProjectProvider

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.eclipse.core.runtime.IProgressMonitor NPM  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.core.runtime.IStatus fail​(java.lang.String message)
      Produces an error in the application
      protected java.lang.String[] getApplicationArguments()  
      java.util.List<java.lang.String> getParameters​(java.lang.String option)  
      java.util.List<java.lang.String> getParameters​(java.lang.String option, int expected)
      Returns a list of strings representing the parameters to the specified option.
      protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getParsedArgs()
      Returns a mapping from string option to parameter string list
      For example, if -option p1 p2 p3 appears on the command line, then the mapping option=>[p1,p2,p3] will be present in the map
      java.lang.String getSingleString​(java.lang.String option)
      Gets an option's single parameter, or throws a CoreException should the option not be present, or if it does not have exactly one parameter
      boolean isPresent​(java.lang.String option)
      Returns whether the specified option appears in the application arguments
      void setApplicationArguments​(java.lang.String[] arguments)
      This method will be called by the export framework before any other method in this class.
      • Methods inherited from class java.lang.Object

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

      • NPM

        public static final org.eclipse.core.runtime.IProgressMonitor NPM
    • Constructor Detail

      • AbstractExportProjectProvider

        public AbstractExportProjectProvider()
    • Method Detail

      • getApplicationArguments

        protected java.lang.String[] getApplicationArguments()
        Returns:
        the application arguments
      • setApplicationArguments

        public void setApplicationArguments​(java.lang.String[] arguments)
        Description copied from interface: IExportProjectProvider
        This method will be called by the export framework before any other method in this class. It passes the application argument received by the export application
        Specified by:
        setApplicationArguments in interface IExportProjectProvider
        Parameters:
        arguments - the application arguments
        See Also:
        Platform.getApplicationArgs()
      • getParsedArgs

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getParsedArgs()
        Returns a mapping from string option to parameter string list
        For example, if -option p1 p2 p3 appears on the command line, then the mapping option=>[p1,p2,p3] will be present in the map
        Returns:
        a mapping from string option to parameter string list
      • getSingleString

        public java.lang.String getSingleString​(java.lang.String option)
                                         throws org.eclipse.core.runtime.CoreException
        Gets an option's single parameter, or throws a CoreException should the option not be present, or if it does not have exactly one parameter
        Parameters:
        option -
        Returns:
        an option's single parameter
        Throws:
        org.eclipse.core.runtime.CoreException - should the specified option not be present, or if it does not have exactly one parameter
      • getParameters

        public java.util.List<java.lang.String> getParameters​(java.lang.String option)
        Parameters:
        option -
        Returns:
        the list of parameters given with this option
      • isPresent

        public boolean isPresent​(java.lang.String option)
        Returns whether the specified option appears in the application arguments
        Parameters:
        option - the option to check for
        Returns:
        whether the specified option appears in the application arguments
      • getParameters

        public java.util.List<java.lang.String> getParameters​(java.lang.String option,
                                                              int expected)
                                                       throws org.eclipse.core.runtime.CoreException
        Returns a list of strings representing the parameters to the specified option. If the number of parameters does not match the expected number, an command-line error message is shown to the user.
        Parameters:
        option -
        expected - the number of parameters expected
        Throws:
        org.eclipse.core.runtime.CoreException
      • fail

        public org.eclipse.core.runtime.IStatus fail​(java.lang.String message)
                                              throws org.eclipse.core.runtime.CoreException
        Produces an error in the application
        Parameters:
        message - an error message suitable for the user
        Returns:
        does not return
        Throws:
        org.eclipse.core.runtime.CoreException - Throws a CoreException with an ERROR status