Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd.Willink2012-05-27 13:39:29 -0400
committerEd.Willink2012-05-27 13:39:29 -0400
commit0f04dc8273626f716338c50dac5b10ab67dcf449 (patch)
treef1065b225118ddb4690fab8b7b9f63f1719acbc0 /examples/org.eclipse.qvtd.examples
parenteebe1f5b6ff3c739a22efb1ae574123f894a8f55 (diff)
downloadorg.eclipse.qvtd-0f04dc8273626f716338c50dac5b10ab67dcf449.tar.gz
org.eclipse.qvtd-0f04dc8273626f716338c50dac5b10ab67dcf449.tar.xz
org.eclipse.qvtd-0f04dc8273626f716338c50dac5b10ab67dcf449.zip
[unrelated] Add the examples
Diffstat (limited to 'examples/org.eclipse.qvtd.examples')
-rw-r--r--examples/org.eclipse.qvtd.examples/.classpath7
-rw-r--r--examples/org.eclipse.qvtd.examples/.cvsignore1
-rw-r--r--examples/org.eclipse.qvtd.examples/.gitignore1
-rw-r--r--examples/org.eclipse.qvtd.examples/.launching/org.eclipse.qvtd.examples buildZips.xml.launch20
-rw-r--r--examples/org.eclipse.qvtd.examples/.project28
-rw-r--r--examples/org.eclipse.qvtd.examples/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--examples/org.eclipse.qvtd.examples/META-INF/MANIFEST.MF18
-rw-r--r--examples/org.eclipse.qvtd.examples/about.html26
-rw-r--r--examples/org.eclipse.qvtd.examples/buckminster.cspex25
-rw-r--r--examples/org.eclipse.qvtd.examples/build.properties10
-rw-r--r--examples/org.eclipse.qvtd.examples/buildZips.xml48
-rw-r--r--examples/org.eclipse.qvtd.examples/icons/OCLModelFile.gifbin0 -> 558 bytes
-rw-r--r--examples/org.eclipse.qvtd.examples/icons/QVTcModelFile.gifbin0 -> 598 bytes
-rw-r--r--examples/org.eclipse.qvtd.examples/icons/QVTrModelFile.gifbin0 -> 601 bytes
-rw-r--r--examples/org.eclipse.qvtd.examples/intro/css/graphics/tx.gifbin0 -> 1331 bytes
-rw-r--r--examples/org.eclipse.qvtd.examples/intro/css/sample.css3
-rw-r--r--examples/org.eclipse.qvtd.examples/intro/sample.xml10
-rw-r--r--examples/org.eclipse.qvtd.examples/plugin.properties43
-rw-r--r--examples/org.eclipse.qvtd.examples/plugin.xml75
-rw-r--r--examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/QVTDeclarativeExamplesPlugin.java45
-rw-r--r--examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtc/wizards/EmptyExampleWizard.java33
-rw-r--r--examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/EmptyExampleWizard.java33
-rw-r--r--examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/ModelMorfExampleWizard.java33
-rw-r--r--examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/RelToCoreExampleWizard.java33
-rw-r--r--examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/wizards/AbstractExampleWizard.java280
-rw-r--r--examples/org.eclipse.qvtd.examples/zips/.cvsignore3
-rw-r--r--examples/org.eclipse.qvtd.examples/zips/.gitignore2
27 files changed, 789 insertions, 0 deletions
diff --git a/examples/org.eclipse.qvtd.examples/.classpath b/examples/org.eclipse.qvtd.examples/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.qvtd.examples/.cvsignore b/examples/org.eclipse.qvtd.examples/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/examples/org.eclipse.qvtd.examples/.gitignore b/examples/org.eclipse.qvtd.examples/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/examples/org.eclipse.qvtd.examples/.launching/org.eclipse.qvtd.examples buildZips.xml.launch b/examples/org.eclipse.qvtd.examples/.launching/org.eclipse.qvtd.examples buildZips.xml.launch
new file mode 100644
index 000000000..af4099759
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/.launching/org.eclipse.qvtd.examples buildZips.xml.launch
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.qvtd.examples/buildZips.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.qvtd.examples"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dworkspace.root=${workspace_loc}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${project}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.qvtd.examples/buildZips.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.qvtd.examples/.project b/examples/org.eclipse.qvtd.examples/.project
new file mode 100644
index 000000000..466a6075c
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.qvtd.examples</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.qvtd.examples/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.qvtd.examples/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..4e3b2730d
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Sat Dec 26 15:01:30 GMT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.qvtd.examples/META-INF/MANIFEST.MF b/examples/org.eclipse.qvtd.examples/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..e6c4a51df
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.qvtd.examples;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-Localization: plugin
+Bundle-Activator: org.eclipse.qvtd.examples.QVTDeclarativeExamplesPlugin
+Require-Bundle: org.eclipse.core.resources;visibility:=reexport,
+ org.eclipse.core.runtime,
+ org.eclipse.ui;visibility:=reexport,
+ org.eclipse.ui.ide;visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
+Export-Package: org.eclipse.qvtd.examples,
+ org.eclipse.qvtd.examples.qvtc.wizards,
+ org.eclipse.qvtd.examples.qvtr.wizards,
+ org.eclipse.qvtd.examples.wizards
diff --git a/examples/org.eclipse.qvtd.examples/about.html b/examples/org.eclipse.qvtd.examples/about.html
new file mode 100644
index 000000000..2f46c1759
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/about.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head><body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>July 19, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body></html> \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples/buckminster.cspex b/examples/org.eclipse.qvtd.examples/buckminster.cspex
new file mode 100644
index 000000000..128ccc4ce
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/buckminster.cspex
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cspecExtension
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0"
+ xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
+ <dependencies>
+ <!-- QVTd Examples dependencies to build the zips -->
+ <dependency name="org.eclipse.qvtd.examples.qvtcore.empty" componentType="unknown"/>
+ <dependency name="org.eclipse.qvtd.examples.qvtrelation.empty" componentType="unknown"/>
+ <dependency name="org.eclipse.qvtd.examples.qvtrelation.modelmorf" componentType="unknown"/>
+ <dependency name="org.eclipse.qvtd.examples.qvtrelation.reltocore" componentType="unknown"/>
+ <!-- EMF Examples dependencies to build the zips >
+ <dependency name="org.eclipse.emf.examples.library" componentType="osgi.bundle"/>
+ <dependency name="org.eclipse.emf.examples.library.edit" componentType="osgi.bundle"/>
+ <dependency name="org.eclipse.emf.examples.library.editor" componentType="osgi.bundle"/-->
+ </dependencies>
+ <actions>
+ <public name="buckminster.prebind" actor="ant">
+ <actorProperties>
+ <property key="buildFile" value="buildZips.xml" />
+ <property key="targets" value="zip.examples" />
+ </actorProperties>
+ </public>
+ </actions>
+</cspecExtension>
diff --git a/examples/org.eclipse.qvtd.examples/build.properties b/examples/org.eclipse.qvtd.examples/build.properties
new file mode 100644
index 000000000..9d661c8c4
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ zips/,\
+ intro/,\
+ icons/,\
+ about.html
diff --git a/examples/org.eclipse.qvtd.examples/buildZips.xml b/examples/org.eclipse.qvtd.examples/buildZips.xml
new file mode 100644
index 000000000..a68b68217
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/buildZips.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="org.eclipse.qvtd.examples" default="zip.examples" basedir=".">
+ <target name="init">
+ </target>
+
+ <patternset id="qvtc.excludes" excludes="qvtcbin/**"/>
+ <patternset id="qvtr.excludes" excludes="qvtrbin/**"/>
+
+ <target name="zip.examples" depends="init">
+ <!-- ../../examples is the prefcerred project layout
+ ../ is the result of an Import Project Set File -->
+ <condition property="examplesDir" value="../../examples/" else="../">
+ <available file="../../examples" type="dir"/>
+ </condition>
+ <echoproperties/>
+ <!-- This example may have been compiled already in the Master feature -->
+ <delete>
+ <!-- Cleanup obsolete zips from earlier variant of script -->
+ <fileset dir="zips" includes="*.zip"/>
+ </delete>
+ <mkdir dir="zips/qvtc"/>
+ <zip destfile="zips/qvtc/empty.zip" basedir="${examplesDir}org.eclipse.qvtd.examples.qvtcore.empty">
+ <patternset refid="qvtc.excludes"/>
+ </zip>
+ <mkdir dir="zips/qvtr"/>
+ <zip destfile="zips/qvtr/empty.zip" basedir="${examplesDir}org.eclipse.qvtd.examples.qvtrelation.empty">
+ <patternset refid="qvtr.excludes"/>
+ </zip>
+ <zip destfile="zips/qvtr/modelmorf.zip" basedir="${examplesDir}org.eclipse.qvtd.examples.qvtrelation.modelmorf">
+ <patternset refid="qvtr.excludes"/>
+ </zip>
+ <zip destfile="zips/qvtr/reltocore.zip" basedir="${examplesDir}org.eclipse.qvtd.examples.qvtrelation.reltocore">
+ <patternset refid="qvtr.excludes"/>
+ </zip>
+ <antcall target="refresh"/>
+ </target>
+
+ <target name="clean" depends="init" description="Clean the plug-in: org.eclipse.qvtd.examples.">
+ <delete>
+ <fileset dir="zips" includes="**/*.zip"/>
+ </delete>
+ <antcall target="refresh"/>
+ </target>
+
+ <target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder.">
+ <eclipse.refreshLocal resource="/org.eclipse.qvtd.examples" depth="infinite"/>
+ </target>
+</project>
diff --git a/examples/org.eclipse.qvtd.examples/icons/OCLModelFile.gif b/examples/org.eclipse.qvtd.examples/icons/OCLModelFile.gif
new file mode 100644
index 000000000..294510303
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/icons/OCLModelFile.gif
Binary files differ
diff --git a/examples/org.eclipse.qvtd.examples/icons/QVTcModelFile.gif b/examples/org.eclipse.qvtd.examples/icons/QVTcModelFile.gif
new file mode 100644
index 000000000..e8f4fc7dd
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/icons/QVTcModelFile.gif
Binary files differ
diff --git a/examples/org.eclipse.qvtd.examples/icons/QVTrModelFile.gif b/examples/org.eclipse.qvtd.examples/icons/QVTrModelFile.gif
new file mode 100644
index 000000000..aa2381eb3
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/icons/QVTrModelFile.gif
Binary files differ
diff --git a/examples/org.eclipse.qvtd.examples/intro/css/graphics/tx.gif b/examples/org.eclipse.qvtd.examples/intro/css/graphics/tx.gif
new file mode 100644
index 000000000..37adf89df
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/intro/css/graphics/tx.gif
Binary files differ
diff --git a/examples/org.eclipse.qvtd.examples/intro/css/sample.css b/examples/org.eclipse.qvtd.examples/intro/css/sample.css
new file mode 100644
index 000000000..4b13302e9
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/intro/css/sample.css
@@ -0,0 +1,3 @@
+
+a#qvtd-examples-introLink img { background-image : url(graphics/tx.gif); }
+a#qvtd-examples-introLink:hover img { background-image : url(graphics/tx.gif); } \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples/intro/sample.xml b/examples/org.eclipse.qvtd.examples/intro/sample.xml
new file mode 100644
index 000000000..1bdca06a0
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/intro/sample.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<introContent>
+ <extensionContent id="qvtd-examples-introExtension" style="css/sample.css" name="Sample Extension" path="overview/@">
+ <group style-id="content-group" id="qvtd-examples-introLink-group">
+ <link label="QVT Declarative Examples" url="http://www.eclipse.org" id="qvtde-examples-introLink" style-id="content-link">
+ <text>Example QVT Declarative projects may be loaded by File->New->Projects... Examples.QVT...</text>
+ </link>
+ </group>
+ </extensionContent>
+</introContent> \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples/plugin.properties b/examples/org.eclipse.qvtd.examples/plugin.properties
new file mode 100644
index 000000000..ca1ab571c
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/plugin.properties
@@ -0,0 +1,43 @@
+###############################################################################
+# Copyright (c) 2008-2009 Eclipse Modeling Project 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:
+# E.D.Willink - initial API and implementation
+#
+# $Id: plugin.properties,v 1.6 2010/07/10 09:39:41 ewillink Exp $
+###############################################################################
+
+# NLS_MESSAGEFORMAT_VAR
+
+# ==============================================================================
+# Do not change the properties between this line and the last line containing:
+# %%% END OF TRANSLATED PROPERTIES %%%
+# Instead, either redefine an existing property, or create a new property,
+# append it to the end of the file, and change the code to use the new name.
+# ==============================================================================
+
+pluginName=QVT Declarative Examples
+providerName=Eclipse Modeling Project
+
+# ==============================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# The above properties have been shipped for translation.
+# ==============================================================================
+
+QVT_category=QVT (Queries, Views, Transformations Language) Projects
+
+EmptyQVTc_name=Empty QVTc Project
+EmptyQVTc_description=Create an Empty QVT Core project
+
+EmptyQVTr_name=Empty QVTr Project
+EmptyQVTr_description=Create an Empty QVT Relation project
+
+ModelMorf_name=ModelMorf distribution Examples
+ModelMorf_description=Create a project containing Examples from the ModelMorf distribution
+
+RelToCore_name=Relations To Core Example
+RelToCore_description=Create a project containing the Relations To Core Example
diff --git a/examples/org.eclipse.qvtd.examples/plugin.xml b/examples/org.eclipse.qvtd.examples/plugin.xml
new file mode 100644
index 000000000..982f9d384
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/plugin.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2008 E.D.Willink 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:
+ * E.D.Willink - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id: plugin.xml,v 1.4 2010/07/10 09:39:41 ewillink Exp $
+ */
+-->
+<?eclipse version="3.0"?>
+<plugin>
+ <extension point="org.eclipse.ui.newWizards">
+ <category id="org.eclipse.qvtd.examples.category"
+ name="%QVT_category"
+ parentCategory="org.eclipse.ui.Examples"/>
+ <wizard id="org.eclipse.qvtd.examples.qvtcore.empty"
+ canFinishEarly="true"
+ category="org.eclipse.ui.Examples/org.eclipse.qvtd.examples.category"
+ class="org.eclipse.qvtd.examples.qvtc.wizards.EmptyExampleWizard"
+ hasPages="false"
+ project="true"
+ name="%EmptyQVTc_name"
+ icon="$nl$/icons/QVTcModelFile.gif">
+ <description>%EmptyQVTc_description</description>
+ </wizard>
+ <wizard id="org.eclipse.qvtd.examples.qvtrelation.empty"
+ canFinishEarly="true"
+ category="org.eclipse.ui.Examples/org.eclipse.qvtd.examples.category"
+ class="org.eclipse.qvtd.examples.qvtr.wizards.EmptyExampleWizard"
+ hasPages="false"
+ project="true"
+ name="%EmptyQVTr_name"
+ icon="$nl$/icons/QVTrModelFile.gif">
+ <description>%EmptyQVTr_description</description>
+ </wizard>
+ <wizard id="org.eclipse.qvtd.examples.qvtrelation.modelmorf"
+ canFinishEarly="true"
+ category="org.eclipse.ui.Examples/org.eclipse.qvtd.examples.category"
+ class="org.eclipse.qvtd.examples.qvtr.wizards.ModelMorfExampleWizard"
+ hasPages="false"
+ project="true"
+ name="%ModelMorf_name"
+ icon="$nl$/icons/QVTrModelFile.gif">
+ <description>%ModelMorf_description</description>
+ </wizard>
+ <wizard id="org.eclipse.qvtd.examples.qvtrelation.reltocore"
+ canFinishEarly="true"
+ category="org.eclipse.ui.Examples/org.eclipse.qvtd.examples.category"
+ class="org.eclipse.qvtd.examples.qvtr.wizards.RelToCoreExampleWizard"
+ hasPages="false"
+ project="true"
+ name="%RelToCore_name"
+ icon="$nl$/icons/QVTrModelFile.gif">
+ <description>%RelToCore_description</description>
+ </wizard>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.intro.configExtension">
+ <configExtension
+ content="intro/sample.xml"
+ configId="org.eclipse.ui.intro.universalConfig">
+ </configExtension>
+ </extension>
+</plugin>
diff --git a/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/QVTDeclarativeExamplesPlugin.java b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/QVTDeclarativeExamplesPlugin.java
new file mode 100644
index 000000000..2ebdef012
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/QVTDeclarativeExamplesPlugin.java
@@ -0,0 +1,45 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2008 E.D.Willink 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:
+ * E.D.Willink - initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id: QVTDeclarativeExamplesPlugin.java,v 1.1 2008/08/26 21:00:59 ewillink Exp $
+ */
+package org.eclipse.qvtd.examples;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class QVTDeclarativeExamplesPlugin extends AbstractUIPlugin
+{
+ // The shared instance
+ private static QVTDeclarativeExamplesPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public QVTDeclarativeExamplesPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static QVTDeclarativeExamplesPlugin getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtc/wizards/EmptyExampleWizard.java b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtc/wizards/EmptyExampleWizard.java
new file mode 100644
index 000000000..7819c031a
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtc/wizards/EmptyExampleWizard.java
@@ -0,0 +1,33 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2009 E.D.Willink 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:
+ * E.D.Willink - initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id: EmptyExampleWizard.java,v 1.2 2009/08/16 12:41:53 ewillink Exp $
+ */
+package org.eclipse.qvtd.examples.qvtc.wizards;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.qvtd.examples.wizards.AbstractExampleWizard;
+
+public class EmptyExampleWizard extends AbstractExampleWizard
+{
+ @Override
+ protected Collection<ProjectDescriptor> getProjectDescriptors() {
+ List<ProjectDescriptor> projects = new ArrayList<ProjectDescriptor>(4);
+ projects.add(new ProjectDescriptor("org.eclipse.qvtd.examples", "zips/qvtc/empty.zip", "EmptyQVTcProject")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ return projects;
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/EmptyExampleWizard.java b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/EmptyExampleWizard.java
new file mode 100644
index 000000000..526641bff
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/EmptyExampleWizard.java
@@ -0,0 +1,33 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2009 E.D.Willink 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:
+ * E.D.Willink - initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id: EmptyExampleWizard.java,v 1.2 2009/08/16 12:41:53 ewillink Exp $
+ */
+package org.eclipse.qvtd.examples.qvtr.wizards;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.qvtd.examples.wizards.AbstractExampleWizard;
+
+public class EmptyExampleWizard extends AbstractExampleWizard
+{
+ @Override
+ protected Collection<ProjectDescriptor> getProjectDescriptors() {
+ List<ProjectDescriptor> projects = new ArrayList<ProjectDescriptor>(4);
+ projects.add(new ProjectDescriptor("org.eclipse.qvtd.examples", "zips/qvtr/empty.zip", "EmptyQVTrProject")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ return projects;
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/ModelMorfExampleWizard.java b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/ModelMorfExampleWizard.java
new file mode 100644
index 000000000..c6e0de962
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/ModelMorfExampleWizard.java
@@ -0,0 +1,33 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2008,2009 E.D.Willink 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:
+ * E.D.Willink - initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id: ModelMorfExampleWizard.java,v 1.2 2009/06/20 09:15:07 ewillink Exp $
+ */
+package org.eclipse.qvtd.examples.qvtr.wizards;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.qvtd.examples.wizards.AbstractExampleWizard;
+
+public class ModelMorfExampleWizard extends AbstractExampleWizard
+{
+ @Override
+ protected Collection<ProjectDescriptor> getProjectDescriptors() {
+ List<ProjectDescriptor> projects = new ArrayList<ProjectDescriptor>(4);
+ projects.add(new ProjectDescriptor("org.eclipse.qvtd.examples", "zips/qvtr/modelmorf.zip", "org.eclipse.qvtd.examples.qvtrelation.modelmorf")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ return projects;
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/RelToCoreExampleWizard.java b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/RelToCoreExampleWizard.java
new file mode 100644
index 000000000..889499114
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/qvtr/wizards/RelToCoreExampleWizard.java
@@ -0,0 +1,33 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2008,2009 E.D.Willink 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:
+ * E.D.Willink - initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id: RelToCoreExampleWizard.java,v 1.2 2009/06/20 09:15:07 ewillink Exp $
+ */
+package org.eclipse.qvtd.examples.qvtr.wizards;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.qvtd.examples.wizards.AbstractExampleWizard;
+
+public class RelToCoreExampleWizard extends AbstractExampleWizard
+{
+ @Override
+ protected Collection<ProjectDescriptor> getProjectDescriptors() {
+ List<ProjectDescriptor> projects = new ArrayList<ProjectDescriptor>(4);
+ projects.add(new ProjectDescriptor("org.eclipse.qvtd.examples", "zips/qvtr/reltocore.zip", "org.eclipse.qvtd.examples.qvtrelation.reltocore")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ return projects;
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/wizards/AbstractExampleWizard.java b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/wizards/AbstractExampleWizard.java
new file mode 100644
index 000000000..8741176a7
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/src/org/eclipse/qvtd/examples/wizards/AbstractExampleWizard.java
@@ -0,0 +1,280 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006,2007,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 - Initial API and implementation
+ * E.D.Willink - Re-use of org.eclipse.emf.ocl.examples.internal.wizard.AbstractExampleWizard
+ *
+ * </copyright>
+ *
+ * $Id: AbstractExampleWizard.java,v 1.2 2008/10/27 21:07:32 ewillink Exp $
+ */
+
+package org.eclipse.qvtd.examples.wizards;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.qvtd.examples.QVTDeclarativeExamplesPlugin;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * <p>
+ * This abstract example wizard simply unzips a number of zips
+ * into the workspace as projects. It does not offer any
+ * pages but can be added as a new wizard to the new wizards
+ * dialog through the org.eclipse.ui.newWizards extension point.
+ * </p>
+ * <p>
+ * Clients should subclass this class and override the <code>getProjectDescriptor()</code>
+ * method to provide the location of the project zips that
+ * should be unzipped into the workspace. Note that any projects
+ * that are already in the workspace will <i>not</i> be overwritten
+ * because the user could have made changes to them that would
+ * be lost.
+ * </p>
+ * <p>
+ * It is highly recommended when registering subclasses to the
+ * new wizards extension point that the wizard declaration should
+ * have canFinishEarly = true and hasPages = false. Any label
+ * and icon can be freely given to the wizard to suit the needs
+ * of the client.
+ * </p>
+ */
+public abstract class AbstractExampleWizard extends Wizard
+ implements INewWizard {
+
+ /**
+ * A descriptor class that describes where to find the zipped
+ * contents of a project and what that project should be named
+ * when unzipped into the workspace.
+ */
+ public static class ProjectDescriptor {
+ private String bundleName;
+ private String zipLocation;
+ private String projectName;
+
+ /**
+ * Construct a descriptor that points to a zip file located
+ * in a particular bundle at the given location within that
+ * bundle. Also provided is the project name for which the
+ * zip is the contents. Note that this project name should
+ * be the same as is in the contents not some alternative name.
+ *
+ * @param bundleName The bundle in the runtime that contains the
+ * zipped up project contents.
+ * @param zipLocation The location within the bundle where the
+ * zip file is located.
+ * @param projectName The project name in the workspace that
+ * will be created to house the project contents.
+ */
+ public ProjectDescriptor(String bundleName, String zipLocation, String projectName) {
+ super();
+ this.bundleName = bundleName;
+ this.zipLocation = zipLocation;
+ this.projectName = projectName;
+ }
+
+ public String getBundleName() {
+ return bundleName;
+ }
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ public String getZipLocation() {
+ return zipLocation;
+ }
+ }
+
+ @Override
+ public boolean performFinish() {
+ final Collection<ProjectDescriptor> projectDescriptors = getProjectDescriptors();
+
+ try {
+ getContainer().run(true, false, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor m)
+
+ throws CoreException, InvocationTargetException, InterruptedException {
+ m.beginTask("Unzipping Projects", projectDescriptors.size()); //$NON-NLS-1$
+
+ for (Iterator<ProjectDescriptor> i = projectDescriptors.iterator(); i.hasNext();) {
+ unzipProject(i.next(), m);
+ m.worked(1);
+ }
+ }
+ };
+ op.run(monitor);
+ }
+ });
+ } catch (InvocationTargetException e) {
+ log(e);
+ } catch (InterruptedException e) {
+ // We cannot be interrupted, just proceed as normal.
+ }
+
+ return true;
+ }
+
+ protected void log(Exception e) {
+ QVTDeclarativeExamplesPlugin plugin = QVTDeclarativeExamplesPlugin.getDefault();
+ if (e instanceof CoreException) {
+ plugin.getLog().log(((CoreException)e).getStatus());
+ } else {
+ plugin.getLog().log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(),IStatus.ERROR, e.getMessage(),e));
+ }
+ }
+
+ /**
+ * The subclass provides the specific project descriptors for the
+ * projects that should be unzipped into the workspace. Note that
+ * any projects that already exist in the workspace will not be
+ * overwritten as they may contain changes made by the user.
+ *
+ * @return The collection of project descriptors that should be
+ * unzipped into the workspace.
+ */
+ protected abstract Collection<ProjectDescriptor> getProjectDescriptors();
+
+ private void unzipProject(ProjectDescriptor descriptor, IProgressMonitor monitor) {
+ String bundleName = descriptor.getBundleName();
+ String zipLocation = descriptor.getZipLocation();
+ String projectName = descriptor.getProjectName();
+
+ URL interpreterZipUrl = FileLocator.find(Platform.getBundle(bundleName), new Path(zipLocation), null);
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+
+ if (project.exists()) {
+ return;
+ }
+
+ try {
+ // We make sure that the project is created from this point forward.
+ project.create(monitor);
+
+ ZipInputStream zipFileStream = new ZipInputStream(interpreterZipUrl.openStream());
+ ZipEntry zipEntry = zipFileStream.getNextEntry();
+
+ // We derive a regexedProjectName so that the dots don't end up being
+ // interpreted as the dot operator in the regular expression language.
+ String regexedProjectName = projectName.replaceAll("\\.", "\\."); //$NON-NLS-1$ //$NON-NLS-2$
+
+ while (zipEntry != null) {
+ // We will construct the new file but we will strip off the project
+ // directory from the beginning of the path because we have already
+ // created the destination project for this zip.
+ File file = new File(project.getLocation().toString(), zipEntry.getName().replaceFirst("^"+regexedProjectName+"/", "")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+
+ if (false == zipEntry.isDirectory()) {
+
+ /*
+ * Copy files (and make sure parent directory exist)
+ */
+ File parentFile = file.getParentFile();
+ if (null != parentFile && false == parentFile.exists()) {
+ parentFile.mkdirs();
+ }
+
+ // TODO Figure out why it was necessary to try to convert the encoding in the zip file
+ /*Path path = new Path(file.getPath());
+ if (path.getFileExtension().equals("java")) { //$NON-NLS-1$
+ InputStreamReader is = null;
+ OutputStreamWriter os = null;
+
+ try {
+ is = new InputStreamReader(zipFileStream, "ISO-8859-1"); //$NON-NLS-1$
+ os = new OutputStreamWriter(new FileOutputStream(file),
+ ResourcesPlugin.getEncoding());
+ char[] buffer = new char[102400];
+ while (true) {
+ int len = is.read(buffer);
+ if (zipFileStream.available() == 0)
+ break;
+ os.write(buffer, 0, len);
+ }
+ } finally {
+ if (null != os) {
+ os.close();
+ }
+ }
+ } else {*/
+ OutputStream os = null;
+
+ try {
+ os = new FileOutputStream(file);
+
+ byte[] buffer = new byte[102400];
+ while (true) {
+ int len = zipFileStream.read(buffer);
+ if (zipFileStream.available() == 0) {
+ break;
+ }
+ os.write(buffer, 0, len);
+ }
+ } finally {
+ if (null != os) {
+ os.close();
+ }
+ }
+ //}
+ }
+
+ zipFileStream.closeEntry();
+ zipEntry = zipFileStream.getNextEntry();
+ }
+
+ project.open(monitor);
+ project.refreshLocal(IFile.DEPTH_INFINITE, monitor);
+
+ // Close and re-open the project to force eclipse to re-evaluate
+ // any natures that this project has.
+ project.close(monitor);
+ project.open(monitor);
+ } catch (IOException e) {
+ log(e);
+ } catch (CoreException e) {
+ log(e);
+ }
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ // No code is necessary.
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples/zips/.cvsignore b/examples/org.eclipse.qvtd.examples/zips/.cvsignore
new file mode 100644
index 000000000..66df494d0
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/zips/.cvsignore
@@ -0,0 +1,3 @@
+ocl
+qvtc
+qvtr
diff --git a/examples/org.eclipse.qvtd.examples/zips/.gitignore b/examples/org.eclipse.qvtd.examples/zips/.gitignore
new file mode 100644
index 000000000..62e145628
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples/zips/.gitignore
@@ -0,0 +1,2 @@
+/qvtc
+/qvtr

Back to the top