Example usage for com.google.gwt.eclipse.core.properties GWTProjectProperties getGwtCompileSettings

List of usage examples for com.google.gwt.eclipse.core.properties GWTProjectProperties getGwtCompileSettings

Introduction

In this page you can find the example usage for com.google.gwt.eclipse.core.properties GWTProjectProperties getGwtCompileSettings.

Prototype

public static GWTCompileSettings getGwtCompileSettings(IProject project) 

Source Link

Usage

From source file:com.google.gdt.eclipse.suite.launch.SpeedTracerLaunchDelegate.java

License:Open Source License

private void performGwtCompile(IProject project, File extraDir, List<String> modules, IPath warOutLocation,
        IProgressMonitor monitor) throws CoreException, IOException, InterruptedException {

    monitor.beginTask("Performing GWT compile...", 100);

    try {//from   w  w w. j av a  2 s.  c om
        GWTCompileSettings compileSettings = GWTProjectProperties.getGwtCompileSettings(project);
        compileSettings.setEntryPointModules(
                !modules.isEmpty() ? modules : GWTProjectProperties.getEntryPointModules(project));
        compileSettings.setExtraArgs("-extra " + StringUtilities.quote(extraDir.getAbsolutePath()) + " -gen "
                + StringUtilities.quote(
                        GWTPreferences.computeSpeedTracerGeneratedFolderPath(warOutLocation).toOSString()));

        // Get a message console for GWT compiler output
        CustomMessageConsole messageConsole = showGwtCompilationConsole(project);
        OutputStream consoleOutputStream = messageConsole.newMessageStream();

        TerminateProcessAction terminateAction = new TerminateProcessAction();
        messageConsole.setTerminateAction(terminateAction);

        try {
            GWTCompileRunner.compileWithCancellationSupport(JavaCore.create(project), warOutLocation,
                    compileSettings, consoleOutputStream, terminateAction, monitor, terminateAction);
        } finally {
            try {
                assert (consoleOutputStream != null);
                consoleOutputStream.close();
            } catch (IOException e) {
                // Ignore IOExceptions during stream close
            }
        }

        // refresh so that eclipse picks up on the gen files 
        project.refreshLocal(IResource.DEPTH_INFINITE, null);

    } finally {
        monitor.done();
    }
}

From source file:com.myeclipsedev.gdt.eclipse.ui.internal.wizard.WebComponentExportPage.java

License:Open Source License

private void initializeControls() {
    // Set the project field if we have one set
    if (project != null) {
        projectText.setText(project.getName());
    }/*  w w w.ja  va  2 s . c om*/

    // If we have a GWT project, get its saved compilation settings;
    // otherwise
    // just use the defaults settings.
    GWTCompileSettings settings = (project != null) ? GWTProjectProperties.getGwtCompileSettings(project)
            : new GWTCompileSettings();

    initializeLogLevel(settings.getLogLevel());
    initializeOutputStyle(settings.getOutputStyle());
}

From source file:com.myeclipsedev.gdt.eclipse.ui.internal.wizard.WebComponentExportPage.java

License:Open Source License

private void updateEntryPointModulesIfProjectChanged() {
    if (project != null) {
        IJavaProject javaProject = JavaCore.create(project);
        if (javaProject != null && !javaProject.equals(entryPointModulesBlock.getJavaProject())) {
            // Set the project for the block (needed for adding a module)
            entryPointModulesBlock.setJavaProject(javaProject);

            GWTCompileSettings settings = GWTProjectProperties.getGwtCompileSettings(project);

            // Set the default and initially-selected modules for the block
            // from
            // the saved settings
            entryPointModulesBlock.setDefaultModules(settings.getEntryPointModules());
            entryPointModulesBlock.setModules(settings.getEntryPointModules());
        }//from  ww w. j  a  v a2 s  . co m
    } else {
        entryPointModulesBlock.setJavaProject(null);
        entryPointModulesBlock.setDefaultModules(Collections.<String>emptyList());
        entryPointModulesBlock.setModules(Collections.<String>emptyList());
    }
}

From source file:org.jboss.tools.maven.gwt.GWTProjectConfigurator.java

License:Open Source License

private void setErraiVmParams(IProject project, String path) {
    GWTCompileSettings settings = GWTProjectProperties.getGwtCompileSettings(project);
    if (settings == null) {
        settings = new GWTCompileSettings(project);
    }/*from  w  w  w .j a  v a  2s.  c o m*/
    String vmArgs = (settings.getVmArgs() == null) ? "" : settings.getVmArgs();
    if (!vmArgs.contains(ERRAI_MARSHALLING_SERVER_CLASS_OUTPUT)) {
        vmArgs += ERRAI_MARSHALLING_SERVER_CLASS_OUTPUT + path;
        settings.setVmArgs(vmArgs);

        try {
            GWTProjectProperties.setGwtCompileSettings(project, settings);
        } catch (BackingStoreException e) {
            logError("Exception in Maven GWT Configurator, cannot set VM Parameters for Errai", e);
        }
    }
}