diff --git a/editor/Processing Plugin for Eclipse/feature.xml b/editor/Processing Plugin for Eclipse/feature.xml index 0451a3060..effc80457 100644 --- a/editor/Processing Plugin for Eclipse/feature.xml +++ b/editor/Processing Plugin for Eclipse/feature.xml @@ -2,7 +2,7 @@ @@ -22,35 +22,30 @@ Portions of the code were written by other contributors and are attributed in th There are many contributions to the Exhibition and Examples on the Processing.org website and these are attributed in context. The Reference for the Language and Environment are under a Creative Commons license which makes it possible to re-use this content for non-commercial purposes if it is credited. - - This program and the accompanying materials, unless otherwise noted, are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.opensource.org/licenses/eclipse-1.0.php - -Several libraries are included from the Processing language and Processing development environment. These are included under the GNU LGPL (http://www.gnu.org/licenses/lgpl.html). - -All images are included under a creative commons license (http://creativecommons.org/) that allows re-use for non-commercial work if it is credited. + + This program and the accompanying materials, unless otherwise +noted, are made available under the terms of the Eclipse Public +License v1.0 which accompanies this distribution, and is available +at http://www.opensource.org/licenses/eclipse-1.0.php +Several libraries are included from the Processing language and +Processing development environment. These are included under +the GNU LGPL (http://www.gnu.org/licenses/lgpl.html). +All images are included under a creative commons license (http://creativecommons.org/) +that allows re-use for non-commercial work if it is credited. - - - - - - - - - - + - - - - - - diff --git a/editor/processing.plugin.core/src/processing/plugin/core/ProcessingCore.java b/editor/processing.plugin.core/src/processing/plugin/core/ProcessingCore.java index eb35813ef..fc0bc477c 100644 --- a/editor/processing.plugin.core/src/processing/plugin/core/ProcessingCore.java +++ b/editor/processing.plugin.core/src/processing/plugin/core/ProcessingCore.java @@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Plugin; import processing.plugin.core.builder.Utilities; - + /** * The plug-in activator enabling the core (UI-free) support for Processing sketches. *

diff --git a/editor/processing.plugin.core/src/processing/plugin/core/launching/ProcessingSketchLaunchConfigurationDelegate.java b/editor/processing.plugin.core/src/processing/plugin/core/launching/ProcessingSketchLaunchConfigurationDelegate.java deleted file mode 100644 index cba81c705..000000000 --- a/editor/processing.plugin.core/src/processing/plugin/core/launching/ProcessingSketchLaunchConfigurationDelegate.java +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Copyright (c) 2010 Chris Lonnen. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.opensource.org/licenses/eclipse-1.0.php - * - * Contributors: - * Chris Lonnen - initial API and implementation - */ -package processing.plugin.core.launching; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; -import org.eclipse.jdt.launching.JavaLaunchDelegate; -import org.eclipse.jdt.launching.JavaRuntime; - -import processing.plugin.core.ProcessingLog; - -/** - * The default launch configuration delegate for Processing Sketches. - *

- * Checks to make sure the last build was successful and that the sketch is not being run in debug mode. - * Then it computes some sensible defaults, builds a simple html wrapper and launches the sketch as an - * applet. This is not the same process as an export, and will not populate the applet folder. - */ -public class ProcessingSketchLaunchConfigurationDelegate extends JavaLaunchDelegate implements IDebugEventSetListener { - - /** - * Maps ILaunch objects to File objects that represent the .html file initiating the - * applet launch. This is used to delete the .html file when the launch terminates. - */ - private static Map fgLaunchToFileMap = new HashMap(); - - /** Used to map temp file to launch object. */ - private ILaunch fLaunch; - - /* (non-Javadoc) Makes sure to cleanup the leftovers if things break. */ - public synchronized void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { - try{ - fLaunch = launch; - super.launch(configuration, mode, launch, monitor); - } catch (CoreException e){ - cleanup(launch); - throw e; - } - fLaunch = null; - } - - /** - * Called first in the launch sequence. Checks to make sure this launcher is being executed - * in run mode, and returns true to indicate that things can proceed. If it is being executed - * in debug mode or some other unsupported mode, return false to abort the launch. - */ - public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - if(mode.equals(ILaunchManager.RUN_MODE)){ - if(configuration.getAttribute("wasLastBuildSuccessful", false)) - return true; - ProcessingLog.logInfo("Aborting launch -- Sketch has unresolved build problems."); - } - return false; - } - - // public String getJavaPolicyFile() ?? - - /** Clean up the temp files and listeners after a launch */ - public void cleanup(ILaunch launch){ - File temp = (File) fgLaunchToFileMap.get(launch); - if (temp != null){ - try { - fgLaunchToFileMap.remove(launch); - temp.delete(); - } finally { - // unregister any debug listeners? there shouldn't be any - // because we don't support debugging - } - } - - } - - public File buildHTMLFile(ILaunchConfiguration configuration, File dir) { - FileWriter writer = null; - File tempFile = null; - try { - String name = getAppletMainTypeName(configuration); - tempFile = new File(dir, name + System.currentTimeMillis() + ".html"); //$NON-NLS-1$ - writer = new FileWriter(tempFile); - writer.write("\n"); - writer.write("\n"); - writer.write("\n"); - Map parameters = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_PARAMETERS, new HashMap()); - if (parameters.size() != 0) { - Iterator iterator= parameters.entrySet().iterator(); - while(iterator.hasNext()) { - Map.Entry next = (Map.Entry) iterator.next(); - writer.write("\n"); - } - } - writer.write("\n"); - writer.write("\n"); - writer.write("\n"); - } catch(IOException e) { - } catch(CoreException e) { - } finally { - if (writer != null) { - try { - writer.close(); - } catch(IOException e) { - } - } - } - - return tempFile; - } - - public String getQuotedString(String string) { - if (string.indexOf('"') == -1) { - return '"' + string + '"'; - } - return '\'' + string + '\''; - } - - - /* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration) */ - public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException{ - File workingDir = verifyWorkingDirectory(configuration); - File htmlFile = buildHTMLFile(configuration, workingDir); - if(htmlFile == null){ - abort("Could not build HTML for applet launch.", null, IJavaLaunchConfigurationConstants.ERR_COULD_NOT_BUILD_HTML); - } - // add a mapping of the launch to the html file - fgLaunchToFileMap.put(fLaunch, htmlFile); - return htmlFile.getName(); - } - - // Uncomment if we end up using javaPolicyFile - // public String getVMArguments(ILaunchConfiguration configuration) throws CoreException { - // StringBuffer arguments = new StringBuffer(super.getVMArguments(configuration)); - // File workingDir = verifyWorkingDirectory(configuration); - // String javaPolicyFile = getJavaPolicyFile(workingDir); - // arguments.append(javaPolicyFile); - // return arguments.toString(); - // } - - public String getMainTypeName(ILaunchConfiguration configuration) throws CoreException{ - return configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_APPLETVIEWER_CLASS, IJavaLaunchConfigurationConstants.DEFAULT_APPLETVIEWER_CLASS); - } - - /** Returns the applet's main type name. */ - public String getAppletMainTypeName(ILaunchConfiguration configuration) throws CoreException{ - return super.getMainTypeName(configuration); - } - - /* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getDefaultWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration) */ - public File getDefaultWorkingDirectory(ILaunchConfiguration configuration) throws CoreException{ - // default working dir for applets is the project's output directory - String outputDir = JavaRuntime.getProjectOutputDirectory(configuration); - if (outputDir == null) { - // if no project attribute, default to eclipse directory - return new File(System.getProperty("user.dir")); - } - IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(outputDir); - if (resource == null || !resource.exists()) { - //default to eclipse directory - return new File(System.getProperty("user.dir")); - } - return resource.getLocation().toFile(); - } - -} diff --git a/editor/processing.plugin.ui/META-INF/MANIFEST.MF b/editor/processing.plugin.ui/META-INF/MANIFEST.MF index 037d4bb39..f1b4d1c88 100644 --- a/editor/processing.plugin.ui/META-INF/MANIFEST.MF +++ b/editor/processing.plugin.ui/META-INF/MANIFEST.MF @@ -2,24 +2,20 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Processing Plugin User Interface Elements Bundle-SymbolicName: processing.plugin.ui;singleton:=true -Bundle-Version: 0.2.1.0 +Bundle-Version: 0.2.2.0 Bundle-Activator: processing.plugin.ui.ProcessingPlugin Bundle-Vendor: Processing.org Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, - org.eclipse.core.filebuffers, - org.eclipse.jdt.debug.ui, org.eclipse.jface.text;bundle-version="3.6.0", org.eclipse.ui.editors;bundle-version="3.6.0", - org.eclipse.core.resources;bundle-version="3.6.0", - processing.plugin.core;bundle-version="0.1.0", + processing.plugin.core, org.eclipse.debug.ui, - org.eclipse.jdt.launching;bundle-version="3.5.100", + org.eclipse.jdt.launching, org.eclipse.ui.ide;bundle-version="3.6.0", - org.eclipse.jdt.core;bundle-version="3.6.0", - org.eclipse.ui.navigator, - org.eclipse.ui.navigator.resources, - org.eclipse.jdt.ui;bundle-version="3.6.0" + org.eclipse.jdt.ui;bundle-version="3.6.0", + org.eclipse.jdt.core, + org.eclipse.ui.navigator;bundle-version="3.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Import-Package: org.eclipse.ui.actions diff --git a/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java b/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java index c2a9adf61..0526c1fc4 100644 --- a/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java +++ b/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java @@ -164,9 +164,8 @@ public class ExportAsAppletWizard extends Wizard implements IExportWizard { } catch (CoreException e) { // This will happen when the copy fails, which we expect if there is no // image file. It isn't worth reporting. - File resourceFolder = ProcessingCore.getProcessingCore().getPluginResourceFolder(); try { - File exportResourcesFolder = new File(resourceFolder, "export"); + File exportResourcesFolder = new File(ProcessingCore.getProcessingCore().getPluginResourceFolder().getCanonicalPath(), "export"); File loadingImageCoreResource = new File(exportResourcesFolder, LOADING_IMAGE); Utilities.copyFile(loadingImageCoreResource, new File(exportFolder.getFullPath().toString(), LOADING_IMAGE)); } catch (Exception ex) { diff --git a/editor/processing.plugin.updateSite/site.xml b/editor/processing.plugin.updateSite/site.xml index 5372a59f6..c5d9eda3a 100644 --- a/editor/processing.plugin.updateSite/site.xml +++ b/editor/processing.plugin.updateSite/site.xml @@ -1,9 +1,6 @@ - - - - +