Class EclipseRuntimeBuilder

  • All Implemented Interfaces:
    ITooltipPropList, IRuntimeBuilder, org.osgi.framework.BundleActivator

    public class EclipseRuntimeBuilder
    extends org.eclipse.ui.plugin.AbstractUIPlugin
    implements IRuntimeBuilder
    The activator class controls the plug-in life cycle.
    • Field Detail

      • PLUGIN_ID

        public static final java.lang.String PLUGIN_ID
        The plug-in ID: "com.iizigo.run".
        See Also:
        Constant Field Values
    • Constructor Detail

      • EclipseRuntimeBuilder

        public EclipseRuntimeBuilder()
        The constructor.
    • Method Detail

      • start

        public void start​(org.osgi.framework.BundleContext context)
                   throws java.lang.Exception
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Overrides:
        start in class org.eclipse.ui.plugin.AbstractUIPlugin
        Throws:
        java.lang.Exception
      • stop

        public void stop​(org.osgi.framework.BundleContext context)
                  throws java.lang.Exception
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
        Overrides:
        stop in class org.eclipse.ui.plugin.AbstractUIPlugin
        Throws:
        java.lang.Exception
      • getInstance

        public static EclipseRuntimeBuilder getInstance()
        Returns the shared instance.
        Returns:
        The shared instance.
      • createPage

        public void createPage​(org.eclipse.swt.widgets.Composite parent,
                               ModuleModel module,
                               org.eclipse.core.resources.IFile runtimeBuilderFile,
                               EditorRuntimeBuilderProps props,
                               EditorRuntimeBuilderPropertyPage parentPage)
        Creates the property page.
        Specified by:
        createPage in interface IRuntimeBuilder
        Parameters:
        parent - Parent composite initialized with a grid layout of 1 column.
        module - The module model.
        runtimeBuilderFile - The .iiziRun file.
        props - The runtime builder properties being edited.
        parentPage - The parent page.
      • getTooltipPropertyList

        public java.util.List<TooltipItem> getTooltipPropertyList()
        Gets the list of property items that should be displayed.
        Specified by:
        getTooltipPropertyList in interface ITooltipPropList
        Returns:
        The list, or null for no tooltip.
      • getCodeModifier

        public CodeModifier getCodeModifier()
        Gets the code modifier.
        Returns:
        The code modifier, or null for failure (it's been logged).
      • getRequiredTextIDs

        public java.util.Set<java.lang.String> getRequiredTextIDs​(RuntimeBuilderSettings settings)
        Gets the required text IDs for the text file.
        Specified by:
        getRequiredTextIDs in interface IRuntimeBuilder
        Parameters:
        settings - The runtime builder settings.
        Returns:
        The set of text IDs, null means failed to read it from the "www/js/msg.js" file. In case null is returned, it has been logged in the server.
      • verify

        public void verify​(EditorRuntimeBuilderProps props,
                           java.io.File projectDir,
                           PropVerification verification)
        Verifies this property container. The check performed is the extension of classes and that no circular reference is present.
        Specified by:
        verify in interface IRuntimeBuilder
        Parameters:
        props - The runtime builder properties being edited.
        projectDir - The project directory.
        verification - The property verification class.
      • buildRuntime

        public org.eclipse.core.runtime.IStatus buildRuntime​(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                             RuntimeBuilderSettings settings,
                                                             IPrintAdapter printer,
                                                             boolean isVerbose)
                                                      throws org.eclipse.core.runtime.CoreException,
                                                             CancelException,
                                                             BuildException,
                                                             java.io.IOException,
                                                             PropException
        Runs the job to create the iiziRun program.
        Specified by:
        buildRuntime in interface IRuntimeBuilder
        Parameters:
        monitor - The progress monitor initialized with a job of 100 ticks.
        settings - The settings.
        printer - The printer for output.
        isVerbose - If the job should be verbose or not.
        Returns:
        The status of the job.
        Throws:
        org.eclipse.core.runtime.CoreException - For core exceptions.
        CancelException - When job is canceled.
        BuildException - For build exceptions.
        java.io.IOException - For I/O errors.
        PropException - For property errors.
      • processRemoteEvent

        public boolean processRemoteEvent​(EditorRuntimeBuilderProps props,
                                          java.io.File projectDir,
                                          RemoteEvent event)
        Processes a remote event from the server.
        Specified by:
        processRemoteEvent in interface IRuntimeBuilder
        Parameters:
        props - The runtime builder properties being edited.
        projectDir - The project directory.
        event - The remote event.
        Returns:
        true if processed, false if not.