### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.ide Index: build.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/build.properties,v retrieving revision 1.10 diff -u -r1.10 build.properties --- build.properties 8 Jun 2005 19:09:06 -0000 1.10 +++ build.properties 4 Jan 2008 17:19:02 -0000 @@ -15,7 +15,8 @@ about.html,\ icons/,\ .,\ - META-INF/ + META-INF/,\ + ant_tasks/resources-ant.jar src.includes = about.html,\ schema/ source.. = extensions/,\ Index: .project =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/.project,v retrieving revision 1.12 diff -u -r1.12 .project --- .project 13 Apr 2006 14:46:59 -0000 1.12 +++ .project 4 Jan 2008 17:19:02 -0000 @@ -16,13 +16,22 @@ + org.eclipse.ui.externaltools.ExternalToolBuilder + + + LaunchConfigHandle + <project>/.externalToolBuilders/Build resources-ant.jar.launch + + + + org.eclipse.pde.SchemaBuilder - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature Index: .classpath =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/.classpath,v retrieving revision 1.14 diff -u -r1.14 .classpath --- .classpath 11 May 2006 21:39:37 -0000 1.14 +++ .classpath 4 Jan 2008 17:19:02 -0000 @@ -2,6 +2,7 @@ + Index: .cvsignore =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/.cvsignore,v retrieving revision 1.1 diff -u -r1.1 .cvsignore --- .cvsignore 29 Oct 2003 17:59:01 -0000 1.1 +++ .cvsignore 4 Jan 2008 17:19:02 -0000 @@ -1 +1,2 @@ -bin \ No newline at end of file +bin +temp.folder Index: plugin.xml =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/plugin.xml,v retrieving revision 1.253 diff -u -r1.253 plugin.xml --- plugin.xml 3 Jan 2008 20:31:59 -0000 1.253 +++ plugin.xml 4 Jan 2008 17:19:03 -0000 @@ -2041,5 +2041,30 @@ type="org.eclipse.ui.internal.views.markers.ExtendedMarkersView"> + + + + + + + + + + + + Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/META-INF/MANIFEST.MF,v retrieving revision 1.36 diff -u -r1.36 MANIFEST.MF --- META-INF/MANIFEST.MF 3 Jan 2008 20:31:59 -0000 1.36 +++ META-INF/MANIFEST.MF 4 Jan 2008 17:19:03 -0000 @@ -54,7 +54,9 @@ org.eclipse.update.core;bundle-version="[3.1.100,4.0.0)", org.eclipse.update.ui;bundle-version="[3.1.100,4.0.0)", org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)", - org.eclipse.ui.forms;bundle-version="[3.3.0,4.0.0)" + org.eclipse.ui.forms;bundle-version="[3.3.0,4.0.0)", + org.apache.ant, + org.eclipse.ant.core Eclipse-LazyStart: true Import-Package: com.ibm.icu.text Bundle-RequiredExecutionEnvironment: J2SE-1.4 Index: src_ant/META-INF/eclipse.inf =================================================================== RCS file: src_ant/META-INF/eclipse.inf diff -N src_ant/META-INF/eclipse.inf --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src_ant/META-INF/eclipse.inf 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +jarprocessor.exclude.sign=true Index: .externalToolBuilders/Build resources-ant.jar.launch =================================================================== RCS file: .externalToolBuilders/Build resources-ant.jar.launch diff -N .externalToolBuilders/Build resources-ant.jar.launch --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ .externalToolBuilders/Build resources-ant.jar.launch 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + Index: scripts/buildExtraJAR.xml =================================================================== RCS file: scripts/buildExtraJAR.xml diff -N scripts/buildExtraJAR.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ scripts/buildExtraJAR.xml 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: src_ant/org/eclipse/ui/ide/anttasks/ExportPreferencesTask.java =================================================================== RCS file: src_ant/org/eclipse/ui/ide/anttasks/ExportPreferencesTask.java diff -N src_ant/org/eclipse/ui/ide/anttasks/ExportPreferencesTask.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src_ant/org/eclipse/ui/ide/anttasks/ExportPreferencesTask.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation and others. + * 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.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.ui.ide.anttasks; + +import java.io.*; +import org.apache.tools.ant.BuildException; +import org.eclipse.ant.core.Task; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.IPreferencesService; + +/** + * An ant task which exports preferences from specified file. + * + * @see IPreferencesService#importPreferences(InputStream) + */ +public class ExportPreferencesTask extends Task { + + private String preferencesPath; + + /** + * Sets the path to the preference file. + * @param path A string pointing to the file + */ + public void setPreferencesFile(String path) { + preferencesPath = path; + } + + /** + * Performs the preferences export. + * @throws BuildException thrown if a problem occurs during execution. + */ + public final void execute() throws BuildException { + try { + OutputStream os = new BufferedOutputStream(new FileOutputStream(preferencesPath)); + IPreferencesService service = Platform.getPreferencesService(); + service.exportPreferences(service.getRootNode(), os, null); + } catch (FileNotFoundException e) { + //should not happen + throw new BuildException(e); + } catch (CoreException e) { + throw new BuildException(e); + } + } +} Index: src_ant/org/eclipse/ui/ide/anttasks/ImportPreferencesTask.java =================================================================== RCS file: src_ant/org/eclipse/ui/ide/anttasks/ImportPreferencesTask.java diff -N src_ant/org/eclipse/ui/ide/anttasks/ImportPreferencesTask.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src_ant/org/eclipse/ui/ide/anttasks/ImportPreferencesTask.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation and others. + * 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.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.ui.ide.anttasks; + +import java.io.*; +import org.apache.tools.ant.BuildException; +import org.eclipse.ant.core.Task; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.IPreferencesService; + +/** + * An ant task which imports preferences from specified file. + * + * @see IPreferencesService#importPreferences(InputStream) + */ +public class ImportPreferencesTask extends Task { + + private String preferencesPath; + + /** + * Sets the path to the preference file. + * @param path A string pointing to the file + */ + public void setPreferencesFile(String path) { + preferencesPath = path; + } + + /** + * Performs the preferences import. + * @throws BuildException thrown if a problem occurs during execution. + */ + public final void execute() throws BuildException { + try { + InputStream is = new BufferedInputStream(new FileInputStream(preferencesPath)); + IPreferencesService service = Platform.getPreferencesService(); + service.importPreferences(is); + } catch (FileNotFoundException e) { + //should not happen + throw new BuildException(e); + } catch (CoreException e) { + throw new BuildException(e); + } + } +}