This commit was manufactured by cvs2svn to create tag 'v20060627-1200'.
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/.classpath b/org.eclipse.gmf.examples.runtime.ui.pde/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/.cvsignore b/org.eclipse.gmf.examples.runtime.ui.pde/.cvsignore
deleted file mode 100644
index 6938697..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-doc
diff --git "a/org.eclipse.gmf.examples.runtime.ui.pde/.externalToolBuilders/org.eclipse.gmf.examples.runtime.ui.pde Gather Examples \133Builder\135.launch" "b/org.eclipse.gmf.examples.runtime.ui.pde/.externalToolBuilders/org.eclipse.gmf.examples.runtime.ui.pde Gather Examples \133Builder\135.launch"
deleted file mode 100644
index 3261d55..0000000
--- "a/org.eclipse.gmf.examples.runtime.ui.pde/.externalToolBuilders/org.eclipse.gmf.examples.runtime.ui.pde Gather Examples \133Builder\135.launch"
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
-<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
-<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
-<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.gmf.examples.runtime.ui.pde/gatherExamples.xml}"/>
-<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
-</launchConfiguration>
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/.project b/org.eclipse.gmf.examples.runtime.ui.pde/.project
deleted file mode 100644
index 0289616..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/.project
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.gmf.examples.runtime.ui.pde</name>
- <comment></comment>
- <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>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/org.eclipse.gmf.examples.runtime.ui.pde Gather Examples [Builder].launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/META-INF/MANIFEST.MF b/org.eclipse.gmf.examples.runtime.ui.pde/META-INF/MANIFEST.MF
deleted file mode 100644
index 87e5f6a..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Plugin.name
-Bundle-SymbolicName: org.eclipse.gmf.examples.runtime.ui.pde; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin
-Bundle-Vendor: %Plugin.providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.gmf.examples.runtime.ui.pde.internal,
- org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n,
- org.eclipse.gmf.examples.runtime.ui.pde.internal.wizards,
- org.eclipse.gmf.examples.runtime.ui.pde.util
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)"
-Eclipse-LazyStart: true
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/about.html b/org.eclipse.gmf.examples.runtime.ui.pde/about.html
deleted file mode 100644
index c258ef5..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!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>June 5, 2006</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/org.eclipse.gmf.examples.runtime.ui.pde/build.properties b/org.eclipse.gmf.examples.runtime.ui.pde/build.properties
deleted file mode 100644
index a609e5b..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-# ==============================================================================
-#*+------------------------------------------------------------------------+
-#*| Copyright (c) 2005 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 |
-#*+------------------------------------------------------------------------+
-# ==============================================================================
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- META-INF/,\
- .,\
- examples/,\
- about.html
-jars.compile.order = .
-source.. = src/
-output.. = bin/
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/examples/.cvsignore b/org.eclipse.gmf.examples.runtime.ui.pde/examples/.cvsignore
deleted file mode 100644
index c4c4ffc..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/examples/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.zip
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/gatherExamples.xml b/org.eclipse.gmf.examples.runtime.ui.pde/gatherExamples.xml
deleted file mode 100644
index 5af9c70..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/gatherExamples.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2005 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 -->
-<project default="gather_examples" basedir=".">
-
- <target name="init">
-
- <property name="workspace.folder" value=".."/>
- <property name="examples.destination" value="${basedir}/examples"/>
- <property name="examples.icons.destination" value="${basedir}/icons"/>
-
- <!-- IMPORTANT: Include new examples here. Example that is added here must be added as a dependency in plugin.xml of this plugin -->
- <patternset id="examples">
- <include name="org.eclipse.gmf.examples.runtime.diagram.geoshapes/geoshapes.zip"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic/logic.zip"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic.model/logicSemantic.zip"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic.model.edit/logicSemanticEdit.zip"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic.model.editor/logicSemanticEditor.zip"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.decorator/servicesDecorator.zip"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.layout/servicesLayout.zip"/>
- <include name="org.eclipse.gmf.examples.runtime.common.service/serviceExample.zip"/>
- </patternset>
-
- <!-- IMPORTANT: Include new example icons here -->
- <patternset id="icons">
- <include name="org.eclipse.gmf.examples.runtime.diagram.geoshapes/icons/geoshape.gif"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic/icons/logic.gif"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic.model/icons/Circuit.gif"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic.model.edit/icons/full/obj16/Element.gif"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.logic.model.editor/icons/full/obj16/SemanticModelFile.gif"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.decorator/icons/diagram.gif"/>
- <include name="org.eclipse.gmf.examples.runtime.diagram.layout/icons/diagram2.gif"/>
- </patternset>
-
- </target>
-
- <target name="gather_examples" depends="init">
-
- <copy todir="${examples.destination}" flatten="true">
- <fileset dir="${workspace.folder}">
- <patternset refid="examples"/>
- </fileset>
- </copy>
-
- <copy todir="${examples.icons.destination}" flatten="true">
- <fileset dir="${workspace.folder}">
- <patternset refid="icons"/>
- </fileset>
- </copy>
-
- </target>
-
-</project>
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/icons/.cvsignore b/org.eclipse.gmf.examples.runtime.ui.pde/icons/.cvsignore
deleted file mode 100644
index 2d0c929..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/icons/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.gif
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/plugin.properties b/org.eclipse.gmf.examples.runtime.ui.pde/plugin.properties
deleted file mode 100644
index dd15912..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/plugin.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-# ==============================================================================
-#*+------------------------------------------------------------------------+
-#*| Copyright (c) 2005 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 |
-#*+------------------------------------------------------------------------+
-# ==============================================================================
-#
-# START TRANSLATABLE
-#
-
-Plugin.name = GMF Examples Plug-in
-Plugin.providerName = Eclipse.org
-
-newWizardCategories.examples.runtimePDEPlugin = GMF (Graphical Modeling Framework) Plug-ins
-
-newWizards.examples.logic.name = Logic
-newWizards.examples.logic.desc = Create plug-ins that collectively contribute an editor to edit a logic diagram using the Modeling Platform Diagram Layer
-
-newWizards.examples.geoshapes.name = Geoshape
-newWizards.examples.geoshapes.desc = Create a plug-in that contributes an editor to edit a diagram containing geometric shapes using the Modeling Platform Diagram Layer
-
-newWizards.examples.layoutservice.name = Square Layout Provider
-newWizards.examples.layoutservice.desc = Create a plug-in that contributes a layout provider that positions the shapes of a diagram in a square geometry to demonstrate how to construct a custom layout.
-
-newWizards.examples.decorationservice.name = Review Decorator Provider
-newWizards.examples.decorationservice.desc = Create a plug-in that contributes a decorator provider that demonstrates how to adorn a note with an icon depending on the contents of the text (Passed vs. Failed)
-
-newWizards.examples.serviceexample.name = Service
-newWizards.examples.serviceexample.description = Creates the Service Example Plugin which demonstrates the use of the Service.
-
-
-#
-# END TRANSLATABLE
-#
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/plugin.xml b/org.eclipse.gmf.examples.runtime.ui.pde/plugin.xml
deleted file mode 100644
index 13b3c40..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/plugin.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!-- Copyright (c) 2005 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 -->
-<plugin>
- <extension
- point="org.eclipse.ui.newWizards">
- <category
- name="%newWizardCategories.examples.runtimePDEPlugin"
- parentCategory="org.eclipse.ui.Examples"
- id="org.eclipse.gmf.examples.runtime">
- </category>
-
- <wizard
- name="%newWizards.examples.logic.name"
- icon="icons/logic.gif"
- category="org.eclipse.ui.Examples/org.eclipse.gmf.examples.runtime"
- class="org.eclipse.gmf.examples.runtime.ui.pde.internal.wizards.LogicNewWizard"
- project="true"
- finalPerspective="org.eclipse.pde.ui.PDEPerspective"
- id="org.eclipse.gmf.examples.runtime.ui.pde.wizards.logic">
- <description>
- %newWizards.examples.logic.desc
- </description>
- </wizard>
-
- <wizard
- name="%newWizards.examples.geoshapes.name"
- icon="icons/geoshape.gif"
- category="org.eclipse.ui.Examples/org.eclipse.gmf.examples.runtime"
- class="org.eclipse.gmf.examples.runtime.ui.pde.internal.wizards.GeoshapeNewWizard"
- project="true"
- finalPerspective="org.eclipse.pde.ui.PDEPerspective"
- id="org.eclipse.gmf.examples.runtime.ui.pde.wizards.geoshapes">
- <description>
- %newWizards.examples.geoshapes.desc
- </description>
- </wizard>
-
- <wizard
- name="%newWizards.examples.layoutservice.name"
- icon="icons/diagram2.gif"
- category="org.eclipse.ui.Examples/org.eclipse.gmf.examples.runtime"
- class="org.eclipse.gmf.examples.runtime.ui.pde.internal.wizards.LayoutNewWizard"
- project="true"
- finalPerspective="org.eclipse.pde.ui.PDEPerspective"
- id="org.eclipse.gmf.examples.runtime.ui.pde.wizards.layoutService">
- <description>
- %newWizards.examples.layoutservice.desc
- </description>
- </wizard>
-
- <wizard
- name="%newWizards.examples.decorationservice.name"
- icon="icons/diagram.gif"
- category="org.eclipse.ui.Examples/org.eclipse.gmf.examples.runtime"
- class="org.eclipse.gmf.examples.runtime.ui.pde.internal.wizards.DecoratorNewWizard"
- project="true"
- finalPerspective="org.eclipse.pde.ui.PDEPerspective"
- id="org.eclipse.gmf.examples.runtime.ui.pde.wizards.decoratorService">
- <description>
- %newWizards.examples.decorationservice.desc
- </description>
- </wizard>
-
- <wizard
- category="org.eclipse.ui.Examples/org.eclipse.gmf.examples.runtime"
- class="org.eclipse.gmf.examples.runtime.ui.pde.internal.wizards.ServiceExampleNewWizard"
- finalPerspective="org.eclipse.pde.ui.PDEPerspective"
- icon="icons/diagram.gif"
- id="org.eclipse.gmf.examples.runtime.common.service.wizards"
- name="%newWizards.examples.serviceexample.name"
- project="true">
- <description>
- %newWizards.examples.serviceexample.description
- </description>
- </wizard>
-
- </extension>
-</plugin>
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesDebugOptions.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesDebugOptions.java
deleted file mode 100644
index 00a4c8a..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesDebugOptions.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2002, 2003 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.gmf.examples.runtime.ui.pde.internal;
-
-/**
- * A list of debug options for this plug-in.
- *
- * @author khussey
- *
- */
-public final class GmfExamplesDebugOptions {
-
- /**
- * This class should not be instantiated since it is a static constant
- * class.
- *
- */
- private GmfExamplesDebugOptions() {
- /* private constructor */
- }
-
- /** Debug option. */
- public static final String DEBUG = GmfExamplesPlugin.getPluginId() + "/debug"; //$NON-NLS-1$
-
- /** Debug option for tracing exception catching. */
- public static final String EXCEPTIONS_CATCHING = DEBUG + "/exceptions/catching"; //$NON-NLS-1$
-
- /** Debug option for tracing exception throwing. */
- public static final String EXCEPTIONS_THROWING = DEBUG + "/exceptions/throwing"; //$NON-NLS-1$
-
- /** Debug option for tracing method entering. */
- public static final String METHODS_ENTERING = DEBUG + "/methods/entering"; //$NON-NLS-1$
-
- /** Debug option for tracing method exiting. */
- public static final String METHODS_EXITING = DEBUG + "/methods/exiting"; //$NON-NLS-1$
-
- /** Debug option for tracing command admin. */
- public static final String COMMANDS_ADMIN = DEBUG + "/commands/admin"; //$NON-NLS-1$
-
- /** Debug option for trasing command execution. */
- public static final String COMMANDS_EXECUTE = DEBUG + "/commands/execute"; //$NON-NLS-1$
-
- /** Debug option for tracing command undo. */
- public static final String COMMANDS_UNDO = DEBUG + "/commands/undo"; //$NON-NLS-1$
-
- /** Debug option for tracing command redo. */
- public static final String COMMANDS_REDO = DEBUG + "/commands/redo"; //$NON-NLS-1$
-
- /** Debug option for tracing service configuration. */
- public static final String SERVICES_CONFIG = DEBUG + "/services/config"; //$NON-NLS-1$
-
- /** Debug option for tracing service activation. */
- public static final String SERVICES_ACTIVATE = DEBUG + "/services/activate"; //$NON-NLS-1$
-
- /** Debug option for tracing service execution. */
- public static final String SERVICES_EXECUTE = DEBUG + "/services/execute"; //$NON-NLS-1$
-
- /** Debug option for tracing on demand loading. */
- public static final String ONDEMANEDLOADING = DEBUG + "/plugin/ondemand/loading";//$NON-NLS-1$
-
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesPlugin.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesPlugin.java
deleted file mode 100644
index 027bedf..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesPlugin.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004 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.gmf.examples.runtime.ui.pde.internal;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class GmfExamplesPlugin
- extends AbstractUIPlugin {
-
- /** The shared instance. */
- private static GmfExamplesPlugin fPlugin;
-
- /**
- * Constructor.
- */
- public GmfExamplesPlugin() {
- super();
- fPlugin = this;
- }
-
- /**
- * Returns the shared instance.
- *
- * @return The plugin instance of <code>GmfExamplesPlugin</code>
- */
- public static GmfExamplesPlugin getDefault() {
- return fPlugin;
- }
-
- /**
- * Retrieves the unique identifier of this plug-in.
- *
- * @return A non-empty string and is unique within the plug-in registry.
- */
- public static String getPluginId() {
- return getDefault().getBundle().getSymbolicName();
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesStatusCodes.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesStatusCodes.java
deleted file mode 100644
index 4a84dfa..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/GmfExamplesStatusCodes.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2002, 2003 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.gmf.examples.runtime.ui.pde.internal;
-
-/**
- * A list of status codes for this plug-in.
- *
- * @author khussey
- *
- */
-public final class GmfExamplesStatusCodes {
-
- /**
- * This class should not be instantiated since it is a static constant
- * class.
- *
- */
- private GmfExamplesStatusCodes() {
- //No-op
- }
-
- /**
- * Status code indicating that an error occurred with internationalization.
- */
- public static final int L10N_FAILURE = 3;
-
- /**
- * Status code indicating that an error occurred with a service.
- */
- public static final int SERVICE_FAILURE = 5;
-
- /**
- * Error caused by an exception
- */
- public static final int EXCEPTION_OCCURED = 10;
-
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/AbstractResourceManager.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/AbstractResourceManager.java
deleted file mode 100644
index ad3ebba..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/AbstractResourceManager.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2002, 2005 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.gmf.examples.runtime.ui.pde.internal.l10n;
-
-import java.text.MessageFormat;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Plugin;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesDebugOptions;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesStatusCodes;
-import org.eclipse.gmf.examples.runtime.ui.pde.util.Log;
-import org.eclipse.gmf.examples.runtime.ui.pde.util.StringStatics;
-import org.eclipse.gmf.examples.runtime.ui.pde.util.Trace;
-
-/**
- * <p>
- * AbstractResourceManager is an abstract class which is designed to encapsulate a behaviour
- * of an object that provides a single point of access to the I18N and resource management
- * per logical cluster of Java packages.
- * </p>
- * <p>
- * The logical cluster, though can be equivalent, but not limited to one per plug-in.
- * For instance, a logical cluster in the plug-in devoted to UML diagrams can be
- * split into as many logical clusters, as there are types of diagrams in the plug-in.
- * That is - a plugin that is dedicated to collaboration and sequence diagrams, can be
- * split into two logical clusters, each requiring separate resource management -
- * one for collaboration diagram, and another for sequence diagram.
- * </p>
- * <p>
- * Each cluster should allocate a dedicated package for I18N and resource management. The
- * preferred convention is use i18n package suffix to designate such package. For example,
- * com.ibm.diagrams.collaboration.l10n and com.ibm.diagrams.sequence.l10n are
- * designated packages for resource and I18N management.
- * </p>
- * <p>
- * Each cluster-oriented resource management package will have a single
- * <code>org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n.AbstractResourceManager</code> subclass. The subclass should
- * have a singleton instance and override, if necessary, the resource initialization method
- * <code>
- * initializeMessageResources()
- * </code>
- * to add the assignments of values to any value holding static variables declared in the
- * subclass. The subclass can be designated to hold
- * any resource and I18N related static variables if necessary, e.g. message resource bundle
- * keys.
- *
- * The <code>initilaizeResources()</code> method should be overridden by subclasses in order to
- * add/remove initialization of any additional/redundant resource types
- * </p>
- * <p>
- * The subclass should override if necessary the default names of the message resource bundle
- * file (default MessageBundle) using the method:
- * <code>
- * getMessageBundleName()
- * </code>
- * </p>
- * <p>
- * On the file system side the convention is to store all resources associated with the given
- * cluster in the designated i18n package. That includes messages.properties.
- * For example, com.ibm.diagram.collaboration cluster will store
- * its resources here:
- * com/
- * rational/
- * diagram/
- * collaboration/
- * l10n/
- * messages.properties
- * </p>
- * <p>
- * Synchronization aspects
- *
- * The instances of this class are immutable, once created and initialized.
- *
- * @see java.util.ResourceBundle
- * @author Natalia Balaba
- * @canBeSeenBy %partners
- */
-
-public abstract class AbstractResourceManager {
- // --------------------------------------------------------------------//
- // ------------ STATIC VARIABLES BEGIN -------------------------------//
- // --------------------------------------------------------------------//
-
- // strings that used to compose default resource names
-
- private static final String MESSAGES = ".messages"; //$NON-NLS-1$
-
- private static final String MISSING_RESOURCE_MESSAGE = "Attempt to access missing resource ({0})."; //$NON-NLS-1$
-
- //
- // Resource bundle keys for localizable components of a list of items.
- // Note that these strings are localized in the Common Core plug-in's
- // message resource bundle, not in my subclass's plug-in's bundle!
- //
- /** Key for list separator. */
- static final String KEY_LIST_SEPARATOR = "list.separator"; //$NON-NLS-1$
-
- /** Ksy for list separator only. */
- static final String KEY_LIST_SEPARATOR_ONLY = "list.separator.only"; //$NON-NLS-1$
-
- /** Key for first list separator. */
- static final String KEY_LIST_SEPARATOR_FIRST = "list.separator.first"; //$NON-NLS-1$
-
- /** Key for last list separator. */
- static final String KEY_LIST_SEPARATOR_LAST = "list.separator.last"; //$NON-NLS-1$
-
- /** Key for list prefix. */
- static final String KEY_LIST_PREFIX = "list.prefix"; //$NON-NLS-1$
-
- /** Key for list suffix. */
- static final String KEY_LIST_SUFFIX = "list.suffix"; //$NON-NLS-1$
-
- /** Key for default list separator. */
- static final String DEFAULT_LIST_SEPARATOR = ", "; //$NON-NLS-1$
-
- /** Key for default list prefix. */
- static final String DEFAULT_LIST_PREFIX = ""; //$NON-NLS-1$
-
- /** Key for default list suffix. */
- static final String DEFAULT_LIST_SUFFIX = ""; //$NON-NLS-1$
-
- // --------------------------------------------------------------------//
- // ------------ STATIC VARIABLES END ---------------------------------//
- // --------------------------------------------------------------------//
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE VARIABLES BEGIN -----------------------------//
- // --------------------------------------------------------------------//
-
- /**
- * a resource bundle that stores I18N message resources
- */
- private ResourceBundle messagesBundle = null;
-
- /*
- * the strings that point to the names and locations of the resources.
- * subclasses must override if name of the messages bundle is different
- * from the default
- */
-
- /**
- * The name of the messages bundle. The default is "messages"
- */
- private String messagesBundleName = null;
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE VARIABLES END ------------------------------//
- // --------------------------------------------------------------------//
-
- // --------------------------------------------------------------------//
- // ------------ CONSTRUCTORS BEGIN ---------------------------------//
- // --------------------------------------------------------------------//
-
- /**
- * Create a resource manager instance and initialize resources it will manage.
- * Subclasses should be declared final and have a singleton instance. If the
- * name of the messages bundle is different from the default the subclasses
- * should override getMessagesBundleDefaultName()
- */
- protected AbstractResourceManager() {
- super();
- messagesBundleName = getMessagesBundleDefaultName();
-
- initializeResources();
- }
-
- // --------------------------------------------------------------------//
- // ------------ CONSTRUCTORS BEGIN ---------------------------------//
- // --------------------------------------------------------------------//
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE METHODS BEGIN ------------------------------//
- // --------------------------------------------------------------------//
-
- /**
- * Returns the messageBundle.
- * Resource bundles contain locale-specific objects - text, numbers, etc.
- * @return the message bundle
- */
- protected ResourceBundle getMessagesBundle() {
- return messagesBundle;
- }
-
- /**
- * Returns a package name of the class of this object
- * @return - the full name if the client resource package
- */
- protected String getPackageName() {
- return getClass().getPackage().getName();
- }
-
- /**
- * Returns the name of the messages bundle, including the package path.
- * E.g. for MessageBundle.properties file located at
- * com.ibm.diagrams.collaboration.l10n
- * the name returned will be com.ibm.diagrams.collaboration.l10n.MessageBundle
- * @return - messages bundle name
- */
- protected String getMessagesBundleName() {
- return messagesBundleName;
- }
-
- /**
- * Returns the plugin that hosts the resource manager
- * @return Plugin the plugin that hosts the resource manager
- */
- protected abstract Plugin getPlugin();
-
- /**
- * Load various resources. Do nothing by default.
- * Subclasses should override this method to include initialization of the
- * particular resource types.
- */
- protected abstract void initializeResources();
-
- /**
- * Populate messageBundle with text related resources from the MessageBundle
- * properties file.
- * This method provides single assignment point to the private variable messagesBundle.
- * To override default initialization subclasses should override createMessagesBundle()
- * @see #createMessagesBundle()
- */
- protected void initializeMessageResources() {
- messagesBundle = createMessagesBundle();
- }
-
- /**
- * Load messages resource bundle.
- *
- * If resource bundle is missing creates an instance of EmptyResourceBundle and
- * returns that as a default value
- * @return - messages resource bundle
- */
-
- protected ResourceBundle createMessagesBundle() {
- try {
- return ResourceBundle.getBundle(
- getMessagesBundleName(),
- Locale.getDefault(),
- getClass().getClassLoader());
- } catch (MissingResourceException mre) {
- Trace.catching(GmfExamplesPlugin.getDefault(), GmfExamplesDebugOptions.EXCEPTIONS_CATCHING, getClass(), "createMessagesBundle", mre); //$NON-NLS-1$
- Log.error(GmfExamplesPlugin.getDefault(), GmfExamplesStatusCodes.L10N_FAILURE, "createMessagesBundle", mre); //$NON-NLS-1$
- return new EmptyResourceBundle(getMessagesBundleName());
- }
-
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- * @return - value for the given key or the key if value
- * @param key java.lang.String the key to retrieve the value
- */
- public String getString(String key) {
- return getString(key, key);
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or defaultValue if not found.
- * @return - value for the given key or the suuplied
- * default if value was not found
- * @param key java.lang.String the key to retrieve the value
- * @param defaultValue java.lang.String the default value to return
- * if no value by the given key was
- * found
- */
- public String getString(String key, String defaultValue) {
- try {
- return getMessagesBundle().getString(key);
- } catch (MissingResourceException mre) {
- Trace.catching(GmfExamplesPlugin.getDefault(), GmfExamplesDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getString", mre); //$NON-NLS-1$
- Log.warning(
- GmfExamplesPlugin.getDefault(),
- GmfExamplesStatusCodes.L10N_FAILURE,
- MessageFormat.format(
- MISSING_RESOURCE_MESSAGE,
- new Object[] { key }),
- mre);
-
- return defaultValue;
- }
- }
-
- /**
- * Creates a localized, parameterized message from the specified pattern
- * in the resource bundle.
- *
- * @param patternKey resource bundle key of the message pattern
- * @param args objects to substitute into the <tt>{0}</tt>, <tt>{1}</tt>,
- * etc. parameters in the message pattern
- * @return the formatted message
- *
- * @see MessageFormat
- */
- public String formatMessage(String patternKey, Object[] args) {
- final String pattern = getString(patternKey);
-
- try {
- return MessageFormat.format(pattern, args);
- } catch (Exception e) {
- // formats may throw IllegalArgumentExceptions and others
- Trace.catching(
- getPlugin(),
- GmfExamplesDebugOptions.EXCEPTIONS_CATCHING,
- ResourceManager.class,
- "messageFormat", //$NON-NLS-1$
- e);
-
- return pattern; // better than nothing?
- }
- }
-
- /**
- * Formats an array of strings according to the conventions of the locale.
- * For example, in English locales, the result is a comma-separated list
- * with "and" preceding the last item (no commas if there are only two
- * items). The entry in a singleton array is returned as is.
- *
- * @param strings an array of strings to format into a list
- * @return the list, <code>strings[0]</code> if there is only one element,
- * or <code>""</code> if the array has no elements
- */
- public String formatList(String[] strings) {
- return formatList(java.util.Arrays.asList(strings));
- }
-
- /**
- * <p>
- * Formats a collection of objects according to the conventions of the
- * locale.
- * For example, in English locales, the result is a comma-separated list
- * with "and" preceding the last item (no commas if there are only two
- * items).
- * </p>
- * <p>
- * The individual elements of the collection are converted to strings using
- * the {@link String#valueOf(java.lang.Object)} method.
- * </p>
- *
- * @param items an array of objects to format into a list
- * @return the list, <code>strings[0]</code> if there is only one element,
- * or <code>""</code> if the array has no elements
- */
- public String formatList(Collection items) {
- switch (items.size()) {
- case 0 :
- return StringStatics.BLANK;
- case 1 :
- return String.valueOf(items.iterator().next());
- case 2 :
- return formatPair(ResourceManager.getInstance(), items);
- default :
- return formatList(ResourceManager.getInstance(), items);
- }
- }
-
- /**
- * Helper method to format a two-item list (which in some locales looks
- * different from a list of more than two items).
- *
- * @param mgr the common core plug-in's resource manager, which is used to
- * retrieve the localized components of a list
- * @param items the pair of items (must be exactly two)
- * @return the pair as a string
- *
- * @see #formatList(Collection)
- */
- private String formatPair(AbstractResourceManager mgr, Collection items) {
- Iterator iter = items.iterator();
-
- StringBuffer result = new StringBuffer(32);
-
- result.append(iter.next());
-
- result.append(mgr.getString(
- KEY_LIST_SEPARATOR_ONLY,
- mgr.getString(
- KEY_LIST_SEPARATOR,
- DEFAULT_LIST_SEPARATOR)));
-
- result.append(iter.next());
-
- return result.toString();
- }
-
- /**
- * Helper method to format a list of more than two items.
- *
- * @param mgr the common core plug-in's resource manager, which is used to
- * retrieve the localized components of a list
- * @param items the list of items (must be more than two)
- * @return the list as a string
- *
- * @see #formatList(Collection)
- */
- private String formatList(AbstractResourceManager mgr, Collection items) {
- Iterator iter = items.iterator();
- int max = items.size() - 1;
-
- final String sep = mgr.getString(
- KEY_LIST_SEPARATOR,
- DEFAULT_LIST_SEPARATOR);
-
- StringBuffer result = new StringBuffer(32);
-
- result.append(mgr.getString(KEY_LIST_PREFIX, DEFAULT_LIST_PREFIX));
-
- for (int i = 0; i <= max; i++) {
- if (i == 1) {
- result.append(mgr.getString(KEY_LIST_SEPARATOR_FIRST, sep));
- } else if (i == max) {
- result.append(mgr.getString(KEY_LIST_SEPARATOR_LAST, sep));
- } else if (i > 1) {
- result.append(sep);
- }
-
- result.append(iter.next());
- }
-
- result.append(mgr.getString(KEY_LIST_SUFFIX, DEFAULT_LIST_SUFFIX));
-
- return result.toString();
- }
-
- /**
- * Returns default name for the messages bundle. Subclasses should override
- * if the messages bundle name differs from the default
- * @return - default name for the messages bundle
- */
- protected String getMessagesBundleDefaultName() {
- return getPackageName() + MESSAGES;
- }
-
-
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE METHODS END --------------------------------//
- // --------------------------------------------------------------------//
-
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/EmptyResourceBundle.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/EmptyResourceBundle.java
deleted file mode 100644
index d9167fe..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/EmptyResourceBundle.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2002, 2005 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.gmf.examples.runtime.ui.pde.internal.l10n;
-
-import java.text.MessageFormat;
-import java.util.Enumeration;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesStatusCodes;
-import org.eclipse.gmf.examples.runtime.ui.pde.util.Log;
-
-/**
- * The EmptyResourceBundle represents a resource bundle object that is always empty.
- * This object is used as a deafult return value whenever the loading of a resource bundle
- * has failed. The object keeps error logging every attempt to access to.
- *
- * @author Natalia Balaba
- * @canBeSeenBy %partners
- */
-public final class EmptyResourceBundle extends ResourceBundle {
-
- // --------------------------------------------------------------------//
- // ------------ STATIC VARIABLES BEGIN -------------------------------//
- // --------------------------------------------------------------------//
-
- /**
- * error message
- */
- private static String MISSING_BUNDLE_MESSAGE = "Resource bundle ({0}) is missing."; //$NON-NLS-1$
-
- /**
- * error message
- */
- private static String INVALID_ACCESS_MESSAGE = "Attempt to access resource in missing bundle ({0})."; //$NON-NLS-1$
-
- // --------------------------------------------------------------------//
- // ------------ STATIC VARIABLES END ---------------------------------//
- // --------------------------------------------------------------------//
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE VARIABLES BEGIN -----------------------------//
- // --------------------------------------------------------------------//
-
- /**
- * name of the bundle that failed to load - will be used for exception
- * messages
- */
- private String bundleName = null;
-
- /**
- * collection of bundle keys - always empty
- */
- private Vector keys = new Vector();
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE VARIABLES END -------------------------------//
- // --------------------------------------------------------------------//
-
- // --------------------------------------------------------------------//
- // ------------ CONSTRUCTORS BEGIN -----------------------------------//
- // --------------------------------------------------------------------//
-
- /**
- * Create an instance of EmptyResourceBundle and log the error to the log
- * file.
- *
- * @param bundleName name of the bundle
- */
- public EmptyResourceBundle(String bundleName) {
- super();
- this.bundleName = bundleName;
- Log.warning(
- GmfExamplesPlugin.getDefault(),
- GmfExamplesStatusCodes.L10N_FAILURE,
- MessageFormat.format(
- MISSING_BUNDLE_MESSAGE,
- new Object[] { getBundleName()}));
- }
-
- // --------------------------------------------------------------------//
- // ------------ CONSTRUCTORS END -------------------------------------//
- // --------------------------------------------------------------------//
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE METHODS BEGIN -------------------------------//
- // --------------------------------------------------------------------//
-
- /* This method always returns null - since there is not associated value
- * @see java.util.ResourceBundle#handleGetObject(String)
- */
- protected Object handleGetObject(String key) {
- return null;
- }
-
- /*
- * Return empty keys enumeration
- * @see java.util.ResourceBundle#getKeys()
- */
- public Enumeration getKeys() {
- Log.warning(
- GmfExamplesPlugin.getDefault(),
- GmfExamplesStatusCodes.L10N_FAILURE,
- MessageFormat.format(
- INVALID_ACCESS_MESSAGE,
- new Object[] { getBundleName()}));
-
- return keys.elements();
- }
-
- /**
- * Returns the bundleName.
- * @return java.lang.String - name of the missing resource bundle
- */
- private String getBundleName() {
- return bundleName;
- }
-
- // --------------------------------------------------------------------//
- // ------------ INSTANCE METHODS END ---------------------------------//
- // --------------------------------------------------------------------//
-
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/ResourceManager.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/ResourceManager.java
deleted file mode 100644
index 6dc3ce8..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/ResourceManager.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004 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.gmf.examples.runtime.ui.pde.internal.l10n;
-
-import org.eclipse.core.runtime.Plugin;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-
-
-/**
- * A singleton resource manager object that manages string, image, font and
- * cursor types of resources for this plug-in.
- */
-public final class ResourceManager
- extends AbstractResourceManager {
-
- /**
- * Singleton instance for the resource manager.
- */
- private static AbstractResourceManager resourceManager = new ResourceManager();
-
- /**
- * Constructs a new resource manager.
- */
- private ResourceManager() {
- super();
- }
-
- /**
- * Retrieves the singleton instance of this resource manager.
- *
- * @return The singleton resource manager.
- */
- public static AbstractResourceManager getInstance() {
- return resourceManager;
- }
-
- /**
- * Retrieves a localized string for the specified key.
- *
- * @return A localized string value, or a key if the bundle does not contain
- * this entry.
- * @param key
- * The resource bundle key.
- */
- public static String getI18NString(String key) {
- return getInstance().getString(key);
- }
-
- /**
- * Initializes this resource manager's resources.
- *
- */
- protected void initializeResources() {
- initializeMessageResources();
- }
-
- protected Plugin getPlugin() {
- return GmfExamplesPlugin.getDefault();
- }
-
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/messages.properties b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/messages.properties
deleted file mode 100644
index 9032f05..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/l10n/messages.properties
+++ /dev/null
@@ -1,61 +0,0 @@
-# ==============================================================================
-#*+------------------------------------------------------------------------+
-#*| Copyright (c) 2005 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 |
-#*+------------------------------------------------------------------------+
-# ==============================================================================
-#
-# START TRANSLATABLE
-#
-
-Logic.wizard.createProjectPage.title = Modeling Logic Diagram Plug-in Project Creation
-Logic.wizard.createProjectPage.desc = Create the three plug-in projects of the logic example
-
-Geoshapes.wizard.createProjectPage.title = Modeling Geoshapes Diagram Plug-in Project Creation
-Geoshapes.wizard.createProjectPage.desc = Create the plug-in project of the Geoshapes example
-
-LayoutService.wizard.createProjectPage.title = Square Layout Provider Diagram Plug-in
-LayoutService.wizard.createProjectPage.desc = Create a plug-in that contributes a layout provider that positions the shapes of a diagram in a square geometry to demonstrate how to construct a custom layout
-
-DecoratorService.wizard.createProjectPage.title = Review Decorator Provider Diagram Plug-in
-DecoratorService.wizard.createProjectPage.desc = Create a plug-in that contributes a decorator provider that demonstrates how to adorn a note with an icon depending on the contents of the text (Passed vs. Failed)
-
-emf.msl.title = EMF Model Services Layer Plug-in Project Creation
-emf.msl.desc = Create the plug-in project for the EMF Model Services Layer support example
-
-emf.clipboard.copypaste.title = EMF Clipboard Support Plug-in Project Creation
-emf.clipboard.copypaste.desc = Create the plug-in project for the EMF clipboard support example
-
-emf.ocl.interpreter.title = EMF OCL Interpreter Plug-in Project Creation
-emf.ocl.interpreter.desc = Create the plug-in project for the EMF OCL interpreter example
-
-emf.ocl.query.title = EMF OCL Query Plug-in Project Creation
-emf.ocl.query.desc = Create the plug-in project for the EMF OCL query example
-
-emf.ocl.validation.title = EMF OCL Validation Plug-in Project Creation
-emf.ocl.validation.desc = Create the plug-in project for the EMF OCL validation constraints example
-
-emf.query.statements.title = EMF Query Statements Plug-in Project Creation
-emf.query.statements.desc = Create the plug-in project for the EMF query statements example
-
-emf.validation.adapter.title = EMF Validation Adapter Plug-in Project Creation
-emf.validation.adapter.desc = Create the plug-in project for the EMF Validation Framework EValidator adapter
-
-emf.validation.general.title = EMF Validation Example Plug-in Project Creation
-emf.validation.general.desc = Create the plug-in project for the EMF validation API example
-
-ServiceExample.wizard.createProjectPage.title = Service Example Plug-in Project Creation
-ServiceExample.wizard.createProjectPage.desc = Creates the Service Example plug-in project
-
-monitor.creatingProject = Creating Project
-monitor.unzippingProject = - Copying archive into the new project
-
-#
-# END TRANSLATABLE
-#
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/DecoratorNewWizard.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/DecoratorNewWizard.java
deleted file mode 100644
index 2ce619f..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/DecoratorNewWizard.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005 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.gmf.examples.runtime.ui.pde.internal.wizards;
-
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n.ResourceManager;
-
-/**
- * This wizard generates the Review Decorator plug-in sample.
- */
-public class DecoratorNewWizard
- extends ProjectUnzipperNewWizard {
-
- /** Wizard page title. */
- private static final String DECORATORSERVICE_WIZARD_CREATEPROJECTPAGE_TITLE = ResourceManager
- .getI18NString("DecoratorService.wizard.createProjectPage.title"); //$NON-NLS-1$
-
- /** Wizard page description. */
- private static final String DECORATORSERVICE_WIZARD_CREATEPROJECTPAGE_DESC = ResourceManager
- .getI18NString("DecoratorService.wizard.createProjectPage.desc"); //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public DecoratorNewWizard() {
- super("exampleProjectLocation", //$NON-NLS-1$
- DECORATORSERVICE_WIZARD_CREATEPROJECTPAGE_TITLE,
- DECORATORSERVICE_WIZARD_CREATEPROJECTPAGE_DESC,
- "org.eclipse.gmf.examples.runtime.diagram.decorator", //$NON-NLS-1$
- GmfExamplesPlugin
- .getDefault().find(new Path("examples/servicesDecorator.zip"))); //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/GeoshapeNewWizard.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/GeoshapeNewWizard.java
deleted file mode 100644
index 5cd6a17..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/GeoshapeNewWizard.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004 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.gmf.examples.runtime.ui.pde.internal.wizards;
-
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n.ResourceManager;
-
-/**
- * This wizard generates the Geoshapes plug-in sample.
- */
-public class GeoshapeNewWizard
- extends ProjectUnzipperNewWizard {
-
- /** Wizard page title. */
- private static final String GEOSHAPES_WIZARD_CREATEPROJECTPAGE_TITLE = ResourceManager
- .getI18NString("Geoshapes.wizard.createProjectPage.title"); //$NON-NLS-1$
-
- /** Wizard page description. */
- private static final String GEOSHAPES_WIZARD_CREATEPROJECTPAGE_DESC = ResourceManager
- .getI18NString("Geoshapes.wizard.createProjectPage.desc"); //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public GeoshapeNewWizard() {
- super("exampleProjectLocation", //$NON-NLS-1$
- GEOSHAPES_WIZARD_CREATEPROJECTPAGE_TITLE,
- GEOSHAPES_WIZARD_CREATEPROJECTPAGE_DESC,
- "org.eclipse.gmf.examples.runtime.diagram.geoshapes", //$NON-NLS-1$
- GmfExamplesPlugin
- .getDefault().find(new Path("examples/geoshapes.zip"))); //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/LayoutNewWizard.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/LayoutNewWizard.java
deleted file mode 100644
index bb0bd6f..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/LayoutNewWizard.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005 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.gmf.examples.runtime.ui.pde.internal.wizards;
-
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n.ResourceManager;
-
-/**
- * This wizard generates the Layout provider plug-in sample.
- */
-public class LayoutNewWizard
- extends ProjectUnzipperNewWizard {
-
- /** Wizard page title. */
- private static final String LAYOUTSERVICE_WIZARD_CREATEPROJECTPAGE_TITLE = ResourceManager
- .getI18NString("LayoutService.wizard.createProjectPage.title"); //$NON-NLS-1$
-
- /** Wizard page description. */
- private static final String LAYOUTSERVICE_WIZARD_CREATEPROJECTPAGE_DESC = ResourceManager
- .getI18NString("LayoutService.wizard.createProjectPage.desc"); //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public LayoutNewWizard() {
- super("exampleProjectLocation", //$NON-NLS-1$
- LAYOUTSERVICE_WIZARD_CREATEPROJECTPAGE_TITLE,
- LAYOUTSERVICE_WIZARD_CREATEPROJECTPAGE_DESC,
- "org.eclipse.gmf.examples.runtime.diagram.layout", //$NON-NLS-1$
- GmfExamplesPlugin
- .getDefault().find(new Path("examples/servicesLayout.zip"))); //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/LogicNewWizard.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/LogicNewWizard.java
deleted file mode 100644
index 97b97a6..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/LogicNewWizard.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005 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.gmf.examples.runtime.ui.pde.internal.wizards;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n.ResourceManager;
-
-/**
- * This wizard generates the geoshapes example plug-in.
- */
-public class LogicNewWizard
- extends ProjectUnzipperNewWizard {
-
- /**
- * Wizard page title
- */
- private static final String LOGIC_WIZARD_CREATEPROJECTPAGE_TITLE = ResourceManager
- .getI18NString("Logic.wizard.createProjectPage.title"); //$NON-NLS-1$
-
- /**
- * Wizard page description
- */
- private static final String LOGIC_WIZARD_CREATEPROJECTPAGE_DESC = ResourceManager
- .getI18NString("Logic.wizard.createProjectPage.desc"); //$NON-NLS-1$
-
- /**
- * Constructor.
- */
- public LogicNewWizard() {
- super("exampleProjectLocation", //$NON-NLS-1$
- LOGIC_WIZARD_CREATEPROJECTPAGE_TITLE,
- LOGIC_WIZARD_CREATEPROJECTPAGE_DESC,
- "org.eclipse.gmf.examples.runtime.diagram.logic", //$NON-NLS-1$
- new URL[] {
- GmfExamplesPlugin.getDefault().find(
- new Path("examples/logic.zip")), //$NON-NLS-1$
- GmfExamplesPlugin.getDefault().find(
- new Path("examples/logicSemantic.zip")), //$NON-NLS-1$
- GmfExamplesPlugin.getDefault().find(
- new Path("examples/logicSemanticEdit.zip")), //$NON-NLS-1$
- GmfExamplesPlugin.getDefault().find(
- new Path("examples/logicSemanticEditor.zip")) //$NON-NLS-1$
- }, new String[] {"{0}", "{0}.semantic", "{0}.semantic.edit", "{0}.semantic.editor"} //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- );
- }
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/ProjectUnzipperNewWizard.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/ProjectUnzipperNewWizard.java
deleted file mode 100644
index ed288e8..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/ProjectUnzipperNewWizard.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004 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.gmf.examples.runtime.ui.pde.internal.wizards;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesStatusCodes;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n.ResourceManager;
-import org.eclipse.gmf.examples.runtime.ui.pde.util.Log;
-
-/**
- * This abstract wizard serves as the base for our zipped project wizards. At
- * minimum, the wizard uses its constructor parameter to create a 1 page wizard.
- * The page lets users define the name and location of the project where to
- * unzip the project archive. The wizard performs: project creation, the unzip
- * operation, the classpath update, the progress monitoring
- *
- * @see Wizard
- */
-abstract public class ProjectUnzipperNewWizard
- extends Wizard
- implements INewWizard, IExecutableExtension {
-
- /**
- * Java Nature
- */
- private static final String ORG_ECLIPSE_JDT_CORE_JAVANATURE = "org.eclipse.jdt.core.javanature"; //$NON-NLS-1$
-
- /**
- * PDE Nature
- */
- private static final String ORG_ECLIPSE_PDE_PLUGIN_NATURE = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$
-
- /**
- * Monitor string shown when creating project
- */
- private static String KEY_CREATING_PROJECT = "monitor.creatingProject"; //$NON-NLS-1$
-
- /**
- * Monitor string shown when unzipping the project
- */
- private static String KEY_UNZIPPING_PROJECT = "monitor.unzippingProject"; //$NON-NLS-1$
-
- /**
- * The single page provided by this base implementation. It provides all the
- * functionality required to capture the name and location of the target
- * project
- */
- private WizardNewProjectCreationPage wizardNewProjectCreationPage;
-
- /**
- * The name of the project creation page
- */
- private String pageName;
-
- /**
- * The title of the project creation page
- */
- private String pageTitle;
-
- /**
- * The description of the project creation page
- */
- private String pageDescription;
-
- /**
- * The name of the project in the project creation page
- */
- private String pageProjectName;
-
- /**
- * The list of paths pointing to the location of the project archives
- */
- private URL[] projectZipURL;
-
- /**
- * The list of formats to be applied to the user supplied name
- */
- private String[] nameFormats;
-
- /**
- * The configuration element associated with this new project wizard
- */
- private IConfigurationElement config;
-
- /**
- * Constructor
- *
- * @param pageNameIn
- * The name of the project creation page
- * @param pageTitleIn
- * The title of the project creation page
- * @param pageDescriptionIn
- * The description of the project creation page
- * @param pageProjectNameIn
- * The project name in the project creation page
- * @param projectZipURLIn
- * The URL pointing to the location of the project archive
- */
- public ProjectUnzipperNewWizard(String pageNameIn, String pageTitleIn,
- String pageDescriptionIn, String pageProjectNameIn, URL projectZipURLIn) {
- this(pageNameIn, pageTitleIn, pageDescriptionIn, pageProjectNameIn,
- new URL[] {projectZipURLIn}, new String[] {"{0}"}); //$NON-NLS-1$
- }
-
- /**
- * Constructor
- *
- * @param pageNameIn
- * The name of the project creation page
- * @param pageTitleIn
- * The title of the project creation page
- * @param pageDescriptionIn
- * The description of the project creation page
- * @param pageProjectNameIn
- * The project name in the project creation page
- * @param projectZipURLListIn
- * The list of URL pointing to the location of the project
- * archives
- * @param formatsIn
- * The list of formats to be applied to the user supplied name.
- * The {@link java.text.MessageFormat} class should be consulted
- * to understand substitutions. The "{0}" substitution
- * will be overridden with the user supplied name. Otherwise, the
- * absolute strings may be passed in, which will completely
- * ignore the user supplied name.
- */
- public ProjectUnzipperNewWizard(String pageNameIn, String pageTitleIn,
- String pageDescriptionIn, String pageProjectNameIn,
- URL[] projectZipURLListIn,
- String[] nameFormatsIn) {
- super();
-
- assert projectZipURLListIn.length > 0;
- assert nameFormatsIn.length > 0;
- assert projectZipURLListIn.length == nameFormatsIn.length;
-
- pageName = pageNameIn;
- pageTitle = pageTitleIn;
- pageDescription = pageDescriptionIn;
- pageProjectName = pageProjectNameIn;
- projectZipURL = projectZipURLListIn;
- nameFormats = nameFormatsIn;
- setNeedsProgressMonitor(true);
- }
-
- /**
- * Performs the bulk of the wizard functionality: project creation, the
- * unzip operation and classpath update
- *
- * @see Wizard#performFinish
- */
- public boolean performFinish() {
-
- try {
- IRunnableWithProgress operation = new WorkspaceModifyOperation() {
-
- public void execute(IProgressMonitor monitor)
- throws InterruptedException {
- try {
- monitor.beginTask(ResourceManager
- .getI18NString(KEY_CREATING_PROJECT), 120);
-
- /*
- * Create the project folder
- */
- IPath projectPath = wizardNewProjectCreationPage
- .getLocationPath();
-
- for (int i = 0; i < nameFormats.length; i++) {
- String projectName = MessageFormat.format(
- nameFormats[i],
- new Object[] {wizardNewProjectCreationPage
- .getProjectName()});
- String projectFolder = projectPath.toOSString()
- + File.separator + projectName;
- File projectFolderFile = new File(projectFolder);
-
- IWorkspace workspace = ResourcesPlugin
- .getWorkspace();
- IProject project = workspace.getRoot().getProject(
- projectName);
-
- // If the project does not exist, we will create it
- // and populate it.
- if (!project.exists()) {
- projectFolderFile.mkdirs();
- monitor.worked(10);
-
- /*
- * Copy plug-in project code
- */
- extractProject(projectFolderFile,
- getProjectZipURL()[i],
- new SubProgressMonitor(monitor, 100));
-
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
-
- if (projectPath.equals(workspace.getRoot()
- .getLocation())) {
- project.create(monitor);
- } else {
- IProjectDescription desc = workspace
- .newProjectDescription(project
- .getName());
- desc.setLocation(new Path(projectFolder));
-
- project.create(desc, monitor);
- }
- }
-
- // Now, we ensure that the project is open.
- project.open(monitor);
-
- renameProject(project, projectName);
-
- // Add Java and PDE natures
- IProjectDescription desc = workspace
- .newProjectDescription(project.getName());
- desc.setNatureIds(new String[] {
- ORG_ECLIPSE_PDE_PLUGIN_NATURE,
- ORG_ECLIPSE_JDT_CORE_JAVANATURE});
- project.setDescription(desc, monitor);
-
- monitor.worked(10);
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
- } // end for
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- } finally {
- monitor.done();
- }
- }
- };
-
- getContainer().run(false, true, operation);
-
- /* Set perspective */
- BasicNewProjectResourceWizard
- .updatePerspective(getConfigurationElement());
-
- } catch (InterruptedException e) {
- return false;
-
- } catch (Exception e) {
-
- Log.error(GmfExamplesPlugin.getDefault(),
- GmfExamplesStatusCodes.EXCEPTION_OCCURED, e.getMessage(), e);
- return false;
- }
-
- return true;
- }
-
- /**
- * Unzip the project archive to the specified folder
- *
- * @param projectFolderFile
- * The folder where to unzip the project archive
- * @param monitor
- * Monitor to display progress and/or cancel operation
- * @throws IOException
- * @throws IOException
- * @throws InterruptedException
- * @throws FileNotFoundException
- *
- * @throws FileNotFoundException
- * @throws InterruptedException
- */
- private void extractProject(File projectFolderFile, URL url,
- IProgressMonitor monitor)
- throws FileNotFoundException, IOException, InterruptedException {
-
- /*
- * Get project archive
- */
- // URL urlZip = PdeUiPlugin.getDefault().find();
- // URL urlZipLocal = Platform.asLocalURL(urlZip);
- URL urlZipLocal = Platform.asLocalURL(url);
-
- /*
- * Walk each element and unzip
- */
- ZipFile zipFile = new ZipFile(urlZipLocal.getPath());
-
- try {
- /*
- * Allow for a hundred work units
- */
- monitor.beginTask(ResourceManager
- .getI18NString(KEY_UNZIPPING_PROJECT), zipFile.size());
-
- unzip(zipFile, projectFolderFile, monitor);
- } finally {
- zipFile.close();
- monitor.done();
- }
- }
-
- /**
- * Unzips the platform formatted zip file to specified folder
- *
- * @param zipFile
- * The platform formatted zip file
- * @param projectFolderFile
- * The folder where to unzip the project archive
- * @param monitor
- * Monitor to display progress and/or cancel operation
- * @throws IOException
- * @throws FileNotFoundException
- * @throws InterruptedException
- */
- private void unzip(ZipFile zipFile, File projectFolderFile,
- IProgressMonitor monitor)
- throws IOException, FileNotFoundException, InterruptedException {
-
- Enumeration e = zipFile.entries();
-
- while (e.hasMoreElements()) {
- ZipEntry zipEntry = (ZipEntry) e.nextElement();
- File file = new File(projectFolderFile, zipEntry.getName());
-
- if (false == zipEntry.isDirectory()) {
-
- /*
- * Copy files (and make sure parent directory exist)
- */
- File parentFile = file.getParentFile();
- if (null != parentFile && false == parentFile.exists()) {
- parentFile.mkdirs();
- }
-
- Path path = new Path(file.getPath());
- if (path.getFileExtension().equals("java")) { //$NON-NLS-1$
- InputStreamReader is = null;
- OutputStreamWriter os = null;
-
- try {
- is = new InputStreamReader(zipFile
- .getInputStream(zipEntry), "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 (len < 0)
- break;
- os.write(buffer, 0, len);
- }
- } finally {
- if (null != is) {
- is.close();
- }
- if (null != os) {
- os.close();
- }
- }
- } else {
- InputStream is = null;
- OutputStream os = null;
-
- try {
- is = zipFile.getInputStream(zipEntry);
- os = new FileOutputStream(file);
-
- byte[] buffer = new byte[102400];
- while (true) {
- int len = is.read(buffer);
- if (len < 0)
- break;
- os.write(buffer, 0, len);
- }
- } finally {
- if (null != is) {
- is.close();
- }
- if (null != os) {
- os.close();
- }
- }
- }
- }
-
- monitor.worked(1);
-
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
- }
- }
-
- /**
- * Renames the specified project to the specified name
- *
- * @param project
- * Project to rename
- * @param projectName
- * New name for the project
- * @throws CoreException
- */
- private void renameProject(IProject project, String projectName)
- throws CoreException {
- IProjectDescription description = project.getDescription();
- description.setName(projectName);
- project.move(description, IResource.FORCE | IResource.SHALLOW, null);
- }
-
- /**
- * Creates the sole wizard page contributed by this base implementation; the
- * standard Eclipse WizardNewProjectCreationPage.
- *
- * @see WizardNewProjectCreationPage#WizardNewProjectCreationPage(String)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
-
- wizardNewProjectCreationPage = new WizardNewProjectCreationPage(
- getPageName());
-
- wizardNewProjectCreationPage.setTitle(getPageTitle());
-
- wizardNewProjectCreationPage.setDescription(getPageDescription());
-
- wizardNewProjectCreationPage.setInitialProjectName(getPageProjectName());
-
- this.addPage(wizardNewProjectCreationPage);
- }
-
- /**
- * Accessor to the pageName field
- *
- * @return The pageName field value
- */
- private String getPageName() {
- return pageName;
- }
-
- /**
- * Accessor to the pageTitle field
- *
- * @return The pageTitle field value
- */
- private String getPageTitle() {
- return pageTitle;
- }
-
- /**
- * Accessor to the pageDescription field
- *
- * @return The pageDescription field value
- */
- private String getPageDescription() {
- return pageDescription;
- }
-
- /**
- * Accessor to the PageProjectName field
- *
- * @return The PageProjectName field value
- */
- private String getPageProjectName() {
- return pageProjectName;
- }
-
- /**
- * Accessor to the ProjectZipURL field
- *
- * @return The projectZipURL field value
- */
- private URL[] getProjectZipURL() {
- return projectZipURL;
- }
-
- /**
- * Accessor to the config field
- *
- * @return The config field value
- */
- private IConfigurationElement getConfigurationElement() {
- return config;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String, java.lang.Object)
- */
- public void setInitializationData(IConfigurationElement configIn,
- String propertyName, Object data)
- throws CoreException {
- config = configIn;
- }
-
-}
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/ServiceExampleNewWizard.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/ServiceExampleNewWizard.java
deleted file mode 100644
index af62a78..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/internal/wizards/ServiceExampleNewWizard.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005 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.gmf.examples.runtime.ui.pde.internal.wizards;
-
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.l10n.ResourceManager;
-
-
-/**
- * Service Example wizard page.
- *
- * @author jcorchis
- *
- */
-public class ServiceExampleNewWizard extends ProjectUnzipperNewWizard {
-
-
- /**
- * Wizard page title
- */
- private static final String WIZARD_CREATEPROJECTPAGE_TITLE = ResourceManager
- .getI18NString("ServiceExample.wizard.createProjectPage.title"); //$NON-NLS-1$
-
- /**
- * Wizard page description
- */
- private static final String WIZARD_CREATEPROJECTPAGE_DESC = ResourceManager
- .getI18NString("ServiceExample.wizard.createProjectPage.desc"); //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public ServiceExampleNewWizard() {
- super("exampleProjectLocation", //$NON-NLS-1$
- WIZARD_CREATEPROJECTPAGE_TITLE,
- WIZARD_CREATEPROJECTPAGE_DESC,
- "org.eclipse.gmf.examples.runtime.common.service", //$NON-NLS-1$
- GmfExamplesPlugin
- .getDefault().find(new Path("examples/serviceExample.zip"))); //$NON-NLS-1$
- }
-
-}
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/Log.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/Log.java
deleted file mode 100644
index 43d233f..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/Log.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2002, 2005 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.gmf.examples.runtime.ui.pde.util;
-
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesDebugOptions;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesPlugin;
-import org.eclipse.gmf.examples.runtime.ui.pde.internal.GmfExamplesStatusCodes;
-
-
-/**
- * A utility for logging errors, warnings, and information. Provides a simple
- * interface for generating logs based on status objects.
- *
- * @author khussey
- * @canBeSeenBy %partners
- */
-public class Log {
-
- /**
- * private constructor for the static class.
- */
- protected Log() {
- super();
- }
-
- /**
- * The default log listener for this log utility.
- */
- private static final ILog fLog = GmfExamplesPlugin.getDefault().getLog();
-
- /**
- * Retrieves the default log listener for this log utility.
- *
- * @return The default log listener for this log utility.
- */
- protected static ILog getDefault() {
- return fLog;
- }
-
- /**
- * Responds to a log request for the specified plug-in based on the
- * specified status object. Statuses with severity of error or warning
- * result in the generation of a platform log for the specified plug-in; all
- * log requests are forward to the default log listener.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param status
- * The status object on which to base the log.
- *
- */
- public static void log(Plugin plugin, IStatus status) {
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- case IStatus.WARNING:
- getDefault().log(status);
- break;
- default:
- /*
- * The Eclipse logging facility does not have the concept of
- * logging levels. Anything logged to the plugins logger will
- * automatically be logged to the .log file. The Common Logging
- * implementation provides the common log file
- * (CommonBaseEvents.log) with the associated extension point
- * and preference page but is not related to the .log file.
- * Since we do not want to Eclipse log poluted with "plug-in
- * started" messages, we do not log these.
- *
- * getDefault().log(status);
- */
- break;
- }
- }
-
- /**
- * Generates a log for the specified plug-in, with the specified severity,
- * status code, and message.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param severity
- * The severity of the log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- *
- */
- public static void log(Plugin plugin, int severity, int code, String message) {
-
- log(plugin, severity, code, message, null);
- }
-
- /**
- * Generates a log for the specified plug-in, with the specified severity,
- * status code, message, and throwable.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param severity
- * The severity of the log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- * @param throwable
- * The throwable for the log.
- *
- */
- public static void log(Plugin plugin, int severity, int code,
- String message, Throwable throwable) {
-
- //
- // Status ctor requires a non-null message
- String msg = message == null ? "" //$NON-NLS-1$
- : message;
-
- try {
- log(plugin, new Status(severity, plugin.getBundle()
- .getSymbolicName(), code, msg, throwable));
- } catch (IllegalArgumentException iae) {
- Trace.catching(GmfExamplesPlugin.getDefault(),
- GmfExamplesDebugOptions.EXCEPTIONS_CATCHING, Log.getDefault()
- .getClass(), "log", iae); //$NON-NLS-1$
- Log.error(GmfExamplesPlugin.getDefault(),
- GmfExamplesStatusCodes.SERVICE_FAILURE, "log", iae); //$NON-NLS-1$
- }
- }
-
- /**
- * Generates an error log for the specified plug-in, with the specified
- * status code and message.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- *
- */
- public static void error(Plugin plugin, int code, String message) {
- error(plugin, code, message, null);
- }
-
- /**
- * Generates an error log for the specified plug-in, with the specified
- * status code, message, and throwable.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- * @param throwable
- * The throwable for the log.
- *
- */
- public static void error(Plugin plugin, int code, String message,
- Throwable throwable) {
-
- log(plugin, IStatus.ERROR, code, message, throwable);
- }
-
- /**
- * Generates a warning log for the specified plug-in, with the specified
- * status code and message.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- *
- */
- public static void warning(Plugin plugin, int code, String message) {
- warning(plugin, code, message, null);
- }
-
- /**
- * Generates a warning log for the specified plug-in, with the specified
- * status code, message, and throwable.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- * @param throwable
- * The throwable for the log.
- *
- */
- public static void warning(Plugin plugin, int code, String message,
- Throwable throwable) {
-
- log(plugin, IStatus.WARNING, code, message, throwable);
- }
-
- /**
- * Generates an information log for the specified plug-in, with the
- * specified status code and message.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- *
- */
- public static void info(Plugin plugin, int code, String message) {
- info(plugin, code, message, null);
- }
-
- /**
- * Generates an information log for the specified plug-in, with the
- * specified status code, message, and throwable.
- *
- * @param plugin
- * The plug-in for which to generate a log.
- * @param code
- * The status code for the log.
- * @param message
- * The message for the log.
- * @param throwable
- * The throwable for the log.
- *
- */
- public static void info(Plugin plugin, int code, String message,
- Throwable throwable) {
-
- log(plugin, IStatus.INFO, code, message, throwable);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/StringStatics.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/StringStatics.java
deleted file mode 100644
index 2c3f77a..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/StringStatics.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2002, 2004 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.gmf.examples.runtime.ui.pde.util;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-
-/**
- * This class contains string statics that are not to be translated.
- *
- * @author wdiu, Wayne Diu
- * @canBeSeenBy %partners
- */
-public class StringStatics {
-
- /** Prevent instantiation with a private constructor */
- private StringStatics() {
- /* private constructor */
- }
-
- /** The empty string */
- public static final String BLANK = ""; //$NON-NLS-1$
-
- /** The period . */
- public static final String PERIOD = "."; //$NON-NLS-1$
-
- /** The forward slash / */
- public static final String FORWARD_SLASH = "/"; //URLs //$NON-NLS-1$
-
- /** The backward slash / */
- public static final String BACKWARD_SLASH = "\\"; //$NON-NLS-1$
-
- /** The ellipsis ... */
- public static final String ELLIPSIS = "..."; //$NON-NLS-1$
-
- /** The space */
- public static final String SPACE = " "; //$NON-NLS-1$
-
- /** The colon : */
- public static final String COLON = ":"; //$NON-NLS-1$
-
- /** The double colon :: */
- public static final String DOUBLE_COLON = "::"; //$NON-NLS-1$
-
- /** The newline for a particular platform */
- public static final String PLATFORM_NEWLINE = System
- .getProperty("line.separator"); //$NON-NLS-1$
-
- /** The newline for the Windows platform */
- public static final String WINDOWS_NEWLINE = "\r\n"; //$NON-NLS-1$
-
- /** The newline for the Unix platform */
- public static final String UNIX_NEWLINE = "\n"; //$NON-NLS-1$
-
- /** The separator defined by File.separator */
- public static final String FILE_SEPARATOR = File.separator;
-
- /** The separator defined by IPath.SEPARATOR */
- public static final String PATH_SEPARATOR = String.valueOf(IPath.SEPARATOR);
-
- /** The apostrophe ' */
- public static final String APOSTROPHE = "'"; //$NON-NLS-1$
-
- /** The apostrophe ' */
- public static final String AMPERSAND = "&"; //$NON-NLS-1$
-
- /** The greater than symbol > */
- public static final String GREATER_THAN = ">"; //$NON-NLS-1$
-
- /** The equals = */
- public static final String EQUALS = "="; //$NON-NLS-1$
-
- /** The version separator in a plugin name for release _ */
- public static final String PLUGIN_VERSION_SEPARATOR = "_"; //$NON-NLS-1$
-
- /** The Underscore * */
- public static final String UNDER_SCORE = "_"; //$NON-NLS-1$
-
- /** The hyphen * */
- public static final String HYPHEN = "-"; //$NON-NLS-1$
-
- /** The comma * */
- public static final String COMMA = ",";//$NON-NLS-1$
-
- /** Open Parenthesis */
- public static final String OPEN_PARENTHESIS = "("; //$NON-NLS-1$
-
- /** Close Parenthesis */
- public static final String CLOSE_PARENTHESIS = ")"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/Trace.java b/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/Trace.java
deleted file mode 100644
index 98cc137..0000000
--- a/org.eclipse.gmf.examples.runtime.ui.pde/src/org/eclipse/gmf/examples/runtime/ui/pde/util/Trace.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2002, 2005 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.gmf.examples.runtime.ui.pde.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * A utility for tracing debug information. Provides a simple interface for
- * filtering and generating trace output.
- *
- * @author khussey
- * @canBeSeenBy %partners
- */
-public class Trace {
-
- /**
- * private constructor for the static class.
- */
- private Trace() {
- super();
- }
-
- /**
- * String containing an open parenthesis.
- *
- */
- protected static final String PARENTHESIS_OPEN = "("; //$NON-NLS-1$
-
- /**
- * String containing a close parenthesis.
- *
- */
- protected static final String PARENTHESIS_CLOSE = ")"; //$NON-NLS-1$
-
- /**
- * Prefix for tracing the changing of values.
- *
- */
- protected static final String PREFIX_CHANGING = "CHANGING "; //$NON-NLS-1$
-
- /**
- * Prefix for tracing the catching of throwables.
- *
- */
- protected static final String PREFIX_CATCHING = "CAUGHT "; //$NON-NLS-1$
-
- /**
- * Prefix for tracing the throwing of throwables.
- *
- */
- protected static final String PREFIX_THROWING = "THROWN "; //$NON-NLS-1$
-
- /**
- * Prefix for tracing the entering of methods.
- *
- */
- protected static final String PREFIX_ENTERING = "ENTERING "; //$NON-NLS-1$
-
- /**
- * Prefix for tracing the exiting of methods.
- *
- */
- protected static final String PREFIX_EXITING = "EXITING "; //$NON-NLS-1$
-
- /**
- * Separator for methods.
- *
- */
- protected static final String SEPARATOR_METHOD = "#"; //$NON-NLS-1$
-
- /**
- * Separator for parameters.
- *
- */
- protected static final String SEPARATOR_PARAMETER = ", "; //$NON-NLS-1$
-
- /**
- * Separator for return values.
- *
- */
- protected static final String SEPARATOR_RETURN = ":"; //$NON-NLS-1$
-
- /**
- * Separator containing a space.
- *
- */
- protected static final String SEPARATOR_SPACE = " "; //$NON-NLS-1$
-
- /**
- * Label indicating old value.
- *
- */
- protected static final String LABEL_OLD_VALUE = "old="; //$NON-NLS-1$
-
- /**
- * Label indicating new value.
- *
- */
- protected static final String LABEL_NEW_VALUE = "new="; //$NON-NLS-1$
-
-
- /**
- * The cached debug options (for optimization).
- */
- private static final Map cachedOptions = new HashMap();
-
- /**
- * Retrieves a Boolean value indicating whether tracing is enabled for the
- * specified plug-in.
- *
- * @return Whether tracing is enabled for the plug-in.
- * @param plugin The plug-in for which to determine trace enablement.
- *
- */
- protected static boolean shouldTrace(Plugin plugin) {
- return plugin.isDebugging();
- }
-
- /**
- * Retrieves a Boolean value indicating whether tracing is enabled for the
- * specified debug option of the specified plug-in.
- *
- * @return Whether tracing is enabled for the debug option of the plug-in.
- * @param plugin The plug-in for which to determine trace enablement.
- * @param option The debug option for which to determine trace enablement.
- *
- */
- public static boolean shouldTrace(Plugin plugin, String option) {
- if (shouldTrace(plugin)) {
- Boolean value = null;
-
- synchronized (cachedOptions) {
- value = (Boolean) cachedOptions.get(option);
-
- if (null == value) {
- value = Boolean.valueOf(Platform.getDebugOption(option));
-
- cachedOptions.put(option, value);
- }
- }
-
- return value.booleanValue();
- }
-
- return false;
- }
-
- /**
- * Retrieves a textual representation of the specified argument.
- *
- * @return A textual representation of the specified argument.
- * @param argument The argument for which to retrieve a textual
- * representation.
- *
- */
- protected static String getArgumentString(Object argument) {
- return String.valueOf(argument);
- }
-
- /**
- * Retrieves a textual representation of the specified arguments.
- *
- * @return A textual representation of the specified arguments.
- * @param arguments The arguments for which to retrieve a textual
- * representation.
- *
- */
- protected static String getArgumentsString(Object[] arguments) {
- StringBuffer buffer = new StringBuffer();
-
- for (int i = 0; i < arguments.length; i++) {
- buffer.append(getArgumentString(arguments[i]));
-
- if (i < arguments.length - 1) {
- buffer.append(SEPARATOR_PARAMETER);
- }
- }
-
- return buffer.toString();
- }
-
- /**
- * Traces the specified message.
- *
- * @param message The message to be traced.
- *
- */
- protected static void trace(String message) {
- System.out.println(message);
- }
-
- /**
- * Traces the specified message from the specified plug-in.
- *
- * @param plugin The plug-in from which to trace.
- * @param message The message to be traced.
- *
- */
- public static void trace(Plugin plugin, String message) {
- if (shouldTrace(plugin)) {
- trace(message);
- }
- }
-
- /**
- * Traces the specified message from the specified plug-in for the specified
- * debug option.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param message The message to be traced.
- *
- */
- public static void trace(Plugin plugin, String option, String message) {
- if (shouldTrace(plugin, option)) {
- trace(message);
- }
- }
-
- /**
- * Traces the changing of a value.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param valueDescription The description of the value which is changing.
- * @param oldValue The old value.
- * @param newValue The new value.
- */
- public static void changing(
- Plugin plugin,
- String option,
- String valueDescription,
- Object oldValue,
- Object newValue) {
-
- if (shouldTrace(plugin, option)) {
- trace(
- PREFIX_CHANGING
- + valueDescription
- + SEPARATOR_SPACE
- + LABEL_OLD_VALUE
- + getArgumentString(oldValue)
- + SEPARATOR_PARAMETER
- + LABEL_NEW_VALUE
- + getArgumentString(newValue)
- );
- }
- }
-
- /**
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class in which the value is changing.
- * @param methodName The name of the method in which the value is changing.
- * @param valueDescription The description of the value which is changing.
- * @param oldValue The old value.
- * @param newValue The new value.
- */
- public static void changing(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName,
- String valueDescription,
- Object oldValue,
- Object newValue) {
-
- if (shouldTrace(plugin, option)) {
- trace(
- PREFIX_CHANGING
- + valueDescription
- + SEPARATOR_SPACE
- + LABEL_OLD_VALUE
- + getArgumentString(oldValue)
- + SEPARATOR_PARAMETER
- + LABEL_NEW_VALUE
- + getArgumentString(newValue)
- + SEPARATOR_SPACE
- + PARENTHESIS_OPEN
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName
- + PARENTHESIS_CLOSE
- );
- }
- }
-
- /**
- * Traces the catching of the specified throwable in the specified method of
- * the specified class.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class in which the throwable is being caught.
- * @param methodName The name of the method in which the throwable is being
- * caught.
- * @param throwable The throwable that is being caught.
- *
- */
- public static void catching(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName,
- Throwable throwable) {
-
- if (shouldTrace(plugin, option)) {
-
- trace(
- PREFIX_CATCHING
- + throwable.getMessage()
- + SEPARATOR_SPACE
- + PARENTHESIS_OPEN
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName
- + PARENTHESIS_CLOSE);
-
- throwable.printStackTrace(System.err);
- }
- }
-
- /**
- * Traces the throwing of the specified throwable from the specified method
- * of the specified class.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class from which the throwable is being thrown.
- * @param methodName The name of the method from which the throwable is
- * being thrown.
- * @param throwable The throwable that is being thrown.
- *
- */
- public static void throwing(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName,
- Throwable throwable) {
-
- if (shouldTrace(plugin, option)) {
-
- trace(
- PREFIX_THROWING
- + throwable.getMessage()
- + SEPARATOR_SPACE
- + PARENTHESIS_OPEN
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName
- + PARENTHESIS_CLOSE);
-
- throwable.printStackTrace(System.err);
- }
- }
-
- /**
- * Traces the entering into the specified method of the specified class.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class whose method is being entered.
- * @param methodName The name of method that is being entered.
- *
- */
- public static void entering(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName) {
-
- if (shouldTrace(plugin, option)) {
-
- trace(
- PREFIX_ENTERING
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName);
- }
- }
-
- /**
- * Traces the entering into the specified method of the specified class,
- * with the specified parameter.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class whose method is being entered.
- * @param methodName The name of method that is being entered.
- * @param parameter The parameter to the method being entered.
- *
- */
- public static void entering(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName,
- Object parameter) {
-
- if (shouldTrace(plugin, option)) {
-
- trace(
- PREFIX_ENTERING
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName
- + PARENTHESIS_OPEN
- + getArgumentString(parameter)
- + PARENTHESIS_CLOSE);
- }
- }
-
- /**
- * Traces the entering into the specified method of the specified class,
- * with the specified parameters.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class whose method is being entered.
- * @param methodName The name of method that is being entered.
- * @param parameters The parameters to the method being entered.
- *
- */
- public static void entering(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName,
- Object[] parameters) {
-
- if (shouldTrace(plugin, option)) {
-
- trace(
- PREFIX_ENTERING
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName
- + PARENTHESIS_OPEN
- + getArgumentsString(parameters)
- + PARENTHESIS_CLOSE);
- }
- }
-
- /**
- * Traces the exiting from the specified method of the specified class.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class whose method is being exited.
- * @param methodName The name of method that is being exited.
- *
- */
- public static void exiting(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName) {
-
- if (shouldTrace(plugin, option)) {
-
- trace(
- PREFIX_EXITING
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName);
- }
- }
-
- /**
- * Traces the exiting from the specified method of the specified class,
- * with the specified return value.
- *
- * @param plugin The plug-in from which to trace.
- * @param option The debug option for which to trace.
- * @param clazz The class whose method is being exited.
- * @param methodName The name of method that is being exited.
- * @param returnValue The return value of the method being exited.
- *
- */
- public static void exiting(
- Plugin plugin,
- String option,
- Class clazz,
- String methodName,
- Object returnValue) {
-
- if (shouldTrace(plugin, option)) {
-
- trace(
- PREFIX_EXITING
- + clazz.getName()
- + SEPARATOR_METHOD
- + methodName
- + SEPARATOR_RETURN
- + getArgumentString(returnValue));
- }
- }
-
-}