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 http://www.eclipse.org/legal/epl-v10.html.
-For purposes of the EPL, "Program" will mean the Content.
-
-
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.
-
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.html/build.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.html/build.properties
deleted file mode 100644
index cb33cb2a0e2..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.html/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.commonHTML.jar = src/
-output.commonHTML.jar = bin/
-bin.includes = commonHTML.jar,\
- plugin.properties,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- lib/
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.html/lib/Tidy.jar b/extraplugins/epf-richtext/org.eclipse.epf.common.html/lib/Tidy.jar
deleted file mode 100644
index af4eed0506b..00000000000
Binary files a/extraplugins/epf-richtext/org.eclipse.epf.common.html/lib/Tidy.jar and /dev/null differ
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.html/plugin.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.html/plugin.properties
deleted file mode 100644
index 6372abf9e60..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.html/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# NLS_ENCODING=UNICODE
-#-------------------------------------------------------------------------------
-# Copyright (c) 2000, 2007 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 implementation.
-#-------------------------------------------------------------------------------
-# NLS_MESSAGEFORMAT_VAR
-
-# Plug-in
-pluginName=EPF Common HTML
-providerName=Eclipse.org
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.html/plugin.xml b/extraplugins/epf-richtext/org.eclipse.epf.common.html/plugin.xml
deleted file mode 100644
index f6af5e2d3ca..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.html/plugin.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/CommonHTMLPlugin.java b/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/CommonHTMLPlugin.java
deleted file mode 100644
index ae5a9f9c28f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/CommonHTMLPlugin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.html;
-
-import org.eclipse.epf.common.AbstractActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * The Common plug-in activator.
- */
-public final class CommonHTMLPlugin extends AbstractActivator {
-
- // The shared plug-in instance.
- private static CommonHTMLPlugin plugin;
-
- /**
- * Creates a new instance.
- */
- public CommonHTMLPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * @see org.eclipse.epf.common.ui.AbstractPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * @see org.eclipse.epf.common.ui.AbstractPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Gets the shared instance.
- *
- * @return the shared plug-in instance
- */
- public static CommonHTMLPlugin getDefault() {
- return plugin;
- }
-
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/DefaultHTMLFormatter.java b/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/DefaultHTMLFormatter.java
deleted file mode 100644
index eca7bf5a198..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/DefaultHTMLFormatter.java
+++ /dev/null
@@ -1,286 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.html;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.epf.common.IHTMLFormatter;
-import org.eclipse.epf.common.utils.FileUtil;
-import org.eclipse.epf.common.utils.StrUtil;
-import org.w3c.tidy.Tidy;
-
-/**
- * Pretty-formats HTML source and makes it XHTML compliant.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class DefaultHTMLFormatter implements IHTMLFormatter{
-
- protected static final String HTML_BODY_START_TAG = " around each text block (?that isn't in a block already?)
-// tidy.setEncloseBlockText(true);
- // setting this seemed to prevent JTidy from indenting the source
-// tidy.setPrintBodyOnly(true);
-
- if (forceOutput) {
- // output document even if errors are present
-// tidy.setForceOutput(true);
- }
- if (makeBare) {
- // remove MS clutter
-// tidy.setMakeBare(true);
- tidy.setMakeClean(true);
- }
- if (word2000) {
- // draconian Word2000 cleaning
- tidy.setWord2000(true);
- }
-
-
-// Reader input = new StringReader(html);
-// Writer output = new StringWriter();
-
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- tidy.setErrout(pw);
- InputStream input= new ByteArrayInputStream(html.getBytes("UTF-8"));
-
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- tidy.parse(input, output);
- String error = sw.getBuffer().toString();
- if (error != null && error.length() > 0
- && error.startsWith("line") && error.indexOf("column") > 0) { //$NON-NLS-1$ //$NON-NLS-2$
- lastErrorStr = error;
- if (!forceOutput) {
- // if forceOutput is true, JTidy will return clean HTML so don't return here
- return html;
- }
- }
-
- String formattedHTML = new String(output.toByteArray(), "UTF-8"); //$NON-NLS-1$
- formattedHTML = StrUtil.getEscapedHTML(formattedHTML);
-
- String htmlStartUpper = html.substring(0, Math.min(10, html.length())).toUpperCase();
-
- if (returnBodyOnly || (!htmlStartUpper.startsWith("",startBodyTag); //$NON-NLS-1$
- }
- int end = formattedHTML.indexOf(HTML_BODY_END_TAG);
- if (start == -1 || end == -1) {
- return ""; //$NON-NLS-1$
- }
- start += 1;
- if (start >= end) {
- return ""; //$NON-NLS-1$
- }
- start += FileUtil.LINE_SEP_LENGTH;
- end -= FileUtil.LINE_SEP_LENGTH;
- if (indent && indentSize > 0) {
- end -= indentSize;
- }
- if (start >= end) {
- return ""; //$NON-NLS-1$
- }
- String result = formattedHTML.substring(start, end);
- if (indent && indentSize > 0) {
- String indentStr = getIndentStr(indentSize * 2);
- result = fixIndentation(result, indentStr);
- return result;
- }
- }
- return formattedHTML;
- }
-
- /**
- * Returns the indent string.
- */
- protected static String getIndentStr(int indentLength) {
- if (indentLength == 0) {
- return ""; //$NON-NLS-1$
- }
- StringBuffer indentStr = new StringBuffer();
- for (int i = 0; i < indentLength; i++) {
- indentStr.append(' ');
- }
- return indentStr.toString();
- }
-
- public static final String PRE_TAG_START = "
"; //$NON-NLS-1$
-
- public static final String PRE_TAG_END = "
"; //$NON-NLS-1$
-
- public static final int PRE_TAG_END_LENGTH = PRE_TAG_END.length();
-
- /**
- * Undo the JTidy indent, but ignore <pre> tags
- *
- * @param html
- * @param indentStr
- * @return
- */
- protected static String fixIndentation(String html, String indentStr) {
- if (html.startsWith(indentStr)) {
- html = html.substring(indentStr.length());
- }
- StringBuffer strBuf = new StringBuffer();
- int pre_index = -1;
- int last_pre_end_index = -1;
- while ((pre_index = html.indexOf(PRE_TAG_START, last_pre_end_index)) != -1) {
- strBuf.append(html.substring(
- last_pre_end_index < 0 ? 0 : last_pre_end_index
- + PRE_TAG_END_LENGTH, pre_index).replaceAll(
- "\r\n" + indentStr, "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
- last_pre_end_index = html.indexOf(PRE_TAG_END, pre_index);
- if (last_pre_end_index != -1) {
- strBuf.append(html.substring(pre_index, last_pre_end_index
- + PRE_TAG_END_LENGTH));
- } else {
- // found
, but no ending
- shouldn't ever get here
- // append rest of string and return it
- strBuf.append(html.substring(pre_index));
- return strBuf.toString();
- }
- }
- strBuf.append(html.substring(
- last_pre_end_index < 0 ? 0 : last_pre_end_index
- + PRE_TAG_END_LENGTH).replaceAll("\r\n" + indentStr, //$NON-NLS-1$
- "\r\n")); //$NON-NLS-1$
- return strBuf.toString();
- }
-
- public String getLastErrorStr() {
- return lastErrorStr;
- }
-
-
- public String removeLeadingWhitespace(String input) {
- return p_whitespace.matcher(input).replaceAll(""); //$NON-NLS-1$
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/DefaultHTMLParser.java b/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/DefaultHTMLParser.java
deleted file mode 100644
index 9e99d55b3ed..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.html/src/org/eclipse/epf/common/html/DefaultHTMLParser.java
+++ /dev/null
@@ -1,212 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.html;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Properties;
-
-import org.eclipse.epf.common.IHTMLParser;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.tidy.Configuration;
-import org.w3c.tidy.Tidy;
-
-/**
- * Extracts the title, meta tags and text from a HTML file or source.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class DefaultHTMLParser implements IHTMLParser{
-
- private static final int BUFFER_SIZE = 4096;
-
- private static final String HTML_SCRIPT_TAG = "script"; //$NON-NLS-1$
-
- private static final String HTML_TITLE_TAG = "title"; //$NON-NLS-1$
-
- private static final String HTML_META_TAG = "meta"; //$NON-NLS-1$
-
- protected Tidy tidy;
-
- private String title;
-
- private String summary;
-
- private String text;
-
- private Properties metaTags;
-
- private StringBuffer htmlText;
-
- /**
- * Creates a new instance.
- */
- public DefaultHTMLParser() {
- try {
- tidy = new Tidy();
- tidy.setXHTML(true);
- tidy.setDropEmptyParas(true);
- tidy.setDropFontTags(true);
- tidy.setQuiet(true);
- tidy.setShowWarnings(false);
- tidy.setSmartIndent(false);
- tidy.setTidyMark(false);
- tidy.setWraplen(132);
- tidy.setIndentAttributes(false);
- tidy.setIndentContent(false);
- tidy.setSpaces(2);
- tidy.setCharEncoding(Configuration.ISO2022);
-// tidy.setInputEncoding("UTF-8"); //$NON-NLS-1$
-// tidy.setOutputEncoding("UTF-8"); //$NON-NLS-1$
- } catch (Exception e) {
- tidy = null;
- }
- }
-
- /**
- * Parses the given HTML file.
- */
- public void parse(File file) throws Exception {
- if (tidy == null || !file.exists() || !file.canRead()) {
- return;
- }
-
- FileInputStream fis = new FileInputStream(file);
- InputStreamReader isr = new InputStreamReader(fis, "UTF-8"); //$NON-NLS-1$
- BufferedReader br = new BufferedReader(isr);
-
- StringBuffer textBuffer = new StringBuffer(BUFFER_SIZE);
- char[] buffer = new char[BUFFER_SIZE];
- int charsRead;
- while ((charsRead = br.read(buffer, 0, BUFFER_SIZE)) > 0) {
- textBuffer.append(buffer, 0, charsRead);
- }
-
- parse(textBuffer.toString());
-
- if (br != null) {
- try {
- br.close();
- } catch (IOException e) {
- }
- }
- }
-
- /**
- * Parses the given HTML source.
- */
- protected void parse(String htmlSource) throws Exception {
- title = ""; //$NON-NLS-1$
- summary = ""; //$NON-NLS-1$
- text = ""; //$NON-NLS-1$
- metaTags = new Properties();
-
- Document doc = getDocument(htmlSource);
- if (doc != null) {
- htmlText = new StringBuffer(1024);
- extract(doc.getChildNodes());
- text = htmlText.toString();
- }
- }
-
- /**
- * Returns the title text.
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Returns the HTML meta tags.
- */
- public Properties getMetaTags() {
- return metaTags;
- }
-
- /**
- * Returns the summary.
- */
- public String getSummary() {
- return summary;
- }
-
- /**
- * Returns the body text.
- */
- public String getText() {
- return text;
- }
-
- /**
- * Returns the DOM document for the given HTML source.
- */
- protected Document getDocument(String html) throws Exception {
- if (html == null || html.length() == 0) {
- return null;
- }
-
- ByteArrayInputStream input = new ByteArrayInputStream(html
- .getBytes("UTF-8")); //$NON-NLS-1$
- ByteArrayOutputStream output = new ByteArrayOutputStream();
-
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- tidy.setErrout(pw);
-
- return tidy.parseDOM(input, output);
- }
-
- /**
- * Extracts the title, meta tags and body text from the given nodes.
- */
- protected void extract(NodeList nodes) {
- for (int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- String nodeName = node.getNodeName();
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE:
- if (!nodeName.equals(HTML_SCRIPT_TAG)) {
- NamedNodeMap attrs = node.getAttributes();
- for (int j = 0; j < attrs.getLength(); j++) {
- Node attrNode = attrs.item(j);
- String attrNodeName = attrNode.getNodeName();
- String attrNodeValue = attrNode.getNodeValue();
- if (attrNodeName.equals(HTML_TITLE_TAG)) {
- title = attrNodeValue;
- } else if (attrNodeName.equals(HTML_META_TAG)) {
- metaTags.put(attrNodeName, attrNodeValue);
- }
- }
- NodeList childNodes = node.getChildNodes();
- if (childNodes != null && childNodes.getLength() > 0) {
- extract(childNodes);
- }
- }
- break;
- case Node.TEXT_NODE:
- htmlText.append(node.getNodeValue()).append(' ');
- break;
- }
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.classpath b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.classpath
deleted file mode 100644
index 02159672985..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.project b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.project
deleted file mode 100644
index eacf917d8f1..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- org.eclipse.epf.common.ui
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.settings/org.eclipse.pde.core.prefs b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index 0efa3f0b61e..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Fri Jan 04 15:09:09 PST 2008
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/META-INF/MANIFEST.MF b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 376c2425211..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.epf.common.ui
-Bundle-Version: 1.5.0.qualifier
-Bundle-Activator: org.eclipse.epf.common.ui.CommonUIPlugin
-Import-Package: org.osgi.framework;version="1.3.0"
-Eclipse-LazyStart: true
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui;visibility:=reexport,
- org.eclipse.epf.common;visibility:=reexport
-Export-Package: org.eclipse.epf.common.ui,
- org.eclipse.epf.common.ui.actions,
- org.eclipse.epf.common.ui.util
-Bundle-Vendor: %providerName
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/about.html b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/about.html
deleted file mode 100644
index 04a6d65fb9f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-About
-
-
-
About This Content
-
-
February 24, 2005
-
License
-
-
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 http://www.eclipse.org/legal/epl-v10.html.
-For purposes of the EPL, "Program" will mean the Content.
-
-
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.
-
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/build.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/build.properties
deleted file mode 100644
index f4ae9701586..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/plugin.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/plugin.properties
deleted file mode 100644
index b50cbf887d1..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2000, 2007 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 implementation.
-#-------------------------------------------------------------------------------
-# NLS_MESSAGEFORMAT_VAR
-
-# Plug-in
-pluginName=EPF Common UI plug-in
-providerName=Eclipse.org
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/AbstractPlugin.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/AbstractPlugin.java
deleted file mode 100644
index fa3ca270068..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/AbstractPlugin.java
+++ /dev/null
@@ -1,529 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.internal.runtime.InternalPlatform;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.epf.common.IActivator;
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.epf.common.ui.util.MsgDialog;
-import org.eclipse.epf.common.utils.FileUtil;
-import org.eclipse.epf.common.utils.I18nUtil;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * The abstract base class for all EPF plug-ins.
- *
- * @author Kelvin Low
- * @author Jinhua Xi
- * @author Phong Nguyen Le
- * @since 1.0
- */
-public abstract class AbstractPlugin extends AbstractUIPlugin implements IActivator {
-
-
- // The relative path to the icons.
- private static final String ICON_PATH = "icons/"; //$NON-NLS-1$;
-
- // The logger hash map.
- private static Map loggers = new HashMap();
-
- // The message dialog hash map.
- private static Map msgDialogs = new HashMap();
-
- // The shared image hash map.
- private static Map sharedImages = new HashMap();
-
- // The resource bundle for this plug-in.
- private ResourceBundle resourceBundle;
-
- // This plug-in ID.
- private String pluginId;
-
- // The plug-in install URL.
- private URL installURL;
-
- // The plug-in install path.
- private String installPath;
-
- // The plug-in icon URL.
- private URL iconURL;
-
- // The profiling flag.
- private boolean profiling;
-
- /**
- * Default constructor.
- */
- public AbstractPlugin() {
- super();
- }
-
- /**
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- init(context);
-
- // set the
- if (isDebugging()) {
- getLogger().logInfo("Started " + pluginId); //$NON-NLS-1$
- }
- }
-
- /**
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- // Free the shared images.
- for (Iterator images = sharedImages.values().iterator(); images
- .hasNext();) {
- Image image = (Image) images.next();
- if (image != null && !image.isDisposed()) {
- image.dispose();
- }
- }
-
- super.stop(context);
-
- if (isDebugging()) {
- getLogger().logInfo("Stopped " + pluginId); //$NON-NLS-1$
- }
- }
-
- /**
- * Initializes this plug-in.
- *
- * @param context
- * The bundle context.
- */
- protected void init(BundleContext context) throws Exception {
- // Get the bundle for this plug-in.
- Bundle bundle = getBundle();
-
- // Get the resouce bundle for this plug-in.
- resourceBundle = Platform.getResourceBundle(bundle);
-
- // Get the ID for this plug-in.
- pluginId = bundle.getSymbolicName();
-
- if (isDebugging()) {
- getLogger().logInfo("Initializing " + pluginId); //$NON-NLS-1$
- }
-
- // Get the install path of this plug-in.
- installURL = bundle.getEntry("/"); //$NON-NLS-1$
-
- try {
- installPath = FileLocator.resolve(installURL).getPath();
- } catch (IOException e) {
- installPath = Platform.getInstallLocation().getURL().getPath();
- }
-
- try {
- iconURL = new URL(installURL, ICON_PATH);
- } catch (IOException e) {
- }
-
- String symbolicName = bundle.getSymbolicName();
- if (symbolicName != null) {
- String key = symbolicName + "/profiling"; //$NON-NLS-1$
- String value = InternalPlatform.getDefault().getOption(key);
- profiling = value == null ? false : value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- if (isDebugging()) {
- getLogger().logInfo(
- "Initialized " + pluginId + ", installPath=" + installPath); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Returns the ID of this plug-in.
- *
- * @return The ID of this plug-in.
- */
- public String getId() {
- return pluginId;
- }
-
- /**
- * Returns the install URL of this plug-in.
- *
- * @param The
- * install URL of this plug-in.
- */
- public URL getInstallURL() {
- return installURL;
- }
-
- /**
- * Returns the install path of this plug-in.
- *
- * @param The
- * install path of this plug-in.
- */
- public String getInstallPath() {
- return installPath;
- }
-
- /**
- * Loads and returns the localized properties of a Java properties file.
- *
- *
- * @param path
- * The properties file path relative to the plug-in root.
- * @return A Properties object.
- */
- public Properties getProperties(String path) throws IOException {
- Properties props = new Properties();
- if (path == null) {
- return props;
- }
-
- String filePath = getLocalizedFile(path, true);
- if (filePath != null) {
- props.load(new FileInputStream(filePath));
- }
-
- return props;
- }
-
- /**
- * get the locale specific absolute file path name of the given file in the
- * plugin.
- *
- * @param path
- * The properties file path relative to the plug-in root.
- * @return String the locale specific absolute file path name of the given
- * file.
- * @throws IOException
- */
- public String getLocalizedFile(String path, boolean useDefault)
- throws IOException {
- String filePath = null;
- String fileName = FileUtil.getFileName(path);
- int index = path.lastIndexOf(fileName);
- String pathName = path.substring(0, index);
-
- Locale locale = Locale.getDefault();
-
- Bundle bundle = getBundle();
- Bundle[] bundles = Platform.getFragments(bundle);
- if (bundles != null) {
- for (int i = 0; i < bundles.length; i++) {
- URL entry = bundles[i].getEntry(pathName);
- if (entry != null) {
- URL url = FileLocator.resolve(entry);
- filePath = I18nUtil.getLocalizedFile(url.getPath()
- + fileName, locale);
- if (filePath != null) {
- break;
- }
- }
- }
- }
-
- if (filePath == null) {
- URL entry = bundle.getEntry(path);
- if (entry != null) {
- URL url = FileLocator.resolve(entry);
- filePath = I18nUtil.getLocalizedFile(url.getPath(), locale);
- if (filePath == null && useDefault) {
- filePath = url.getPath();
- }
- }
- }
-
- return filePath;
- }
-
- /**
- * for the given path in the plugin, find the localized files form the nl
- * fragemenets and copy the localized files to the destination folder
- *
- * @param path
- * String a relative path to the plugin root. The files in this
- * folder will be iterated and their localized files will be
- * copied over
- * @param toDir
- * FIle the destination folder
- * @param recursive
- * boolean recurively looking for files int the specified folder
- * @param useLocaleFileName
- * boolean if true the locale specific file names will be used in
- * the copied destination, otherwise, the locale specific file
- * name will be renamed to the default one in the destination
- * folder
- * @throws IOException
- */
- public void copyLocalizedFiles(String path, File toDir, boolean recursive,
- boolean useLocaleFileName) throws IOException {
- String pluginPath = getInstallPath();
- URI pluginUri = new File(pluginPath).toURI();
- URI pathUri = new File(pluginPath, path).toURI();
-
- List files = new ArrayList();
- File f = new File(pluginPath, path);
- FileUtil.getAllFiles(f, files, recursive);
-
- // for each file found in the specified folder, get the localized file
- for (Iterator it = files.iterator(); it.hasNext();) {
- URI srcUri = ((File) it.next()).toURI();
-
- // get the relative path of the file to the plugin root, then find
- // the localized file
- String relPath = pluginUri.relativize(srcUri).getPath();
-
- // only get the locale specific file, don't include the default one
- String localizedFile = getLocalizedFile(relPath, false);
- if (localizedFile == null) {
- continue;
- }
-
- // need to change the target file path to relative to the path
- // instead of the plugin root
- relPath = pathUri.relativize(srcUri).getPath();
- File srcFile = new File(localizedFile);
- File targetFile = new File(toDir, relPath);
- File targetParent = targetFile.getParentFile();
-
- // copy the file to the desitination
- // if useLocaleFileName is true, the destination file name should
- // also use the locale specific file name
- if (useLocaleFileName) {
- String fileName = srcFile.getName();
- targetFile = new File(targetParent, fileName);
- }
-
- if (isDebugging()) {
- System.out.println("Copying localized file: "); //$NON-NLS-1$
- System.out.println("Source: " + srcFile); //$NON-NLS-1$
- System.out.println("Target: " + targetFile); //$NON-NLS-1$
- System.out.println(""); //$NON-NLS-1$
- }
-
- try {
- if (!targetParent.exists()) {
- targetParent.mkdirs();
- }
-
- if (!targetFile.exists()) {
- targetFile.createNewFile();
- }
-
- FileUtil.copyFile(srcFile, targetFile);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- }
-
- /**
- * Returns the localized resource.
- *
- * @param key
- * The resource key.
- * @return The localized resource.
- */
- public String getString(String key) {
- if (resourceBundle != null) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- }
- }
- return '[' + key + ']';
- }
-
- /**
- * Returns the formatted localized message given the resource key and the
- * message argument.
- *
- * @param key
- * The resource key.
- * @param argument
- * The message argument.
- * @return The formatted localized message.
- */
- public String formatMessage(String key, Object argument) {
- if (resourceBundle != null) {
- try {
- String msg = resourceBundle.getString(key);
- Object[] arguments = { argument };
- return MessageFormat.format(msg, arguments);
- } catch (MissingResourceException e) {
- }
- }
- return '[' + key + ']';
- }
-
- /**
- * Returns the image URL given the relative path.
- *
- * @param relativePath
- * The image's path relative to the plug-in's root.
- * @return The image URL.
- */
- public URL getImageURL(String relativePath) {
- try {
- URL url = new URL(iconURL, relativePath);
- return FileLocator.resolve(url);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Returns the image descriptor given the relative path.
- *
- * @param relativePath
- * The image's path relative to the plug-in's root.
- * @return The image descriptor.
- */
- public ImageDescriptor getImageDescriptor(String relativePath) {
- try {
- URL url = new URL(iconURL, relativePath);
- return ImageDescriptor.createFromURL(url);
- } catch (MalformedURLException e) {
- return ImageDescriptor.getMissingImageDescriptor();
- }
- }
-
- /**
- * Returns the image given the relative path.
- *
- * Note: The returned image need to be freed by the caller.
- *
- * @param relativePath
- * The image's path relative to the plug-in's root.
- * @return The image.
- */
- public Image getImage(String relativePath) {
- Image image = null;
-
- ImageDescriptor imageDescriptor = getImageDescriptor(relativePath);
- if (imageDescriptor != null) {
- image = imageDescriptor.createImage(false);
- }
-
- return image;
- }
-
- /**
- * Returns the shared image given the relative path.
- *
- * Note: The returned image will be automatically freed when the plug-in
- * shuts down.
- *
- * @param relativePath
- * The image's path relative to the plug-in's root.
- * @return The image.
- */
- public Image getSharedImage(String relativePath) {
- Image image = (Image) sharedImages.get(relativePath);
- if (image != null) {
- return image;
- }
-
- ImageDescriptor imageDescriptor = getImageDescriptor(relativePath);
- if (imageDescriptor != null) {
- image = imageDescriptor.createImage(false);
- if (image != null) {
- sharedImages.put(relativePath, image);
- }
- }
-
- return image;
- }
-
- /**
- * Returns the profiling flag.
- *
- * @return true if profiling is enabled for this plu-in
- */
- public boolean isProfiling() {
- return profiling;
- }
-
- /**
- * Returns the logger given the plug-in ID.
- *
- * @return The new or cached logger.
- */
- public Logger getLogger() {
- Logger logger = (Logger) loggers.get(pluginId);
- if (logger == null) {
- logger = new Logger(this);
- loggers.put(pluginId, logger);
- }
- return logger;
- }
-
- /**
- * Returns the message dialog given the plug-in ID.
- *
- * @return The new or cached message dialog.
- */
- public static MsgDialog getMsgDialog(IActivator plugin) {
- MsgDialog msgDialog = (MsgDialog) msgDialogs.get(plugin.getId());
- if (msgDialog == null) {
- msgDialog = new MsgDialog(plugin);
- msgDialogs.put(plugin.getId(), msgDialog);
- }
- return msgDialog;
- }
-
-
- public MsgDialog getMsgDialog() {
- return getMsgDialog(this);
- }
-
- /**
- * Returns the standard display to be used. The method first checks, if the
- * thread calling this method has an associated disaply. If so, this display
- * is returned. Otherwise the method returns the default display.
- */
- public static Display getStandardDisplay() {
- Display display;
- display = Display.getCurrent();
- if (display == null)
- display = Display.getDefault();
- return display;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/CommonUIPlugin.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/CommonUIPlugin.java
deleted file mode 100644
index 3681e7d3c58..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/CommonUIPlugin.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.ui;
-
-import org.eclipse.epf.common.CommonPlugin;
-import org.eclipse.epf.common.IMessageCallback;
-import org.eclipse.epf.common.ui.util.MsgBox;
-import org.osgi.framework.BundleContext;
-
-public class CommonUIPlugin extends AbstractPlugin {
-
- // The shared plug-in instance.
- private static CommonUIPlugin plugin;
-
- /**
- * Creates a new instance.
- */
- public CommonUIPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * @see org.eclipse.epf.common.ui.AbstractPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
-// // set the preference store for the common plugin
- PreferenceStoreWrapper storeWrapper = new PreferenceStoreWrapper(getPreferenceStore());
- CommonPlugin.getDefault().setCommonPreferenceStore(storeWrapper);
-
- // create the message callback context for the non-ui plugins
- // this is the context for message callback
- // for eclipse client, this is the Shell object
- // shell object can't be shared acrooss thread, use a context provider instead
- //CommonPlugin.getDefault().setContext(MsgBox.getDefaultShell());
-
- CommonPlugin.getDefault().setContextProvider(new ContextProvider());
-
- // create the MessageCallback to be accessible to the non-ui plugin
- IMessageCallback msgCallback = new MessageCallback();
- }
-
- /**
- * @see org.eclipse.epf.common.ui.AbstractPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Gets the shared instance.
- *
- * @return the shared plug-in instance
- */
- public static CommonUIPlugin getDefault() {
- return plugin;
- }
-
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/ContextProvider.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/ContextProvider.java
deleted file mode 100644
index 7530e31cf0d..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/ContextProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.ui;
-
-import org.eclipse.epf.common.IContextProvider;
-import org.eclipse.epf.common.ui.util.MsgBox;
-
-/**
- * content provider for non-ui plugins
- *
- * @author Jinhua Xi
- * @since 1.5
- *
- */
-public class ContextProvider implements IContextProvider {
-
- public Object getContext() {
- //TODO: revisit
- Object ctx = null;
- try {
- ctx = CommonUIPlugin.getDefault().getWorkbench().getDisplay().getActiveShell();
- }
- catch(Exception e) {
- //
- }
- return ctx != null ? ctx : MsgBox.getDefaultShell();
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/MessageCallback.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/MessageCallback.java
deleted file mode 100644
index dfef39b6621..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/MessageCallback.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.ui;
-
-import org.eclipse.epf.common.AbstractActivator;
-import org.eclipse.epf.common.IMessageCallback;
-import org.eclipse.epf.common.ui.util.MsgDialog;
-
-/**
- * message callback implementation
- *
- * @author Jinhua Xi
- * @since 1.5
- *
- */
-public class MessageCallback implements IMessageCallback {
-
- public void displayWarning(AbstractActivator plugin, String title, String msg, String reason) {
- displayWarning(plugin, title, msg, reason, null, null);
- }
-
- public void displayWarning(AbstractActivator plugin, String msg, String reason, Throwable ex) {
- displayWarning(plugin, msg, reason, null, ex);
- }
-
- public void displayWarning(AbstractActivator plugin, String msg, String reason,
- String details, Throwable ex) {
- String title = CommonUIPlugin.getDefault().getWorkbench().getDisplay().getActiveShell().getText();
- displayWarning(plugin, title, msg, reason, details, ex);
- }
-
- public void displayWarning(AbstractActivator plugin, String title, String msg, String reason,
- String details, Throwable ex) {
- MsgDialog dlg = CommonUIPlugin.getDefault().getMsgDialog(plugin);
- dlg.displayWarning(title, msg, reason, details, ex);
- }
-
- public void displayError(AbstractActivator plugin, String title, String msg) {
- displayError(plugin, title, msg, null, null, null);
- }
-
- public void displayError(AbstractActivator plugin, String title, String msg, Throwable ex) {
- displayError(plugin, title, msg, null, null, ex);
- }
- public void displayError(AbstractActivator plugin, String title, String msg, String reason, String details, Throwable ex) {
- MsgDialog dlg = CommonUIPlugin.getDefault().getMsgDialog(plugin);
- dlg.displayError(title, msg, reason, details, ex);
-
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/PreferenceStoreWrapper.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/PreferenceStoreWrapper.java
deleted file mode 100644
index 534f8af084b..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/PreferenceStoreWrapper.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.epf.common.preferences.IPreferenceStoreWrapper;
-import org.eclipse.epf.common.preferences.IPropertyChangeListenerWrapper;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * wrapper class for preference store
- *
- * @author Jinhua Xi
- * @since 1.5
- *
- */
-public class PreferenceStoreWrapper implements IPreferenceStoreWrapper {
- private IPreferenceStore store;
- public PreferenceStoreWrapper(IPreferenceStore store) {
- this.store = store;
- }
-
- Map listenerMap = new HashMap();
-
- public IPreferenceStore getStore() {
- return store;
- }
-
- public void addPropertyChangeListener(final IPropertyChangeListenerWrapper listener) {
- // create a PropertyChangeListener and add to the store
- IPropertyChangeListener pcl = new IPropertyChangeListener(){
-
- public void propertyChange(PropertyChangeEvent event) {
- PropertyChangeEventWrapper wrapper = new PropertyChangeEventWrapper(event);
- listener.propertyChange(wrapper);
-
- }};
-
- listenerMap.put(listener, pcl);
- store.addPropertyChangeListener(pcl);
- }
-
- public void firePropertyChangeEvent(String name, Object oldValue,
- Object newValue) {
- store.firePropertyChangeEvent(name, oldValue, newValue);
- }
-
- public void removePropertyChangeListener(IPropertyChangeListenerWrapper listener) {
- IPropertyChangeListener pcl = listenerMap.remove(listener);
- if ( pcl != null ) {
- store.removePropertyChangeListener(pcl);
- }
- }
-
- /**
- * Returns the current value of the boolean-valued preference with the
- * given name.
- * Returns the default-default value (false) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a boolean.
- *
- * @param name the name of the preference
- * @return the boolean-valued preference
- */
- public boolean getBoolean(String name) {
- return store.getBoolean(name);
- }
-
- /**
- * Returns the default value for the boolean-valued preference
- * with the given name.
- * Returns the default-default value (false) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a boolean.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public boolean getDefaultBoolean(String name) {
- return store.getDefaultBoolean(name);
- }
-
- /**
- * Returns the default value for the double-valued preference
- * with the given name.
- * Returns the default-default value (0.0) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a double.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public double getDefaultDouble(String name) {
- return store.getDefaultDouble(name);
- }
-
- /**
- * Returns the default value for the float-valued preference
- * with the given name.
- * Returns the default-default value (0.0f) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a float.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public float getDefaultFloat(String name) {
- return store.getDefaultFloat(name);
- }
-
- /**
- * Returns the default value for the integer-valued preference
- * with the given name.
- * Returns the default-default value (0) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as an integer.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public int getDefaultInt(String name) {
- return store.getDefaultInt(name);
- }
-
- /**
- * Returns the default value for the long-valued preference
- * with the given name.
- * Returns the default-default value (0L) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a long.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public long getDefaultLong(String name) {
- return store.getDefaultLong(name);
- }
-
- /**
- * Returns the default value for the string-valued preference
- * with the given name.
- * Returns the default-default value (the empty string "")
- * is no default preference with the given name, or if the default
- * value cannot be treated as a string.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public String getDefaultString(String name) {
- return store.getDefaultString(name);
- }
-
- /**
- * Returns the current value of the double-valued preference with the
- * given name.
- * Returns the default-default value (0.0) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a double.
- *
- * @param name the name of the preference
- * @return the double-valued preference
- */
- public double getDouble(String name) {
- return store.getDouble(name);
- }
-
- /**
- * Returns the current value of the float-valued preference with the
- * given name.
- * Returns the default-default value (0.0f) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a float.
- *
- * @param name the name of the preference
- * @return the float-valued preference
- */
- public float getFloat(String name) {
- return store.getFloat(name);
- }
-
- /**
- * Returns the current value of the integer-valued preference with the
- * given name.
- * Returns the default-default value (0) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as an integter.
- *
- * @param name the name of the preference
- * @return the int-valued preference
- */
- public int getInt(String name) {
- return store.getInt(name);
- }
-
- /**
- * Returns the current value of the long-valued preference with the
- * given name.
- * Returns the default-default value (0L) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a long.
- *
- * @param name the name of the preference
- * @return the long-valued preference
- */
- public long getLong(String name) {
- return store.getLong(name);
- }
-
- /**
- * Returns the current value of the string-valued preference with the
- * given name.
- * Returns the default-default value (the empty string "")
- * if there is no preference with the given name, or if the current value
- * cannot be treated as a string.
- *
- * @param name the name of the preference
- * @return the string-valued preference
- */
- public String getString(String name) {
- return store.getString(name);
- }
-
- /**
- * Returns whether the current value of the preference with the given name
- * has the default value.
- *
- * @param name the name of the preference
- * @return true if the preference has a known default value
- * and its current value is the same, and false otherwise
- * (including the case where the preference is unknown to this store)
- */
- public boolean isDefault(String name) {
- return store.isDefault(name);
- }
-
- /**
- * Returns whether the current values in this property store
- * require saving.
- *
- * @return true if at least one of values of
- * the preferences known to this store has changed and
- * requires saving, and false otherwise.
- */
- public boolean needsSaving() {
- return store.needsSaving();
- }
-
- /**
- * Sets the current value of the preference with the given name to
- * the given string value without sending a property change.
- *
- * This method does not fire a property change event and
- * should only be used for setting internal preferences
- * that are not meant to be processed by listeners.
- * Normal clients should instead call #setValue.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void putValue(String name, String value) {
- store.putValue(name, value);
- }
-
- /**
- * Sets the default value for the double-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, double value) {
- store.setDefault(name, value);
- }
-
- /**
- * Sets the default value for the float-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, float value) {
- store.setDefault(name, value);
- }
-
- /**
- * Sets the default value for the integer-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, int value) {
- store.setDefault(name, value);
- }
-
- /**
- * Sets the default value for the long-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, long value) {
- store.setDefault(name, value);
- }
-
- /**
- * Sets the default value for the string-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param defaultObject the new default value for the preference
- */
- public void setDefault(String name, String defaultObject) {
- store.setDefault(name, defaultObject);
- }
-
- /**
- * Sets the default value for the boolean-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, boolean value) {
- store.setDefault(name, value);
- }
-
- /**
- * Sets the current value of the preference with the given name back
- * to its default value.
- *
- * Note that the preferred way of re-initializing a preference to the
- * appropriate default value is to call setToDefault.
- * This is implemented by removing the named value from the store,
- * thereby exposing the default value.
- *
- *
- * @param name the name of the preference
- */
- public void setToDefault(String name) {
- store.setToDefault(name);
- }
-
- /**
- * Sets the current value of the double-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, double value) {
- store.setValue(name, value);
- }
-
- /**
- * Sets the current value of the float-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, float value) {
- store.setValue(name, value);
- }
-
- /**
- * Sets the current value of the integer-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, int value) {
- store.setValue(name, value);
- }
-
- /**
- * Sets the current value of the long-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, long value) {
- store.setValue(name, value);
- }
-
- /**
- * Sets the current value of the string-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, String value) {
- store.setValue(name, value);
- }
-
- /**
- * Sets the current value of the boolean-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, boolean value) {
- store.setValue(name, value);
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/PropertyChangeEventWrapper.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/PropertyChangeEventWrapper.java
deleted file mode 100644
index 2d3a7717757..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/PropertyChangeEventWrapper.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.ui;
-
-import org.eclipse.epf.common.preferences.IPropertyChangeEventWrapper;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * wrapper class for property change event
- *
- * @author Jinhua Xi
- * @since 1.5
- *
- */
-public class PropertyChangeEventWrapper implements IPropertyChangeEventWrapper {
-
- private PropertyChangeEvent event;
- public PropertyChangeEventWrapper(PropertyChangeEvent event) {
- this.event = event;
- }
-
- /**
- * Returns the new value of the property.
- *
- * @return the new value, or null if not known
- * or not relevant (for instance if the property was removed).
- */
- public Object getNewValue() {
- return this.event.getNewValue();
- }
-
- /**
- * Returns the old value of the property.
- *
- * @return the old value, or null if not known
- * or not relevant (for instance if the property was just
- * added and there was no old value).
- */
- public Object getOldValue() {
- return this.event.getOldValue();
- }
-
- /**
- * Returns the name of the property that changed.
- *
- * Warning: there is no guarantee that the property name returned
- * is a constant string. Callers must compare property names using
- * equals, not ==.
- *
- *
- * @return the name of the property that changed
- */
- public String getProperty() {
- return this.event.getProperty();
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/actions/CComboContributionItem.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/actions/CComboContributionItem.java
deleted file mode 100644
index 1858e7f8bb6..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/actions/CComboContributionItem.java
+++ /dev/null
@@ -1,164 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.actions;
-
-import java.util.Collection;
-
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.CoolBar;
-import org.eclipse.swt.widgets.CoolItem;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-/**
- * Wraps a CCombo in a ContributionItem for use in a toolbar
- *
- * Does not use a ComboViewer because of tabbing issues - see bug 78885
- * @author Jeff Hardy
- *
- */
-public class CComboContributionItem extends ContributionItem {
-
- protected CCombo CCombo;
-
- protected ToolItem toolItem;
-
- protected CoolItem coolItem;
-
- protected int style;
-
- protected Collection input;
-
- /**
- * Creates a new instance.
- */
- public CComboContributionItem(int style) {
- super();
- this.style = style;
- }
-
- /*
- * @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.ToolBar,
- * int)
- */
- public void fill(ToolBar parent, int index) {
- toolItem = new ToolItem(parent, SWT.SEPARATOR);
- Control box = createControl(parent);
- toolItem.setControl(box);
- Point preferredSize = CCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- toolItem.setWidth(preferredSize.x);
- }
-
- /*
- * @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.CoolBar,
- * int)
- */
- public void fill(CoolBar coolBar, int index) {
- Control box = createControl(coolBar);
-
- if (index >= 0) {
- coolItem = new CoolItem(coolBar, SWT.DROP_DOWN, index);
- } else {
- coolItem = new CoolItem(coolBar, SWT.DROP_DOWN);
- }
-
- // Set the back reference.
- coolItem.setData(this);
-
- // Add the toolbar to the CoolItem widget.
- coolItem.setControl(box);
-
- // If the toolbar item exists then adjust the size of the cool item.
- Point toolBarSize = box.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- // Set the preferred size to the size of the toolbar plus trim.
- coolItem.setMinimumSize(toolBarSize);
- coolItem.setPreferredSize(toolBarSize);
- coolItem.setSize(toolBarSize);
- }
-
- /*
- * @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Composite)
- */
- public void fill(Composite parent) {
- createControl(parent);
- }
-
- /**
- * Creates the control.
- */
- protected Control createControl(final Composite parent) {
- CCombo = new CCombo(parent, style);
- CCombo.setVisibleItemCount(10);
- CCombo.setEnabled(true);
- CCombo.setItems(input.toArray(new String[0]));
- CCombo.addDisposeListener(
- new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- dispose();
- }
- });
-
- CCombo.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- performSelectionChanged();
- }
- });
-
- return CCombo;
- }
-
- /**
- * Returns the currently selected method configuration
- */
- protected int getSelectionIndex() {
- return CCombo.getSelectionIndex();
- }
-
- protected void setInput(Collection input) {
- this.input = input;
- }
-
-
- protected void performSelectionChanged() {
- }
-
- /*
- * @see org.eclipse.jface.action.ContributionItem#dispose()
- */
- public void dispose() {
- super.dispose();
- }
-
- public CCombo getCCombo() {
- return CCombo;
- }
-
- public ToolItem getToolItem() {
- return toolItem;
- }
-
- public CoolItem getCoolItem() {
- return coolItem;
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/ClipboardUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/ClipboardUtil.java
deleted file mode 100644
index 6fc767b6db4..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/ClipboardUtil.java
+++ /dev/null
@@ -1,122 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.epf.common.utils.FileUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.HTMLTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Display;
-import org.osgi.framework.Bundle;
-
-/**
- * Utility class for retrieving data from the clipboard.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class ClipboardUtil {
-
- /**
- * The current clipboard.
- */
- private static Clipboard clipboard;
-
- private static final String SOURCE_URL = "SourceURL:"; //$NON-NLS-1$
-
- private static Transfer htmlTransfer = null;
-
- static {
- if (SWT.getPlatform().equals("win32")) { //$NON-NLS-1$
- try {
- boolean is64bit = (System.getProperty("os.arch").indexOf("64") != -1);
- Bundle bundle = null;
- if (is64bit) {
- bundle = Platform
- .getBundle("org.eclipse.epf.common.win32.win32.x86_64"); //$NON-NLS-1$
- } else {
- bundle = Platform
- .getBundle("org.eclipse.epf.common.win32.win32.x86"); //$NON-NLS-1$
- }
- if (bundle != null) {
- Class> c = bundle
- .loadClass("org.eclipse.epf.common.win32.Win32HTMLTransfer"); //$NON-NLS-1$
- if (c != null) {
- htmlTransfer = (Transfer) c.newInstance();
- }
- }
- } catch (Exception e) {
- htmlTransfer = null;
- }
- }
- }
-
- /**
- * Gets the HTML source URL from the current clipboard.
- *
- * @return the HTML source URL or null
- */
- public static String getHTMLSourceURL() {
- if (htmlTransfer == null) {
- return null;
- }
-
- Clipboard clipboard = new Clipboard(Display.getCurrent());
- String sourceURL = null;
- try {
- String htmlContent = (String) clipboard.getContents(htmlTransfer);
- if (htmlContent != null && htmlContent.length() > 0) {
- int index = htmlContent.indexOf(SOURCE_URL);
- if (index > 0) {
- sourceURL = htmlContent.substring(index
- + SOURCE_URL.length());
- sourceURL = sourceURL.substring(0, sourceURL
- .indexOf(FileUtil.LINE_SEP));
- }
- }
- if (sourceURL != null && sourceURL.indexOf("\\") != -1) { //$NON-NLS-1$
- // IE provides sourceURL in form "file://C:\foo\bar.htm"
- // but when the hrefs are resolved, files look like "file:///C:/foo/bar.htm"
- URL url = new URL(sourceURL);
- sourceURL = url.toExternalForm();
- if (sourceURL.startsWith("file://") && !sourceURL.startsWith("file:///")) { //$NON-NLS-1$ //$NON-NLS-2$
- // need to add a third / so rte.js can match the sourceURL to hrefs
- sourceURL = "file:///" + sourceURL.substring(7); //$NON-NLS-1$
- }
- }
- return sourceURL;
- } catch (MalformedURLException urlEx) {
- return sourceURL;
- } finally {
- clipboard.dispose();
- }
- }
-
- /**
- * Copy the string to the clipboard.
- */
- public static void copyTextHTMLToClipboard(String string) {
- if (clipboard != null)
- clipboard.dispose();
- clipboard = new Clipboard(null);
- clipboard.setContents(new Object[] { string, string },
- new Transfer[] { TextTransfer.getInstance(), HTMLTransfer.getInstance() });
- if (clipboard != null)
- clipboard.dispose();
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/CommonPreferences.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/CommonPreferences.java
deleted file mode 100644
index d20685d3365..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/CommonPreferences.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.ui.util;
-
-import org.eclipse.epf.common.ui.CommonUIPlugin;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * Manages the common preferences.
- *
- * @author Kelvin Low
- * @since 1.2
- */
-public class CommonPreferences {
-
- /**
- * Preference key for storing the preference history size.
- */
- private static final String PREFERENCE_HISTORY_SIZE = "preferenceHistorySize"; //$NON-NLS-1$
-
- // The plug-in specific preference store.
- private static IPreferenceStore prefStore = CommonUIPlugin.getDefault()
- .getPreferenceStore();
-
- static {
- // Initialize the default preference values.
- prefStore.setDefault(PREFERENCE_HISTORY_SIZE,
- getDefaultPreferenceHistorySize());
- }
-
- /**
- * Gets the default preference history size.
- */
- public static int getDefaultPreferenceHistorySize() {
- return 10;
- }
-
- /**
- * Gets the preference history size.
- */
- public static int getPreferenceHistorySize() {
- return prefStore.getInt(PREFERENCE_HISTORY_SIZE);
- }
-
- /**
- * Saves the preference history size.
- */
- public static void setPreferenceHistorySize(int value) {
- prefStore.setValue(PREFERENCE_HISTORY_SIZE, value);
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/ErrorDialogNoReason.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/ErrorDialogNoReason.java
deleted file mode 100644
index 6793260c080..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/ErrorDialogNoReason.java
+++ /dev/null
@@ -1,598 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IconAndMessageDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Displays an error dialog without the Details button.
- *
- * @author Bingxue Xu
- * @since 1.0
- */
-public class ErrorDialogNoReason extends IconAndMessageDialog {
-
- /**
- * Static to prevent opening of error dialogs for automated testing.
- */
- public static final boolean AUTOMATED_MODE = false;
-
- /**
- * Reserve room for this many list items.
- */
- private static final int LIST_ITEM_COUNT = 7;
-
- /**
- * The nesting indent.
- */
- private static final String NESTING_INDENT = " "; //$NON-NLS-1$
-
- /**
- * The Details button.
- */
- protected Button detailsButton;
-
- /**
- * The title of the dialog.
- */
- private String title;
-
- /**
- * The SWT list control that displays the error details.
- */
- private List list;
-
- /**
- * Indicates whether the error details viewer is currently created.
- */
- private boolean listCreated = false;
-
- /**
- * Filter mask for determining which status items to display.
- */
- private int displayMask = 0xFFFF;
-
- /**
- * The main status object.
- */
- private IStatus status;
-
- /**
- * The current clipboard. To be disposed when closing the dialog.
- */
- private Clipboard clipboard;
-
- private boolean shouldIncludeTopLevelErrorInDetails = false;
-
- /**
- * Creates an error dialog. Note that the dialog will have no visual
- * representation (no widgets) until it is told to open.
- *
- * Normally one should use openError to create and open one
- * of these. This constructor is useful only if the error object being
- * displayed contains child items and you need to specify a mask
- * which will be used to filter the displaying of these children.
- *
- *
- * @param parentShell
- * the shell under which to create this dialog
- * @param dialogTitle
- * the title to use for this dialog, or null to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or null to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @param displayMask
- * the mask to use to filter the displaying of child items, as
- * per IStatus.matches
- * @see org.eclipse.core.runtime.IStatus#matches(int)
- */
- public ErrorDialogNoReason(Shell parentShell, String dialogTitle,
- String message, IStatus status, int displayMask) {
- super(parentShell);
- this.title = dialogTitle == null ? JFaceResources
- .getString("Problem_Occurred") : //$NON-NLS-1$
- dialogTitle;
- this.message = message == null ? status.getMessage() : message;
- this.status = status;
- this.displayMask = displayMask;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog. Handles the pressing of the Ok
- * or Details button in this dialog. If the Ok button was pressed then close
- * this dialog. If the Details button was pressed then toggle the displaying
- * of the error details area. Note that the Details button will only be
- * visible if the error being displayed specifies child details.
- */
- protected void buttonPressed(int id) {
- if (id == IDialogConstants.DETAILS_ID) {
- // was the details button pressed?
- toggleDetailsArea();
- } else {
- super.buttonPressed(id);
- }
- }
-
- /*
- * (non-Javadoc) Method declared in Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(title);
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- // create OK and Details buttons
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
- true);
- createButton(parent, IDialogConstants.CANCEL_ID,
- IDialogConstants.CANCEL_LABEL, false);
- if (shouldShowDetailsButton()) {
- detailsButton = createButton(parent, IDialogConstants.DETAILS_ID,
- IDialogConstants.SHOW_DETAILS_LABEL, false);
- }
- }
-
- /**
- * This implementation of the Dialog framework method creates
- * and lays out a composite and calls createMessageArea and
- * createCustomArea to populate it. Subclasses should
- * override createCustomArea to add contents below the
- * message.
- */
- protected Control createDialogArea(Composite parent) {
- createMessageArea(parent);
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- layout.numColumns = 2;
- composite.setLayout(layout);
- GridData childData = new GridData(GridData.FILL_BOTH);
- childData.horizontalSpan = 2;
- composite.setLayoutData(childData);
- composite.setFont(parent.getFont());
- return composite;
- }
-
- /*
- * @see IconAndMessageDialog#createDialogAndButtonArea(Composite)
- */
- protected void createDialogAndButtonArea(Composite parent) {
- super.createDialogAndButtonArea(parent);
- if (this.dialogArea instanceof Composite) {
- // Create a label if there are no children to force a smaller layout
- Composite dialogComposite = (Composite) dialogArea;
- if (dialogComposite.getChildren().length == 0)
- new Label(dialogComposite, SWT.NULL);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.IconAndMessageDialog#getImage()
- */
- protected Image getImage() {
- if (status != null) {
- if (status.getSeverity() == IStatus.WARNING)
- return getWarningImage();
- if (status.getSeverity() == IStatus.INFO)
- return getInfoImage();
- }
- // If it was not a warning or an error then return the error image
- return getErrorImage();
- }
-
- /**
- * Create this dialog's drop-down list component.
- *
- * @param parent
- * the parent composite
- * @return the drop-down list component
- */
- protected List createDropDownList(Composite parent) {
- // create the list
- list = new List(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
- | SWT.MULTI);
- // fill the list
- populateList(list);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL
- | GridData.GRAB_VERTICAL);
- data.heightHint = list.getItemHeight() * LIST_ITEM_COUNT;
- data.horizontalSpan = 2;
- list.setLayoutData(data);
- list.setFont(parent.getFont());
- Menu copyMenu = new Menu(list);
- MenuItem copyItem = new MenuItem(copyMenu, SWT.NONE);
- copyItem.addSelectionListener(new SelectionListener() {
- /*
- * @see SelectionListener.widgetSelected (SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- copyToClipboard();
- }
-
- /*
- * @see SelectionListener.widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- copyToClipboard();
- }
- });
- copyItem.setText(JFaceResources.getString("copy")); //$NON-NLS-1$
- list.setMenu(copyMenu);
- listCreated = true;
- return list;
- }
-
- /*
- * (non-Javadoc) Method declared on Window.
- */
- /**
- * Extends Window.open(). Opens an error dialog to display
- * the error. If you specified a mask to filter the displaying of these
- * children, the error dialog will only be displayed if there is at least
- * one child status matching the mask.
- */
- public int open() {
- if (!AUTOMATED_MODE && shouldDisplay(status, displayMask)) {
- return super.open();
- }
- setReturnCode(OK);
- return OK;
- }
-
- /**
- * Opens an error dialog to display the given error. Use this method if the
- * error object being displayed does not contain child items, or if you wish
- * to display all such items without filtering.
- *
- * @param parent
- * the parent shell of the dialog, or null if none
- * @param dialogTitle
- * the title to use for this dialog, or null to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or null to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @return the code of the button that was pressed that resulted in this
- * dialog closing. This will be Dialog.OK if the OK
- * button was pressed, or Dialog.CANCEL if this
- * dialog's close window decoration or the ESC key was used.
- */
- public static int openError(Shell parent, String dialogTitle,
- String message, IStatus status) {
- return openError(parent, dialogTitle, message, status, IStatus.OK
- | IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
- }
-
- /**
- * Opens an error dialog to display the given error. Use this method if the
- * error object being displayed contains child items and you wish
- * to specify a mask which will be used to filter the displaying of these
- * children. The error dialog will only be displayed if there is at least
- * one child status matching the mask.
- *
- * @param parentShell
- * the parent shell of the dialog, or null if none
- * @param title
- * the title to use for this dialog, or null to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or null to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @param displayMask
- * the mask to use to filter the displaying of child items, as
- * per IStatus.matches
- * @return the code of the button that was pressed that resulted in this
- * dialog closing. This will be Dialog.OK if the OK
- * button was pressed, or Dialog.CANCEL if this
- * dialog's close window decoration or the ESC key was used.
- * @see org.eclipse.core.runtime.IStatus#matches(int)
- */
- public static int openError(Shell parentShell, String title,
- String message, IStatus status, int displayMask) {
- ErrorDialogNoReason dialog = new ErrorDialogNoReason(parentShell,
- title, message, status, displayMask);
- return dialog.open();
- }
-
- /**
- * Populates the list using this error dialog's status object. This walks
- * the child static of the status object and displays them in a list. The
- * format for each entry is status_path : status_message If the status's
- * path was null then it (and the colon) are omitted.
- *
- * @param listToPopulate
- * The list to fill.
- */
- private void populateList(List listToPopulate) {
- populateList(listToPopulate, status, 0,
- shouldIncludeTopLevelErrorInDetails);
- }
-
- /**
- * Populate the list with the messages from the given status. Traverse the
- * children of the status deeply and also traverse CoreExceptions that
- * appear in the status.
- *
- * @param listToPopulate
- * the list to populate
- * @param buildingStatus
- * the status being displayed
- * @param nesting
- * the nesting level (increases one level for each level of
- * children)
- * @param includeStatus
- * whether to include the buildingStatus in the display or just
- * its children
- */
- private void populateList(List listToPopulate, IStatus buildingStatus,
- int nesting, boolean includeStatus) {
-
- if (!buildingStatus.matches(displayMask)) {
- return;
- }
-
- Throwable t = buildingStatus.getException();
- boolean isCoreException = t instanceof CoreException;
- boolean incrementNesting = false;
-
- if (includeStatus) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < nesting; i++) {
- sb.append(NESTING_INDENT);
- }
- String message = buildingStatus.getMessage();
- sb.append(message);
- listToPopulate.add(sb.toString());
- incrementNesting = true;
- }
-
- if (!isCoreException && t != null) {
- // Include low-level exception message
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < nesting; i++) {
- sb.append(NESTING_INDENT);
- }
- String message = t.getLocalizedMessage();
- if (message == null)
- message = t.toString();
-
- sb.append(message);
- listToPopulate.add(sb.toString());
- incrementNesting = true;
- }
-
- if (incrementNesting)
- nesting++;
-
- // Look for a nested core exception
- if (isCoreException) {
- CoreException ce = (CoreException) t;
- IStatus eStatus = ce.getStatus();
- // Only print the exception message if it is not contained in the
- // parent message
- if (message == null || message.indexOf(eStatus.getMessage()) == -1) {
- populateList(listToPopulate, eStatus, nesting, true);
- }
- }
-
- // Look for child status
- IStatus[] children = buildingStatus.getChildren();
- for (int i = 0; i < children.length; i++) {
- populateList(listToPopulate, children[i], nesting, true);
- }
- }
-
- /**
- * Returns whether the given status object should be displayed.
- *
- * @param status
- * a status object
- * @param mask
- * a mask as per IStatus.matches
- * @return true if the given status should be displayed, and
- * false otherwise
- * @see org.eclipse.core.runtime.IStatus#matches(int)
- */
- protected static boolean shouldDisplay(IStatus status, int mask) {
- IStatus[] children = status.getChildren();
- if (children == null || children.length == 0) {
- return status.matches(mask);
- }
- for (int i = 0; i < children.length; i++) {
- if (children[i].matches(mask))
- return true;
- }
- return false;
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by the user
- * pressing the details button.
- */
- private void toggleDetailsArea() {
- Point windowSize = getShell().getSize();
- Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- if (listCreated) {
- list.dispose();
- listCreated = false;
- detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
- } else {
- list = createDropDownList((Composite) getContents());
- detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
- }
- Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- getShell()
- .setSize(
- new Point(windowSize.x, windowSize.y
- + (newSize.y - oldSize.y)));
- }
-
- /**
- * Put the details of the status of the error onto the stream.
- *
- * @param buildingStatus
- * @param buffer
- * @param nesting
- */
- private void populateCopyBuffer(IStatus buildingStatus,
- StringBuffer buffer, int nesting) {
- if (!buildingStatus.matches(displayMask)) {
- return;
- }
- for (int i = 0; i < nesting; i++) {
- buffer.append(NESTING_INDENT);
- }
- buffer.append(buildingStatus.getMessage());
- buffer.append("\n"); //$NON-NLS-1$
-
- // Look for a nested core exception
- Throwable t = buildingStatus.getException();
- if (t instanceof CoreException) {
- CoreException ce = (CoreException) t;
- populateCopyBuffer(ce.getStatus(), buffer, nesting + 1);
- }
-
- IStatus[] children = buildingStatus.getChildren();
- for (int i = 0; i < children.length; i++) {
- populateCopyBuffer(children[i], buffer, nesting + 1);
- }
- }
-
- /**
- * Copy the contents of the statuses to the clipboard.
- */
- private void copyToClipboard() {
- if (clipboard != null)
- clipboard.dispose();
- StringBuffer statusBuffer = new StringBuffer();
- populateCopyBuffer(status, statusBuffer, 0);
- clipboard = new Clipboard(list.getDisplay());
- clipboard.setContents(new Object[] { statusBuffer.toString() },
- new Transfer[] { TextTransfer.getInstance() });
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#close()
- */
- public boolean close() {
- if (clipboard != null)
- clipboard.dispose();
- return super.close();
- }
-
- /**
- * Show the details portion of the dialog if it is not already visible. This
- * method will only work when it is invoked after the control of the dialog
- * has been set. In other words, after the createContents
- * method has been invoked and has returned the control for the content area
- * of the dialog. Invoking the method before the content area has been set
- * or after the dialog has been disposed will have no effect.
- *
- * @since 3.1
- */
- protected final void showDetailsArea() {
- if (!listCreated) {
- Control control = getContents();
- if (control != null && !control.isDisposed())
- toggleDetailsArea();
- }
- }
-
- /**
- * Return whether the Details button should be included. This method is
- * invoked once when the dialog is built. By default, the Details button is
- * only included if the status used when creating the dialog was a
- * multi-status or if the status contains an exception. Subclasses may
- * override.
- *
- * @return whether the Details button should be included
- * @since 3.1
- */
- protected boolean shouldShowDetailsButton() {
- return status.isMultiStatus() || status.getException() != null;
- }
-
- /**
- * Set the status displayed by this error dialog to the given status. This
- * only affects the status displayed by the Details list. The message, image
- * and title should be updated by the subclass, if desired.
- *
- * @param status
- * the status to be displayed in the details list
- * @since 3.1
- */
- protected final void setStatus(IStatus status) {
- if (this.status != status) {
- this.status = status;
- }
- shouldIncludeTopLevelErrorInDetails = true;
- if (listCreated) {
- repopulateList();
- }
- }
-
- /**
- * Repopulate the supplied list widget.
- */
- private void repopulateList() {
- if (list != null && !list.isDisposed()) {
- list.removeAll();
- populateList(list);
- }
- }
-
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MenuUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MenuUtil.java
deleted file mode 100644
index 52a828d1e80..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MenuUtil.java
+++ /dev/null
@@ -1,47 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import org.eclipse.swt.widgets.MenuItem;
-
-/**
- * A helper class for retrieving Eclipse menus.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class MenuUtil {
-
- /**
- * Searches an array of menu items and returns the menu item that matches
- * the given menu text.
- *
- * @param menuItems
- * An array of menu items.
- * @param text
- * The text to look for.
- * @return The menu item if found, null otherwise.
- */
- public static MenuItem getMenuItem(MenuItem[] menuItems, String text) {
- if (menuItems == null || text == null || text.length() == 0) {
- return null;
- }
-
- for (int i = 0; i < menuItems.length; i++) {
- if (menuItems[i].getText().startsWith(text)) {
- return menuItems[i];
- }
- }
-
- return null;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MsgBox.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MsgBox.java
deleted file mode 100644
index 1d97b41167a..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MsgBox.java
+++ /dev/null
@@ -1,123 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Helper class to display a message box.
- *
- * @author Phong Nguyen Le
- * @author Kelvin Low
- * @since 1.0
- */
-public final class MsgBox {
- /**
- * Use this method to show error message if you don't want long path to be
- * cut off.
- *
- * @param msg
- */
- public static final void nativeShowError(Shell shell, String msg) {
- if (shell == null) {
- shell = getDefaultShell();
- if (shell == null) {
- return;
- }
- }
- MessageBox msgBox = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
- msgBox.setMessage(msg);
- msgBox.setText(shell.getText());
- msgBox.open();
- }
-
- public static final void showError(String msg) {
- showError(getDefaultShell(), msg);
- }
-
- public static final void showError(Shell shell, String msg) {
- WrappedMessageDialog.openError(shell, shell == null ? null : shell
- .getText(), msg);
- }
-
- public static final void showWarning(String msg) {
- showWarning(getDefaultShell(), msg);
- }
-
- public static final void showWarning(Shell shell, String msg) {
- WrappedMessageDialog.openWarning(shell, shell == null ? null : shell
- .getText(), msg);
- }
-
- public static final Shell getDefaultShell() {
- try {
- Display d = Display.getCurrent();
- if (d == null) {
- d = Display.getDefault();
- }
-
- Shell s = null;
- if (d != null) {
- s = d.getActiveShell();
- }
-
- return s;
- } catch (RuntimeException e) {
- return null;
- }
- }
-
- public static final Display getDisplay() {
- try {
- Display d = Display.getCurrent();
- if (d == null) {
- d = Display.getDefault();
- }
-
- return d;
- } catch (RuntimeException e) {
- return null;
- }
- }
-
- public static final int prompt(String msg) {
- return prompt(getDefaultShell(), msg);
- }
-
- public static final int prompt(Shell shell, String msg) {
- return prompt(shell, null, msg, SWT.YES | SWT.NO | SWT.CANCEL);
- }
-
- public static final int prompt(String msg, int buttons) {
- return prompt(getDefaultShell(), null, msg, buttons);
- }
-
- public static final int prompt(String title, String msg, int buttons) {
- return prompt(getDefaultShell(), title, msg, buttons);
- }
-
- public static final int prompt(Shell shell, String msg, int buttons) {
- return prompt(shell, null, msg, buttons);
- }
-
- public static final int prompt(Shell shell, String title, String msg,
- int buttons) {
- MessageBox msgBox = new MessageBox(shell, buttons | SWT.ICON_QUESTION);
- msgBox.setText(title != null && title.length() > 0 ? title : shell
- .getText());
- msgBox.setMessage(msg);
- return msgBox.open();
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MsgDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MsgDialog.java
deleted file mode 100644
index e681d33a19d..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/MsgDialog.java
+++ /dev/null
@@ -1,626 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.epf.common.IActivator;
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A message dialog used for displaying error, warning, confirmation or
- * informational messages.
- *
- * @author Kelvin Low
- * @author Jinhua Xi
- * @author Phong Nguyen Le
- * @since 1.0
- */
-public class MsgDialog {
-
- // The plug-in ID.
- private String pluginId;
-
- // The plug-in logger.
- private Logger logger;
-
- /**
- * Create a new instance given the plug-in instance.
- *
- * @param plugin
- * The plugin instance.
- */
- public MsgDialog(IActivator plugin) {
- this.pluginId = plugin.getId();
- this.logger = plugin.getLogger();
- }
-
- protected Shell getShell() {
- return PlatformUI.getWorkbench().getDisplay().getActiveShell();
- }
-
- /**
- * Displays the given error message in an error dialog without the error
- * reason and Details button.
- *
- * Note: The error message will be written to the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- */
- public void displayError(String title, String msg) {
- display(IStatus.ERROR, title, msg, null, null, null);
- }
-
- /**
- * Displays the given error message in an error dialog without the error
- * reason and Details button.
- *
- * Note: The error message and the exception stack trace will be written to
- * the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param ex
- * The exception associated with the error.
- */
- public void displayError(String title, String msg, Throwable ex) {
- display(IStatus.ERROR, title, msg, null, null, ex);
- }
-
- /**
- * Displays the given error message in an error dialog without the Details
- * button.
- *
- * Note: The error message will be written to the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param reason
- * The reason for the error.
- */
- public void displayError(String title, String msg, String reason) {
- display(IStatus.ERROR, title, msg, reason, null, null);
- }
-
- /**
- * Displays the given error message in an error dialog without the Details
- * button.
- *
- * Note: The error message and the exception stack trace will be written to
- * the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param reason
- * The reason for the error.
- * @param ex
- * The exception associated with the error.
- */
- public void displayError(String title, String msg, String reason,
- Throwable ex) {
- display(IStatus.ERROR, title, msg, reason, null, ex);
- }
-
- /**
- * Displays the given error message in an error dialog. The Details button
- * will be displayed if the details parameter it not null or
- * empty.
- *
- * Note: The error message will be written to the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param reason
- * The reason for the error.
- * @param details
- * The error details.
- */
- public void displayError(String title, String msg, String reason,
- String details) {
- display(IStatus.ERROR, title, msg, reason, details, null);
- }
-
- /**
- * Displays the given error message in an error dialog. The Details button
- * will be displayed if the details parameter it not null or
- * empty.
- *
- * Note: The error message and the exception stack trace will be written to
- * the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param reason
- * The reason for the error.
- * @param details
- * The error details.
- * @param ex
- * The exception associated with the error.
- */
- public void displayError(String title, String msg, String reason,
- String details, Throwable ex) {
- display(IStatus.ERROR, title, msg, reason, details, ex);
- }
-
- /**
- * Displays the given error status in an error dialog.
- *
- * Note: The error message and the exception stack trace will be written to
- * the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param status
- * The error status.
- */
- public int displayError(String title, IStatus status) {
- return display(title, null, status);
- }
-
- /**
- * Displays the given error status in an error dialog.
- *
- * Note: The error message and the exception stack trace will be written to
- * the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param status
- * The error status.
- */
- public int displayError(String title, String msg, IStatus status) {
- return display(title, msg, status);
- }
-
- /**
- * Displays the given warning message in a warning dialog without the
- * warning reason and Details button.
- *
- * Note: The waning message will be written to the log file.
- *
- * @param title
- * The title for the warning dialog.
- * @param msg
- * The warning message.
- */
- public void displayWarning(String title, String msg) {
- display(IStatus.WARNING, title, msg, null, null, null);
- }
-
- /**
- * Displays the given warning message in a warning dialog without the
- * warning reason and Details button.
- *
- * Note: The warning message and the exception stack trace will be written
- * to the log file.
- *
- * @param title
- * The title for the warning dialog.
- * @param msg
- * The warning message.
- * @param ex
- * The exception associated with the warning.
- */
- public void displayWarning(String title, String msg, Throwable ex) {
- display(IStatus.WARNING, title, msg, null, null, ex);
- }
-
- /**
- * Displays the given warning message in a warning dialog without the
- * warning reason and Details button.
- *
- * Note: The waning message will be written to the log file.
- *
- * @param title
- * The title for the warning dialog.
- * @param msg
- * The warning message.
- * @param reason
- * The reason for the warning.
- */
- public void displayWarning(String title, String msg, String reason) {
- display(IStatus.WARNING, title, msg, reason, null, null);
- }
-
- /**
- * Displays the given warning message in a warning dialog without the
- * warning reason and Details button.
- *
- * Note: The warning message and the exception stack trace will be written
- * to the log file.
- *
- * @param title
- * The title for the warning dialog.
- * @param msg
- * The warning message.
- * @param reason
- * The reason for the warning.
- * @param ex
- * The exception associated with the warning.
- */
- public void displayWarning(String title, String msg, String reason,
- Throwable ex) {
- display(IStatus.WARNING, title, msg, reason, null, ex);
- }
-
- /**
- * Displays the given warning message in a warning dialog. The Details
- * button will be displayed if the details parameter it not
- * null or empty.
- *
- * Note: The waning message will be written to the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The warning message.
- * @param reason
- * The reason for the warning.
- * @param details
- * The warning details.
- */
- public void displayWarning(String title, String msg, String reason,
- String details) {
- display(IStatus.WARNING, title, msg, reason, details, null);
- }
-
- /**
- * Displays the given warning message in a warning dialog. The Details
- * button will be displayed if the details parameter it not
- * null or empty.
- *
- * Note: The warning message and the exception stack trace will be written
- * to the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The warning message.
- * @param reason
- * The reason for the warning.
- * @param details
- * The warning details.
- * @param ex
- * The exception associated with the warning.
- */
- public void displayWarning(String title, String msg, String reason,
- String details, Throwable ex) {
- display(IStatus.WARNING, title, msg, reason, details, ex);
- }
-
- /**
- * Displays the given warning status in an error dialog.
- *
- * Note: The warning message and the exception stack trace will be written
- * to the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param status
- * The error status.
- */
- public void displayWarning(String title, IStatus status) {
- display(title, null, status);
- }
-
- /**
- * Displays the given warning status in an error dialog.
- *
- * Note: The warning message and the exception stack trace will be written
- * to the log file.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param status
- * The error status.
- */
- public void displayWarning(String title, String msg, IStatus status) {
- display(title, msg, status);
- }
-
- /**
- * Displays the given error or warning message in an error or warning
- * dialog. The Details button will be displayed if the details
- * parameter it not null or empty.
- *
- * @param severity
- * The severity, either IStatus.ERROR or IStatus.WARNING.
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param reason
- * The reason for the error.
- * @param details
- * The error details.
- * @param ex
- * The exception associated with the error.
- */
- public synchronized void display(int severity, String title, String msg,
- String reason, String details, Throwable ex) {
- if (msg == null && ex != null) {
- msg = ex.getMessage();
- }
-
- if (msg == null) {
- msg = ""; //$NON-NLS-1$
- }
-
- if (severity == IStatus.ERROR || severity == IStatus.WARNING) {
- logger.logMsg(severity, msg, ex);
- } else {
- throw new IllegalArgumentException(
- "severity argument must be IStatus.ERROR or IStatus.WARNING"); //$NON-NLS-1$
- }
-
- Image oldImage = org.eclipse.jface.dialogs.ErrorDialog
- .getDefaultImage();
- Image shellImage = getShellImage();
- if (shellImage != null) {
- ErrorDialog.setDefaultImage(shellImage);
- }
-
- Shell shell = getShell();
-
- if (details != null && details.length() > 0) {
- MultiStatus mStatus = new MultiStatus(pluginId, IStatus.OK, reason,
- ex);
- Status status = new Status(severity, pluginId, IStatus.OK, details,
- ex);
- mStatus.add(status);
- org.eclipse.jface.dialogs.ErrorDialog.openError(shell, title, msg,
- mStatus);
- } else if (reason != null && reason.length() > 0) {
- Status status = new Status(severity, pluginId, IStatus.OK, reason,
- ex);
- org.eclipse.jface.dialogs.ErrorDialog.openError(shell, title, msg,
- status);
- } else {
- if (severity == IStatus.ERROR) {
- WrappedMessageDialog.openError(shell, title, msg);
- } else if (severity == IStatus.WARNING) {
- WrappedMessageDialog.openWarning(shell, title, msg);
- }
- }
-
- if (shellImage != null) {
- ErrorDialog.setDefaultImage(oldImage);
- }
- }
-
- /**
- * Displays the given error or warning message in an error or warning
- * dialog. The Details button will be displayed if the details
- * parameter it not null or empty.
- *
- * @param title
- * The title for the error dialog.
- * @param status
- * The error status.
- */
- public synchronized int display(String title, IStatus status) {
- return display(title, null, status);
- }
-
- /**
- * Displays the given error or warning message in an error or warning
- * dialog. The Details button will be displayed if the details
- * parameter it not null or empty.
- *
- * @param title
- * The title for the error dialog.
- * @param msg
- * The error message.
- * @param status
- * The error status.
- */
- public synchronized int display(String title, String msg, IStatus status) {
- if (status == null) {
- throw new IllegalArgumentException("status argument cannot be null"); //$NON-NLS-1$
- }
-
- if (msg == null) {
- msg = status.getMessage();
- }
- if (msg == null) {
- msg = ""; //$NON-NLS-1$
- }
-
- int severity = status.getSeverity();
- if (severity == IStatus.ERROR || severity == IStatus.WARNING) {
- logger.logMsg(severity, msg, status.getException());
- }
-
- Image oldImage = org.eclipse.jface.dialogs.ErrorDialog
- .getDefaultImage();
- Image shellImage = getShellImage();
- if (shellImage != null) {
- ErrorDialog.setDefaultImage(shellImage);
- }
-
- Shell shell = getShell();
-
- int rc = org.eclipse.jface.dialogs.ErrorDialog.openError(shell, title,
- msg, status);
-
- if (shellImage != null) {
- ErrorDialog.setDefaultImage(oldImage);
- }
-
- return rc;
- }
-
- /**
- * Displays the given message in a informational dialog with an "OK" button.
- *
- * @param title
- * The title for the information dialog.
- * @param msg
- * The message to display.
- */
- public void displayInfo(String title, String msg) {
- if (msg == null) {
- msg = ""; //$NON-NLS-1$
- }
-
- Image oldImage = WrappedMessageDialog.getDefaultImage();
- Image shellImage = getShellImage();
- if (shellImage != null) {
- WrappedMessageDialog.setDefaultImage(shellImage);
- }
-
- Shell shell = getShell();
- WrappedMessageDialog.openInformation(shell, title, msg);
-
- if (shellImage != null) {
- WrappedMessageDialog.setDefaultImage(oldImage);
- }
- }
-
- /**
- * Displays the given message in a question dialog with a "Yes" and "No"
- * button.
- *
- * @param title
- * The title for the information dialog.
- * @param msg
- * The message to display.
- */
- public boolean displayPrompt(String title, String msg) {
- if (msg == null) {
- msg = ""; //$NON-NLS-1$
- }
-
- Image oldImage = WrappedMessageDialog.getDefaultImage();
- Image shellImage = getShellImage();
- if (shellImage != null) {
- WrappedMessageDialog.setDefaultImage(shellImage);
- }
-
- Shell shell = getShell();
- boolean result = WrappedMessageDialog.openQuestion(shell, title, msg);
-
- if (shellImage != null) {
- WrappedMessageDialog.setDefaultImage(oldImage);
- }
-
- return result;
- }
-
- /**
- * Displays the given message in a confirmation dialog with a "Yes" and
- * "Cancel" button.
- *
- * @param title
- * The title for the information dialog.
- * @param msg
- * The message to display.
- */
- public boolean displayConfirmation(String title, String msg) {
- return displayConfirmationWithCheckBox(title, msg, null) > 0;
- }
-
- //return: 0 = cancel, 1 = ok with check-box checked, 2 = ok with check box unchecked
- public int displayConfirmationWithCheckBox(String title, String msg, String checkBoxLabel) {
- if (msg == null) {
- msg = ""; //$NON-NLS-1$
- }
-
- Image oldImage = WrappedMessageDialog.getDefaultImage();
- Image shellImage = getShellImage();
- if (shellImage != null) {
- WrappedMessageDialog.setDefaultImage(shellImage);
- }
-
- Shell shell = getShell();
-
- if (shellImage != null) {
- WrappedMessageDialog.setDefaultImage(oldImage);
- }
-
- if (checkBoxLabel == null) {
- boolean b = WrappedMessageDialog.openConfirm(shell, title, msg);
- return b ? 1 : 0;
- }
-
- return WrappedMessageDialog.openConfirmWithCheckBox(shell, title, msg, checkBoxLabel);
- }
-
- public int displayConfirmation(String title, String msg, IStatus status) {
- if (status == null) {
- throw new IllegalArgumentException("status argument cannot be null"); //$NON-NLS-1$
- }
-
- if (msg == null) {
- msg = status.getMessage();
- }
- if (msg == null) {
- msg = ""; //$NON-NLS-1$
- }
-
- Image shellImage = getShellImage();
- if (shellImage != null) {
- ErrorDialogNoReason.setDefaultImage(shellImage);
- }
-
- Shell shell = getShell();
-
- int rc = ErrorDialogNoReason.openError(shell, title, msg, status);
-
- return rc;
-
- }
-
- /**
- * Returns the image for the current shell.
- *
- * @return The current shell image.
- */
- private Image getShellImage() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null) {
- IWorkbenchWindow workbenchWindow = workbench
- .getActiveWorkbenchWindow();
- if (workbenchWindow != null) {
- Shell shell = workbenchWindow.getShell();
- if (shell != null) {
- return shell.getImage();
- }
- }
- }
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/PerspectiveUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/PerspectiveUtil.java
deleted file mode 100644
index a928ec798c8..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/PerspectiveUtil.java
+++ /dev/null
@@ -1,127 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-
-/**
- * Utility class for accessing perspectives.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class PerspectiveUtil {
-
- /**
- * Private constructor to prevent this class from being instantiated. All
- * methods in this class should be static.
- */
- private PerspectiveUtil() {
- }
-
- /**
- * Returns the ID of the active perspective.
- *
- * @return The active perspective ID.
- */
- public static String getActivePerspectiveId() {
- if (PlatformUI.getWorkbench() == null || PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow() == null) {
- return null;
- }
-
- IWorkbenchPage activePage = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- if (activePage != null) {
- IPerspectiveDescriptor activePerspective = activePage
- .getPerspective();
- return activePerspective.getId();
- }
- return null;
- }
-
- /**
- * Opens a perspective.
- *
- * @param perspectiveId
- * The perspective ID.
- * @return The previously active perspective.
- */
- public static IPerspectiveDescriptor openPerspective(String perspectiveId) {
- IWorkbenchPage activePage = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- if (activePage != null) {
- IPerspectiveRegistry registry = PlatformUI.getWorkbench()
- .getPerspectiveRegistry();
- IPerspectiveDescriptor oldPerspective = activePage.getPerspective();
- if (!oldPerspective.getId().equals(perspectiveId)) {
- IPerspectiveDescriptor perspective = registry
- .findPerspectiveWithId(perspectiveId);
- activePage.setPerspective(perspective);
- }
- return oldPerspective;
- } else {
- IWorkbenchWindow activeWindow = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow();
- try {
- PlatformUI.getWorkbench().showPerspective(
- perspectiveId, activeWindow);
- } catch (WorkbenchException e) {
- }
- }
- return null;
- }
-
- /**
- * Returns true if the given perspective is already active.
- *
- * @param perspectiveId
- * The perspective ID.
- * @return
- */
- public static boolean isActivePerspective(String perspectiveId) {
- String activePerspectiveId = PerspectiveUtil.getActivePerspectiveId();
- if (perspectiveId == null || activePerspectiveId == null) {
- return false;
- }
- return activePerspectiveId.equalsIgnoreCase(perspectiveId);
- }
-
- /**
- * Returns the view part with the given view ID.
- *
- * @param viewId
- * The view ID.
- * @return The view part.
- */
- public static IViewPart getView(String viewId) {
- try {
- IWorkbenchPage activePage = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- if (activePage != null) {
- IViewPart view = activePage.findView(viewId);
- if (view == null) {
- view = activePage.showView(viewId);
- }
- return view;
- }
- } catch (Exception e) {
- }
- return null;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/PreferenceUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/PreferenceUtil.java
deleted file mode 100644
index 158d7d882ec..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/PreferenceUtil.java
+++ /dev/null
@@ -1,173 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * Utility class for accessing preferences.
- *
- * @author Kelvin Low
- * @since 1.2
- */
-public class PreferenceUtil {
-
- // The multi-string preference delimiter.
- private static final String PREFERENCE_DELIMITER = ";"; //$NON-NLS-1$
-
- /**
- * Gets a list containing string values associated with a named preference.
- *
- * @param prefStore
- * a preference store
- * @param name
- * the preference name
- * @return a list of string values
- */
- public static List getList(IPreferenceStore prefStore, String name) {
- List values = new ArrayList();
- if (prefStore != null && name != null) {
- String value = prefStore.getString(name);
- StringTokenizer tokenizer = new StringTokenizer(value,
- PREFERENCE_DELIMITER);
- int tokenCount = tokenizer.countTokens();
- for (int i = 0; i < tokenCount; i++) {
- values.add(tokenizer.nextToken());
- }
- }
- return values;
- }
-
- /**
- * Gets the string values associated with a named preference.
- *
- * @param prefStore
- * a preference store
- * @param name
- * the preference name
- * @return a list of string preference values
- */
- public static String[] getStringValues(IPreferenceStore prefStore,
- String name) {
- List list = getList(prefStore, name);
- String[] values = new String[list.size()];
- list.toArray(values);
- return values;
- }
-
- /**
- * Saves a list containing string values associated with a named preference.
- *
- * @param prefStore
- * a preference store
- * @param name
- * the preference name
- * @param values
- * a list of string values
- */
- public static void setList(IPreferenceStore prefStore, String name,
- List values) {
- if (prefStore != null && name != null && values != null) {
- StringBuffer buffer = new StringBuffer();
- for (Iterator it = values.iterator(); it.hasNext();) {
- String value = (String) it.next();
- buffer.append(value);
- buffer.append(PREFERENCE_DELIMITER);
- }
- prefStore.setValue(name, buffer.toString());
- }
- }
-
- /**
- * Adds a string value to a list containing string values associated with a
- * named preference.
- *
- * @param prefStore
- * a preference store
- * @param name
- * the preference name
- * @param value
- * a string value
- * @param defaultValue
- * a default string value that will be added to the end of the
- * list
- */
- public static void addToList(IPreferenceStore prefStore, String name,
- String value, String defaultValue) {
- if (prefStore != null && name != null && value != null) {
- List list = getList(prefStore, name);
- list.remove(value);
- list.add(0, value);
-
- //adjust the list according to the history size
- int preferenceHistorySize = CommonPreferences.getPreferenceHistorySize();
- if (list.size() > preferenceHistorySize) {
- list = list.subList(0, preferenceHistorySize - 1);
- }
- if (defaultValue != null && defaultValue.length() > 0) {
- if (!list.contains(defaultValue)) {
- if (list.size() == preferenceHistorySize) {
- list.add(list.size() - 1, defaultValue);
- } else {
- list.add(defaultValue);
- }
- }
- }
-
- setList(prefStore, name, list);
- }
- }
-
- /**
- * Adds a string value to a list containing string values associated with a
- * named preference.
- *
- * @param prefStore
- * a preference store
- * @param name
- * the preference name
- * @param value
- * a string value
- */
- public static void addToList(IPreferenceStore prefStore, String name,
- String value) {
- addToList(prefStore, name, value, null);
- }
-
- /**
- * Saves an array of string values associated with a named preference.
- *
- * @param prefStore
- * a preference store
- * @param name
- * the preference name
- * @param values
- * an array of string values
- */
- public static void setStringValues(IPreferenceStore prefStore, String name,
- String[] values) {
- if (prefStore != null && name != null && values != null) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < values.length; i++) {
- buffer.append(values[i]);
- buffer.append(PREFERENCE_DELIMITER);
- }
- prefStore.setValue(name, buffer.toString());
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/WrappedMessageDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/WrappedMessageDialog.java
deleted file mode 100644
index 926cc5ad791..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.ui/src/org/eclipse/epf/common/ui/util/WrappedMessageDialog.java
+++ /dev/null
@@ -1,208 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.ui.util;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Displays a message dialog that displays wrapped text.
- *
- * @author Bingxue Xu
- * @since 1.0
- */
-public class WrappedMessageDialog extends MessageDialog {
-
- public WrappedMessageDialog(Shell parentShell, String dialogTitle,
- Image dialogTitleImage, String dialogMessage, int dialogImageType,
- String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage,
- dialogImageType, dialogButtonLabels, defaultIndex);
- }
-
- protected Control createMessageArea(Composite composite) {
-
- Control rComposite = super.createMessageArea(composite);
-
- int minWidth = IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH;// + 300;
- // TO-DO: need to revist the # of dialog display units and margin
- // when in other languages
- int charsPerLine = minWidth / 4 - 15;
- GridData gd = (GridData) messageLabel.getLayoutData();
- gd.minimumWidth = minWidth;
- messageLabel.setText(addLineBreaks(message, charsPerLine));
-
- return rComposite;
- }
-
- String addLineBreaks(String msg, int maxChars) {
- // System.out.println("$$$ DEBUG: original message = " + msg);
-
- if (msg == null)
- return null;
-
- StringBuffer strBuf = new StringBuffer();
- int count = 0;
- for (int i = 0; i < msg.length(); i++) {
- strBuf.append(msg.charAt(i));
- if (Character.isWhitespace(msg.charAt(i)))
- count = 0;
- else
- count++;
-
- if (count >= maxChars) {
- if (!Character.isWhitespace(msg.charAt(i))) {
- strBuf.append("\n"); //$NON-NLS-1$
- }
- count = 0;
- }
- }
-
- // System.out.println("$$$ DEBUG: broken message = " +
- // strBuf.toString());
- return strBuf.toString();
- }
-
- public static boolean openConfirm(Shell parent, String title, String message) {
- WrappedMessageDialog dialog = new WrappedMessageDialog(parent, title,
- null, // accept
- // the
- // default
- // window
- // icon
- message, QUESTION, new String[] { IDialogConstants.OK_LABEL,
- IDialogConstants.CANCEL_LABEL }, 0); // OK is the
- // default
- return dialog.open() == 0;
- }
-
- static class ConfirmWithCheckBoxDialog extends WrappedMessageDialog {
- private String checkBoxLabel;
- private Button checkBox;
- private boolean checkBoxChecked = false;
-
- public ConfirmWithCheckBoxDialog(Shell parentShell, String dialogTitle,
- Image dialogTitleImage, String dialogMessage, int dialogImageType,
- String[] dialogButtonLabels, int defaultIndex, String checkBoxLabel) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage,
- dialogImageType, dialogButtonLabels, defaultIndex);
- this.checkBoxLabel = checkBoxLabel;
- }
-
- @Override
- protected Control createMessageArea(Composite composite) {
- Control rComposite = super.createMessageArea(composite);
-
- checkBox = new Button(composite, SWT.CHECK);
- checkBox.setText(checkBoxLabel);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
- checkBox.setLayoutData(gd);
-
- return rComposite;
- }
-
- protected void buttonPressed(int buttonId) {
- checkBoxChecked = checkBox.getSelection();
- super.buttonPressed(buttonId);
- }
-
- public boolean isCheckBoxChecked() {
- return checkBoxChecked;
- }
-
- }
-
- //return: 0 = cancel, 1 = ok with check-box checked, 2 = ok with check box unchecked
- public static int openConfirmWithCheckBox(Shell parent, String title, String message, String checkBoxLabel) {
- ConfirmWithCheckBoxDialog dialog = new ConfirmWithCheckBoxDialog(parent, title,
- null, // accept
- // the
- // default
- // window
- // icon
- message, QUESTION, new String[] { IDialogConstants.OK_LABEL,
- IDialogConstants.CANCEL_LABEL }, 0, checkBoxLabel); // OK is the default
-
- int ix = dialog.open() ;
- if (ix != 0) {
- return 0;
- }
-
- return dialog.isCheckBoxChecked() ? 1 : 2;
- }
-
- public static void openError(Shell parent, String title, String message) {
- WrappedMessageDialog dialog = new WrappedMessageDialog(parent, title,
- null, // accept
- // the
- // default
- // window
- // icon
- message, ERROR, new String[] { IDialogConstants.OK_LABEL }, 0); // ok
- // is
- // the
- // default
- dialog.open();
- return;
- }
-
- public static void openInformation(Shell parent, String title,
- String message) {
- WrappedMessageDialog dialog = new WrappedMessageDialog(parent, title,
- null, // accept
- // the
- // default
- // window
- // icon
- message, INFORMATION,
- new String[] { IDialogConstants.OK_LABEL }, 0);
- // ok is the default
- dialog.open();
- return;
- }
-
- public static boolean openQuestion(Shell parent, String title,
- String message) {
- WrappedMessageDialog dialog = new WrappedMessageDialog(parent, title,
- null, // accept
- // the
- // default
- // window
- // icon
- message, QUESTION, new String[] { IDialogConstants.YES_LABEL,
- IDialogConstants.NO_LABEL }, 0); // yes is the
- // default
- return dialog.open() == 0;
- }
-
- public static void openWarning(Shell parent, String title, String message) {
- WrappedMessageDialog dialog = new WrappedMessageDialog(parent, title,
- null, // accept
- // the
- // default
- // window
- // icon
- message, WARNING, new String[] { IDialogConstants.OK_LABEL }, 0); // ok
- // is
- // the
- // default
- dialog.open();
- return;
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/.classpath b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/.classpath
deleted file mode 100644
index 02159672985..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/.project b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/.project
deleted file mode 100644
index e57f6e3d952..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- org.eclipse.epf.common.win32.win32.x86
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/META-INF/MANIFEST.MF b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/META-INF/MANIFEST.MF
deleted file mode 100644
index 4c8e398d5f9..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.epf.common.win32.win32.x86
-Bundle-Version: 1.5.0.qualifier
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.swt
-Bundle-Vendor: %providerName
-Eclipse-PlatformFilter: (& (osgi.os=win32) (osgi.arch=x86))
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/about.html b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/about.html
deleted file mode 100644
index 04a6d65fb9f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-About
-
-
-
About This Content
-
-
February 24, 2005
-
License
-
-
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 http://www.eclipse.org/legal/epl-v10.html.
-For purposes of the EPL, "Program" will mean the Content.
-
-
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.
-
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/build.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/build.properties
deleted file mode 100644
index ebe02751cbb..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- about.html
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/plugin.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/plugin.properties
deleted file mode 100644
index ff010d4c880..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2000, 2007 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 implementation.
-#-------------------------------------------------------------------------------
-# NLS_MESSAGEFORMAT_VAR
-
-# Plug-in
-pluginName=EPF Win32 Common x86
-providerName=Eclipse.org
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/src/org/eclipse/epf/common/win32/Win32HTMLTransfer.java b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/src/org/eclipse/epf/common/win32/Win32HTMLTransfer.java
deleted file mode 100644
index 1a58b1dd316..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/src/org/eclipse/epf/common/win32/Win32HTMLTransfer.java
+++ /dev/null
@@ -1,218 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.win32;
-
-import org.eclipse.swt.dnd.ByteArrayTransfer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.internal.ole.win32.COM;
-import org.eclipse.swt.internal.ole.win32.FORMATETC;
-import org.eclipse.swt.internal.ole.win32.IDataObject;
-import org.eclipse.swt.internal.ole.win32.STGMEDIUM;
-import org.eclipse.swt.internal.win32.OS;
-
-/**
- * The class HTMLTransfer provides a platform specific mechanism
- * for converting text in HTML format represented as a java String
- * to a platform specific representation of the data and vice versa. See
- * Transfer for additional information.
- *
- *
- * An example of a java String containing HTML text is shown
- * below:
- *
- *
- *
- * String htmlData = "
- *
- * This is a paragraph of text.
- *
- * ";
- *
- */
-public class Win32HTMLTransfer extends ByteArrayTransfer {
-
- static Win32HTMLTransfer _instance = new Win32HTMLTransfer();
-
- static final String HTML_FORMAT = "HTML Format"; //$NON-NLS-1$
-
- static final int HTML_FORMATID = registerType(HTML_FORMAT);
-
- static final String NUMBER = "00000000"; //$NON-NLS-1$
-
- static final String HEADER = "Version:0.9\r\nStartHTML:" + NUMBER //$NON-NLS-1$
- + "\r\nEndHTML:" + NUMBER + "\r\nStartFragment:" + NUMBER //$NON-NLS-1$ //$NON-NLS-2$
- + "\r\nEndFragment:" + NUMBER + "\r\n"; //$NON-NLS-1$ //$NON-NLS-2$
-
- static final String PREFIX = ""; //$NON-NLS-1$
-
- static final String SUFFIX = ""; //$NON-NLS-1$
-
- static final String StartFragment = "StartFragment:"; //$NON-NLS-1$
-
- static final String EndFragment = "EndFragment:"; //$NON-NLS-1$
-
- public Win32HTMLTransfer() {
- }
-
- /**
- * Returns the singleton instance of the HTMLTransfer class.
- *
- * @return the singleton instance of the HTMLTransfer class
- */
- public static Win32HTMLTransfer getInstance() {
- return _instance;
- }
-
- /**
- * This implementation of javaToNative converts
- * HTML-formatted text represented by a java String to a
- * platform specific representation. For additional information see
- * Transfer#javaToNative.
- *
- * @param object
- * a java String containing HTML text
- * @param transferData
- * an empty TransferData object; this object will
- * be filled in on return with the platform specific format of
- * the data
- */
- public void javaToNative(Object object, TransferData transferData) {
- if (!checkHTML(object) || !isSupportedType(transferData)) {
- DND.error(DND.ERROR_INVALID_DATA);
- }
- String string = (String) object;
- int count = string.length();
- char[] chars = new char[count + 1];
- string.getChars(0, count, chars, 0);
- int codePage = OS.GetACP();
- int cchMultiByte = OS.WideCharToMultiByte(codePage, 0, chars, -1, null,
- 0, null, null);
- if (cchMultiByte == 0) {
- transferData.stgmedium = new STGMEDIUM();
- transferData.result = COM.DV_E_STGMEDIUM;
- return;
- }
- int startHTML = HEADER.length();
- int startFragment = startHTML + PREFIX.length();
- int endFragment = startFragment + cchMultiByte - 1;
- int endHTML = endFragment + SUFFIX.length();
-
- StringBuffer buffer = new StringBuffer(HEADER);
- int maxLength = NUMBER.length();
- // startHTML
- int start = buffer.toString().indexOf(NUMBER);
- String temp = Integer.toString(startHTML);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
- // endHTML
- start = buffer.toString().indexOf(NUMBER, start);
- temp = Integer.toString(endHTML);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
- // startFragment
- start = buffer.toString().indexOf(NUMBER, start);
- temp = Integer.toString(startFragment);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
- // endFragment
- start = buffer.toString().indexOf(NUMBER, start);
- temp = Integer.toString(endFragment);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
-
- buffer.append(PREFIX);
- buffer.append(string);
- buffer.append(SUFFIX);
-
- count = buffer.length();
- chars = new char[count + 1];
- buffer.getChars(0, count, chars, 0);
- cchMultiByte = OS.WideCharToMultiByte(codePage, 0, chars, -1, null, 0,
- null, null);
- int lpMultiByteStr = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT,
- cchMultiByte);
- OS.WideCharToMultiByte(codePage, 0, chars, -1, lpMultiByteStr,
- cchMultiByte, null, null);
- transferData.stgmedium = new STGMEDIUM();
- transferData.stgmedium.tymed = COM.TYMED_HGLOBAL;
- transferData.stgmedium.unionField = lpMultiByteStr;
- transferData.stgmedium.pUnkForRelease = 0;
- transferData.result = COM.S_OK;
- return;
- }
-
- /**
- * This implementation of nativeToJava converts a platform
- * specific representation of HTML text to a java String.
- * For additional information see Transfer#nativeToJava.
- *
- * @param transferData
- * the platform specific representation of the data to be been
- * converted
- * @return a java String containing HTML text if the
- * conversion was successful; otherwise null
- */
- public Object nativeToJava(TransferData transferData) {
- if (!isSupportedType(transferData) || transferData.pIDataObject == 0)
- return null;
- IDataObject data = new IDataObject(transferData.pIDataObject);
- data.AddRef();
- STGMEDIUM stgmedium = new STGMEDIUM();
- FORMATETC formatetc = transferData.formatetc;
- stgmedium.tymed = COM.TYMED_HGLOBAL;
- transferData.result = data.GetData(formatetc, stgmedium);
- data.Release();
- if (transferData.result != COM.S_OK)
- return null;
- int hMem = stgmedium.unionField;
-
- try {
- int lpMultiByteStr = OS.GlobalLock(hMem);
- if (lpMultiByteStr == 0)
- return null;
- try {
- int codePage = OS.GetACP();
- int cchWideChar = OS.MultiByteToWideChar(codePage,
- OS.MB_PRECOMPOSED, lpMultiByteStr, -1, null, 0);
- if (cchWideChar == 0)
- return null;
- char[] lpWideCharStr = new char[cchWideChar - 1];
- OS
- .MultiByteToWideChar(codePage, OS.MB_PRECOMPOSED,
- lpMultiByteStr, -1, lpWideCharStr,
- lpWideCharStr.length);
- return new String(lpWideCharStr);
- } finally {
- OS.GlobalUnlock(hMem);
- }
- } finally {
- OS.GlobalFree(hMem);
- }
- }
-
- protected int[] getTypeIds() {
- return new int[] { HTML_FORMATID };
- }
-
- protected String[] getTypeNames() {
- return new String[] { HTML_FORMAT };
- }
-
- boolean checkHTML(Object object) {
- return (object != null && object instanceof String && ((String) object)
- .length() > 0);
- }
-
- protected boolean validate(Object object) {
- return checkHTML(object);
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/src/org/eclipse/epf/common/win32/package.html b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/src/org/eclipse/epf/common/win32/package.html
deleted file mode 100644
index 2d697e1a095..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86/src/org/eclipse/epf/common/win32/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-Provides windows-specific clipboard transfer services.
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/.classpath b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/.classpath
deleted file mode 100644
index 02159672985..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/.project b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/.project
deleted file mode 100644
index 0801e35e8a0..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- org.eclipse.epf.common.win32.win32.x86_64
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/META-INF/MANIFEST.MF b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/META-INF/MANIFEST.MF
deleted file mode 100644
index 830ab37eddc..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.epf.common.win32.win32.x86_64
-Bundle-Version: 1.5.0.qualifier
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.swt
-Bundle-Vendor: %providerName
-Eclipse-PlatformFilter: (& (osgi.os=win32) (osgi.arch=x86_64))
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/about.html b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/about.html
deleted file mode 100644
index 04a6d65fb9f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-About
-
-
-
About This Content
-
-
February 24, 2005
-
License
-
-
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 http://www.eclipse.org/legal/epl-v10.html.
-For purposes of the EPL, "Program" will mean the Content.
-
-
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.
-
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/build.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/build.properties
deleted file mode 100644
index ebe02751cbb..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- about.html
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/plugin.properties b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/plugin.properties
deleted file mode 100644
index 0992ed99e31..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2000, 2007 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 implementation.
-#-------------------------------------------------------------------------------
-# NLS_MESSAGEFORMAT_VAR
-
-# Plug-in
-pluginName=EPF Win32 Common x86_64
-providerName=Eclipse.org
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/src/org/eclipse/epf/common/win32/Win32HTMLTransfer.java b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/src/org/eclipse/epf/common/win32/Win32HTMLTransfer.java
deleted file mode 100644
index a5d8162ba96..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/src/org/eclipse/epf/common/win32/Win32HTMLTransfer.java
+++ /dev/null
@@ -1,218 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.win32;
-
-import org.eclipse.swt.dnd.ByteArrayTransfer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.internal.ole.win32.COM;
-import org.eclipse.swt.internal.ole.win32.FORMATETC;
-import org.eclipse.swt.internal.ole.win32.IDataObject;
-import org.eclipse.swt.internal.ole.win32.STGMEDIUM;
-import org.eclipse.swt.internal.win32.OS;
-
-/**
- * The class HTMLTransfer provides a platform specific mechanism
- * for converting text in HTML format represented as a java String
- * to a platform specific representation of the data and vice versa. See
- * Transfer for additional information.
- *
- *
- * An example of a java String containing HTML text is shown
- * below:
- *
- *
- *
- * String htmlData = "
- *
- * This is a paragraph of text.
- *
- * ";
- *
- */
-public class Win32HTMLTransfer extends ByteArrayTransfer {
-
- static Win32HTMLTransfer _instance = new Win32HTMLTransfer();
-
- static final String HTML_FORMAT = "HTML Format"; //$NON-NLS-1$
-
- static final int HTML_FORMATID = registerType(HTML_FORMAT);
-
- static final String NUMBER = "00000000"; //$NON-NLS-1$
-
- static final String HEADER = "Version:0.9\r\nStartHTML:" + NUMBER //$NON-NLS-1$
- + "\r\nEndHTML:" + NUMBER + "\r\nStartFragment:" + NUMBER //$NON-NLS-1$ //$NON-NLS-2$
- + "\r\nEndFragment:" + NUMBER + "\r\n"; //$NON-NLS-1$ //$NON-NLS-2$
-
- static final String PREFIX = ""; //$NON-NLS-1$
-
- static final String SUFFIX = ""; //$NON-NLS-1$
-
- static final String StartFragment = "StartFragment:"; //$NON-NLS-1$
-
- static final String EndFragment = "EndFragment:"; //$NON-NLS-1$
-
- public Win32HTMLTransfer() {
- }
-
- /**
- * Returns the singleton instance of the HTMLTransfer class.
- *
- * @return the singleton instance of the HTMLTransfer class
- */
- public static Win32HTMLTransfer getInstance() {
- return _instance;
- }
-
- /**
- * This implementation of javaToNative converts
- * HTML-formatted text represented by a java String to a
- * platform specific representation. For additional information see
- * Transfer#javaToNative.
- *
- * @param object
- * a java String containing HTML text
- * @param transferData
- * an empty TransferData object; this object will
- * be filled in on return with the platform specific format of
- * the data
- */
- public void javaToNative(Object object, TransferData transferData) {
- if (!checkHTML(object) || !isSupportedType(transferData)) {
- DND.error(DND.ERROR_INVALID_DATA);
- }
- String string = (String) object;
- int count = string.length();
- char[] chars = new char[count + 1];
- string.getChars(0, count, chars, 0);
- int codePage = OS.GetACP();
- int cchMultiByte = OS.WideCharToMultiByte(codePage, 0, chars, -1, null,
- 0, null, null);
- if (cchMultiByte == 0) {
- transferData.stgmedium = new STGMEDIUM();
- transferData.result = COM.DV_E_STGMEDIUM;
- return;
- }
- int startHTML = HEADER.length();
- int startFragment = startHTML + PREFIX.length();
- int endFragment = startFragment + cchMultiByte - 1;
- int endHTML = endFragment + SUFFIX.length();
-
- StringBuffer buffer = new StringBuffer(HEADER);
- int maxLength = NUMBER.length();
- // startHTML
- int start = buffer.toString().indexOf(NUMBER);
- String temp = Integer.toString(startHTML);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
- // endHTML
- start = buffer.toString().indexOf(NUMBER, start);
- temp = Integer.toString(endHTML);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
- // startFragment
- start = buffer.toString().indexOf(NUMBER, start);
- temp = Integer.toString(startFragment);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
- // endFragment
- start = buffer.toString().indexOf(NUMBER, start);
- temp = Integer.toString(endFragment);
- buffer.replace(start + maxLength - temp.length(), start + maxLength,
- temp);
-
- buffer.append(PREFIX);
- buffer.append(string);
- buffer.append(SUFFIX);
-
- count = buffer.length();
- chars = new char[count + 1];
- buffer.getChars(0, count, chars, 0);
- cchMultiByte = OS.WideCharToMultiByte(codePage, 0, chars, -1, null, 0,
- null, null);
- long lpMultiByteStr = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT,
- cchMultiByte);
- OS.WideCharToMultiByte(codePage, 0, chars, -1, lpMultiByteStr,
- cchMultiByte, null, null);
- transferData.stgmedium = new STGMEDIUM();
- transferData.stgmedium.tymed = COM.TYMED_HGLOBAL;
- transferData.stgmedium.unionField = lpMultiByteStr;
- transferData.stgmedium.pUnkForRelease = 0;
- transferData.result = COM.S_OK;
- return;
- }
-
- /**
- * This implementation of nativeToJava converts a platform
- * specific representation of HTML text to a java String.
- * For additional information see Transfer#nativeToJava.
- *
- * @param transferData
- * the platform specific representation of the data to be been
- * converted
- * @return a java String containing HTML text if the
- * conversion was successful; otherwise null
- */
- public Object nativeToJava(TransferData transferData) {
- if (!isSupportedType(transferData) || transferData.pIDataObject == 0)
- return null;
- IDataObject data = new IDataObject(transferData.pIDataObject);
- data.AddRef();
- STGMEDIUM stgmedium = new STGMEDIUM();
- FORMATETC formatetc = transferData.formatetc;
- stgmedium.tymed = COM.TYMED_HGLOBAL;
- transferData.result = data.GetData(formatetc, stgmedium);
- data.Release();
- if (transferData.result != COM.S_OK)
- return null;
- long hMem = stgmedium.unionField;
-
- try {
- long lpMultiByteStr = OS.GlobalLock(hMem);
- if (lpMultiByteStr == 0)
- return null;
- try {
- int codePage = OS.GetACP();
- int cchWideChar = OS.MultiByteToWideChar(codePage,
- OS.MB_PRECOMPOSED, lpMultiByteStr, -1, null, 0);
- if (cchWideChar == 0)
- return null;
- char[] lpWideCharStr = new char[cchWideChar - 1];
- OS
- .MultiByteToWideChar(codePage, OS.MB_PRECOMPOSED,
- lpMultiByteStr, -1, lpWideCharStr,
- lpWideCharStr.length);
- return new String(lpWideCharStr);
- } finally {
- OS.GlobalUnlock(hMem);
- }
- } finally {
- OS.GlobalFree(hMem);
- }
- }
-
- protected int[] getTypeIds() {
- return new int[] { HTML_FORMATID };
- }
-
- protected String[] getTypeNames() {
- return new String[] { HTML_FORMAT };
- }
-
- boolean checkHTML(Object object) {
- return (object != null && object instanceof String && ((String) object)
- .length() > 0);
- }
-
- protected boolean validate(Object object) {
- return checkHTML(object);
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/src/org/eclipse/epf/common/win32/package.html b/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/src/org/eclipse/epf/common/win32/package.html
deleted file mode 100644
index 2d697e1a095..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common.win32.win32.x86_64/src/org/eclipse/epf/common/win32/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-Provides windows-specific clipboard transfer services.
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/.classpath b/extraplugins/epf-richtext/org.eclipse.epf.common/.classpath
deleted file mode 100644
index 4848249846f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/.project b/extraplugins/epf-richtext/org.eclipse.epf.common/.project
deleted file mode 100644
index 9164759b2ef..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- org.eclipse.epf.common
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/META-INF/MANIFEST.MF b/extraplugins/epf-richtext/org.eclipse.epf.common/META-INF/MANIFEST.MF
deleted file mode 100644
index ca607535eb4..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.epf.common;singleton:=true
-Bundle-Version: 1.5.0.qualifier
-Bundle-ClassPath: common.jar
-Bundle-Activator: org.eclipse.epf.common.CommonPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Require-Bundle: com.ibm.icu;visibility:=reexport,
- org.eclipse.core.resources;visibility:=reexport,
- org.eclipse.core.runtime;visibility:=reexport,
- org.apache.ant;visibility:=reexport
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.epf.common,
- org.eclipse.epf.common.preferences,
- org.eclipse.epf.common.serviceability,
- org.eclipse.epf.common.utils,
- org.eclipse.epf.common.xml
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/about.html b/extraplugins/epf-richtext/org.eclipse.epf.common/about.html
deleted file mode 100644
index 04a6d65fb9f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-About
-
-
-
About This Content
-
-
February 24, 2005
-
License
-
-
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 http://www.eclipse.org/legal/epl-v10.html.
-For purposes of the EPL, "Program" will mean the Content.
-
-
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.
-
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/build.properties b/extraplugins/epf-richtext/org.eclipse.epf.common/build.properties
deleted file mode 100644
index 1b2536daec7..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.common.jar = src/
-output.common.jar = bin/
-bin.includes = common.jar,\
- plugin.properties,\
- META-INF/,\
- about.html,\
- plugin.xml
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/plugin.properties b/extraplugins/epf-richtext/org.eclipse.epf.common/plugin.properties
deleted file mode 100644
index 08c7275f893..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2000, 2007 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 implementation.
-#-------------------------------------------------------------------------------
-# NLS_MESSAGEFORMAT_VAR
-
-# Plug-in
-pluginName=EPF Common
-providerName=Eclipse.org
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/plugin.xml b/extraplugins/epf-richtext/org.eclipse.epf.common/plugin.xml
deleted file mode 100644
index aff271b9081..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/plugin.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/htmlFormatter.exsd b/extraplugins/epf-richtext/org.eclipse.epf.common/schema/htmlFormatter.exsd
deleted file mode 100644
index a06c38b4166..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/htmlFormatter.exsd
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-
- [Enter description of this extension point.]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [Enter the first release in which this extension point appears.]
-
-
-
-
-
-
-
-
- [Enter extension point usage example here.]
-
-
-
-
-
-
-
-
- [Enter API information here.]
-
-
-
-
-
-
-
-
- [Enter information about supplied implementation of this extension point.]
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/htmlParser.exsd b/extraplugins/epf-richtext/org.eclipse.epf.common/schema/htmlParser.exsd
deleted file mode 100644
index 38a8881f97e..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/htmlParser.exsd
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-
- [Enter description of this extension point.]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [Enter the first release in which this extension point appears.]
-
-
-
-
-
-
-
-
- [Enter extension point usage example here.]
-
-
-
-
-
-
-
-
- [Enter API information here.]
-
-
-
-
-
-
-
-
- [Enter information about supplied implementation of this extension point.]
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/markerAttributeContributer.exsd b/extraplugins/epf-richtext/org.eclipse.epf.common/schema/markerAttributeContributer.exsd
deleted file mode 100644
index f2a081cf2e3..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/markerAttributeContributer.exsd
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
- Allow adding addtional attributes to markers generated from EPF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.5
-
-
-
-
-
-
-
-
- [Enter extension point usage example here.]
-
-
-
-
-
-
-
-
- org.eclipse.epf.common.utils.IMarkerAttributeContributer
-
-
-
-
-
-
-
-
- [Enter information about supplied implementation of this extension point.]
-
-
-
-
-
-
-
-
- //------------------------------------------------------------------------------
-// Copyright (c) 2005, 2008 IBM Corporation and others.
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// which accompanies this distribution, and is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// Contributors:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/objectFactory.exsd b/extraplugins/epf-richtext/org.eclipse.epf.common/schema/objectFactory.exsd
deleted file mode 100644
index ffa9a99bd00..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/schema/objectFactory.exsd
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-
- Allow to create object through the extension
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.5
-
-
-
-
-
-
-
-
- [Enter extension point usage example here.]
-
-
-
-
-
-
-
-
- package org.eclipse.epf.common.utils.IObjectFactory
-
-
-
-
-
-
-
-
- [Enter information about supplied implementation of this extension point.]
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/AbstractActivator.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/AbstractActivator.java
deleted file mode 100644
index b7593501458..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/AbstractActivator.java
+++ /dev/null
@@ -1,518 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.internal.runtime.InternalPlatform;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.epf.common.preferences.IPreferenceStoreWrapper;
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.epf.common.utils.FileUtil;
-import org.eclipse.epf.common.utils.I18nUtil;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * The abstract base class for all EPF plug-ins.
- *
- * @author Kelvin Low
- * @author Jinhua Xi
- * @author Phong Nguyen Le
- * @since 1.0
- */
-public abstract class AbstractActivator extends Plugin implements IActivator {
-
- // The relative path to the icons.
- private static final String ICON_PATH = "icons/"; //$NON-NLS-1$;
-
- // The logger hash map.
- private static Map loggers = new HashMap();
-
- // The message dialog hash map.
- //private static Map msgDialogs = new HashMap();
-
- // The shared image hash map.
- //private static Map sharedImages = new HashMap();
-
- // The resource bundle for this plug-in.
- private ResourceBundle resourceBundle;
-
- // This plug-in ID.
- private String pluginId;
-
- // The plug-in install URL.
- private URL installURL;
-
- // The plug-in install path.
- private String installPath;
-
- // The plug-in icon URL.
- protected URL iconURL;
-
- // The profiling flag.
- private boolean profiling;
-
- /**
- * Default constructor.
- */
- public AbstractActivator() {
- super();
- }
-
- /**
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- init(context);
-
- // set the
- if (isDebugging()) {
- getLogger().logInfo("Started " + pluginId); //$NON-NLS-1$
- }
- }
-
- /**
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- // Free the shared images.
-// for (Iterator images = sharedImages.values().iterator(); images
-// .hasNext();) {
-// Image image = (Image) images.next();
-// if (image != null && !image.isDisposed()) {
-// image.dispose();
-// }
-// }
-
- super.stop(context);
-
- if (isDebugging()) {
- getLogger().logInfo("Stopped " + pluginId); //$NON-NLS-1$
- }
- }
-
- /**
- * Initializes this plug-in.
- *
- * @param context
- * The bundle context.
- */
- protected void init(BundleContext context) throws Exception {
- // Get the bundle for this plug-in.
- Bundle bundle = getBundle();
-
- // Get the resouce bundle for this plug-in.
- resourceBundle = Platform.getResourceBundle(bundle);
-
- // Get the ID for this plug-in.
- pluginId = bundle.getSymbolicName();
-
- if (isDebugging()) {
- getLogger().logInfo("Initializing " + pluginId); //$NON-NLS-1$
- }
-
- // Get the install path of this plug-in.
- installURL = bundle.getEntry("/"); //$NON-NLS-1$
-
- try {
- installPath = FileLocator.resolve(installURL).getPath();
- } catch (IOException e) {
- installPath = Platform.getInstallLocation().getURL().getPath();
- }
-
- try {
- iconURL = new URL(installURL, ICON_PATH);
- } catch (IOException e) {
- }
-
- String symbolicName = bundle.getSymbolicName();
- if (symbolicName != null) {
- String key = symbolicName + "/profiling"; //$NON-NLS-1$
- String value = InternalPlatform.getDefault().getOption(key);
- profiling = value == null ? false : value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- if (isDebugging()) {
- getLogger().logInfo(
- "Initialized " + pluginId + ", installPath=" + installPath); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Returns the ID of this plug-in.
- *
- * @return The ID of this plug-in.
- */
- public String getId() {
- return pluginId;
- }
-
- /**
- * Returns the install URL of this plug-in.
- *
- * @param The
- * install URL of this plug-in.
- */
- public URL getInstallURL() {
- return installURL;
- }
-
- /**
- * Returns the install path of this plug-in.
- *
- * @param The
- * install path of this plug-in.
- */
- public String getInstallPath() {
- return installPath;
- }
-
- /**
- * Loads and returns the localized properties of a Java properties file.
- *
- *
- * @param path
- * The properties file path relative to the plug-in root.
- * @return A Properties object.
- */
- public Properties getProperties(String path) throws IOException {
- Properties props = new Properties();
- if (path == null) {
- return props;
- }
-
- String filePath = getLocalizedFile(path, true);
- if (filePath != null) {
- props.load(new FileInputStream(filePath));
- }
-
- return props;
- }
-
- /**
- * get the locale specific absolute file path name of the given file in the
- * plugin.
- *
- * @param path
- * The properties file path relative to the plug-in root.
- * @return String the locale specific absolute file path name of the given
- * file.
- * @throws IOException
- */
- public String getLocalizedFile(String path, boolean useDefault)
- throws IOException {
- String filePath = null;
- String fileName = FileUtil.getFileName(path);
- int index = path.lastIndexOf(fileName);
- String pathName = path.substring(0, index);
-
- Locale locale = Locale.getDefault();
-
- Bundle bundle = getBundle();
- Bundle[] bundles = Platform.getFragments(bundle);
- if (bundles != null) {
- for (int i = 0; i < bundles.length; i++) {
- URL entry = bundles[i].getEntry(pathName);
- if (entry != null) {
- URL url = FileLocator.resolve(entry);
- filePath = I18nUtil.getLocalizedFile(url.getPath()
- + fileName, locale);
- if (filePath != null) {
- break;
- }
- }
- }
- }
-
- if (filePath == null) {
- URL entry = bundle.getEntry(path);
- if (entry != null) {
- URL url = FileLocator.resolve(entry);
- filePath = I18nUtil.getLocalizedFile(url.getPath(), locale);
- if (filePath == null && useDefault) {
- filePath = url.getPath();
- }
- }
- }
-
- return filePath;
- }
-
- /**
- * for the given path in the plugin, find the localized files form the nl
- * fragemenets and copy the localized files to the destination folder
- *
- * @param path
- * String a relative path to the plugin root. The files in this
- * folder will be iterated and their localized files will be
- * copied over
- * @param toDir
- * FIle the destination folder
- * @param recursive
- * boolean recurively looking for files int the specified folder
- * @param useLocaleFileName
- * boolean if true the locale specific file names will be used in
- * the copied destination, otherwise, the locale specific file
- * name will be renamed to the default one in the destination
- * folder
- * @throws IOException
- */
- public void copyLocalizedFiles(String path, File toDir, boolean recursive,
- boolean useLocaleFileName) throws IOException {
- String pluginPath = getInstallPath();
- URI pluginUri = new File(pluginPath).toURI();
- URI pathUri = new File(pluginPath, path).toURI();
-
- List files = new ArrayList();
- File f = new File(pluginPath, path);
- FileUtil.getAllFiles(f, files, recursive);
-
- // for each file found in the specified folder, get the localized file
- for (Iterator it = files.iterator(); it.hasNext();) {
- URI srcUri = ((File) it.next()).toURI();
-
- // get the relative path of the file to the plugin root, then find
- // the localized file
- String relPath = pluginUri.relativize(srcUri).getPath();
-
- // only get the locale specific file, don't include the default one
- String localizedFile = getLocalizedFile(relPath, false);
- if (localizedFile == null) {
- continue;
- }
-
- // need to change the target file path to relative to the path
- // instead of the plugin root
- relPath = pathUri.relativize(srcUri).getPath();
- File srcFile = new File(localizedFile);
- File targetFile = new File(toDir, relPath);
- File targetParent = targetFile.getParentFile();
-
- // copy the file to the desitination
- // if useLocaleFileName is true, the destination file name should
- // also use the locale specific file name
- if (useLocaleFileName) {
- String fileName = srcFile.getName();
- targetFile = new File(targetParent, fileName);
- }
-
- if (isDebugging()) {
- System.out.println("Copying localized file: "); //$NON-NLS-1$
- System.out.println("Source: " + srcFile); //$NON-NLS-1$
- System.out.println("Target: " + targetFile); //$NON-NLS-1$
- System.out.println(""); //$NON-NLS-1$
- }
-
- try {
- if (!targetParent.exists()) {
- targetParent.mkdirs();
- }
-
- if (!targetFile.exists()) {
- targetFile.createNewFile();
- }
-
- FileUtil.copyFile(srcFile, targetFile);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- }
-
- /**
- * Returns the localized resource.
- *
- * @param key
- * The resource key.
- * @return The localized resource.
- */
- public String getString(String key) {
- if (resourceBundle != null) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- }
- }
- return '[' + key + ']';
- }
-
- /**
- * Returns the formatted localized message given the resource key and the
- * message argument.
- *
- * @param key
- * The resource key.
- * @param argument
- * The message argument.
- * @return The formatted localized message.
- */
- public String formatMessage(String key, Object argument) {
- if (resourceBundle != null) {
- try {
- String msg = resourceBundle.getString(key);
- Object[] arguments = { argument };
- return MessageFormat.format(msg, arguments);
- } catch (MissingResourceException e) {
- }
- }
- return '[' + key + ']';
- }
-
- /**
- * Returns the image URL given the relative path.
- *
- * @param relativePath
- * The image's path relative to the plug-in's root.
- * @return The image URL.
- */
- public URL getImageURL(String relativePath) {
- try {
- URL url = new URL(iconURL, relativePath);
- return FileLocator.resolve(url);
- } catch (Exception e) {
- return null;
- }
- }
-
-// /**
-// * Returns the image descriptor given the relative path.
-// *
-// * @param relativePath
-// * The image's path relative to the plug-in's root.
-// * @return The image descriptor.
-// */
-// public ImageDescriptor getImageDescriptor(String relativePath) {
-// try {
-// URL url = new URL(iconURL, relativePath);
-// return ImageDescriptor.createFromURL(url);
-// } catch (MalformedURLException e) {
-// return ImageDescriptor.getMissingImageDescriptor();
-// }
-// }
-//
-// /**
-// * Returns the image given the relative path.
-// *
-// * Note: The returned image need to be freed by the caller.
-// *
-// * @param relativePath
-// * The image's path relative to the plug-in's root.
-// * @return The image.
-// */
-// public Image getImage(String relativePath) {
-// Image image = null;
-//
-// ImageDescriptor imageDescriptor = getImageDescriptor(relativePath);
-// if (imageDescriptor != null) {
-// image = imageDescriptor.createImage(false);
-// }
-//
-// return image;
-// }
-//
-// /**
-// * Returns the shared image given the relative path.
-// *
-// * Note: The returned image will be automatically freed when the plug-in
-// * shuts down.
-// *
-// * @param relativePath
-// * The image's path relative to the plug-in's root.
-// * @return The image.
-// */
-// public Image getSharedImage(String relativePath) {
-// Image image = (Image) sharedImages.get(relativePath);
-// if (image != null) {
-// return image;
-// }
-//
-// ImageDescriptor imageDescriptor = getImageDescriptor(relativePath);
-// if (imageDescriptor != null) {
-// image = imageDescriptor.createImage(false);
-// if (image != null) {
-// sharedImages.put(relativePath, image);
-// }
-// }
-//
-// return image;
-// }
-
- /**
- * Returns the profiling flag.
- *
- * @return true if profiling is enabled for this plu-in
- */
- public boolean isProfiling() {
- return profiling;
- }
-
- /**
- * Returns the logger given the plug-in ID.
- *
- * @return The new or cached logger.
- */
- public Logger getLogger() {
- Logger logger = (Logger) loggers.get(pluginId);
- if (logger == null) {
- logger = new Logger(this);
- loggers.put(pluginId, logger);
- }
- return logger;
- }
-
- /**
- * Logs the given object or message.
- */
- public void log(Object logEntry) {
- if (logEntry instanceof Throwable) {
- ((Throwable) logEntry).printStackTrace(System.err);
- } else {
- System.err.println(logEntry);
- }
- }
-
- public IPreferenceStoreWrapper getPreferenceStore() {
- return CommonPlugin.getDefault().getCommonPreferenceStore();
- }
-
-
- public Object getContext() {
- if ( CommonPlugin.getDefault().contextProvider != null ) {
- return CommonPlugin.getDefault().contextProvider.getContext();
- }
-
- return null;
- }
-
- public IMessageCallback getMsgCallback() {
- return CommonPlugin.getDefault().msgCallback;
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/CommonPlugin.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/CommonPlugin.java
deleted file mode 100644
index aa7c0c0d6ce..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/CommonPlugin.java
+++ /dev/null
@@ -1,82 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common;
-
-import org.eclipse.epf.common.preferences.IPreferenceStoreWrapper;
-import org.osgi.framework.BundleContext;
-
-/**
- * The Common plug-in activator.
- */
-public final class CommonPlugin extends AbstractActivator {
-
- // The shared plug-in instance.
- private static CommonPlugin plugin;
-
- /**
- * Creates a new instance.
- */
- public CommonPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * @see org.eclipse.epf.common.ui.AbstractPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * @see org.eclipse.epf.common.ui.AbstractPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Gets the shared instance.
- *
- * @return the shared plug-in instance
- */
- public static CommonPlugin getDefault() {
- return plugin;
- }
-
-// /**
-// * set the store wrapper before it's being used.
-// * @param storeWrapper
-// */
- private IPreferenceStoreWrapper storeWrapper = null;
-
- public void setCommonPreferenceStore(IPreferenceStoreWrapper storeWrapper) {
- this.storeWrapper = storeWrapper;
- }
-
- public IPreferenceStoreWrapper getCommonPreferenceStore() {
- return storeWrapper;
- }
-
- // this is the context for message callback
- // for eclipse client, this is the Shell object
- IContextProvider contextProvider = null;
-
- public void setContextProvider(IContextProvider contextProvider) {
- this.contextProvider = contextProvider;
- }
-
- IMessageCallback msgCallback = null;
- public void setMsgCallback(IMessageCallback msgCallback) {
- this.msgCallback = msgCallback;
- }
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IActivator.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IActivator.java
deleted file mode 100644
index 4ddeed449fb..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IActivator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2008 IBM Corporation and others.
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// which accompanies this distribution, and is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// Contributors:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common;
-
-import org.eclipse.epf.common.serviceability.Logger;
-
-/**
- * @author Phong Nguyen Le
- * @since 1.5
- *
- */
-public interface IActivator {
- String getId();
- Logger getLogger();
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IContextProvider.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IContextProvider.java
deleted file mode 100644
index b361fcb8f17..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IContextProvider.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common;
-
-public interface IContextProvider {
- public Object getContext();
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IHTMLFormatter.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IHTMLFormatter.java
deleted file mode 100644
index b9db6ff70d8..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IHTMLFormatter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common;
-
-import java.io.UnsupportedEncodingException;
-import java.util.regex.Pattern;
-
-public interface IHTMLFormatter {
-
- /*
- * String location = m.group(1);
- * String lineStr = m.group(2);
- * String columnStr = m.group(3);
- * String errorMsg = m.group(4);
- */
- public static final Pattern jTidyErrorParser = Pattern
- .compile(
- "(line\\s+(\\d+)\\s+column\\s+(\\d+))\\s+-\\s+(.+)", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
-
- public static final String DIAGNOSTIC_SOURCE = "org.eclipse.epf.common.IHTMLFormatter"; //$NON-NLS-1$
-
- public static final Pattern p_whitespace = Pattern.compile("^\\s+", Pattern.MULTILINE); //$NON-NLS-1$
-
- public String formatHTML(String html, boolean returnBodyOnly, boolean forceOutput, boolean makeBare, boolean word2000) throws UnsupportedEncodingException;
-
- public String formatHTML(String text) throws UnsupportedEncodingException;
-
- public String getLastErrorStr();
-
- public String removeLeadingWhitespace(String input);
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IHTMLParser.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IHTMLParser.java
deleted file mode 100644
index dac8b72e6c3..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IHTMLParser.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common;
-
-import java.io.File;
-import java.util.Properties;
-
-public interface IHTMLParser {
-
- public String getText();
-
- public String getSummary();
-
- public Properties getMetaTags();
-
- public void parse(File file) throws Exception;
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IMessageCallback.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IMessageCallback.java
deleted file mode 100644
index 362f33b983e..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/IMessageCallback.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common;
-
-
-public interface IMessageCallback {
-
- public void displayWarning(AbstractActivator plugin, String title, String msg, String reason);
- public void displayWarning(AbstractActivator plugin, String msg, String reason, Throwable ex);
- public void displayWarning(AbstractActivator plugin, String msg, String reason, String details, Throwable ex);
- public void displayWarning(AbstractActivator plugin, String title, String msg, String reason, String details, Throwable ex);
-
- public void displayError(AbstractActivator plugin, String title, String msg);
- public void displayError(AbstractActivator plugin, String title, String msg, Throwable ex);
- public void displayError(AbstractActivator plugin, String title, String msg, String reason, String details, Throwable ex);
-
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/package.html b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/package.html
deleted file mode 100644
index dba34bd4a8f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-Provides the activator for managing the Common plug-in's life cycle.
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPreferenceStoreWrapper.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPreferenceStoreWrapper.java
deleted file mode 100644
index 938f1fc7820..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPreferenceStoreWrapper.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.preferences;
-
-
-/**
- * wrapper interface for preference store
- *
- * @author Jinhua Xi
- * @since 1.5
- *
- */
-public interface IPreferenceStoreWrapper {
-
- //public Object getStore();
-
- public void addPropertyChangeListener(IPropertyChangeListenerWrapper listener);
- public void firePropertyChangeEvent(String name, Object oldValue,
- Object newValue);
- public void removePropertyChangeListener(IPropertyChangeListenerWrapper listener);
-
- /**
- * Returns the current value of the boolean-valued preference with the
- * given name.
- * Returns the default-default value (false) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a boolean.
- *
- * @param name the name of the preference
- * @return the boolean-valued preference
- */
- public boolean getBoolean(String name);
-
- /**
- * Returns the default value for the boolean-valued preference
- * with the given name.
- * Returns the default-default value (false) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a boolean.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public boolean getDefaultBoolean(String name);
-
- /**
- * Returns the default value for the double-valued preference
- * with the given name.
- * Returns the default-default value (0.0) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a double.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public double getDefaultDouble(String name);
-
- /**
- * Returns the default value for the float-valued preference
- * with the given name.
- * Returns the default-default value (0.0f) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a float.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public float getDefaultFloat(String name);
-
- /**
- * Returns the default value for the integer-valued preference
- * with the given name.
- * Returns the default-default value (0) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as an integer.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public int getDefaultInt(String name);
-
- /**
- * Returns the default value for the long-valued preference
- * with the given name.
- * Returns the default-default value (0L) if there
- * is no default preference with the given name, or if the default
- * value cannot be treated as a long.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public long getDefaultLong(String name);
-
- /**
- * Returns the default value for the string-valued preference
- * with the given name.
- * Returns the default-default value (the empty string "")
- * is no default preference with the given name, or if the default
- * value cannot be treated as a string.
- *
- * @param name the name of the preference
- * @return the default value of the named preference
- */
- public String getDefaultString(String name);
-
- /**
- * Returns the current value of the double-valued preference with the
- * given name.
- * Returns the default-default value (0.0) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a double.
- *
- * @param name the name of the preference
- * @return the double-valued preference
- */
- public double getDouble(String name);
-
- /**
- * Returns the current value of the float-valued preference with the
- * given name.
- * Returns the default-default value (0.0f) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a float.
- *
- * @param name the name of the preference
- * @return the float-valued preference
- */
- public float getFloat(String name);
-
- /**
- * Returns the current value of the integer-valued preference with the
- * given name.
- * Returns the default-default value (0) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as an integter.
- *
- * @param name the name of the preference
- * @return the int-valued preference
- */
- public int getInt(String name);
-
- /**
- * Returns the current value of the long-valued preference with the
- * given name.
- * Returns the default-default value (0L) if there
- * is no preference with the given name, or if the current value
- * cannot be treated as a long.
- *
- * @param name the name of the preference
- * @return the long-valued preference
- */
- public long getLong(String name);
-
- /**
- * Returns the current value of the string-valued preference with the
- * given name.
- * Returns the default-default value (the empty string "")
- * if there is no preference with the given name, or if the current value
- * cannot be treated as a string.
- *
- * @param name the name of the preference
- * @return the string-valued preference
- */
- public String getString(String name);
-
- /**
- * Returns whether the current value of the preference with the given name
- * has the default value.
- *
- * @param name the name of the preference
- * @return true if the preference has a known default value
- * and its current value is the same, and false otherwise
- * (including the case where the preference is unknown to this store)
- */
- public boolean isDefault(String name);
-
- /**
- * Returns whether the current values in this property store
- * require saving.
- *
- * @return true if at least one of values of
- * the preferences known to this store has changed and
- * requires saving, and false otherwise.
- */
- public boolean needsSaving();
-
- /**
- * Sets the current value of the preference with the given name to
- * the given string value without sending a property change.
- *
- * This method does not fire a property change event and
- * should only be used for setting internal preferences
- * that are not meant to be processed by listeners.
- * Normal clients should instead call #setValue.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void putValue(String name, String value);
-
- /**
- * Sets the default value for the double-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, double value);
-
- /**
- * Sets the default value for the float-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, float value);
-
- /**
- * Sets the default value for the integer-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, int value);
-
- /**
- * Sets the default value for the long-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, long value);
-
- /**
- * Sets the default value for the string-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param defaultObject the new default value for the preference
- */
- public void setDefault(String name, String defaultObject);
-
- /**
- * Sets the default value for the boolean-valued preference with the
- * given name.
- *
- * Note that the current value of the preference is affected if
- * the preference's current value was its old default value, in which
- * case it changes to the new default value. If the preference's current
- * is different from its old default value, its current value is
- * unaffected. No property change events are reported by changing default
- * values.
- *
- *
- * @param name the name of the preference
- * @param value the new default value for the preference
- */
- public void setDefault(String name, boolean value);
-
- /**
- * Sets the current value of the preference with the given name back
- * to its default value.
- *
- * Note that the preferred way of re-initializing a preference to the
- * appropriate default value is to call setToDefault.
- * This is implemented by removing the named value from the store,
- * thereby exposing the default value.
- *
- *
- * @param name the name of the preference
- */
- public void setToDefault(String name);
-
- /**
- * Sets the current value of the double-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, double value);
-
- /**
- * Sets the current value of the float-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, float value);
-
- /**
- * Sets the current value of the integer-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, int value);
-
- /**
- * Sets the current value of the long-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, long value);
-
- /**
- * Sets the current value of the string-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, String value);
-
- /**
- * Sets the current value of the boolean-valued preference with the
- * given name.
- *
- * A property change event is reported if the current value of the
- * preference actually changes from its previous value. In the event
- * object, the property name is the name of the preference, and the
- * old and new values are wrapped as objects.
- *
- *
- * Note that the preferred way of re-initializing a preference to its
- * default value is to call setToDefault.
- *
- *
- * @param name the name of the preference
- * @param value the new current value of the preference
- */
- public void setValue(String name, boolean value);
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPropertyChangeEventWrapper.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPropertyChangeEventWrapper.java
deleted file mode 100644
index e1b305c88a5..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPropertyChangeEventWrapper.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.preferences;
-
-/**
- * wrapper interface for property change event
- *
- * @author Jinhua Xi
- * @since 1.5
- *
- */
-public interface IPropertyChangeEventWrapper {
-
- /**
- * Returns the new value of the property.
- *
- * @return the new value, or null if not known
- * or not relevant (for instance if the property was removed).
- */
- public Object getNewValue();
-
- /**
- * Returns the old value of the property.
- *
- * @return the old value, or null if not known
- * or not relevant (for instance if the property was just
- * added and there was no old value).
- */
- public Object getOldValue();
-
- /**
- * Returns the name of the property that changed.
- *
- * Warning: there is no guarantee that the property name returned
- * is a constant string. Callers must compare property names using
- * equals, not ==.
- *
- *
- * @return the name of the property that changed
- */
- public String getProperty();
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPropertyChangeListenerWrapper.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPropertyChangeListenerWrapper.java
deleted file mode 100644
index 9e4f195a868..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/preferences/IPropertyChangeListenerWrapper.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 implementation
- *******************************************************************************/
-package org.eclipse.epf.common.preferences;
-
-/**
- * wrapper interface for property change listener
- *
- * @author Jinhua Xi
- * @since 1.5
- *
- */
-public interface IPropertyChangeListenerWrapper {
-
- public void propertyChange(IPropertyChangeEventWrapper event);
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/DebugTrace.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/DebugTrace.java
deleted file mode 100644
index 0e004d48034..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/DebugTrace.java
+++ /dev/null
@@ -1,104 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.serviceability;
-
-/**
- * Helper utility for printing debug traces to the console.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class DebugTrace {
-
- /**
- * Prints a debug trace to the console.
- *
- * @param instance
- * a class instance
- * @param method
- * a method name
- * @param msg
- * a debug message
- * @param th
- * a Throwable object
- */
- public static void print(Object instance, String method, String msg,
- Throwable th) {
- StringBuffer debugMsg = new StringBuffer();
- if (instance != null) {
- debugMsg.append(instance.getClass().getName());
- if (method != null) {
- debugMsg.append('.').append(method);
- }
- debugMsg.append(": "); //$NON-NLS-1$
- }
- if (msg != null && msg.length() > 0) {
- debugMsg.append(msg);
- }
- System.out.println(debugMsg);
- if (th != null) {
- th.printStackTrace();
- }
- }
-
- /**
- * Prints a debug trace to the console.
- *
- * @param instance
- * a class instance
- * @param method
- * a method name
- * @param th
- * a Throwable object
- */
- public static void print(Object instance, String method, Throwable th) {
- print(instance, method, null, th);
- }
-
- /**
- * Prints a debug trace to the console.
- *
- * @param instance
- * a class instance
- * @param method
- * a method name
- * @param msg
- * a debug message
- */
- public static void print(Object instance, String method, String msg) {
- print(instance, method, msg, null);
- }
-
- /**
- * Prints a debug trace to the console.
- *
- * @param instance
- * a class instance
- * @param method
- * a method name
- */
- public static void print(Object instance, String method) {
- print(instance, method, null, null);
- }
-
- /**
- * Prints a debug trace to the console.
- *
- * @param th
- * a Throwable object
- */
- public static void print(Throwable th) {
- if (th != null) {
- th.printStackTrace();
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/Logger.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/Logger.java
deleted file mode 100644
index d8e12460230..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/Logger.java
+++ /dev/null
@@ -1,134 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.serviceability;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-
-/**
- * Generic logger used for logging status messages, warning messages, error
- * messages, and exception stack traces.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class Logger {
-
- public static String SeeLogFileForMoreDetails;
-
- // The plug-in instance.
- private Plugin plugin;
-
- // The plug-in ID.
- private String pluginId;
-
- /**
- * Create a new Logger given the plug-in instance.
- *
- * @param plugin
- * The plugin instance.
- */
- public Logger(Plugin plugin) {
- this.plugin = plugin;
- this.pluginId = plugin.getBundle().getSymbolicName(); //plugin.getId();
- }
-
- /**
- * Logs the given error message.
- *
- * @param msg
- * The error message.
- */
- public void logError(String msg) {
- logMsg(IStatus.ERROR, msg, null);
- }
-
- /**
- * Logs the given exception.
- *
- * @param ex
- * The exception.
- */
- public void logError(Throwable ex) {
- logMsg(IStatus.ERROR, null, ex);
- }
-
- /**
- * Logs the given error message and exception.
- *
- * @param msg
- * The error message.
- * @param ex
- * The exception.
- */
- public void logError(String msg, Throwable ex) {
- logMsg(IStatus.ERROR, msg, ex);
- }
-
- /**
- * Logs the given warning message.
- *
- * @param msg
- * The warning message.
- */
- public void logWarning(String msg) {
- logMsg(IStatus.WARNING, msg, null);
- }
-
- /**
- * Logs the given warning message and exception.
- *
- * @param msg
- * The warning message.
- * @param ex
- * The exception.
- */
- public void logWarning(String msg, Throwable ex) {
- logMsg(IStatus.WARNING, msg, ex);
- }
-
- /**
- * Logs the given status message and exception.
- *
- * @param msg
- * The status message.
- */
- public void logInfo(String msg) {
- logMsg(IStatus.INFO, msg, null);
- }
-
- /**
- * Logs the given message and exception.
- *
- * @param severity
- * The severity.
- * @param msg
- * The message.
- * @param ex
- * The exception.
- */
- public synchronized void logMsg(int severity, String msg, Throwable ex) {
- if (msg == null && ex != null) {
- msg = ex.getMessage();
- }
-
- if (msg == null) {
- msg = ""; //$NON-NLS-1$
- }
-
- Status status = new Status(severity, pluginId, IStatus.OK, msg, ex);
-
- // Call the Eclipse Logger.
- plugin.getLog().log(status);
- }
-
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/package.html b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/package.html
deleted file mode 100644
index 7aed6dede63..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/serviceability/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-Provides common error handling, logging and versioning services.
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ExtensionHelper.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ExtensionHelper.java
deleted file mode 100644
index 2745046f8c6..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ExtensionHelper.java
+++ /dev/null
@@ -1,216 +0,0 @@
-//------------------------------------------------------------------------------
-//Copyright (c) 2005, 2008 IBM Corporation and others.
-//All rights reserved. This program and the accompanying materials
-//are made available under the terms of the Eclipse Public License v1.0
-//which accompanies this distribution, and is available at
-//http://www.eclipse.org/legal/epl-v10.html
-//
-//Contributors:
-//IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.utils;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.epf.common.CommonPlugin;
-import org.eclipse.epf.common.IHTMLFormatter;
-import org.eclipse.epf.common.IHTMLParser;
-import org.osgi.framework.Bundle;
-
-/**
-* Helper class with methods to retrieve extensions
-* Moved part of org.eclipse.epf.library.edit.util.ExtensionManager, to allow
-* access by classes that have no dependency on org.eclipse.epf.library.edit
-*
-* @author Phong Nguyen Le
-* @author Weiping Lu
-* @since 1.5
-*/
-public class ExtensionHelper {
- private static Map IDToExtensionMap = new HashMap();
-
- public static Object createExtension(String namespace, String extensionPointName) {
- // Process the contributors.
- //
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(namespace, extensionPointName);
- if (extensionPoint != null) {
- IExtension[] extensions = extensionPoint.getExtensions();
- Object ext = null;
- ext_walk:
- for (int i = 0; i < extensions.length; i++) {
- IExtension extension = extensions[i];
- String pluginId = extension.getNamespaceIdentifier();
- Bundle bundle = Platform.getBundle(pluginId);
- IConfigurationElement[] configElements = extension
- .getConfigurationElements();
- for (int j = 0; j < configElements.length; j++) {
- IConfigurationElement configElement = configElements[j];
- try {
- String className = configElement.getAttribute("class"); //$NON-NLS-1$
- if(className != null) {
- ext = bundle.loadClass(className).newInstance();
- break ext_walk;
- }
- } catch (Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- }
- }
- return ext;
- }
- return null;
- }
-
- public static Object getExtension(String namespace, String extensionPointName) {
- String ID = namespace + '.' + extensionPointName;
- Object ext = IDToExtensionMap.get(ID);
- if(ext == null) {
- synchronized (IDToExtensionMap) {
- ext = IDToExtensionMap.get(ID);
- if(ext == null) {
- ext = createExtension(namespace, extensionPointName);
- if(ext != null) {
- IDToExtensionMap.put(ID, ext);
- }
- }
- }
-
- }
- return ext;
- }
-
- /**
- * This is a special method to handle JTidy extensions
- *
- */
- public static Object createExtensionForJTidy(String namespace, String extensionPointName) {
- List formaters = new ArrayList();
- List parsers = new ArrayList();
-
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(namespace, extensionPointName);
- if (extensionPoint != null) {
- IExtension[] extensions = extensionPoint.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IExtension extension = extensions[i];
- String pluginId = extension.getNamespaceIdentifier();
- Bundle bundle = Platform.getBundle(pluginId);
- IConfigurationElement[] configElements = extension.getConfigurationElements();
- for (int j = 0; j < configElements.length; j++) {
- IConfigurationElement configElement = configElements[j];
- try {
- String className = configElement.getAttribute("class"); //$NON-NLS-1$
- if(className != null) {
- Object obj = bundle.loadClass(className).newInstance();
- if (extensionPointName.equals("htmlFormatter")) { //$NON-NLS-1$
- formaters.add((IHTMLFormatter)obj);
- } else if (extensionPointName.equals("htmlParser")) { //$NON-NLS-1$
- parsers.add((IHTMLParser)obj);
- }
- }
- } catch (Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- }
- }
-
- if (formaters.size() > 0) {
- if (formaters.size() == 1) {
- return formaters.get(0);
- }
- return selectExtension(formaters);
- } else if (parsers.size() > 0) {
- if (parsers.size() == 1) {
- return parsers.get(0);
- }
- return selectExtension(parsers);
- }
- }
-
- return null;
- }
-
- private static Object selectExtension(List objs) {
- for (Object obj : objs) {
- String name = obj.getClass().getName();
- if (!(name.equals("org.eclipse.epf.common.html.DefaultHTMLFormatter") //$NON-NLS-1$
- || name.equals("org.eclipse.epf.common.html.DefaultHTMLParser"))) { //$NON-NLS-1$
- return obj;
- }
- }
-
- return null;
- }
-
- public static IMarkerAttributeContributer getMarkerAttributeContributer() {
- IMarkerAttributeContributer ret = (IMarkerAttributeContributer) getExtension(
- CommonPlugin.getDefault().getId(), "markerAttributeContributer");//$NON-NLS-1$
- return ret;
- }
-
- /**
- * Create object based on type and context through extension
- * @param type
- * @param context
- * @return created object or null if no extension is found
- */
- public static Object create(Class type, Object context) {
- IObjectFactory ret = (IObjectFactory) getExtension(
- CommonPlugin.getDefault().getId(), "objectFactory");//$NON-NLS-1$
- if (ret == null) {
- return null;
- }
- return ret.create(type, context);
- }
-
- public static List getExtensions(String namespace, String extensionPointName, Class type) {
- List list = new ArrayList();
- try {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(namespace, extensionPointName);
- if (extensionPoint != null) {
- IExtension[] extensions = extensionPoint.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IExtension extension = extensions[i];
- String pluginId = extension.getNamespaceIdentifier();
- Bundle bundle = Platform.getBundle(pluginId);
- IConfigurationElement[] configElements = extension
- .getConfigurationElements();
- for (int j = 0; j < configElements.length; j++) {
- IConfigurationElement configElement = configElements[j];
- try {
- String className = configElement.getAttribute("class"); //$NON-NLS-1$
- if(className != null) {
- Object ext = bundle.loadClass(className).newInstance();
- if(type.isInstance(ext)) {
- list.add((T)ext);
- }
- }
- } catch (Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- }
- }
- }
- }
- catch(Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- if(list.isEmpty()) {
- return Collections.emptyList();
- }
- return list;
- }
-
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/FileUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/FileUtil.java
deleted file mode 100644
index bf8c51b2e74..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/FileUtil.java
+++ /dev/null
@@ -1,1285 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.utils;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.nio.CharBuffer;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.nio.channels.OverlappingFileLockException;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CodingErrorAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.epf.common.CommonPlugin;
-import org.osgi.framework.Bundle;
-
-/**
- * Utility class for managing directories and files.
- *
- * @author Kelvin Low
- * @author Jinhua Xi
- * @since 1.0
- */
-public class FileUtil {
-
- /**
- * Platform-specific line separator.
- */
- public static final String LINE_SEP = System.getProperty("line.separator"); //$NON-NLS-1$
-
- /**
- * Platform-specific file separator.
- */
- public static final String FILE_SEP = System.getProperty("file.separator"); //$NON-NLS-1$
-
- /**
- * Platform-specific line separator length.
- */
- public static final int LINE_SEP_LENGTH = LINE_SEP.length();
-
- /**
- * UNC path prefix.
- */
- public static final String UNC_PATH_PREFIX = "\\\\"; //$NON-NLS-1$
-
- /**
- * UNC path prefix length.
- */
- public static final int UNC_PATH_PREFIX_LENGTH = UNC_PATH_PREFIX.length();
-
- /**
- * ISO-8859-1 encoding.
- */
- public static final String ENCODING_ISO_8859_1 = "ISO-8859-1"; //$NON-NLS-1$
-
- /**
- * UTF-8 encoding.
- */
- public static final String ENCODING_UTF_8 = "UTF-8";//$NON-NLS-1$
-
- private static Map copiedFileMap;
-
- /**
- * Private constructor to prevent this class from being instantiated. All
- * methods in this class should be static.
- */
- private FileUtil() {
- }
-
- /**
- * Returns the absolute path for a file or directory.
- *
- * @param file
- * a file or directory
- * @return the absolute path to the file or directory
- */
- public static String getAbsolutePath(File file) {
- return file.getAbsolutePath().replace('\\', '/');
- }
-
- /**
- * Returns the absolute path for a file or directory.
- *
- * @param path
- * a path to a file or directory
- * @return an absolute path to the file or directory
- */
- public static String getAbsolutePath(String path) {
- return getAbsolutePath(new File(path));
- }
-
- /**
- * Returns the absolute path for a URL.
- *
- * @param url
- * a URL
- * @return the absolute path of the URL
- */
- public static String getAbsolutePath(URL url) {
- String pathName = url.getFile().substring(1);
- String result = NetUtil.decodeUrl(pathName, null);
- return result;
- }
-
- /**
- * Returns the parent directory of a path.
- *
- * @param path
- * a path name
- * @return the name of the parent directory
- */
- public static String getParentDirectory(String path) {
- return (new File(path)).getParent();
- }
-
- /**
- * Returns the file name and extension from a path.
- *
- * @param path
- * a path name
- * @return the file name including the file extension
- */
- public static String getFileName(String path) {
- return getFileName(path, true);
- }
-
- /**
- * Returns the file name from a path, with or without the file extension.
- *
- * @param path
- * a path name
- * @param withExtension
- * if true, include the file extension in the
- * result
- * @return the file name with or without the file extension
- */
- public static String getFileName(String path, boolean withExtension) {
- String normalizedPath = path.replace('\\', '/');
-
- int prefixLength = 0;
- if (normalizedPath.startsWith(NetUtil.FILE_URI_PREFIX)) {
- prefixLength = NetUtil.FILE_URI_PREFIX_LENGTH;
- } else if (normalizedPath.startsWith(NetUtil.HTTP_URI_PREFIX)) {
- prefixLength = NetUtil.HTTP_URI_PREFIX_LENGTH;
- }
-
- String fileName;
- int index = normalizedPath.lastIndexOf("/"); //$NON-NLS-1$
- if (index < prefixLength) {
- fileName = normalizedPath.substring(prefixLength);
- } else {
- fileName = path.substring(index + 1);
- }
-
- if (withExtension) {
- return fileName;
- }
-
- index = fileName.indexOf("."); //$NON-NLS-1$
- return (index > 0) ? fileName.substring(0, index) : fileName;
- }
-
- /**
- * Returns the relative path of a path from a base path.
- *
- * @param path
- * a path
- * @param basePath
- * the base path
- * @return a relative path
- */
- public static String getRelativePathToBase(File path, File basePath) {
- try {
- String dir = path.toURL().toExternalForm();
- String baseDir = basePath.toURL().toExternalForm();
- StringBuffer result = new StringBuffer();
- if (dir.indexOf(baseDir) == 0) {
- String delta = dir.substring(baseDir.length());
- for (int i = 0; i < delta.length(); i++) {
- if (delta.charAt(i) == '/') {
- result.append("../"); //$NON-NLS-1$
- }
- }
- }
- return result.toString();
- } catch (Exception e) {
- return ""; //$NON-NLS-1$
- }
- }
-
- public static String getRelativePath(File path, File basePath) {
- try {
- String dir = path.toURL().toExternalForm();
- String baseDir = appendSeparator(basePath.toURL().toExternalForm(),
- "/"); //$NON-NLS-1$
- StringBuffer result = new StringBuffer();
- while (dir.indexOf(baseDir) == -1) {
- basePath = basePath.getParentFile();
- baseDir = appendSeparator(basePath.toURL().toExternalForm(),
- "/"); //$NON-NLS-1$
- result.append("../"); //$NON-NLS-1$
- }
- if (dir.indexOf(baseDir) == 0) {
- String delta = dir.substring(baseDir.length());
- result.append(delta);
- }
- return result.toString();
- } catch (Exception e) {
- return ""; //$NON-NLS-1$
- }
- }
-
- /**
- * Appends the platform specific path separator to the end of a path.
- *
- * @param path
- * a path name
- * @return the path name appended with the platform specific path separator
- */
- public static String appendSeparator(String path) {
- return appendSeparator(path, File.separator);
- }
-
- /**
- * Appends the given path separator to the end of a path
- *
- * @param path
- * a path name
- * @param separator
- * a path separator
- * @return the path name appended with the given separator
- */
- public static String appendSeparator(String path, String separator) {
- return path.endsWith(separator) ? path : path + separator;
- }
-
- /**
- * Removes the ending path separator from a path.
- *
- * @param path
- * a path name
- * @return the path name minus the platform specific path separator
- */
- public static String removeSeparator(String path) {
- return path.endsWith(File.separator) ? path.substring(0,
- path.length() - 1) : path;
- }
-
- /**
- * Removes the ending path separator from a path.
- *
- * @param path
- * a path name
- * @return the path name minus the path separator "\\" or "/"
- */
- public static String removeAllSeparator(String path) {
- return path.endsWith("/") || path.endsWith("\\") ? path.substring(0, path.length() - 1) : path; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Removes the ending path separator from a path.
- *
- * @param path
- * a path name
- * @param separator
- * a path separator
- * @return the path name minus the separator
- */
- public static String removeSeparator(String path, String separator) {
- return path.endsWith(separator) ? path.substring(0, path.length() - 1)
- : path;
- }
-
- /**
- * Replaces the file name with another in a path.
- *
- * @param path
- * a path name
- * @param oldFileName
- * the old file name
- * @param newFileName
- * the new file name
- * @return the new path name with the new file name
- */
- public static String replaceFileName(String path, String oldFileName,
- String newFileName) {
- int index = path.lastIndexOf(oldFileName);
- return path.substring(0, index) + newFileName;
- }
-
- /**
- * Replaces the file extension with another in a path.
- *
- * @param path
- * a path name
- * @param oldFileExt
- * rhe old file extension
- * @param newFileExt
- * the new file extension
- * @return the new path with the new file extension
- */
- public static String replaceExtension(String path, String oldExt,
- String newExt) {
- int index = path.lastIndexOf(oldExt);
- return path.substring(0, index) + newExt;
- }
-
- /**
- * Returns the locale-specific path of a base path.
- *
- * @param path
- * a base path name
- * @param localeStr
- * a locale string
- * @return the locale-specific path
- */
- public static String getLocalePath(String path, String localeStr) {
- if (StrUtil.isBlank(localeStr)) {
- return path;
- }
- String fileName = getFileName(path);
- return replaceFileName(path, fileName, localeStr + "/" + fileName); //$NON-NLS-1$
- }
-
- /**
- * Returns the locale-specific path of a base path.
- *
- * @param path
- * a base path name
- * @param locale
- * a locale object
- * @return the locale-specific path
- */
- public static String getLocalePath(String path, Locale locale) {
- return locale == null ? path : getLocalePath(path, locale.toString());
- }
-
- /**
- * Writes the given text to a text file.
- *
- * @param fileName
- * the target file name
- * @param text
- * the text to write
- * @return true if the given text is written successfully to
- * file
- */
- public static boolean writeFile(String filename, String text) {
- FileWriter writer = null;
- try {
- writer = new FileWriter(filename);
- writer.write(text);
- writer.flush();
- } catch (IOException e) {
- } finally {
- if (writer != null) {
- try {
- writer.close();
- return true;
- } catch (Exception e) {
- }
- }
- }
- return false;
- }
-
- /**
- * Write the given text to a file with UTF-8 encoding.
- *
- * @param fileName
- * the target file name
- * @param text
- * the text to write
- * @param append
- * if true, append the text to the end of the
- * file, if false, override the file
- * @return true if the given text is written successfully to
- * file
- */
- public static boolean writeUTF8File(String filename, String text) {
- return writeUTF8File(filename, text, false);
- }
-
- /**
- * Write the given text to a file with UTF-8 encoding.
- *
- * @param fileName
- * the target file name
- * @param text
- * the text to write
- * @param append
- * if true, append the text to the end of the
- * file, if false, override the file
- * @return true if the given text is written successfully to
- * file
- */
- public static boolean writeUTF8File(String filename, String text,
- boolean append) {
- OutputStreamWriter writer = null;
- FileOutputStream fileOut = null;
- try {
- fileOut = new FileOutputStream(filename, append);
- writer = new OutputStreamWriter(fileOut, ENCODING_UTF_8);
- writer.write(text);
- writer.flush();
- fileOut.flush();
- } catch (IOException e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- } finally {
- if (writer != null) {
- try {
- writer.close();
- return true;
- } catch (Exception e) {
- }
- }
- if (fileOut != null) {
- try {
- fileOut.close();
- return true;
- } catch (Exception e) {
- }
- }
- }
- return false;
- }
-
- /**
- * Write the content of the given URI to an output stream.
- *
- * @param uri
- * the source URI
- * @param output
- * the output stream
- */
- public static void writeFile(String uri, OutputStream output)
- throws IOException {
- if (uri == null) {
- return;
- }
-
- InputStream input = null;
- try {
- input = NetUtil.getInputStream(uri);
- int bytesRead;
- byte[] buf = new byte[4096];
- while ((bytesRead = input.read(buf, 0, 4096)) > 0) {
- output.write(buf, 0, bytesRead);
- }
- output.flush();
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (Exception e) {
- }
- }
- }
- }
-
- /**
- * Write the content of the given URI to a PrintWriter.
- *
- * @param uri
- * the source URI
- * @param writer
- * the PrintWriter object
- */
- public static void writeFile(String uri, PrintWriter pw) throws IOException {
- if (uri == null) {
- return;
- }
-
- InputStreamReader input = null;
- try {
- input = new InputStreamReader(NetUtil.getInputStream(uri));
- int charsRead;
- char[] buf = new char[4096];
- while ((charsRead = input.read(buf, 0, 4096)) > 0) {
- pw.write(buf, 0, charsRead);
- }
- pw.flush();
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (Exception e) {
- }
- }
- }
- }
-
- /**
- * Recursively delete all sub-directories and files in a directory except
- * for the directory itself.
- *
- * @param dir
- * the directory containing the sub-directories and files
- * @return true if the delete operation is successful
- */
- public static boolean deleteAllFiles(String dir) {
- boolean ret = true;
- File targetDir = new File(dir);
- File[] files = targetDir.listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- if (files[i].isDirectory()) {
- ret = ret && deleteAllFiles(files[i].getAbsolutePath());
- }
- ret = ret && files[i].delete();
- }
- }
-
- return ret;
- }
-
- public static boolean deleteTree(File file) {
- boolean ret = true;
-
- if (file.isDirectory()) {
- File[] files = file.listFiles();
- if (files != null) {
- for (File f : files) {
- if (!deleteTree(f)) {
- ret = false;
- }
- }
- }
- }
-
- if (!file.delete()) {
- ret = false;
- }
-
- return ret;
- }
-
- /**
- * Recursively delete all sub-directories and files in a directory except
- * for the directory itself and the specified file.
- *
- * @param dir
- * the directory containing the sub-directories and files
- * @param filesNotToDelete
- * a list of files and/or directories that should not be deleted
- * @return true if delete operation is successful
- */
- public static boolean deleteAllFiles(String dir, List filesNotToDelete) {
- boolean ret = true;
- File targetDir = new File(dir);
- File[] files = targetDir.listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- if (!filesNotToDelete.contains(files[i])) {
- if (files[i].isDirectory()) {
- ret = ret
- && deleteAllFiles(files[i].getAbsolutePath(),
- filesNotToDelete);
- }
- ret = ret && files[i].delete();
- }
- }
- }
-
- return ret;
- }
-
- /**
- * Copies the content of the source file to the target file. Will overwrite
- * an existing file if it has write permission
- *
- * @param srcFile
- * the source file or path
- * @param tgtFile
- * the target file or path
- */
- public static boolean copyFile(File srcFile, File tgtFile) {
- Map map = getCopiedFileMap();
- File keyFile = null;
- File valFile = null;
- if (map != null) {
- try {
- keyFile = tgtFile.getCanonicalFile();
- valFile = srcFile.getCanonicalFile();
- if (valFile.equals(map.get(keyFile))) {
- return true;
- }
- } catch (Exception e) {
- keyFile = valFile = null;
- }
- }
-
- try {
- boolean ret = copyfile(srcFile, tgtFile);
- if (map != null && keyFile != null && valFile != null) {
- map.put(keyFile, valFile);
- }
- return ret;
- } catch (IOException ex) {
- CommonPlugin.getDefault().getLogger().logError(ex);
- return false;
- }
- }
-
- /**
- * Copies the content of the source file to the target file.
- *
- * @param srcFileName
- * the source file name
- * @param tgtFileName
- * the target file name
- */
- public static boolean copyFile(String srcFileName, String tgtFileName) {
- return copyFile(new File(srcFileName), new File(tgtFileName));
- }
-
- /**
- * Copies one file to another.
- *
- * If both source and destination are directories, delegates to
- * copydirectory().
- *
- * source must exist and be readable
- *
- * cannot copy a directory to a file
- *
- * will not copy if timestamps and filesize match, will overwrite otherwise
- *
- * @param source
- * the source file
- * @param dest
- * the destination file
- * @throws IOException
- * if an error occurs during the copy operation
- */
- private static boolean copyfile(File source, File dest) throws IOException {
- if (source.equals(dest))
- // do not copy equal files
- return false;
-
- if (!source.exists() || !source.canRead()) {
- // source does not exist or can't read
- return false;
- }
-
- if (dest.exists() && !dest.canWrite()) {
- // dest exists and cannot be written
- return false;
- }
-
- if (source.isDirectory()) {
- if (dest.isFile()) {
- // can't copy a directory to a file
- return false;
- } else {
- // delegate to copydirectory
- return copydirectory(source, dest);
- }
- } else {
- // source is a file
- if (dest.isDirectory()) {
- String sourceFileName = source.getName();
- return copyfile(source, new File(dest, sourceFileName));
- }
- // both source and dest are files
- boolean needCopy = true;
- if (dest.exists()) {
- needCopy = (dest.lastModified() != source.lastModified())
- || (dest.length() != source.length());
- }
-
- if (needCopy) {
- FileInputStream input = null;
- FileOutputStream output = null;
-
- try {
- input = new FileInputStream(source);
- FileChannel in = input.getChannel();
- if (!dest.exists()) {
- dest.getParentFile().mkdirs();
- }
- output = new FileOutputStream(dest);
- FileChannel out = output.getChannel();
- out.transferFrom(in, 0, source.length());
- dest.setLastModified(source.lastModified());
- return true;
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- }
- }
- if (output != null) {
- try {
- output.close();
- } catch (IOException e) {
- }
- }
- }
- } else {
- // did not copy
- // return true because dest file is same as source
- return true;
- }
- }
- }
-
- /**
- * Copies the content of a directory to another directory.
- *
- * @param srcDirName
- * the source directory name
- * @param tgtDirName
- * the target directory name
- */
- public static boolean copyDir(File srcDir, File tgtDir) {
- try {
- return copydirectory(srcDir, tgtDir);
- } catch (IOException ex) {
- CommonPlugin.getDefault().getLogger().logError(ex);
- return false;
- }
- }
-
- /**
- * Copies the content of a directory to another directory.
- *
- * @param srcDirName
- * the source directory name
- * @param tgtDirName
- * the target directory name
- */
- public static boolean copyDir(String srcDirName, String tgtDirName) {
- return copyDir(new File(srcDirName), new File(tgtDirName));
- }
-
- /**
- * Copies one directory to another - operates ONLY on directories.
- *
- * Both source and dest must exist.
- */
- private static boolean copydirectory(File sourceDir, File destDir)
- throws IOException {
- if (!sourceDir.exists() || !destDir.exists()) {
- return false;
- }
-
- if (!sourceDir.isDirectory() || !destDir.isDirectory()) {
- return false;
- }
-
- File[] files = sourceDir.listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- // calc destination name
- String destName = destDir
- + File.separator
- + files[i].getAbsolutePath().substring(
- sourceDir.getAbsolutePath().length() + 1);
- if (files[i].isFile()) {
- // copy the file
- copyfile(files[i], new File(destName));
- } else if (files[i].isDirectory()) {
- // copy directory recursively
- File destFile = new File(destName);
- destFile.mkdirs();
- copydirectory(files[i], destFile);
- }
- }
- }
- return true;
- }
-
- // for some reason, this guy locks the file, if you try to update the file,
- // got the following exception
- // java.io.FileNotFoundException:
- // (The requested operation cannot be performed on a file with a user-mapped
- // section open)
- // need to handle later
- public static CharBuffer readFile(File file) throws IOException {
- FileInputStream input = null;
- CharBuffer charBuffer = null;
- try {
- input = new FileInputStream(file);
- FileChannel inChannel = input.getChannel();
- int length = (int) inChannel.size();
- MappedByteBuffer byteBuffer = inChannel.map(
- FileChannel.MapMode.READ_ONLY, 0, length);
- Charset charset = Charset.forName(ENCODING_ISO_8859_1);
- CharsetDecoder decoder = charset.newDecoder();
- charBuffer = decoder.decode(byteBuffer);
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- }
- }
- }
- return charBuffer;
- }
-
- public static String readInputStream(InputStream input) throws IOException {
- String result = ""; //$NON-NLS-1$
- byte[] readData = new byte[8 * 1024];
- try {
- int bytesRead = 0;
- while ( (bytesRead = input.read(readData)) > 0) {
- result += new String(readData, 0, bytesRead);
- }
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- }
- }
- }
- return result;
- }
-
- public static StringBuffer readFile(File file, String encoding)
- throws IOException {
-
- StringBuffer result = new StringBuffer();
- FileInputStream fis = null;
- InputStreamReader reader = null;
- int size;
- try {
- Charset cs = Charset.forName(encoding);
- CharsetDecoder csd = cs.newDecoder();
- csd.onMalformedInput(CodingErrorAction.REPLACE);
- char[] buffer = new char[1024];
- fis = new FileInputStream(file);
- reader = new InputStreamReader(fis, csd);
- while ((size = reader.read(buffer, 0, 1024)) > 0) {
- result.append(buffer, 0, size);
- }
- } catch (Exception e) {
- // System.out.println(encoding);
- e.printStackTrace();
- } finally {
- if (fis != null) {
- fis.close();
- }
-
- if (reader != null) {
- reader.close();
- }
- }
-
- return result;
- }
-
- public static long getSize(File file) {
- FileInputStream fis = null;
- try {
- fis = new FileInputStream(file);
- return fis.getChannel().size();
- }
- catch (IOException e) {
- //
- }
- finally {
- try {
- fis.close();
- }
- catch(Exception e) {
- //
- }
- }
- return -1;
- }
-
- /**
- * Uses Java 1.4's FileLock class to test for a file lock
- *
- * @param file
- * @return
- */
- public static boolean isFileLocked(File file) {
- boolean isLocked = false;
- FileOutputStream input = null;
- FileLock lock = null;
-
- if (!file.exists()) {
- return false;
- }
- try {
- input = new FileOutputStream(file);
- FileChannel fileChannel = input.getChannel();
-
- lock = fileChannel.tryLock();
-
- if (lock == null)
- isLocked = true;
- else
- lock.release();
- } catch (Exception e) {
- if (e instanceof SecurityException)
- // Can't write to file.
- isLocked = true;
- else if (e instanceof FileNotFoundException)
- isLocked = false;
- else if (e instanceof IOException)
- isLocked = true;
- // OverlappingFileLockException means that this JVM has it locked
- // therefore it is not locked to us
- else if (e instanceof OverlappingFileLockException)
- isLocked = false;
- // Could not get a lock for some other reason.
- else
- isLocked = true;
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (Exception ex) {
- }
- }
- }
- return isLocked;
- }
-
- /**
- * Locks a file for the current JVM. Will create the file if it does not
- * exist
- *
- * @param file
- * @return a FileLock object, or null if file could not be locked
- */
- public static FileLock lockFile(File file) {
- FileOutputStream input = null;
- FileLock lock = null;
- try {
- input = new FileOutputStream(file);
- FileChannel fileChannel = input.getChannel();
- lock = fileChannel.tryLock();
-
- if (lock.isValid())
- return lock;
- } catch (Exception e) {
- // Could not get a lock for some reason.
- return null;
- } finally {
- try {
- if (input != null && (lock == null || !lock.isValid())) {
- input.close();
- }
- } catch (Exception ex) {
- }
- }
- return null;
- }
-
- /**
- * Gets all files in a specified path.
- *
- * @param path
- * absolute path of a folder
- * @param fileList
- * a list to collect the files
- * @param recursive
- * if true, find the files in sub folders as well
- */
- public static void getAllFiles(File path, List fileList,
- boolean recursive) {
- if (path.isDirectory()) {
- File[] files = path.listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- if (files[i].isFile()) {
- fileList.add(files[i]);
- } else if (recursive) {
- getAllFiles(files[i], fileList, recursive);
- }
- }
- }
- }
- }
-
- /**
- * Given a directory and extension, returns all files (recursively) whose
- * extension starts with a given extension.
- *
- * @param file
- * a directory
- * @param extension
- * a file extension
- * @return a colleciton of File with the given extension
- */
- public static List fileList(File f, String extension) {
- extension = extension.toUpperCase();
- List returnList = new ArrayList();
- try {
- if (f.isDirectory()) {
- String[] flist = f.list();
- for (int i = 0; i < flist.length; ++i) {
- File fc = new File(f.getPath(), flist[i]);
- returnList.addAll(fileList(fc, extension));
- }
- } else {
- if (extension != null) {
- String name = f.getName().toUpperCase();
- if (name.lastIndexOf(".") != -1) //$NON-NLS-1$
- if (name
- .substring(name.lastIndexOf(".") + 1).startsWith(extension)) { //$NON-NLS-1$
- returnList.add(f);
- }
- } else
- returnList.add(f);
- }
- } catch (Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- return returnList;
- }
-
- /**
- * Given a directory and extension, returns all files (recursively) whose
- * extension does not starts with a given extension.
- *
- * @param file
- * a directory
- * @param extension
- * a file extension
- * @return a colleciton of File without the given extension
- */
- public static List fileListExcludeExt(File f, String extension) {
- List returnList = new ArrayList();
- try {
- if (f.isDirectory()) {
- String[] flist = f.list();
- for (int i = 0; i < flist.length; ++i) {
- File fc = new File(f.getPath(), flist[i]);
- returnList.addAll(fileListExcludeExt(fc, extension));
- }
- } else {
- if (extension != null) {
- String name = f.getName();
- if (name.lastIndexOf(".") != -1) //$NON-NLS-1$
- if (!(name.substring(name.lastIndexOf(".") + 1).startsWith(extension))) { //$NON-NLS-1$
- returnList.add(f);
- }
- } else
- returnList.add(f);
- }
- } catch (Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- return returnList;
- }
-
- /**
- * Gets all file paths in the specified path.
- *
- * @param path,
- * absolute path of a folder
- * @param recursive
- * if true, find the files in sub folders as well
- */
- public static ArrayList getAllFileAbsolutePaths(File path,
- boolean recursive) {
- ArrayList files = new ArrayList();
- getAllFiles(path, files, recursive);
- ArrayList paths = new ArrayList();
- for (int i = 0; i < files.size(); i++) {
- String absPath = ((File) files.get(i)).getAbsolutePath();
- paths.add(absPath);
- }
- return paths;
- }
-
- /**
- * Moves a file from a directory to another.
- *
- * A null string is defined as one that has an empty reference or has zero
- * length.
- *
- * @param str
- * a string
- * @return true if the given string is a null string
- */
- public static boolean isNull(String str) {
- return str == null || str.length() == 0;
- }
-
- /**
- * Tests for blank string.
- *
- * A blank string is defined as one that has an empty reference or has zero
- * length after the leading and trailing space characters are trimmed.
- *
- * @param str
- * a string
- * @return true if the given string is a blank string
- */
- public static boolean isBlank(String str) {
- return str == null || str.trim().length() == 0;
- }
-
- /**
- * Removes the leading and trailing space characters from a string.
- *
- * @param str
- * a string
- * @return a string with no leading and trailing space characters
- */
- public static String trim(String str) {
- return str == null ? null : str.trim();
- }
-
- /**
- * Removes whitespace characters (TAB, CR, LF and SPACE) from a string.
- *
- * @param str
- * a string
- * @return a string with whitespace characters removed
- */
- public static String removeWhiteSpaceChars(String str) {
- int len = (str == null) ? 0 : str.length();
- for (int i = 0; i < len; i++) {
- switch (str.charAt(i)) {
- case '\t':
- case '\r':
- case '\n':
- case ' ':
- break;
- default:
- return str;
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Removes CR, LF from a string.
- *
- * @param str
- * a string
- * @return a string with CR, LF removed
- */
- public static String removeNewlines(String str) {
- StringBuffer sb = new StringBuffer();
- int len = (str == null) ? 0 : str.length();
- for (int i = 0; i < len; i++) {
- char c = str.charAt(i);
- switch (c) {
- case '\r':
- case '\n':
- break;
- default:
- sb.append(c);
- }
- }
- return sb.toString();
- }
-
- /**
- * Splits a string into an array of string tokens.
- *
- * @param str
- * a string
- * @param sep
- * a string containing the string separators
- * @param count
- * the desired number of string tokens
- * @return an array of string tokens
- */
- public static String[] split(String str, String sep, int count) {
- if (str == null || count == 0 || count < -1) {
- return null;
- }
-
- StringTokenizer tokenizer = new StringTokenizer(str, sep,
- count == -1 ? false : true);
-
- if (count == -1) {
- count = tokenizer.countTokens();
- }
-
- String[] result = new String[count];
- int i = 0;
- while (tokenizer.hasMoreTokens()) {
- String t = tokenizer.nextToken();
- if (i < count) {
- if ((t.length() == 1) && (sep.indexOf(t) != -1)) {
- continue;
- }
- result[i++] = t;
- } else {
- result[count - 1] += t;
- }
- }
- return result;
- }
-
- /**
- * Splits a string into an array of string tokens.
- *
- * @param str
- * a string
- * @param sep
- * a string containing the string separators
- * @return an array of string tokens
- */
- public static String[] split(String str, String sep) {
- return split(str, sep, -1);
- }
-
- /**
- * Replaces a substring within a string with another substring.
- *
- * Note: Only the first occurrence of the substring will be replaced.
- *
- * @param str
- * a string
- * @param src
- * the substring to replace
- * @param tgt
- * the substring to use for the replacement
- * @return a string with the first substring replaced
- *
- * TODO: Review implementation. Call String.replaceFirst() instead?
- */
- public static String replace(String str, String src, String tgt) {
- if ((str == null || str.length() == 0)
- || (src == null || src.length() == 0)) {
- return str;
- }
-
- String tmpStr = str;
- int index;
- while ((index = tmpStr.indexOf(src)) != -1) {
- tmpStr = tmpStr.substring(0, index) + tgt
- + tmpStr.substring(index + src.length());
- }
- return tmpStr;
- }
-
- /**
- * Returns the integer value of a string.
- *
- * @param str
- * a string
- * @param defaultValue
- * a default integer value for the string
- * @return the integer value of the given string
- */
- public static int getIntValue(String str, int defaultValue) {
- if (StrUtil.isBlank(str)) {
- return defaultValue;
- }
-
- try {
- return Integer.parseInt(str);
- } catch (NumberFormatException e) {
- return defaultValue;
- }
- }
-
- /**
- * Returns an array of bytes representing the UTF-8 encoding of a string.
- *
- * @param str
- * a string
- * @return a byte array containing the UTF-8 encoding of the given string
- */
- public static byte[] getUTF8Bytes(String str) {
- char[] c = str.toCharArray();
- int len = c.length;
- int count = 0;
- for (int i = 0; i < len; i++) {
- int ch = c[i];
- if (ch <= 0x7f) {
- count++;
- } else if (ch <= 0x7ff) {
- count += 2;
- } else {
- count += 3;
- }
- }
-
- byte[] b = new byte[count];
- int off = 0;
- for (int i = 0; i < len; i++) {
- int ch = c[i];
- if (ch <= 0x7f) {
- b[off++] = (byte) ch;
- } else if (ch <= 0x7ff) {
- b[off++] = (byte) ((ch >> 6) | 0xc0);
- b[off++] = (byte) ((ch & 0x3f) | 0x80);
- } else {
- b[off++] = (byte) ((ch >> 12) | 0xe0);
- b[off++] = (byte) (((ch >> 6) & 0x3f) | 0x80);
- b[off++] = (byte) ((ch & 0x3f) | 0x80);
- }
- }
- return b;
- }
-
- /**
- * Returns the hexidecimal character representation for an integer.
- *
- * @param value
- * an integer
- * @return the hexidecimal representation
- */
- private static char toHex(int value) {
- return HEX_DIGITS[(value & 0xF)];
- }
-
- /**
- * Returns the escaped Unicode representation of a string.
- *
- * @param str
- * a string
- * @param skipASCII
- * if true, avoid escaping the ASCII characters
- * @return the escaped Unicode representation of the given string
- */
- public static String toEscapedUnicode(String str, boolean skipASCII) {
- int len = str.length();
- StringBuffer result = new StringBuffer(len * 2);
-
- for (int i = 0; i < len; i++) {
- char ch = str.charAt(i);
-
- if (skipASCII && ch < 0x007E) {
- result.append(ch);
- } else {
- result.append("\\u"); //$NON-NLS-1$
- result.append(toHex((ch >> 12) & 0xF));
- result.append(toHex((ch >> 8) & 0xF));
- result.append(toHex((ch >> 4) & 0xF));
- result.append(toHex(ch & 0xF));
- }
- }
-
- return result.toString();
- }
-
- /**
- * Returns the escaped HTML representation of a string.
- *
- * @param html
- * a HTML string
- * @return the escaped Unicode representation of the given HTML string
- */
- public static String getEscapedHTML(String html) {
- if (html == null || html.length() == 0) {
- return ""; //$NON-NLS-1$
- }
-
- StrUtilOptions options = getOptions();
- StringBuffer result = new StringBuffer();
- int length = html.length();
- for (int i = 0; i < length; i++) {
- char ch = html.charAt(i);
- switch (ch) {
- case '%':
- if (i + 4 < length) {
- String hexStr = html.substring(i + 1, i + 5);
- boolean validHextStr = true;
-
- for (int j = 0; j < hexStr.length(); j++) {
- char c = hexStr.charAt(j);
- if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))) {
- validHextStr = false;
- break;
- }
- }
-
- if (options == null) {
- //code below will treat "%20de" as " de"
- //this may lose some double bytes character(e.g. Chinese), which start with %20, but keep all url links
- //so far open this convertion not only during library migration to support file like "my design.gif"
- if (/*during_migration && */validHextStr) {
- if (hexStr.startsWith("20")) { //$NON-NLS-1$
- result.append("%20"); //$NON-NLS-1$
- i += 2;
- break;
- }
- }
- } else {
- int ix = options.getRteUrlDecodingOption();
- if (ix == 1) {
- validHextStr = false;
- } else if (ix == 2) {
- String key = getHexStr("%" + hexStr);
- if (key != null && options.getRteUrlDecodingHexMap().containsKey(key)) {
- validHextStr = false;
- }
- }
- }
-
- if (validHextStr) {
- try {
- int codePoint = Integer.parseInt(hexStr, 16);
- char[] c = UCharacter.toChars(codePoint);
- result.append(c);
- i += 4;
- break;
- } catch (NumberFormatException e) {
- // wasn't a valid hex string..
- // fall through to the result.append(ch)
- } catch (Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- }
- }
- result.append(ch);
- break;
- case '\u00a9':
- result.append(HTML_COPY);
- break;
- case '\u00ae':
- result.append(HTML_REG);
- break;
- case '\u20ac':
- result.append(HTML_EURO);
- break;
- case '\u2122':
- result.append(HTML_TRADEMARK);
- break;
- default:
- result.append(ch);
- break;
- }
- }
- return result.toString();
- }
-
- /**
- * Returns the plain text from HTML text.
- *
- * Note: All HTML tags will be stripped.
- *
- * @param html
- * the HTML text.
- * @return the plain text representation of the given HTML text
- */
- public static String getPlainText(String html) {
- if (html == null) {
- return ""; //$NON-NLS-1$
- }
-
- final Pattern p_plaintext_filter = Pattern.compile(
- "<[^>]*?>", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
- final Pattern p_plaintext_filter2 = Pattern.compile(
- "&.{1,5}[^;];", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
- final Pattern p_plaintext_filter3 = Pattern.compile(
- "\\s+", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
-
- String result = html.replaceAll(p_plaintext_filter.pattern(), " ") //$NON-NLS-1$
- .replaceAll(p_plaintext_filter2.pattern(), " ") //$NON-NLS-1$
- .replaceAll(p_plaintext_filter3.pattern(), " "); //$NON-NLS-1$
- return result;
- }
-
- /**
- * Converts a string into a valid file name.
- *
- * @param str
- * a string
- * @return a valid file name derived from the given string
- */
- public static String makeValidFileName(String str) {
- if (str == null) {
- return ""; //$NON-NLS-1$
- }
- return getPlainText(str)
- .replaceAll(REGEXP_INVALID_FILENAME_CHARS, " ").trim(); //$NON-NLS-1$
- }
-
- public static String removeSpecialCharacters(String str) {
- if (str == null) {
- return ""; //$NON-NLS-1$
- }
- return getPlainText(str)
- .replaceAll(REGEXP_ANY_SPECIAL_CHARS, " ").trim(); //$NON-NLS-1$
- }
-
- /**
- * Returns true if the path does not contain any invalid filename
- * characters.
- *
- * @param path
- * the file path
- * @return true if the given path contains only valid
- * filename characters
- */
- public static boolean isValidPublishPath(String path) {
- // return path.replaceAll(invalidPublishPathCharsRegExp,
- // "").equals(path);
-
- if (Platform.getOS().equals(Platform.WS_WIN32)) {
- return path
- .replaceAll(REGEXP_INVALID_PUBLISHED_PATH_CHARS, "").equals(path); //$NON-NLS-1$
- }
-
- // else default to Linux
- return path
- .replaceAll(REGEXP_INVALID_PUBLISHED_PATH_CHARS_LINUX, "").equals(path); //$NON-NLS-1$
- }
-
- /**
- * Returns the lower-case of str unless the current locale is German
- *
- * @param str
- * @return
- */
- public static String toLower(String str) {
- if (Platform.getNL().startsWith("de")) { //$NON-NLS-1$
- return str;
- }
- return str.toLowerCase();
- }
-
- /**
- * escape the " and '
- *
- * @param str
- * @return
- */
- public static String escape(String str) {
- return str.replaceAll("'", "\\\\\'").replaceAll("\"", "\\\\\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- /**
- * Converts a List to an String array.
- *
- * @param list
- * a List
- * @return a String array
- */
- public static String[] convertListToStrArray(List list) {
- if (list != null) {
- int cnt = list.size();
- String[] strArray = new String[cnt];
-
- for (int i = 0; i < cnt; i++) {
- String str = (String) list.get(i);
- strArray[i] = new String(str);
- }
- return strArray;
- } else {
- return null;
- }
- }
-
- public static boolean isValidName(String name) {
- return name.replaceAll(REGEXP_ANY_SPECIAL_CHARS, "").equals(name); //$NON-NLS-1$
- }
-
- /**
- * added some test code
- *
- * @param args
- */
- public static void main(String[] args) {
-
- String text = "A&% ` $~!@#$%^&*()_-+={}[\"]:|\\:;\"'<,>.?/ \t\r\nZ"; //$NON-NLS-1$
-
- System.out.println("[" + text + "] <== text"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println("[" + text.replaceAll(REGEXP_ANY_SPECIAL_CHARS, " ") //$NON-NLS-1$ //$NON-NLS-2$
- + "] <== All"); //$NON-NLS-1$
- System.out.println("[" //$NON-NLS-1$
- + text.replaceAll(REGEXP_INVALID_FILENAME_CHARS, " ") //$NON-NLS-1$
- + "] <== File Name"); //$NON-NLS-1$
- System.out.println("[" //$NON-NLS-1$
- + text.replaceAll(REGEXP_INVALID_PUBLISHED_PATH_CHARS, " ") //$NON-NLS-1$
- + "] <== path"); //$NON-NLS-1$
- System.out.println("[" //$NON-NLS-1$
- + text.replaceAll(REGEXP_INVALID_PUBLISHED_PATH_CHARS_LINUX,
- " ") + "] <== path, Linux"); //$NON-NLS-1$ //$NON-NLS-2$
-
- System.out.println(""); //$NON-NLS-1$
- }
-
- /**
- * Converts the platform line-separator (\n or \n\r or \r) to <br/>
- *
- * @param text
- * @return
- */
- public static String convertNewlinesToHTML(String text) {
- if (text != null) {
- text = text.replaceAll(LINE_FEED_REGEX, HTML_BREAK + LINE_FEED);
- text = text.replaceAll(ESCAPED_LINE_FEED_REGEX, HTML_BREAK
- + ESCAPED_LINE_FEED);
- }
- return text;
- }
-
- public static URI toURI(String pathStr) {
- if (pathStr != null && pathStr.length() > 0) {
- IPath path = Path.fromOSString(pathStr);
- try {
- return path.toFile().toURI();
- } catch (Exception e) {
- CommonPlugin.getDefault().getLogger().logError(e);
- }
- }
- return null;
- }
-
- public static String escapeChar(String text, char c) {
- int i=text.indexOf(c);
- if ( i < 0 ) {
- return text;
- }
-
- int start = 0;
- StringBuffer buffer = new StringBuffer();
- while ( i > start ) {
- buffer.append(text.substring(start, i)).append("\\"); //$NON-NLS-1$
- start = i;
- i=text.indexOf(c, start+1);
- }
-
- buffer.append(text.substring(start));
-
- return buffer.toString();
- }
-
- public static String getHexStr(String str) {
- if (str.length() < 3) {
- return null;
- }
- if (str.charAt(0) != '%') {
- return null;
- }
- StringBuffer b = new StringBuffer();
- b.append('%');
- for (int i = 1 ; i <= 2; i++) {
- char c = str.charAt(i);
- if (c >= 'a' && c <= 'z') {
- c -= 'a';
- c += 'A';
- }
- boolean valid = (c >= '0' && c <= '9') ||
- (c >= 'A' && c <= 'F');
- if (!valid) {
- return null;
- }
- b.append(c);
- }
-
- return b.toString();
- }
-
- public interface StrUtilOptions {
- int getRteUrlDecodingOption();
- Map getRteUrlDecodingHexMap();
- }
-
- public static StrUtilOptions getOptions() {
- return options;
- }
-
- public static void setOptions(StrUtilOptions options) {
- StrUtil.options = options;
- }
-
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/StringMatcher.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/StringMatcher.java
deleted file mode 100644
index 4a0b4b443aa..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/StringMatcher.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.epf.common.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-/**
- * A string pattern matcher. Supports '*' and '?' wildcards.
- */
-public class StringMatcher {
- protected String fPattern;
- protected int fLength; // pattern length
- protected boolean fIgnoreWildCards;
- protected boolean fIgnoreCase;
- protected boolean fHasLeadingStar;
- protected boolean fHasTrailingStar;
- protected String fSegments[]; //the given pattern is split into * separated segments
-
- /* boundary value beyond which we don't need to search in the text */
- protected int fBound= 0;
-
-
- protected static final char fSingleWildCard= '\u0000';
-
- public static class Position {
- int start; //inclusive
- int end; //exclusive
- public Position(int start, int end) {
- this.start= start;
- this.end= end;
- }
- public int getStart() {
- return start;
- }
- public int getEnd() {
- return end;
- }
- }
- /**
- * StringMatcher constructor takes in a String object that is a simple
- * pattern. The pattern may contain '*' for 0 and many characters and
- * '?' for exactly one character.
- *
- * Literal '*' and '?' characters must be escaped in the pattern
- * e.g., "\*" means literal "*", etc.
- *
- * Escaping any other character (including the escape character itself),
- * just results in that character in the pattern.
- * e.g., "\a" means "a" and "\\" means "\"
- *
- * If invoking the StringMatcher with string literals in Java, don't forget
- * escape characters are represented by "\\".
- *
- * @param pattern the pattern to match text against
- * @param ignoreCase if true, case is ignored
- * @param ignoreWildCards if true, wild cards and their escape sequences are ignored
- * (everything is taken literally).
- */
- public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) {
- if (pattern == null)
- throw new IllegalArgumentException();
- fIgnoreCase= ignoreCase;
- fIgnoreWildCards= ignoreWildCards;
- fPattern= pattern;
- fLength= pattern.length();
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
- /**
- * Find the first occurrence of the pattern between startend(exclusive).
- * @param text the String object to search in
- * @param start the starting index of the search range, inclusive
- * @param end the ending index of the search range, exclusive
- * @return an StringMatcher.Position object that keeps the starting
- * (inclusive) and ending positions (exclusive) of the first occurrence of the
- * pattern in the specified range of the text; return null if not found or subtext
- * is empty (start==end). A pair of zeros is returned if pattern is empty string
- * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
- * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
- */
- public StringMatcher.Position find(String text, int start, int end) {
- if (text == null)
- throw new IllegalArgumentException();
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
- if (end < 0 ||start >= end )
- return null;
- if (fLength == 0)
- return new Position(start, start);
- if (fIgnoreWildCards) {
- int x= posIn(text, start, end);
- if (x < 0)
- return null;
- return new Position(x, x+fLength);
- }
-
- int segCount= fSegments.length;
- if (segCount == 0)//pattern contains only '*'(s)
- return new Position (start, end);
-
- int curPos= start;
- int matchStart= -1;
- int i;
- for (i= 0; i < segCount && curPos < end; ++i) {
- String current= fSegments[i];
- int nextMatch= regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0 )
- return null;
- if(i == 0)
- matchStart= nextMatch;
- curPos= nextMatch + current.length();
- }
- if (i < segCount)
- return null;
- return new Position(matchStart, curPos);
- }
- /**
- * match the given text with the pattern
- * @return true if matched eitherwise false
- * @param text a String object
- */
- public boolean match(String text) {
- return match(text, 0, text.length());
- }
- /**
- * Given the starting (inclusive) and the ending (exclusive) positions in the
- * text, determine if the given substring matches with aPattern
- * @return true if the specified portion of the text matches the pattern
- * @param text a String object that contains the substring to match
- * @param start marks the starting position (inclusive) of the substring
- * @param end marks the ending index (exclusive) of the substring
- */
- public boolean match(String text, int start, int end) {
- if (null == text)
- throw new IllegalArgumentException();
-
- if (start > end)
- return false;
-
- if (fIgnoreWildCards)
- return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength);
- int segCount= fSegments.length;
- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s)
- return true;
- if (start == end)
- return fLength == 0;
- if (fLength == 0)
- return start == end;
-
- int tlen= text.length();
- if (start < 0)
- start= 0;
- if (end > tlen)
- end= tlen;
-
- int tCurPos= start;
- int bound= end - fBound;
- if ( bound < 0)
- return false;
- int i=0;
- String current= fSegments[i];
- int segLength= current.length();
-
- /* process first segment */
- if (!fHasLeadingStar){
- if(!regExpRegionMatches(text, start, current, 0, segLength)) {
- return false;
- } else {
- ++i;
- tCurPos= tCurPos + segLength;
- }
- }
- if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) {
- // only one segment to match, no wildcards specified
- return tCurPos == end;
- }
- /* process middle segments */
- while (i < segCount) {
- current= fSegments[i];
- int currentMatch;
- int k= current.indexOf(fSingleWildCard);
- if (k < 0) {
- currentMatch= textPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- } else {
- currentMatch= regExpPosIn(text, tCurPos, end, current);
- if (currentMatch < 0)
- return false;
- }
- tCurPos= currentMatch + current.length();
- i++;
- }
-
- /* process final segment */
- if (!fHasTrailingStar && tCurPos != end) {
- int clen= current.length();
- return regExpRegionMatches(text, end - clen, current, 0, clen);
- }
- return i == segCount ;
- }
-
- /**
- * This method parses the given pattern into segments seperated by wildcard '*' characters.
- * Since wildcards are not being used in this case, the pattern consists of a single segment.
- */
- private void parseNoWildCards() {
- fSegments= new String[1];
- fSegments[0]= fPattern;
- fBound= fLength;
- }
- /**
- * Parses the given pattern into segments seperated by wildcard '*' characters.
- */
- private void parseWildCards() {
- if(fPattern.startsWith("*"))//$NON-NLS-1$
- fHasLeadingStar= true;
- if(fPattern.endsWith("*")) {//$NON-NLS-1$
- /* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar= true;
- }
- }
-
- Vector temp= new Vector();
-
- int pos= 0;
- StringBuffer buf= new StringBuffer();
- while (pos < fLength) {
- char c= fPattern.charAt(pos++);
- switch (c) {
- case '\\':
- if (pos >= fLength) {
- buf.append(c);
- } else {
- char next= fPattern.charAt(pos++);
- /* if it's an escape sequence */
- if (next == '*' || next == '?' || next == '\\') {
- buf.append(next);
- } else {
- /* not an escape sequence, just insert literally */
- buf.append(c);
- buf.append(next);
- }
- }
- break;
- case '*':
- if (buf.length() > 0) {
- /* new segment */
- temp.addElement(buf.toString());
- fBound += buf.length();
- buf.setLength(0);
- }
- break;
- case '?':
- /* append special character representing single match wildcard */
- buf.append(fSingleWildCard);
- break;
- default:
- buf.append(c);
- }
- }
-
- /* add last buffer to segment list */
- if (buf.length() > 0) {
- temp.addElement(buf.toString());
- fBound += buf.length();
- }
-
- fSegments= new String[temp.size()];
- temp.copyInto(fSegments);
- }
- /**
- * @param text a string which contains no wildcard
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int posIn(String text, int start, int end) {//no wild card in pattern
- int max= end - fLength;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(fPattern, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength))
- return i;
- }
-
- return -1;
- }
- /**
- * @param text a simple regular expression that may only contain '?'(s)
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a simple regular expression that may contains '?'
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int regExpPosIn(String text, int start, int end, String p) {
- int plen= p.length();
-
- int max= end - plen;
- for (int i= start; i <= max; ++i) {
- if (regExpRegionMatches(text, i, p, 0, plen))
- return i;
- }
- return -1;
- }
-
-
- protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) {
- while (plen-- > 0) {
- char tchar= text.charAt(tStart++);
- char pchar= p.charAt(pStart++);
-
- /* process wild cards */
- if (!fIgnoreWildCards) {
- /* skip single wild cards */
- if (pchar == fSingleWildCard) {
- continue;
- }
- }
- if (pchar == tchar)
- continue;
- if (fIgnoreCase) {
- if (Character.toUpperCase(tchar) == Character.toUpperCase(pchar))
- continue;
- // comparing after converting to upper case doesn't handle all cases;
- // also compare after converting to lower case
- if (Character.toLowerCase(tchar) == Character.toLowerCase(pchar))
- continue;
- }
- return false;
- }
- return true;
- }
- /**
- * @param text the string to match
- * @param start the starting index in the text for search, inclusive
- * @param end the stopping point of search, exclusive
- * @param p a string that has no wildcard
- * @return the starting index in the text of the pattern , or -1 if not found
- */
- protected int textPosIn(String text, int start, int end, String p) {
-
- int plen= p.length();
- int max= end - plen;
-
- if (!fIgnoreCase) {
- int i= text.indexOf(p, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i= start; i <= max; ++i) {
- if (text.regionMatches(true, i, p, 0, plen))
- return i;
- }
-
- return -1;
- }
-
- public static String[] convertFromString(String patterns, String separator) {
- StringTokenizer tokenizer= new StringTokenizer(patterns, separator, true);
- int tokenCount= tokenizer.countTokens();
- List result= new ArrayList(tokenCount);
- boolean escape= false;
- boolean append= false;
- while (tokenizer.hasMoreTokens()) {
- String token= tokenizer.nextToken().trim();
- if (separator.equals(token)) {
- if (!escape)
- escape= true;
- else {
- addPattern(result, separator);
- append= true;
- }
- } else {
- if (!append)
- result.add(token);
- else
- addPattern(result, token);
- append= false;
- escape= false;
- }
- }
- return (String[])result.toArray(new String[result.size()]);
- }
-
- private static void addPattern(List list, String pattern) {
- if (list.isEmpty())
- list.add(pattern);
- else {
- int index= list.size() - 1;
- list.set(index, ((String)list.get(index)) + pattern);
- }
- }
-
- public static String convertToString(String[] patterns, String separator) {
- int length= patterns.length;
- StringBuffer strBuf= new StringBuffer();
- if (length > 0)
- strBuf.append(escapeSeparator(patterns[0], separator));
- else
- return ""; //$NON-NLS-1$
- int i= 1;
- while (i < length) {
- strBuf.append(separator);
- strBuf.append(" "); //$NON-NLS-1$
- strBuf.append(escapeSeparator(patterns[i++], separator));
- }
- return strBuf.toString();
- }
-
- private static String escapeSeparator(String pattern, String separator) {
- int length= pattern.length();
- StringBuffer buf= new StringBuffer(length);
- for (int i= 0; i < length; i++) {
- char ch= pattern.charAt(i);
- if (separator.equals(String.valueOf(ch)))
- buf.append(ch);
- buf.append(ch);
- }
- return buf.toString();
-
- }
-
- public static String[] convertFromString(String patterns) {
- return convertFromString(patterns, SEPARATOR);
- }
-
- private static final String SEPARATOR= ","; //$NON-NLS-1$
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ThreadUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ThreadUtil.java
deleted file mode 100644
index 4faf4ee29d7..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ThreadUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.utils;
-
-/**
- * Utility class for handling threads.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class ThreadUtil {
-
- /**
- * Private constructor to prevent this class from being instantiated. All
- * methods in this class should be static.
- */
- private ThreadUtil() {
- }
-
- /**
- * Puts the current thread to sleep for a given duration.
- *
- * @param time
- * The duration in milliseconds.
- */
- public static void pause(long time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException e) {
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/Timer.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/Timer.java
deleted file mode 100644
index c0dc6361254..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/Timer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.utils;
-import com.ibm.icu.util.Calendar;
-
-/**
- * A simple timer for tracking time.
- *
- * @author Jinhua Xi
- * @since 1.0
- */
-public class Timer {
-
- private long initTime;
-
- private long startTime;
-
- private long endTime;
-
- public Timer() {
- start();
- initTime = startTime;
- }
-
- public void start() {
- startTime = Calendar.getInstance().getTimeInMillis();
- }
-
- public void stop() {
- endTime = Calendar.getInstance().getTimeInMillis();
- }
-
- public int getTime() {
- return (int) (endTime - startTime);
- }
-
- public int getTotalTime() {
- return (int) (endTime - initTime);
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/WarUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/WarUtil.java
deleted file mode 100644
index ccd8a0a2c20..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/WarUtil.java
+++ /dev/null
@@ -1,57 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.utils;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.War;
-import org.apache.tools.ant.types.FileSet;
-
-
-public class WarUtil {
-
- /**
- * Creates a war file.
- *
- * @param outputWarFile
- * an absolute path to the target war file
- * @param webAppDirectory
- * an absolute path to a directory containing the files and sub
- * directories to be wared
- * @param monitor
- * a progress monitor
- * @throws IOException
- * if an error occurs while creating the zip file
- */
- public static void buildWarFile(String outputWarFile, String webAppDirectory,
- IProgressMonitor monitor) throws IOException {
-
- try {
- Project antProject = new Project();
- antProject.init();
- War warTask = new War();
- warTask.setProject(antProject);
- warTask.setDestFile(new File(outputWarFile));
- warTask.setWebxml(new File(webAppDirectory + File.separator + "WEB-INF" //$NON-NLS-1$
- + File.separator + "web.xml")); //$NON-NLS-1$
- FileSet webFiles = new FileSet();
- webFiles.setDir(new File(webAppDirectory));
- warTask.addFileset(webFiles);
- warTask.execute();
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- }
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/XMLUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/XMLUtil.java
deleted file mode 100644
index 100ed59ca33..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/XMLUtil.java
+++ /dev/null
@@ -1,666 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.utils;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXParseException;
-
-/**
- * Utility class for processing XML documents.
- *
- * @author Kelvin Low
- * @author Jinhua Xi
- * @author Phong Nguyen Le
- * @since 1.0
- */
-public class XMLUtil {
-
- /**
- * XML declaration.
- */
- public final static String XML_DECLARATION = ""; //$NON-NLS-1$
-
- /**
- * XML Escape characters.
- */
- public final static String XML_AMP = "&"; //$NON-NLS-1$
-
- public final static String XML_BACKSLASH = "\"; //$NON-NLS-1$
-
- public final static String XML_APOS = "'"; //$NON-NLS-1$
-
- public final static String XML_CR = "
"; //$NON-NLS-1$
-
- public final static String XML_GT = ">"; //$NON-NLS-1$
-
- public final static String XML_LT = "<"; //$NON-NLS-1$
-
- public final static String XML_LF = "
"; //$NON-NLS-1$
-
- public final static String XML_QUOT = """; //$NON-NLS-1$
-
- public final static String XML_TAB = " "; //$NON-NLS-1$
-
- private static final String CRLF = "\r\n"; //$NON-NLS-1$
-
- private static final byte[] CRLF_BYTES = CRLF.getBytes();
-
- /**
- * Private constructor to prevent this class from being instantiated. All
- * methods in this class should be static.
- */
- private XMLUtil() {
- }
-
- /**
- * Clones the given DOM node into the given DOM document.
- *
- * @param node
- * The DOM node to clone.
- * @param doc
- * The target DOM document.
- * @return The cloned node in the target DOM document.
- */
- public static Node cloneNode(Node node, Document doc) {
- Node clone = null;
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE:
- clone = doc.createElement(node.getNodeName());
- NamedNodeMap attrs = node.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Node attrNode = attrs.item(i);
- Attr attrClone = doc.createAttribute(attrNode.getNodeName());
- attrClone.setNodeValue(attrNode.getNodeValue());
- ((Element) clone).setAttributeNode(attrClone);
- }
-
- // Iterate through each child nodes.
- NodeList childNodes = node.getChildNodes();
- if (childNodes != null) {
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node childNode = childNodes.item(i);
- Node childClone = cloneNode(childNode, doc);
- clone.appendChild(childClone);
- }
- }
- break;
-
- case Node.TEXT_NODE:
- case Node.CDATA_SECTION_NODE:
- clone = doc.createTextNode(node.getNodeName());
- clone.setNodeValue(node.getNodeValue());
- break;
- }
- return clone;
- }
-
- /**
- * Escapes a XML attribute to make it XML parser friendly.
- *
- * @param str
- * The XML attribute string.
- * @return The escaped string.
- */
- public static String escapeAttr(String str) {
- if (str == null || str.length() == 0)
- return ""; //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- int len = str.length();
- for (int i = 0; i < len; i++) {
- char ch = str.charAt(i);
- switch (ch) {
- case '<':
- sb.append(XML_LT);
- break;
- case '&':
- sb.append(XML_AMP);
- break;
- case '"':
- sb.append(XML_QUOT);
- break;
- default:
- sb.append(ch);
- break;
- }
- }
- return sb.toString();
- }
-
- /**
- * Escapes the given string to make it XML parser friendly.
- *
- * @param str
- * The source string.
- * @return The escaped string.
- */
- public static String escape(String str) {
- if (str == null || str.length() == 0)
- return ""; //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- int len = str.length();
- for (int i = 0; i < len; i++) {
- char ch = str.charAt(i);
- switch (ch) {
- case '<':
- sb.append(XML_LT);
- break;
- case '>':
- sb.append(XML_GT);
- break;
- case '&':
- sb.append(XML_AMP);
- break;
- case '"':
- sb.append(XML_QUOT);
- break;
- case '\'':
- sb.append(XML_APOS);
- break;
- case '\r':
- sb.append(XML_CR);
- break;
- case '\n':
- sb.append(XML_LF);
- break;
- case '\\':
- sb.append(XML_BACKSLASH);
- break;
- default:
- sb.append(ch);
- break;
- }
- }
- return sb.toString();
- }
-
- /**
- * Escapes the given string to make it XML parser friendly.
- *
- * @param str
- * The source string.
- * @param ignoreCRLF
- * If true, do not escape the CR and LF characters.
- * @return The escaped string.
- */
- public static String escape(String str, boolean ignoreCRLF) {
- if (str == null || str.length() == 0)
- return ""; //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- int len = str.length();
- for (int i = 0; i < len; i++) {
- char ch = str.charAt(i);
- switch (ch) {
- case '<':
- sb.append(XML_LT);
- break;
- case '>':
- sb.append(XML_GT);
- break;
- case '&':
- // This is to avoid the double escaping (see Bugzilla 179921)
- if (!str.startsWith(XML_LT+"p/", i) && !str.startsWith(XML_APOS, i) //$NON-NLS-1$
- && !str.startsWith(XML_AMP, i))
- sb.append(XML_AMP);
- else
- sb.append(ch);
- break;
- case '"':
- sb.append(XML_QUOT);
- break;
- case '\'':
- sb.append(XML_APOS);
- break;
- case '\r':
- if (ignoreCRLF)
- sb.append(ch);
- else
- sb.append(XML_CR);
- break;
- case '\n':
- if (ignoreCRLF)
- sb.append(ch);
- else
- sb.append(XML_LF);
- break;
- default:
- sb.append(ch);
- break;
- }
- }
- return sb.toString();
- }
-
- /**
- * Unescapes the given XML string.
- *
- * @param str
- * The source string.
- * @return The escaped string.
- */
- public static String unescape(String str) {
- if (str == null || str.length() == 0)
- return ""; //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- int len = str.length();
- for (int i = 0; i < len; i++) {
- char ch = str.charAt(i);
- switch (ch) {
- case '&':
- if (str.startsWith(XML_LT, i)) {
- sb.append('<');
- i += 3;
- } else if (str.startsWith(XML_GT, i)) {
- sb.append('>');
- i += 3;
- } else if (str.startsWith(XML_AMP, i)) {
- sb.append('&');
- i += 4;
- } else if (str.startsWith(XML_QUOT, i)) {
- sb.append('"');
- i += 5;
- } else if (str.startsWith(XML_APOS, i)) {
- sb.append("\'"); //$NON-NLS-1$
- i += 5;
- } else if (str.startsWith(XML_CR, i)) {
- sb.append('\r');
- i += 4;
- } else if (str.startsWith(XML_LF, i)) {
- sb.append('\n');
- i += 4;
- } else {
- sb.append(ch);
- }
- break;
- default:
- sb.append(ch);
- break;
- }
- }
- return sb.toString();
- }
-
- /**
- * Writes the content of the given DOM document to the output stream.
- *
- * @param xmlDoc
- * The DOM document.
- * @param output
- * The output stream.
- * @throws IOException
- * if an I/O error occur while accessing the output stream.
- */
- public static void writeDocument(Document xmlDoc, OutputStream output)
- throws IOException {
- DataOutputStream out = new DataOutputStream(output);
- writeNode(xmlDoc, "", out); //$NON-NLS-1$
- out.flush();
- }
-
- /**
- * Writes the content of the given DOM document to the PrintWriter.
- *
- * @param xmlDoc
- * The DOM document.
- * @param pw
- * The PrintWriter object.
- * @throws IOException
- * if an I/O error occur while accessing the output stream.
- */
- public static void writeDocument(Document xmlDoc, PrintWriter pw)
- throws IOException {
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- DataOutputStream out = new DataOutputStream(os);
- writeNode(xmlDoc, "", out); //$NON-NLS-1$
- out.flush();
- // FIXME! Need to specify encoding?
- String s = os.toString();
- pw.write(s);
- pw.flush();
- }
-
- /**
- * Saves the content of the given DOM document to file.
- *
- * @param xmlDoc
- * The DOM document.
- * @param xmlFile
- * The XML file.
- * @throws IOException
- * if an I/O error occur while accessing the output stream.
- */
- public static void saveDocument(Document xmlDoc, String xmlFile)
- throws IOException {
- DataOutputStream out = new DataOutputStream(new FileOutputStream(
- xmlFile));
- writeNode(xmlDoc, "", out); //$NON-NLS-1$
- out.flush();
- out.close();
- }
-
- /**
- * Saves the given XML string to the given file.
- *
- * @param xmlStr
- * The XML string.
- * @param xmlFile
- * The XML file.
- * @throws IOException
- * if an I/O error occur while accessing the output stream.
- */
- public static void saveDocument(String xmlStr, String xmlFile)
- throws IOException {
- DataOutputStream out = new DataOutputStream(new FileOutputStream(
- xmlFile));
- out.write(xmlStr.getBytes());
- out.flush();
- out.close();
- }
-
- /**
- * Writes the given DOM tree node to the given output stream.
- *
- * @param node
- * The DOM node.
- * @param indent
- * The string indentation (containing space characters).
- * @param out
- * The output stream.
- * @throws IOException
- * if an I/O error occur while accessing the output stream.
- */
- private static void writeNode(Node node, String indent, DataOutputStream out)
- throws IOException {
- String text;
-
- switch (node.getNodeType()) {
- case Node.DOCUMENT_NODE:
- // Write the XML file signature.
- out.write(StrUtil.getUTF8Bytes(XML_DECLARATION));
- out.write(CRLF_BYTES);
-
- // Iterate through each child nodes.
- NodeList nodes = node.getChildNodes();
- if (nodes != null) {
- for (int i = 0; i < nodes.getLength(); i++) {
- writeNode(nodes.item(i), "", out); //$NON-NLS-1$
- }
- }
- break;
-
- case Node.ELEMENT_NODE:
- String name = node.getNodeName();
- out.write(StrUtil.getUTF8Bytes(indent + "<" + name)); //$NON-NLS-1$
- NamedNodeMap attrs = node.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Node attrNode = attrs.item(i);
- out.write(StrUtil.getUTF8Bytes(" " + attrNode.getNodeName() //$NON-NLS-1$
- + "=\"" + escape(attrNode.getNodeValue()) + "\"")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- out.write(StrUtil.getUTF8Bytes(">")); //$NON-NLS-1$
- out.write(CRLF_BYTES);
-
- // Iterate through each child nodes.
- NodeList childNodes = node.getChildNodes();
- if (childNodes != null) {
- for (int i = 0; i < childNodes.getLength(); i++) {
- writeNode(childNodes.item(i), indent, out);
- }
- }
- out.write(StrUtil.getUTF8Bytes(indent + "" + name + ">")); //$NON-NLS-1$ //$NON-NLS-2$
- out.write(CRLF_BYTES);
-
- break;
-
- case Node.TEXT_NODE:
- text = StrUtil.removeWhiteSpaceChars(node.getNodeValue());
- if (text.length() > 0) {
- out.write(StrUtil.getUTF8Bytes(escape(text)));
- }
- break;
-
- case Node.CDATA_SECTION_NODE:
- text = StrUtil.removeWhiteSpaceChars(node.getNodeValue());
- if (text.length() > 0) {
- out.write(StrUtil.getUTF8Bytes("")); //$NON-NLS-1$
- out.write(CRLF_BYTES);
- }
- break;
-
- case Node.PROCESSING_INSTRUCTION_NODE:
- out.write(StrUtil.getUTF8Bytes("" + node.getNodeName() //$NON-NLS-1$
- + " " + node.getNodeValue() + "?>")); //$NON-NLS-1$ //$NON-NLS-2$
- out.write(CRLF_BYTES);
- break;
-
- case Node.ENTITY_REFERENCE_NODE:
- out.write(StrUtil.getUTF8Bytes("&" + node.getNodeName() + ";")); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- }
- }
-
- /**
- * Returns the file location where the given SAX exception occurred.
- *
- * @param e
- * The SAX parse exception.
- * @return A string containing the file location where the exception
- * occurred.
- */
- public static String getLocationOfException(SAXParseException e) {
- StringBuffer sb = new StringBuffer();
- sb.append("row "); //$NON-NLS-1$
- sb.append(e.getLineNumber());
- sb.append(", col "); //$NON-NLS-1$
- sb.append(e.getColumnNumber());
-
- String systemId = e.getSystemId();
- if (systemId != null) {
- int index = systemId.lastIndexOf('/');
- if (index != -1) {
- systemId = systemId.substring(index + 1);
- }
- sb.append(" of XML document "); //$NON-NLS-1$
- sb.append(systemId);
- }
-
- return sb.toString();
- }
-
- public static Document loadXml(File file) throws Exception {
- DocumentBuilderFactory builderFactory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder = builderFactory.newDocumentBuilder();
-
- return builder.parse(file);
- }
-
- public static Document createDocument() throws Exception {
- DocumentBuilderFactory builderFactory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder = builderFactory.newDocumentBuilder();
- return builder.newDocument();
- }
-
- /**
- * text of a leaf node, without child element
- *
- * @param tag
- * @return String
- */
- public static String getNodeText(Element tag) {
- String text = tag.toString();
- int i = text.indexOf(">"); //$NON-NLS-1$
- int j = text.lastIndexOf(""); //$NON-NLS-1$
- if (i < 0 || j < 0 || j < i) {
- return ""; //$NON-NLS-1$
- }
-
- return text.substring(i + 1, j);
- }
-
- public static String getChildText(Element tag, String childTagName) {
- Element child = getFirstChild(tag, childTagName);
- if (child != null) {
- return getNodeText(child);
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public static Element getFirstChild(Element tag, String childTagName) {
- NodeList nodes = tag.getElementsByTagName(childTagName);
- if (nodes == null || nodes.getLength() == 0) {
- return null;
- }
-
- return (Element) nodes.item(0);
- }
-
- /**
- * iterator of all the children of the element
- *
- * @param tag
- * @return Iterator
- */
- public static Iterator childIterator(Element tag) {
- NodeList nodes = tag.getChildNodes();
-
- // NodeList contains no Element nodes such as text nodes, ignore those
- List elements = new ArrayList();
- if (nodes != null) {
- int size = nodes.getLength();
- for (int i = 0; i < size; i++) {
- Node node = nodes.item(i);
- if (node instanceof Element) {
- elements.add(node);
- }
- }
- }
-
- return elements.iterator();
- }
-
- private static class NodeIterator implements Iterator {
- int currentIndex = -1;
-
- int size = 0;
-
- NodeList nodes = null;
-
- public NodeIterator(NodeList nodes) {
- this.nodes = nodes;
- if (nodes != null)
- size = nodes.getLength();
- }
-
- public void remove() {
- // Do nothing, this is a readonly iterator.
- }
-
- public boolean hasNext() {
- return currentIndex + 1 < size;
- }
-
- public Object next() {
- if (hasNext()) {
- return nodes.item(++currentIndex);
- }
-
- return null;
- }
- }
-
- /**
- * iterator of all the children of the element
- *
- * @param tag
- * @return Iterator
- */
- public static Iterator childIterator(Element tag, String childTagName) {
- NodeList nodes = tag.getElementsByTagName(childTagName);
- return new NodeIterator(nodes);
- }
-
- /**
- * Gets the list of immediate child elements with the given tag name.
- *
- * @param element
- * @param tagName
- * @return list of {@link Element} objects
- */
- public static List getChildElementsByTagName(Element element, String tagName) {
- List elements = new ArrayList();
- NodeList list = element.getChildNodes();
- int size = list.getLength();
- if(size > 0) {
- for (int i = 0; i < size; i++) {
- Node node = list.item(i);
- if(node instanceof Element) {
- Element e = (Element) node;
- if(e.getTagName().equals(tagName)) {
- elements.add(e);
- }
- }
- }
- }
- return elements;
- }
-
- /**
- * Gets the first element with the given tag name in the immediate child elements.
- *
- * @param element
- * @param tagName
- * @return
- */
- public static Element getFirstChildElementByTagName(Node element, String tagName) {
- NodeList list = element.getChildNodes();
- int size = list.getLength();
- if(size > 0) {
- for (int i = 0; i < size; i++) {
- Node node = list.item(i);
- if(node instanceof Element) {
- Element e = (Element) node;
- if(e.getTagName().equals(tagName)) {
- return e;
- }
- }
- }
- }
- return null;
- }
-
- public static String removeBOM(String xml) {
- return xml.trim().replaceFirst("^([\\W]+)<", "<"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ZipUtil.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ZipUtil.java
deleted file mode 100644
index 5396843191e..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/ZipUtil.java
+++ /dev/null
@@ -1,106 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * Utility class for reading and writing zip files.
- *
- * @author Kelvin Low
- * @since 1.2
- */
-public class ZipUtil {
-
- /**
- * Creates a zip file.
- *
- * @param zipFilePath
- * an absolute path to the target zip file
- * @param contentPath
- * an absolute path to a directory containing the files and sub
- * directories to be zipped
- * @param monitor
- * a progress monitor
- * @throws IOException
- * if an error occurs while creating the zip file
- */
- public static void createZipFile(String zipFilePath, String contentPath,
- IProgressMonitor monitor) throws IOException {
- ZipOutputStream out = null;
- try {
- out = new ZipOutputStream(new FileOutputStream(
- zipFilePath));
- File contentDir = new File(contentPath);
- populateZipFile(out, contentDir.getAbsolutePath(), contentDir,
- monitor);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- finally {
- if (out != null) {
- try {
- out.close();
- }
- catch (Exception e) {
- }
- }
- }
- }
-
- /**
- * Populates a zip file with directories and files.
- *
- * @param out
- * a zip file output stream
- * @param rootPath
- * a root path that is used to compute the relative paths of the
- * zip content
- * @param file
- * a file or directory
- * @param monitor
- * a progress monitor
- */
- public static void populateZipFile(ZipOutputStream out, String rootPath,
- File file, IProgressMonitor monitor) throws IOException {
- File[] files = file.listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- if (files[i].isDirectory()) {
- populateZipFile(out, rootPath, files[i], monitor);
- } else {
- String filePath = files[i].getAbsolutePath();
- FileInputStream in = new FileInputStream(filePath);
- String relativePath = filePath
- .substring(rootPath.length() + 1);
- out.putNextEntry(new ZipEntry(relativePath));
- byte[] buffer = new byte[1024];
- int len;
- while ((len = in.read(buffer)) > 0) {
- out.write(buffer, 0, len);
- }
- out.closeEntry();
- in.close();
- }
- }
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/package.html b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/package.html
deleted file mode 100644
index 164d717abc6..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/utils/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-Provides common clipboard, file, I18N, image, networking, string manipulation and threading services.
-
-
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/xml/AbstractSAXParser.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/xml/AbstractSAXParser.java
deleted file mode 100644
index 13218b004d5..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/xml/AbstractSAXParser.java
+++ /dev/null
@@ -1,216 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.xml;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.epf.common.utils.NetUtil;
-import org.eclipse.epf.common.utils.StrUtil;
-import org.eclipse.epf.common.utils.XMLUtil;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * An abstract SAX parser that can be used to parse a single XML file or a
- * directory of XML files.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public abstract class AbstractSAXParser extends DefaultHandler {
-
- /**
- * The logger used for logging warnings, errors and exceptions.
- */
- protected Logger logger;
-
- /**
- * The name of the current XML file being parsed.
- */
- protected String xmlFile;
-
- /**
- * The String buffer for accumulating text.
- */
- protected StringBuffer strBuf;
-
- /**
- * The XML validating flag.
- */
- private boolean validating;
-
- /**
- * Creates a new AbstractSaxParser given the validating flag.
- *
- * @param logger
- * The logger for logging warnings and errors.
- * @param validating
- * If true, validate the XML document.
- */
- public AbstractSAXParser(Logger logger, boolean validating) {
- this.logger = logger;
- this.validating = validating;
- }
-
- /**
- * Parses the given XML directory or file.
- *
- * @param xmlPath
- * The XML directory or file.
- */
- public void parse(String xmlPath) {
- String pathName = StrUtil.replace(xmlPath, "%20", " "); //$NON-NLS-1$ //$NON-NLS-2$
- File path = new File(pathName);
- File[] files = path.isFile() ? new File[] { path } : path.listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- if (!files[i].isDirectory()) {
- try {
- parseFile(files[i].getAbsoluteFile());
- } catch (Exception e) {
- if (logger != null) {
- logger
- .logError(
- "Failed to parse \"" + files[i].getAbsolutePath() + '"', e); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
-
- /**
- * Parses the given XML file.
- *
- * @param xmlFile
- * The XML file.
- */
- protected void parseFile(File xmlFile) throws ParserConfigurationException,
- IOException, SAXException {
- // Create the SAX parser factory.
- SAXParserFactory spf = SAXParserFactory.newInstance();
-
- // Set the XML validating flag.
- spf.setValidating(validating);
-
- // Create the SAX parser.
- SAXParser saxParser = spf.newSAXParser();
-
- // Get the SAX XML reader.
- XMLReader xmlReader = saxParser.getXMLReader();
-
- // Set the SAX parser handlers to this class.
- xmlReader.setContentHandler(this);
- xmlReader.setErrorHandler(this);
-
- // Instruct the SAX parser to parse the given XML file.
- this.xmlFile = xmlFile.getAbsolutePath();
- xmlReader.parse(NetUtil.getUri(xmlFile));
- }
-
- /**
- * Called when the XML parser starts to parse the document.
- */
- public void startDocument() {
- strBuf = new StringBuffer();
- }
-
- /**
- * Called when the the XML parser encounters the chararacter data within a
- * text element.
- */
- public void characters(char[] buffer, int start, int length) {
- strBuf.append(buffer, start, length);
- }
-
- /**
- * Called when the parser starts to parse each new element.
- */
- public abstract void startElement(String namespaceURL, String localName,
- String qname, Attributes attributes);
-
- /**
- * Called when the XML parser reaches the end of the an element.
- */
- public abstract void endElement(String namespaceURL, String localName,
- String qname);
-
- /**
- * Called when the XML parser reaches the end of the document.
- */
- public void endDocument() {
- }
-
- /**
- * Logs the SAX parsing warning.
- *
- * @param e
- * The SAX parse exception.
- */
- public void warning(SAXParseException e) {
- if (logger != null) {
- logger
- .logWarning("SAX parsing warning encountered at " //$NON-NLS-1$
- + XMLUtil.getLocationOfException(e)
- + ": " + e.getMessage()); //$NON-NLS-1$
- }
- }
-
- /**
- * Logs the SAX parsing error.
- *
- * @param e
- * The SAX parse exception.
- */
- public void error(SAXParseException e) {
- if (logger != null) {
- logger
- .logError("SAX parsing error encountered at " //$NON-NLS-1$
- + XMLUtil.getLocationOfException(e)
- + ": " + e.getMessage()); //$NON-NLS-1$
- }
- }
-
- /**
- * Logs the SAX non-recoverable error and exits.
- *
- * @param e
- * The SAX parse exception.
- */
- public void fatalError(SAXParseException e) throws SAXException {
- if (logger != null) {
- logger
- .logError("SAX parsing fatal error encountered at " //$NON-NLS-1$
- + XMLUtil.getLocationOfException(e)
- + ": " + e.getMessage()); //$NON-NLS-1$
- logger.logError(e);
- }
- }
-
- /**
- * Returns the current XML file that is being parsed.
- *
- * @return The name of the XML file.
- */
- public String getXMLFile() {
- return xmlFile;
- }
-
-}
\ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/xml/XSLTProcessor.java b/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/xml/XSLTProcessor.java
deleted file mode 100644
index a595850fbec..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.common/src/org/eclipse/epf/common/xml/XSLTProcessor.java
+++ /dev/null
@@ -1,449 +0,0 @@
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 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 implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.common.xml;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.InputStream;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.eclipse.epf.common.CommonPlugin;
-
-/**
- * A wrapper over the XSLT processor bundled with the JRE.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class XSLTProcessor {
-
- // If true, cache the compiled the XSL transformer with the compiled XSL
- // templates.
- private static boolean cacheXSL;
-
- // Caches the XSL transformers.
- private static Map transformerCache;
-
- static {
- String cacheXSLProperty = CommonPlugin.getDefault().getString(
- "cacheXSL"); //$NON-NLS-1$
- if (cacheXSLProperty != null && !cacheXSLProperty.startsWith("[")) { //$NON-NLS-1$
- cacheXSL = Boolean.getBoolean(cacheXSLProperty);
- } else {
- cacheXSL = true;
- }
- if (cacheXSL) {
- transformerCache = new HashMap();
- }
-
- // Increase the entity expansion line limit to handle a larger number of
- // XML entities.
- System.setProperty("entityExpansionLimit", "1000000"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Default private constructor to prevent this class from being
- * instantiated.
- */
- private XSLTProcessor() {
- }
-
- /**
- * Executes the XSL transformation given the XSL source, XML source, target
- * output and encoding.
- *
- * @param xslSource
- * The XSL source.
- * @param xmlSource
- * The XML source.
- * @param output
- * The output target.
- * @param params
- * The parameters for the XSL transformation.
- * @param encoding
- * The target encoding.
- */
- public static void transform(Source xslSource, Source xmlSource,
- Writer output, Properties params, String encoding) throws Exception {
- if (xslSource != null && xmlSource != null) {
- Transformer transformer = null;
- String xslFile = xslSource.getSystemId();
- if (cacheXSL && xslFile != null) {
- CachedTransformer cachedTransformer = null;
- synchronized (transformerCache) {
- cachedTransformer = transformerCache.get(xslFile);
- if (cachedTransformer == null) {
- TransformerFactory factory = TransformerFactory
- .newInstance();
- transformer = factory.newTransformer(xslSource);
- transformerCache.put(xslFile, new CachedTransformer(
- transformer, params));
- } else {
- cachedTransformer.setParams(params);
- transformer = cachedTransformer.getTransformer();
- }
- }
- } else {
- TransformerFactory factory = TransformerFactory.newInstance();
- transformer = factory.newTransformer(xslSource);
-
- if (params != null && params.size() > 0) {
- for (Iterator
+ *
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement()
+ * @model
+ * @generated
+ */
+public interface GraphElement extends DiagramElement {
+
+ /**
+ * Returns the value of the 'Contained' containment reference list. The list
+ * contents are of type {@link org.eclipse.papyrus.conversion.di2.DiagramElement}. It is
+ * bidirectional and its opposite is '
+ * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getContainer
+ * Container}'.
+ *
+ * If the meaning of the 'Contained' containment reference list isn't clear, there
+ * really should be more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Contained' containment reference list.
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_Contained()
+ * @see org.eclipse.papyrus.conversion.di2.DiagramElement#getContainer
+ * @model opposite="container" containment="true"
+ * @generated
+ */
+ EList getContained();
+
+ /**
+ * Returns the value of the 'Link' containment reference list. The list contents
+ * are of type {@link org.eclipse.papyrus.conversion.di2.DiagramLink}.
+ *
+ * If the meaning of the 'Link' containment reference list isn't clear, there really
+ * should be more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Link' containment reference list.
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_Link()
+ * @model containment="true"
+ * @generated
+ */
+ EList getLink();
+
+ /**
+ * Returns the value of the 'Semantic Model' containment reference.
+ *
+ * If the meaning of the 'Semantic Model' containment reference isn't clear, there
+ * really should be more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Semantic Model' containment reference.
+ * @see #setSemanticModel(SemanticModelBridge)
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_SemanticModel()
+ * @model containment="true"
+ * @generated
+ */
+ SemanticModelBridge getSemanticModel();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.conversion.di2.GraphElement#getSemanticModel
+ * Semantic Model}' containment reference.
+ *
+ * @param value
+ * the new value of the 'Semantic Model' containment reference.
+ * @see #getSemanticModel()
+ * @generated
+ */
+ void setSemanticModel(SemanticModelBridge value);
+
+ /**
+ * Returns the value of the 'Position' attribute.
+ *
+ * If the meaning of the 'Position' attribute isn't clear, there really should be more
+ * of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Position' attribute.
+ * @see #setPosition(Point)
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_Position()
+ * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point"
+ * @generated
+ */
+ Point getPosition();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.conversion.di2.GraphElement#getPosition Position}'
+ * attribute.
+ *
+ * @param value
+ * the new value of the 'Position' attribute.
+ * @see #getPosition()
+ * @generated
+ */
+ void setPosition(Point value);
+
+ /**
+ * Returns the value of the 'Anchorage' containment reference list. The list
+ * contents are of type {@link org.eclipse.papyrus.conversion.di2.GraphConnector}. It is
+ * bidirectional and its opposite is '
+ * {@link org.eclipse.papyrus.conversion.di2.GraphConnector#getGraphElement
+ * Graph Element}'.
+ *
+ * If the meaning of the 'Anchorage' containment reference list isn't clear, there
+ * really should be more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Anchorage' containment reference list.
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_Anchorage()
+ * @see org.eclipse.papyrus.conversion.di2.GraphConnector#getGraphElement
+ * @model opposite="graphElement" containment="true"
+ * @generated
+ */
+ EList getAnchorage();
+
+} // GraphElement
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphNode.java b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphNode.java
new file mode 100644
index 00000000000..15c4722f878
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphNode.java
@@ -0,0 +1,55 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.conversion.di2;
+
+import org.eclipse.draw2d.geometry.Dimension;
+
+/**
+ * A representation of the model object 'Graph Node'.
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getPolilyne()
+ * @model
+ * @generated
+ */
+public interface Polilyne extends GraphicPrimitive {
+
+ /**
+ * Returns the value of the 'Waypoints' attribute list. The list contents are of
+ * type {@link org.eclipse.draw2d.geometry.Point}.
+ *
+ * If the meaning of the 'Waypoints' attribute list isn't clear, there really should be
+ * more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Waypoints' attribute list.
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getPolilyne_Waypoints()
+ * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point" lower="2"
+ * @generated
+ */
+ EList getWaypoints();
+
+ /**
+ * Returns the value of the 'Closed' attribute list. The list contents are of
+ * type {@link java.lang.Boolean}.
+ *
+ * If the meaning of the 'Closed' attribute list isn't clear, there really should be
+ * more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Closed' attribute list.
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getPolilyne_Closed()
+ * @model dataType="org.eclipse.uml2.uml.Boolean" lower="2"
+ * @generated
+ */
+ EList getClosed();
+
+} // Polilyne
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Property.java b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Property.java
new file mode 100644
index 00000000000..722cf36092a
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Property.java
@@ -0,0 +1,83 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.conversion.di2;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A representation of the model object 'Property'.
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getReference()
+ * @model
+ * @generated
+ */
+public interface Reference extends DiagramElement {
+
+ /**
+ * Returns the value of the 'Is Individual Representation' attribute.
+ *
+ * If the meaning of the 'Is Individual Representation' attribute isn't clear, there
+ * really should be more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Is Individual Representation' attribute.
+ * @see #setIsIndividualRepresentation(boolean)
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getReference_IsIndividualRepresentation()
+ * @model dataType="org.eclipse.uml2.uml.Boolean"
+ * @generated
+ */
+ boolean isIsIndividualRepresentation();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.conversion.di2.Reference#isIsIndividualRepresentation
+ * Is Individual Representation}' attribute.
+ *
+ * @param value
+ * the new value of the 'Is Individual Representation' attribute.
+ * @see #isIsIndividualRepresentation()
+ * @generated
+ */
+ void setIsIndividualRepresentation(boolean value);
+
+ /**
+ * Returns the value of the 'Referenced' reference.
+ *
+ * If the meaning of the 'Referenced' reference isn't clear, there really should be
+ * more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Referenced' reference.
+ * @see #setReferenced(DiagramElement)
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getReference_Referenced()
+ * @model required="true"
+ * @generated
+ */
+ DiagramElement getReferenced();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.conversion.di2.Reference#getReferenced Referenced}'
+ * reference.
+ *
+ * @param value
+ * the new value of the 'Referenced' reference.
+ * @see #getReferenced()
+ * @generated
+ */
+ void setReferenced(DiagramElement value);
+
+} // Reference
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SemanticModelBridge.java b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SemanticModelBridge.java
new file mode 100644
index 00000000000..01086766fef
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SemanticModelBridge.java
@@ -0,0 +1,87 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.conversion.di2;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A representation of the model object '
+ * Semantic Model Bridge'.
+ *
+ *
+ *
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getSemanticModelBridge()
+ * @model
+ * @generated
+ */
+public interface SemanticModelBridge extends EObject {
+
+ /**
+ * Returns the value of the 'Presentation' attribute.
+ *
+ * If the meaning of the 'Presentation' attribute isn't clear, there really should be
+ * more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Presentation' attribute.
+ * @see #setPresentation(String)
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getSemanticModelBridge_Presentation()
+ * @model dataType="org.eclipse.uml2.uml.String"
+ * @generated
+ */
+ String getPresentation();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.conversion.di2.SemanticModelBridge#getPresentation
+ * Presentation}' attribute.
+ *
+ * @param value
+ * the new value of the 'Presentation' attribute.
+ * @see #getPresentation()
+ * @generated
+ */
+ void setPresentation(String value);
+
+ /**
+ * Returns the value of the 'Graph Element' reference.
+ *
+ * If the meaning of the 'Graph Element' reference isn't clear, there really should be
+ * more of a description here...
+ *
+ *
+ *
+ * @return the value of the 'Graph Element' reference.
+ * @see #setGraphElement(GraphElement)
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#getSemanticModelBridge_GraphElement()
+ * @model
+ * @generated
+ */
+ GraphElement getGraphElement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.conversion.di2.SemanticModelBridge#getGraphElement
+ * Graph Element}' reference.
+ *
+ * @param value
+ * the new value of the 'Graph Element' reference.
+ * @see #getGraphElement()
+ * @generated
+ */
+ void setGraphElement(GraphElement value);
+
+} // SemanticModelBridge
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SimpleSemanticModelElement.java b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SimpleSemanticModelElement.java
new file mode 100644
index 00000000000..0177655afb4
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SimpleSemanticModelElement.java
@@ -0,0 +1,55 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.conversion.di2;
+
+/**
+ * A representation of the model object '
+ * Simple Semantic Model Element'.
+ *
+ *
+ * Note: the correct way to create the package is via the static factory method {@link #init
+ * init()}, which also performs initialization of the package, or returns the registered
+ * package, if one already exists.
+ *
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.papyrus.conversion.di2.Di2Package#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private Di2PackageImpl() {
+ super(eNS_URI, Di2Factory.eINSTANCE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the Package for this model, and for any others
+ * upon which it depends. Simple dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives initialization for
+ * interdependent packages directly, in parallel with this package, itself.
+ *
+ * Of this package and its interdependencies, all packages which have not yet been registered by
+ * their URI values are first created and registered. The packages are then initialized in two
+ * steps: meta-model objects for all of the packages are created before any are initialized,
+ * since one package's meta-model objects may refer to those of another.
+ *
+
+This plugin enables to convert diagrams created using papyrus 1.X version
+into diagram editable by Papyrus MDT. This Tutorial is twofold:
+
+
+
First, it includes a user guide in order to convert your diagrams (created
+ with Papyrus 1.X) into diagrams editable by Papyrus MDT
+
+
Second, it includes a developer guide in order to help developers to extend the
+ conversion to other diagram not already supported.
+
+
+
+
+
How to use the converter?
+
+
+
Add the org.eclipse.papyrus.conversion.di2 + di2todi plugins to your
+ eclipse configuration. These plugins are provided in the Papyrus SVN
+ repository under extraplugins/conversion.
+
+
Launch eclipse, including Papyrus MDT. Import your old-version model
+ created with Papyrus 1.x, let’s call it “Example”. To this aim
+ you need to import two files: “Example.di2” and “Example.uml”,
+ as shown in Figure 2.
+
+
+
+
+
+ Import Papyrus 1.x Model
+
+
+
+
Convert your model. To this aim:
+ Right click on “Example.di2”> in the menu, select “Convert
+ Diagram”>then, “Di2 to Di Action”, as shown in Figure 3.
+
+
+
+
+ Convert Your Model
+
+
+
+
After processing, a new model is created, compatible with Papyrus MDT.
+ Indeed, the conversion creates from the di2 file (i.e., Example.di2)
+ two new files, namely, “Example.notation” and “Example.di”.
+ The uml file (i.e., Example.uml) is used to make reference to the
+ uml graphical elements. At the end of the conversion a message
+ dialog is opened to inform you of the success or the failure of your
+ conversion.
+
+
+
+
+ Conversion result
+
+
+
+
Open the generated di file (i.e., Example.di) to show and edit your
+ model.
+
+
+
Internal Process of the conversion
+
+This process is performed transparently to user, however, this brief description aims
+to provide global overview of the internal process
+
+
1st Step
+As mentioned in the step2, the diagram
+converter requires the di2 namespace to be uniquely defined. To this
+aim as a first step of the internal process, the converter changed
+the namespace in the di2 file from “http://www.papyrusuml.org” to
+“http://www.papyrusuml.org/di2”.
+
+
+This step is meant to be transparent to the user, as the converter
+restores the di2 namespace to “http://www.papyrusuml.org”
+at the end of the conversion, in order to make your diagram editable
+by Papyrus 1.x. However,
+if the conversion fails before restoring the original name space, the
+old-version model may be no more editable by Papyrus 1.x. Hence, the
+user may need to restore it manually by editing the di2 file using a
+text editor, and removing the “/di2” from the namespace
+http://www.papyrusuml.org/di2.
+
+
2nd Step
+
+As a second step, the converter transforms elements described in the di2
+file into elements in the notation and di files according to their
+respective metamodels.
+
+The di file contains references to the different diagrams in your model.
+The notation file contains a specific description of the elements
+that are represented graphically in each diagram: size, coordinates,
+nested elements, and so on.
+To perform this step, the converter performed a set of QVT
+(Query/View/Transform) Operation mappings.
+
+
3rd Step
+
+Finally, the converter stores the result of the transformation in to two files,
+namely, notation and di file, and restores the di2 namespace to
+“http://www.papyrusuml.org”.
+
+
Supported Conversions
+
+Herein, we present two sample conversions and outline the elements supported by the converter. We start
+first with the class diagram and then, we detail the transformations in the composite diagram.
+
+
Class Diagram
+
+Tests have been done with class diagrams containing
+
+
Simple classes
+
Class with operations and attributes
+
Comments
+
Relationships between classes
+
+
Dependency
+
Association
+
Link with a comment
+
Realization
+
Generalization
+
+
+
+The screenshots have been taken with an older version that did not copy color attributes. These are now handled.
+
+
+
+ Class diagram in Papyrus 1.12 (original)
+
+
+ Class diagram in Papyrus MDT (conversion result)
+
+
+
Composite Diagram
+
+Tests have been done with composite diagrams containing
+
+
+
Composite classes
+
Properties within composite classes
+
Nested classes
+
Ports
+
Connection between ports: connector
+
+
+
+
+ Composite diagram in Papyrus 1.12 (original)
+
+
+ Composite diagram in Papyrus MDT (conversion result)
+
+
+
Developer guide
+
+To convert models from Papyrus 1.x to Papyrus MDT, this plugin uses Q/V/T operational mappings.
+The plugin contains additional Java code, it is divided into three parts:
+
+
Model Transformation libraries implemented in QVTO
+
Black Boxes implemented in Java and used by the model transformations
+
Java code that is used to call the model transformations and extend the eclipse
+ context menu with the conversion action, i.e., "Convert Diagram".
+
+
+The main part of the plugin is the model transformation, which includes
+
+
General libraries:
+
+
ElementType.qvto: names of diagrams in Papyrus 1.12 and MDT.
+
GeneralMappingsandHelpers.qvto: collection of utilities
+
NotationQueries.qvto
+ includes all the queries that are made to the di2 model in order to
+ be used in the notation model.
+
Diagram.qvto: convert the supported diagrams, make use of diagram specific
+ libraries below.
+
DiTansformation.qvto
+ enable to create the elements of the di model from the di2 model.
+
+
+
Diagram specific libraries, prefixed with name of diagram, i.e. <Class>, <Composite>, <State>,
+ <Profile> and <ClassAndProfile> (the letter is a particular case for edges in class and profile
+ diagrams which have identical IDs in these two diagram types)
+
+
DiagEdge.qvto
+ that converts all sorts of edges (realization, dependency,
+ generalization, and so on).
+
DiagNodes.qvto that converts the node elements of a diagram
+
+
The main transformation
+
+
Transfo.qvto, which triggers the model transformation.
+
+
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-di2action.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-di2action.png
new file mode 100644
index 00000000000..1e1d021cd66
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-di2action.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-project.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-project.png
new file mode 100644
index 00000000000..5c11cc12e2e
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-project.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-result.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-result.png
new file mode 100644
index 00000000000..fe3a0e97514
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-result.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-mdt.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-mdt.png
new file mode 100644
index 00000000000..ae6b496d0c8
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-mdt.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-p1.12.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-p1.12.png
new file mode 100644
index 00000000000..0a61e8d5ae5
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-p1.12.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-mdt.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-mdt.png
new file mode 100644
index 00000000000..531381a328e
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-mdt.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-p1.12.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-p1.12.png
new file mode 100644
index 00000000000..726a5582f1b
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-p1.12.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-mdt.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-mdt.png
new file mode 100644
index 00000000000..c8112529635
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-mdt.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-p1.12.png b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-p1.12.png
new file mode 100644
index 00000000000..8a9e3e5e824
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-p1.12.png differ
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/plugin.properties b/deprecated/org.eclipse.papyrus.conversion.di2todi/plugin.properties
new file mode 100644
index 00000000000..1803ba8aee5
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2011 CEA LIST.
+# 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:
+# Manel Fredj, Ansgar Radermacher - Initial API and implementation
+##################################################################################
+pluginName=di2 to di conversion (Papyrus 1.x to Papyrus MDT)
+providerName=Eclipse Modeling Project
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/plugin.xml b/deprecated/org.eclipse.papyrus.conversion.di2todi/plugin.xml
new file mode 100644
index 00000000000..484692c3519
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/plugin.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/Activator.java b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/Activator.java
new file mode 100644
index 00000000000..c660b3cea70
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/Activator.java
@@ -0,0 +1,61 @@
+package org.eclipse.papyrus.conversion.di2todi;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.conversion.di2todi"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/blackboxes/UtilitiesLibrary.java b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/blackboxes/UtilitiesLibrary.java
new file mode 100644
index 00000000000..9138b043865
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/blackboxes/UtilitiesLibrary.java
@@ -0,0 +1,236 @@
+/**
+ * @author: Manel Fredj - CEA
+ * This class includes all the operations that are called in the transformation QVTO from java.
+ * These operations are wrapped into a black-box
+ */
+
+package org.eclipse.papyrus.conversion.di2todi.blackboxes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
+import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
+import org.eclipse.m2m.qvt.oml.blackbox.java.Operation;
+import org.eclipse.papyrus.conversion.di2.GraphElement;
+import org.eclipse.papyrus.conversion.di2.SemanticModelBridge;
+import org.eclipse.papyrus.conversion.di2.Uml1SemanticModelBridge;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Realization;
+
+public class UtilitiesLibrary {
+
+ @Operation(contextual=true)
+ public static String getName(Diagram self)
+ {
+ return self.getName();
+ }
+
+ @Operation(contextual=true)
+ public static EObject convertElement(Element self)
+ {
+ return self;
+ }
+
+ @Operation(contextual=true)
+ public static String getElementType(Element self)
+ {
+ if (self instanceof Association )
+ return "Association";
+ if (self instanceof Generalization )
+ return "Generalization";
+ else return null;
+ }
+
+ @Operation(contextual=true)
+ public static boolean isGeneralization(Element self)
+ {
+ if (self instanceof Generalization)
+ return true;
+ else return false;
+ }
+
+
+ @Operation(contextual=true)
+ public static boolean isAssociation(Element self)
+ {
+ if (self instanceof Association)
+ return true;
+ else
+ return false;
+ }
+
+ @Operation(contextual=true)
+ public static boolean isRealization(Element self)
+ {
+ if (self instanceof Realization)
+ return true;
+ else
+ return false;
+ }
+ @Operation(contextual=true)
+ public static boolean isDependency(Element self)
+ {
+ if (self instanceof Dependency)
+ return true;
+ else
+ return false;
+ }
+
+ @Operation(contextual=true)
+ public static int dimensionGetWidth(Dimension self)
+ {
+ if (self!=null)
+ return self.width;
+ else
+ return 0;
+ }
+
+ @Operation(contextual=true)
+ public static int dimensionGetHeight(Dimension self)
+ {
+ if (self!=null)
+ return self.height;
+ else
+ return 0;
+ }
+
+ @Operation(contextual=true)
+ public static int pointGetX(Point self)
+ {
+ if (self!=null)
+ {
+
+ return self.x;
+ }else
+ return 0;
+ }
+
+ @Operation(contextual=true)
+ public static int pointGetY(Point self)
+ {
+ if (self!=null)
+ {
+ return self.y;
+ }
+ else
+ return 0;
+ }
+
+ @Operation(contextual=true)
+ public static String showcoordinates(Point self)
+ {
+ if (self!=null)
+ {
+ return "the x is "+ self.x+ "and the y is "+ self.y;
+ }
+ else
+ return "nothing to display";
+ }
+
+ @Operation(contextual=true)
+ public static int rgb2int(RGB self)
+ {
+ if (self!=null)
+ return self.blue * 0x10000 + self.green *0x100 + self.red;
+ else
+ return 0;
+ }
+
+ @Operation(contextual=true)
+ public static Element getElement(Uml1SemanticModelBridge bridge) {
+ // difference to using element attribute directly: getElement will try to resolve proxies
+ // and thus detects elements referenced by the di2 model that do not exist (anymore) in the
+ // uml model
+ Element element = bridge.getElement();
+ if ((element != null) && element.eIsProxy()) {
+ // is still proxy (the getElement implementation of Uml1SemanticModelBridge already tried to
+ // resolve) => return null
+ return null;
+ }
+ else {
+ return element;
+ }
+ }
+
+ /**
+ * Return the semantic model for a given di2 element
+ * @param di2Element existing di2 element
+ * @return the associated semantic model or null
+ */
+ @Operation(contextual=true)
+ public static Uml1SemanticModelBridge getSemanticModel(GraphElement di2Element) {
+ SemanticModelBridge semanticModel;
+ if (di2Element instanceof org.eclipse.papyrus.conversion.di2.Diagram) {
+ semanticModel =((org.eclipse.papyrus.conversion.di2.Diagram) di2Element).getOwner();
+ }
+ else {
+ semanticModel = di2Element.getSemanticModel();
+ }
+ if (semanticModel instanceof Uml1SemanticModelBridge) {
+ return (Uml1SemanticModelBridge) semanticModel;
+ }
+ return null;
+ }
+
+ @Operation(contextual=true)
+ public static Element getElement(GraphElement di2Element) {
+
+ Uml1SemanticModelBridge semanticModel = getSemanticModel(di2Element);
+ if (semanticModel != null) {
+ return getElement (semanticModel);
+ }
+ else {
+ System.err.println("no bridge found for di2Node" + di2Element);
+ }
+ return null;
+ }
+
+ // may be useful for debugging (use it instead of getElement in combination with a breakpoint)
+ @Operation(contextual=true)
+ public static Element getElementDebug(GraphElement di2Element) {
+
+ Element element = getElement(di2Element);
+ return element;
+ }
+
+ /**
+ * Papyrus 1 profile diagrams do not reference meta-class elements directly, but the
+ * associated element imported
+ * @param bridge
+ * @return
+ */
+ @Operation(contextual=true)
+ public static Element getMetaclassRef(Uml1SemanticModelBridge semanticModel) {
+ Element element = getElement (semanticModel);
+ if (element != null) {
+ if (element instanceof ElementImport) {
+ return ((ElementImport) element).getImportedElement();
+ }
+ }
+ else {
+ System.err.println("no element found");
+ }
+ return element;
+ }
+
+ public Object createBendpoints()
+ {
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ List points = new ArrayList(2);
+ points.add(new RelativeBendpoint(0,0,0,0));
+ points.add(new RelativeBendpoint(0,0,0,0));
+ bendpoints.setPoints(points);
+ return bendpoints;
+ }
+}
\ No newline at end of file
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/Di2toDiAction.java b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/Di2toDiAction.java
new file mode 100644
index 00000000000..2c0729cdeda
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/Di2toDiAction.java
@@ -0,0 +1,253 @@
+/**
+ * @author: Manel Fredj - CEA
+ * This class invoke QVTO transformations that convert a diagram from di2 into di+notation
+ */
+
+package org.eclipse.papyrus.conversion.di2todi.popupactions;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.URIConverter;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.m2m.internal.qvt.oml.ast.env.ModelExtentContents;
+import org.eclipse.m2m.internal.qvt.oml.common.MdaException;
+import org.eclipse.m2m.internal.qvt.oml.emf.util.ModelContent;
+import org.eclipse.m2m.internal.qvt.oml.library.Context;
+import org.eclipse.m2m.internal.qvt.oml.runtime.generator.TransformationRunner;
+import org.eclipse.m2m.internal.qvt.oml.runtime.generator.TransformationRunner.In;
+import org.eclipse.m2m.internal.qvt.oml.runtime.generator.TransformationRunner.Out;
+import org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpretedTransformation;
+import org.eclipse.m2m.internal.qvt.oml.runtime.project.TransformationUtil;
+import org.eclipse.m2m.internal.qvt.oml.trace.Trace;
+import org.eclipse.m2m.internal.qvt.oml.trace.TraceRecord;
+import org.eclipse.m2m.qvt.oml.util.IContext;
+import org.eclipse.papyrus.conversion.di2.util.Di2AdapterFactory;
+import org.eclipse.papyrus.conversion.di2todi.Activator;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+
+@SuppressWarnings("restriction")
+public class Di2toDiAction implements IObjectActionDelegate {
+
+ private static final Map, ?> options = null;
+ private IPath inModelPath; //reference to selected Model
+ private String inAbsolutepath;
+
+ /**
+ * Constructor for Action1.
+ */
+ public Di2toDiAction() {
+ super();
+ inModelPath=null;
+ inAbsolutepath=null;
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ if (adapterFactory == null) {
+ // dummy operation to force loading/initialization of di2 plugin
+ adapterFactory = new Di2AdapterFactory();
+ }
+ // Refer to an existing transformation via URI
+ final URI transformationURI =
+ URI.createURI("platform:/plugin/" + Activator.PLUGIN_ID + "/TransfoQvtoDi2toDi/Transfo.qvto");
+
+ //get the resources from the input URI
+ final ResourceSet resourceSet = new ResourceSetImpl();
+ Job job = new Job("Convert diagram " + inModelPath.toString()) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ // execute the task ...
+
+ try {
+ monitor.beginTask("converting ...", 4);
+
+ URI inURI = URI.createPlatformResourceURI(inModelPath.toString(), true);
+ Resource inResource = resourceSet.getResource(inURI, true);
+ // create the inputs
+ List inObjects =inResource.getContents();
+ ModelContent input_di2 = new ModelContent (inObjects);
+ ModelContent[] inputs = new ModelContent[1];
+ inputs[0]=input_di2;
+
+ // setup the execution environment details -> context
+ IContext mycontext = new Context();
+ Trace trace= null;
+
+ QvtInterpretedTransformation transformation = new QvtInterpretedTransformation (TransformationUtil.getQvtModule(transformationURI));
+ In IntransformationRunner=new TransformationRunner.In(inputs, mycontext);
+ Out OuttransformationRunner=new TransformationRunner.Out(null,null, null);
+
+ monitor.worked(1);
+ // running the transformation
+ OuttransformationRunner=transformation.run(IntransformationRunner);
+
+ // retrieve the outputs
+ List outputs= OuttransformationRunner.getExtents();
+
+ // retrieve the trace
+ trace= OuttransformationRunner.getTrace();
+
+ if (trace !=null && outputs.size()==2) {
+ // processing the trace
+ URI Uri_trace = inURI.trimFileExtension().appendFileExtension("trace");
+ EList outObjects_trace = trace.getTraceRecords();
+ Resource outResource_trace = resourceSet.createResource(Uri_trace);
+ outResource_trace.getContents().addAll(outObjects_trace);
+
+ // processing the outputs
+ ModelExtentContents output_notation = outputs.get(0);
+ ModelExtentContents output_di = outputs.get(1);
+ monitor.worked(1);
+
+ URI Uri_notation = inURI.trimFileExtension().appendFileExtension("notation");
+ URI Uri_di = inURI.trimFileExtension().appendFileExtension("di");
+
+ // the output objects got captured in the output extent
+ List outObjects_notation = output_notation.getAllRootElements();
+ List outObjects_di = output_di.getAllRootElements();
+
+ //Let's persist them using a resource for notation
+ Resource outResource_notation = resourceSet.createResource(Uri_notation );
+ outResource_notation.getContents().addAll(outObjects_notation);
+
+ // let's persist them using a resource for di
+ Resource outResource_di = resourceSet.createResource(Uri_di);
+ outResource_di.getContents().addAll(outObjects_di);
+
+ monitor.worked(1);
+
+ try{
+ outResource_notation.save(Collections.emptyMap());
+ outResource_di.save(Collections.emptyMap());
+ outResource_trace.save(Collections.emptyMap());
+ }
+ catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ monitor.worked(1);
+
+ // remove trace file
+ URIConverter uri= resourceSet.getURIConverter();
+ uri.delete(Uri_trace, options);
+ }
+ }
+ catch (final MdaException e) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openError(
+ new Shell(), "Model transformation error during conversion", e.toString ());
+ }
+ });
+ e.printStackTrace();
+ }
+ catch (final IOException e) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openError(
+ new Shell(), "IO error during conversion", e.toString ());
+ }
+ });
+ e.printStackTrace();
+ }
+ catch (final RuntimeException e) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openError(
+ new Shell(), "Error during conversion", e.toString ());
+ }
+ });
+ e.printStackTrace ();
+ }
+ finally {
+ // when the transformation succeeds
+ //1- restore the content of Di2 file i.e., di2 namespace
+ PapyrusNamespace.restoreDi2Namespace(inAbsolutepath);
+ }
+
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setUser (true);
+ job.schedule ();
+ }
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection)
+ {
+ this.inModelPath = null;
+
+ if (!(selection instanceof IStructuredSelection)) {
+ // no structured-selection
+ return;
+ }
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ if (selection.isEmpty()) {
+ return;
+ }
+
+ Object firstElement = structuredSelection.getFirstElement();
+
+ if (firstElement instanceof IFile) {
+
+ IFile di2Select = (IFile) firstElement;
+ // retrieve the path of the file
+ IPath di2Path = di2Select.getFullPath();
+ IPath location = di2Select.getLocation();
+ if (location != null) {
+ // Get the file for the location
+ File file = location.toFile();
+ if (file != null) {
+ // Add the absolute path to the list
+ this.inAbsolutepath = file.getAbsolutePath();
+ }
+
+ // check whether it is a .di2 file
+ String di2filename = di2Path.toString();
+ if (di2filename.endsWith (".di2")) {
+ // change namespace of di2
+ PapyrusNamespace.replaceNamespace(this.inAbsolutepath);
+ this.inModelPath = di2Path;
+ }
+ }
+ }
+ }
+
+ Di2AdapterFactory adapterFactory = null;
+}
+
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/PapyrusNamespace.java b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/PapyrusNamespace.java
new file mode 100644
index 00000000000..5a17df64ff2
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/PapyrusNamespace.java
@@ -0,0 +1,80 @@
+/**
+ * @author: Manel Fredj - CEA
+ * This class enables to change the namespace of di2 metamodel from
+ * replace http://www.papyrusuml.org into http://www.papyrusuml.org/di2
+ */
+
+package org.eclipse.papyrus.conversion.di2todi.popupactions;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+
+public class PapyrusNamespace
+{
+ /////////////////////////////////////////////////////////////////////////////////////////////
+ //replace http://www.papyrusuml.org -- by -- http://www.papyrusuml.org/di2
+
+ public static void replaceNamespace(String absolutepath)
+ {
+ try {
+ String oldNameSpace = "di2=\"http://www.papyrusuml.org\"";
+ String newNameSpace="di2=\"http://www.papyrusuml.org/di2\"";
+ String oldtext =readFileAsString(absolutepath);
+ // replace the namespace in the di2 file
+ String newtext = oldtext.replaceAll (oldNameSpace, newNameSpace);
+
+ FileWriter writer = new FileWriter(absolutepath);
+ writer.write(newtext);writer.close();
+ }
+ catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+
+ public static void restoreDi2Namespace(String absolutepath)
+ {
+ try {
+ String oldNameSpace="di2=\"http://www.papyrusuml.org/di2\"";
+ String newNameSpace = "di2=\"http://www.papyrusuml.org\"";
+
+ String oldtext =readFileAsString(absolutepath);
+ // replace the namespace in the di2 file
+ String newtext = oldtext.replaceAll (oldNameSpace, newNameSpace);
+
+ FileWriter writer = new FileWriter(absolutepath);
+ writer.write(newtext);writer.close();
+ }
+ catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+
+ /**
+ * @param filePath the name of the file to open. Not sure if it can accept
+ * cccURLs or just filenames. Path handling could be better, and buffer
+ * sizes are hardcoded
+ */
+ private static String readFileAsString (String filePath)
+ throws java.io.IOException
+ {
+ byte[] buffer = new byte[(int) new File(filePath).length()];
+ BufferedInputStream f = null;
+ try {
+ f = new BufferedInputStream(new FileInputStream(filePath));
+ f.read(buffer);
+ }
+ finally {
+ if (f != null) {
+ try {
+ f.close();
+ }
+ catch (IOException ignored) {
+ }
+ }
+ }
+ return new String(buffer);
+ }
+}
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/toc.xml b/deprecated/org.eclipse.papyrus.conversion.di2todi/toc.xml
new file mode 100644
index 00000000000..3057fc280ee
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/toc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.conversion.di2todi/tocdev.xml b/deprecated/org.eclipse.papyrus.conversion.di2todi/tocdev.xml
new file mode 100644
index 00000000000..53009154565
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.conversion.di2todi/tocdev.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/.project b/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/.project
deleted file mode 100644
index d2f295e1a2a..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- org.eclipse.papyrus.conversion-feature
-
-
-
-
-
- org.eclipse.pde.FeatureBuilder
-
-
-
-
-
- org.eclipse.pde.FeatureNature
-
-
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/build.properties b/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/build.properties
deleted file mode 100644
index 9c864246773..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/eclipse_update_120.jpg b/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad61..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/eclipse_update_120.jpg and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/epl-v10.html b/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/epl-v10.html
deleted file mode 100644
index cb1073a4bad..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/epl-v10.html
+++ /dev/null
@@ -1,304 +0,0 @@
-
-
-
-
-
-
-Eclipse Public License - Version 1.0
-
-
-
-
-
-
-
-
Eclipse Public License - v 1.0
-
-
-
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.
-
-
1. DEFINITIONS
-
-
"Contribution" means:
-
-
a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-
-
i)
-changes to the Program, and
-
-
ii)
-additions to the Program;
-
-
where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program.
-
-
"Contributor" means any person or
-entity that distributes the Program.
-
-
"Licensed Patents " mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program.
-
-
"Program" means the Contributions
-distributed in accordance with this Agreement.
-
-
"Recipient" means anyone who
-receives the Program under this Agreement, including all Contributors.
-
-
2. GRANT OF RIGHTS
-
-
a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license toreproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.
-
-
b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder.
-
-
c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.
-
-
d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement.
-
-
3. REQUIREMENTS
-
-
A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:
-
-
-
a)
-it complies with the terms and conditions of this Agreement; and
-
-
b)
-its license agreement:
-
-
i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose;
-
-
ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits;
-
-
iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and
-
-
iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.
-
-
When the Program is made available in source
-code form:
-
-
a)
-it must be made available under this Agreement; and
-
-
b) a
-copy of this Agreement must be included with each copy of the Program.
-
-
Contributors may not remove or alter any
-copyright notices contained within the Program.
-
-
Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution.
-
-
4. COMMERCIAL DISTRIBUTION
-
-
Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor ("Commercial
-Contributor") hereby agrees to defend and indemnify every other
-Contributor ("Indemnified Contributor") against any losses, damages and
-costs (collectively "Losses") arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.
-
-
For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.
-
-
5. NO WARRANTY
-
-
EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations.
-
-
6. DISCLAIMER OF LIABILITY
-
-
EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.
-
-
7. GENERAL
-
-
If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.
-
-
If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed.
-
-
All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive.
-
-
Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.
-
-
This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/feature.properties b/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/feature.properties
deleted file mode 100644
index 7e8977d5850..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-# NLS_MESSAGEFORMAT_VAR
-
-# "featureName" property - name of the feature
-featureName=MARTE profile (Incubation)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Modeling Project
-
-# "description" property - description of the feature
-description=Contains a diagram converter from Papyrus 1.x to Papyrus MDT
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-Eclipse Foundation Software User Agreement\n\
-April 14, 2010\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the\n\
-Eclipse Foundation is provided to you under the terms and conditions of\n\
-the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
-provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse Foundation source code\n\
-repository ("Repository") in software modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
-Update License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties" found within a Feature.\n\
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
-terms and conditions (or references to such terms and conditions) that\n\
-govern your use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-\n\Use of Provisioning Technology\n\
-\n\
-The Eclipse Foundation makes available provisioning software, examples of which include,\n\
-but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
-the purpose of allowing users to install software, documentation, information and/or\n\
-other materials (collectively "Installable Software"). This capability is provided with\n\
-the intent of allowing such users to install, extend and update Eclipse-based products.\n\
-Information about packaging Installable Software is available at\n\
-http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
-\n\
-You may use Provisioning Technology to allow other parties to install Installable Software.\n\
-You shall be responsible for enabling the applicable license agreements relating to the\n\
-Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
-in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
-making it available in accordance with the Specification, you further acknowledge your\n\
-agreement to, and the acquisition of all necessary rights to permit the following:\n\
-\n\
- 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
- the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
- extending or updating the functionality of an Eclipse-based product.\n\
- 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
- Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
- 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
- govern the use of the Installable Software ("Installable Software Agreement") and such\n\
- Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
- with the Specification. Such Installable Software Agreement must inform the user of the\n\
- terms and conditions that govern the Installable Software and must solicit acceptance by\n\
- the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
- indication of agreement by the user, the provisioning Technology will complete installation\n\
- of the Installable Software.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use, and\n\
-re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
-########### end of license property ##########################################
-
-
-# "UpdateSiteName" property - label for the update site (on download1.eclipse.org)
-PapyrusUpdateSiteName=MDT Papyrus Extra Updates - Nightly builds
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/feature.xml b/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/feature.xml
deleted file mode 100644
index ad450331f44..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/feature.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- This feature includes an implementation of a diagram converter
-from Papyrus 1.x to Papyrus MDT.
-
-
-
- Copyright (c) 2008-2011 CEA LIST
-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
-
-
-
- %license
-
-
-
-
-
-
-
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/license.html b/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/license.html
deleted file mode 100644
index a9b560f44cd..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion-feature/license.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-Eclipse.org Software User Agreement
-
-
-
-
Eclipse Foundation Software User Agreement
-
March 17, 2005
-
-
Usage Of Content
-
-
THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.
-
-
Applicable Licenses
-
-
Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.
- For purposes of the EPL, "Program" will mean the Content.
-
-
Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
- modules ("Modules") and made available as downloadable archives ("Downloads").
-
-
-
Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
-
Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
-
A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.
-
Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
-
-
-
The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
-Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:
-
-
-
The top-level (root) directory
-
Plug-in and Fragment directories
-
Inside Plug-ins and Fragments packaged as JARs
-
Sub-directories of the directory named "src" of certain Plug-ins
-
Feature directories
-
-
-
Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.
-
-
THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.
-
-
Cryptography
-
-
Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagram()
- * @model
- * @generated
- */
-public interface Diagram extends GraphNode {
-
- /**
- * Returns the value of the 'Owner' containment reference.
- *
- * If the meaning of the 'Owner' containment reference isn't clear, there really should
- * be more of a description here...
- *
- *
- *
- * @return the value of the 'Owner' containment reference.
- * @see #setOwner(SemanticModelBridge)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagram_Owner()
- * @model containment="true" required="true"
- * @generated
- */
- SemanticModelBridge getOwner();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Diagram#getOwner
- * Owner}' containment reference.
- *
- * @param value
- * the new value of the 'Owner' containment reference.
- * @see #getOwner()
- * @generated
- */
- void setOwner(SemanticModelBridge value);
-
- /**
- * Returns the value of the 'Name' attribute.
- *
- * If the meaning of the 'Name' attribute isn't clear, there really should be more of a
- * description here...
- *
- *
- *
- * @return the value of the 'Name' attribute.
- * @see #setName(String)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagram_Name()
- * @model dataType="org.eclipse.uml2.uml.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Diagram#getName
- * Name}' attribute.
- *
- * @param value
- * the new value of the 'Name' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the 'Zoom' attribute.
- *
- * If the meaning of the 'Zoom' attribute isn't clear, there really should be more of a
- * description here...
- *
- *
- *
- * @return the value of the 'Zoom' attribute.
- * @see #setZoom(double)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagram_Zoom()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Double"
- * @generated
- */
- double getZoom();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Diagram#getZoom
- * Zoom}' attribute.
- *
- * @param value
- * the new value of the 'Zoom' attribute.
- * @see #getZoom()
- * @generated
- */
- void setZoom(double value);
-
- /**
- * Returns the value of the 'Viewport' attribute.
- *
- * If the meaning of the 'Viewport' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Viewport' attribute.
- * @see #setViewport(Point)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagram_Viewport()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point"
- * @generated
- */
- Point getViewport();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Diagram#getViewport
- * Viewport}' attribute.
- *
- * @param value
- * the new value of the 'Viewport' attribute.
- * @see #getViewport()
- * @generated
- */
- void setViewport(Point value);
-
- /**
- * Returns the value of the 'Diagram Link' reference list. The list contents are
- * of type {@link org.eclipse.papyrus.conversion.di2.DiagramLink}.
- *
- * If the meaning of the 'Diagram Link' reference list isn't clear, there really should
- * be more of a description here...
- *
- *
- *
- * @return the value of the 'Diagram Link' reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagram_DiagramLink()
- * @model
- * @generated
- */
- EList getDiagramLink();
-
- /**
- * Returns the value of the 'Type' attribute.
- *
- * If the meaning of the 'Type' attribute isn't clear, there really should be more of a
- * description here...
- *
- *
- *
- * @return the value of the 'Type' attribute.
- * @see #setType(String)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagram_Type()
- * @model dataType="org.eclipse.uml2.uml.String"
- * @generated
- */
- String getType();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Diagram#getType
- * Type}' attribute.
- *
- * @param value
- * the new value of the 'Type' attribute.
- * @see #getType()
- * @generated
- */
- void setType(String value);
-
-} // Diagram
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/DiagramElement.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/DiagramElement.java
deleted file mode 100644
index 96ac0a3a71b..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/DiagramElement.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * A representation of the model object 'Diagram Element'.
- *
- *
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement()
- * @model
- * @generated
- */
-public interface DiagramElement extends EObject {
-
- /**
- * Returns the value of the 'Property' containment reference list. The list
- * contents are of type {@link org.eclipse.papyrus.conversion.di2.Property}.
- *
- * If the meaning of the 'Property' containment reference list isn't clear, there
- * really should be more of a description here...
- *
- *
- *
- * @return the value of the 'Property' containment reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_Property()
- * @model containment="true"
- * @generated
- */
- EList getProperty();
-
- /**
- * Returns the value of the 'Is Visible' attribute.
- *
- * If the meaning of the 'Is Visible' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Is Visible' attribute.
- * @see #setIsVisible(boolean)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_IsVisible()
- * @model dataType="org.eclipse.uml2.uml.Boolean"
- * @generated
- */
- boolean isIsVisible();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#isIsVisible
- * Is Visible}' attribute.
- *
- * @param value
- * the new value of the 'Is Visible' attribute.
- * @see #isIsVisible()
- * @generated
- */
- void setIsVisible(boolean value);
-
- /**
- * Returns the value of the 'Reference' reference list. The list contents are of
- * type {@link org.eclipse.papyrus.conversion.di2.Reference}.
- *
- * If the meaning of the 'Reference' reference list isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Reference' reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_Reference()
- * @model
- * @generated
- */
- EList getReference();
-
- /**
- * Returns the value of the 'Container' container reference. It is bidirectional
- * and its opposite is '
- * {@link org.eclipse.papyrus.conversion.di2.GraphElement#getContained Contained}
- * '.
- *
- * If the meaning of the 'Container' container reference isn't clear, there really
- * should be more of a description here...
- *
- *
- *
- * @return the value of the 'Container' container reference.
- * @see #setContainer(GraphElement)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_Container()
- * @see org.eclipse.papyrus.conversion.di2.GraphElement#getContained
- * @model opposite="contained" transient="false"
- * @generated
- */
- GraphElement getContainer();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getContainer
- * Container}' container reference.
- *
- * @param value
- * the new value of the 'Container' container reference.
- * @see #getContainer()
- * @generated
- */
- void setContainer(GraphElement value);
-
- /**
- * Returns the value of the 'Font Family' attribute. The default value is
- * "".
- *
- * If the meaning of the 'Font Family' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Font Family' attribute.
- * @see #setFontFamily(String)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_FontFamily()
- * @model default="" dataType="org.eclipse.uml2.uml.String"
- * @generated
- */
- String getFontFamily();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getFontFamily
- * Font Family}' attribute.
- *
- * @param value
- * the new value of the 'Font Family' attribute.
- * @see #getFontFamily()
- * @generated
- */
- void setFontFamily(String value);
-
- /**
- * Returns the value of the 'Font Size' attribute. The default value is
- * "10".
- *
- * If the meaning of the 'Font Size' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Font Size' attribute.
- * @see #setFontSize(int)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_FontSize()
- * @model default="10" dataType="org.eclipse.uml2.uml.Integer"
- * @generated
- */
- int getFontSize();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getFontSize Font Size}
- * ' attribute.
- *
- * @param value
- * the new value of the 'Font Size' attribute.
- * @see #getFontSize()
- * @generated
- */
- void setFontSize(int value);
-
- /**
- * Returns the value of the 'Line Style' attribute. The default value is
- * "".
- *
- * If the meaning of the 'Line Style' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Line Style' attribute.
- * @see #setLineStyle(String)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_LineStyle()
- * @model default="" dataType="org.eclipse.uml2.uml.String"
- * @generated
- */
- String getLineStyle();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getLineStyle
- * Line Style}' attribute.
- *
- * @param value
- * the new value of the 'Line Style' attribute.
- * @see #getLineStyle()
- * @generated
- */
- void setLineStyle(String value);
-
- /**
- * Returns the value of the 'Line Thickness' attribute. The default value is
- * "1".
- *
- * If the meaning of the 'Line Thickness' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Line Thickness' attribute.
- * @see #setLineThickness(int)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_LineThickness()
- * @model default="1" dataType="org.eclipse.uml2.uml.Integer"
- * @generated
- */
- int getLineThickness();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getLineThickness
- * Line Thickness}' attribute.
- *
- * @param value
- * the new value of the 'Line Thickness' attribute.
- * @see #getLineThickness()
- * @generated
- */
- void setLineThickness(int value);
-
- /**
- * Returns the value of the 'Font Color' attribute.
- *
- * If the meaning of the 'Font Color' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Font Color' attribute.
- * @see #setFontColor(RGB)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_FontColor()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.RGB"
- * @generated
- */
- RGB getFontColor();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getFontColor
- * Font Color}' attribute.
- *
- * @param value
- * the new value of the 'Font Color' attribute.
- * @see #getFontColor()
- * @generated
- */
- void setFontColor(RGB value);
-
- /**
- * Returns the value of the 'Foreground Color' attribute.
- *
- * If the meaning of the 'Foreground Color' attribute isn't clear, there really should
- * be more of a description here...
- *
- *
- *
- * @return the value of the 'Foreground Color' attribute.
- * @see #setForegroundColor(RGB)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_ForegroundColor()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.RGB"
- * @generated
- */
- RGB getForegroundColor();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getForegroundColor
- * Foreground Color}' attribute.
- *
- * @param value
- * the new value of the 'Foreground Color' attribute.
- * @see #getForegroundColor()
- * @generated
- */
- void setForegroundColor(RGB value);
-
- /**
- * Returns the value of the 'Background Color' attribute.
- *
- * If the meaning of the 'Background Color' attribute isn't clear, there really should
- * be more of a description here...
- *
- *
- *
- * @return the value of the 'Background Color' attribute.
- * @see #setBackgroundColor(RGB)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_BackgroundColor()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.RGB"
- * @generated
- */
- RGB getBackgroundColor();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getBackgroundColor
- * Background Color}' attribute.
- *
- * @param value
- * the new value of the 'Background Color' attribute.
- * @see #getBackgroundColor()
- * @generated
- */
- void setBackgroundColor(RGB value);
-
- /**
- * Returns the value of the 'Border Color' attribute.
- *
- * If the meaning of the 'Border Color' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Border Color' attribute.
- * @see #setBorderColor(RGB)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_BorderColor()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.RGB"
- * @generated
- */
- RGB getBorderColor();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getBorderColor
- * Border Color}' attribute.
- *
- * @param value
- * the new value of the 'Border Color' attribute.
- * @see #getBorderColor()
- * @generated
- */
- void setBorderColor(RGB value);
-
- /**
- * Returns the value of the 'Translucent' attribute.
- *
- * If the meaning of the 'Translucent' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Translucent' attribute.
- * @see #setTranslucent(boolean)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_Translucent()
- * @model dataType="org.eclipse.uml2.uml.Boolean"
- * @generated
- */
- boolean isTranslucent();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#isTranslucent
- * Translucent}' attribute.
- *
- * @param value
- * the new value of the 'Translucent' attribute.
- * @see #isTranslucent()
- * @generated
- */
- void setTranslucent(boolean value);
-
- /**
- * Returns the value of the 'Semantic Parent' reference. It is bidirectional and
- * its opposite is '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getSemanticChild
- * Semantic Child}'.
- *
- * If the meaning of the 'Semantic Parent' reference isn't clear, there really should
- * be more of a description here...
- *
- *
- *
- * @return the value of the 'Semantic Parent' reference.
- * @see #setSemanticParent(DiagramElement)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_SemanticParent()
- * @see org.eclipse.papyrus.conversion.di2.DiagramElement#getSemanticChild
- * @model opposite="semanticChild"
- * @generated
- */
- DiagramElement getSemanticParent();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getSemanticParent
- * Semantic Parent}' reference.
- *
- * @param value
- * the new value of the 'Semantic Parent' reference.
- * @see #getSemanticParent()
- * @generated
- */
- void setSemanticParent(DiagramElement value);
-
- /**
- * Returns the value of the 'Semantic Child' reference list. The list contents
- * are of type {@link org.eclipse.papyrus.conversion.di2.DiagramElement}. It is
- * bidirectional and its opposite is '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getSemanticParent
- * Semantic Parent}'.
- *
- * If the meaning of the 'Semantic Child' reference list isn't clear, there really
- * should be more of a description here...
- *
- *
- *
- * @return the value of the 'Semantic Child' reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramElement_SemanticChild()
- * @see org.eclipse.papyrus.conversion.di2.DiagramElement#getSemanticParent
- * @model opposite="semanticParent"
- * @generated
- */
- EList getSemanticChild();
-
- /**
- *
- *
- * @model keyDataType="org.eclipse.uml2.uml.String" annotation="http://www.eclipse.org/emf/2002/GenModel body='java.util.Iterator it = getProperty().iterator();\r\nwhile (it.hasNext()) {\r\n\tProperty element = (Property) it.next();\r\n\tif(key.equals(element.getKey())) {\r\n\t\treturn element;\r\n\t}\r\n}\r\nreturn null;'"
- * @generated
- */
- Property getProperty(String key);
-
- /**
- *
- *
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.String"
- * keyDataType="org.eclipse.uml2.uml.String" annotation="http://www.eclipse.org/emf/2002/GenModel body=' if(this.getProperty(key)!=null){\r\n\treturn this.getProperty(key).getValue();}\r\nreturn null;\r\n\t'"
- * @generated
- */
- String getPropertyValue(String key);
-
- /**
- * it is used to obtain
- * the name of the good editpart
- *
- * @model kind="operation" dataType="org.eclipse.uml2.uml.String" annotation="http://www.eclipse.org/emf/2002/GenModel body='return this.getPropertyValue(com.cea.papyrus.diagraminterchange2.di2.PapyrusKeyEnumeration.PAPYRUSEDITPART.getLiteral());'"
- * @generated
- */
- String getEditpartName();
-
-} // DiagramElement
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/DiagramLink.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/DiagramLink.java
deleted file mode 100644
index ad9325318a6..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/DiagramLink.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-import org.eclipse.draw2d.geometry.Point;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * A representation of the model object 'Diagram Link'.
- *
- *
{@link org.eclipse.papyrus.conversion.di2.DiagramLink#getGraphElement Graph Element
- * }
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramLink()
- * @model
- * @generated
- */
-public interface DiagramLink extends EObject {
-
- /**
- * Returns the value of the 'Diagram' reference.
- *
- * If the meaning of the 'Diagram' reference isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Diagram' reference.
- * @see #setDiagram(Diagram)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramLink_Diagram()
- * @model required="true"
- * @generated
- */
- Diagram getDiagram();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.DiagramLink#getDiagram
- * Diagram}' reference.
- *
- * @param value
- * the new value of the 'Diagram' reference.
- * @see #getDiagram()
- * @generated
- */
- void setDiagram(Diagram value);
-
- /**
- * Returns the value of the 'Zoom' attribute.
- *
- * If the meaning of the 'Zoom' attribute isn't clear, there really should be more of a
- * description here...
- *
- *
- *
- * @return the value of the 'Zoom' attribute.
- * @see #setZoom(double)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramLink_Zoom()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Double"
- * @generated
- */
- double getZoom();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.DiagramLink#getZoom
- * Zoom}' attribute.
- *
- * @param value
- * the new value of the 'Zoom' attribute.
- * @see #getZoom()
- * @generated
- */
- void setZoom(double value);
-
- /**
- * Returns the value of the 'Viewport' attribute.
- *
- * If the meaning of the 'Viewport' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Viewport' attribute.
- * @see #setViewport(Point)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramLink_Viewport()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point"
- * @generated
- */
- Point getViewport();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramLink#getViewport Viewport}'
- * attribute.
- *
- * @param value
- * the new value of the 'Viewport' attribute.
- * @see #getViewport()
- * @generated
- */
- void setViewport(Point value);
-
- /**
- * Returns the value of the 'Graph Element' reference.
- *
- * If the meaning of the 'Graph Element' reference isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Graph Element' reference.
- * @see #setGraphElement(GraphElement)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getDiagramLink_GraphElement()
- * @model required="true"
- * @generated
- */
- GraphElement getGraphElement();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramLink#getGraphElement
- * Graph Element}' reference.
- *
- * @param value
- * the new value of the 'Graph Element' reference.
- * @see #getGraphElement()
- * @generated
- */
- void setGraphElement(GraphElement value);
-
-} // DiagramLink
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Ellipse.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Ellipse.java
deleted file mode 100644
index 201533a1643..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Ellipse.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-import org.eclipse.draw2d.geometry.Point;
-
-/**
- * A representation of the model object 'Ellipse'.
- *
- *
{@link org.eclipse.papyrus.conversion.di2.Ellipse#getEndAngle End Angle}
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getEllipse()
- * @model
- * @generated
- */
-public interface Ellipse extends GraphicPrimitive {
-
- /**
- * Returns the value of the 'Center' attribute.
- *
- * If the meaning of the 'Center' attribute isn't clear, there really should be more of
- * a description here...
- *
- *
- *
- * @return the value of the 'Center' attribute.
- * @see #setCenter(Point)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getEllipse_Center()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point"
- * @generated
- */
- Point getCenter();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Ellipse#getCenter
- * Center}' attribute.
- *
- * @param value
- * the new value of the 'Center' attribute.
- * @see #getCenter()
- * @generated
- */
- void setCenter(Point value);
-
- /**
- * Returns the value of the 'Radius X' attribute.
- *
- * If the meaning of the 'Radius X' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Radius X' attribute.
- * @see #setRadiusX(double)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getEllipse_RadiusX()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Double"
- * @generated
- */
- double getRadiusX();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Ellipse#getRadiusX
- * Radius X}' attribute.
- *
- * @param value
- * the new value of the 'Radius X' attribute.
- * @see #getRadiusX()
- * @generated
- */
- void setRadiusX(double value);
-
- /**
- * Returns the value of the 'Radius Y' attribute.
- *
- * If the meaning of the 'Radius Y' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Radius Y' attribute.
- * @see #setRadiusY(double)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getEllipse_RadiusY()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Double"
- * @generated
- */
- double getRadiusY();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Ellipse#getRadiusY
- * Radius Y}' attribute.
- *
- * @param value
- * the new value of the 'Radius Y' attribute.
- * @see #getRadiusY()
- * @generated
- */
- void setRadiusY(double value);
-
- /**
- * Returns the value of the 'Rotation' attribute.
- *
- * If the meaning of the 'Rotation' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Rotation' attribute.
- * @see #setRotation(double)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getEllipse_Rotation()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Double"
- * @generated
- */
- double getRotation();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Ellipse#getRotation
- * Rotation}' attribute.
- *
- * @param value
- * the new value of the 'Rotation' attribute.
- * @see #getRotation()
- * @generated
- */
- void setRotation(double value);
-
- /**
- * Returns the value of the 'Start Angle' attribute.
- *
- * If the meaning of the 'Start Angle' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Start Angle' attribute.
- * @see #setStartAngle(double)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getEllipse_StartAngle()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Double"
- * @generated
- */
- double getStartAngle();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Ellipse#getStartAngle
- * Start Angle}' attribute.
- *
- * @param value
- * the new value of the 'Start Angle' attribute.
- * @see #getStartAngle()
- * @generated
- */
- void setStartAngle(double value);
-
- /**
- * Returns the value of the 'End Angle' attribute.
- *
- * If the meaning of the 'End Angle' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'End Angle' attribute.
- * @see #setEndAngle(double)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getEllipse_EndAngle()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Double"
- * @generated
- */
- double getEndAngle();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.conversion.di2.Ellipse#getEndAngle
- * End Angle}' attribute.
- *
- * @param value
- * the new value of the 'End Angle' attribute.
- * @see #getEndAngle()
- * @generated
- */
- void setEndAngle(double value);
-
-} // Ellipse
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphConnector.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphConnector.java
deleted file mode 100644
index f2c69450c48..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphConnector.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-import org.eclipse.draw2d.geometry.Point;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * A representation of the model object 'Graph Connector'.
- *
- *
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphConnector()
- * @model
- * @generated
- */
-public interface GraphConnector extends EObject {
-
- /**
- * Returns the value of the 'Position' attribute.
- *
- * If the meaning of the 'Position' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Position' attribute.
- * @see #setPosition(Point)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphConnector_Position()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point"
- * @generated
- */
- Point getPosition();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.GraphConnector#getPosition Position}'
- * attribute.
- *
- * @param value
- * the new value of the 'Position' attribute.
- * @see #getPosition()
- * @generated
- */
- void setPosition(Point value);
-
- /**
- * Returns the value of the 'Graph Edge' reference list. The list contents are
- * of type {@link org.eclipse.papyrus.conversion.di2.GraphEdge}. It is bidirectional and
- * its opposite is '{@link org.eclipse.papyrus.conversion.di2.GraphEdge#getAnchor
- * Anchor}'.
- *
- * If the meaning of the 'Graph Edge' reference list isn't clear, there really should
- * be more of a description here...
- *
- *
- *
- * @return the value of the 'Graph Edge' reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphConnector_GraphEdge()
- * @see org.eclipse.papyrus.conversion.di2.GraphEdge#getAnchor
- * @model opposite="anchor"
- * @generated
- */
- EList getGraphEdge();
-
- /**
- * Returns the value of the 'Graph Element' container reference. It is
- * bidirectional and its opposite is '
- * {@link org.eclipse.papyrus.conversion.di2.GraphElement#getAnchorage Anchorage}
- * '.
- *
- * If the meaning of the 'Graph Element' container reference isn't clear, there really
- * should be more of a description here...
- *
- *
- *
- * @return the value of the 'Graph Element' container reference.
- * @see #setGraphElement(GraphElement)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphConnector_GraphElement()
- * @see org.eclipse.papyrus.conversion.di2.GraphElement#getAnchorage
- * @model opposite="anchorage" required="true" transient="false"
- * @generated
- */
- GraphElement getGraphElement();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.GraphConnector#getGraphElement
- * Graph Element}' container reference.
- *
- * @param value
- * the new value of the 'Graph Element' container reference.
- * @see #getGraphElement()
- * @generated
- */
- void setGraphElement(GraphElement value);
-
-} // GraphConnector
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphEdge.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphEdge.java
deleted file mode 100644
index c67362796e9..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/GraphEdge.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-import org.eclipse.draw2d.geometry.Point;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * A representation of the model object 'Graph Edge'.
- *
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphEdge()
- * @model
- * @generated
- */
-public interface GraphEdge extends GraphElement {
-
- /**
- * Returns the value of the 'Anchor' reference list. The list contents are of
- * type {@link org.eclipse.papyrus.conversion.di2.GraphConnector}. It is bidirectional and
- * its opposite is '{@link org.eclipse.papyrus.conversion.di2.GraphConnector#getGraphEdge
- * Graph Edge}'.
- *
- * If the meaning of the 'Anchor' reference list isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Anchor' reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphEdge_Anchor()
- * @see org.eclipse.papyrus.conversion.di2.GraphConnector#getGraphEdge
- * @model opposite="graphEdge" upper="2"
- * @generated
- */
- EList getAnchor();
-
- /**
- * Returns the value of the 'Waypoints' attribute list. The list contents are of
- * type {@link org.eclipse.draw2d.geometry.Point}.
- *
- * If the meaning of the 'Waypoints' attribute list isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement()
- * @model
- * @generated
- */
-public interface GraphElement extends DiagramElement {
-
- /**
- * Returns the value of the 'Contained' containment reference list. The list
- * contents are of type {@link org.eclipse.papyrus.conversion.di2.DiagramElement}. It is
- * bidirectional and its opposite is '
- * {@link org.eclipse.papyrus.conversion.di2.DiagramElement#getContainer
- * Container}'.
- *
- * If the meaning of the 'Contained' containment reference list isn't clear, there
- * really should be more of a description here...
- *
- *
- *
- * @return the value of the 'Contained' containment reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_Contained()
- * @see org.eclipse.papyrus.conversion.di2.DiagramElement#getContainer
- * @model opposite="container" containment="true"
- * @generated
- */
- EList getContained();
-
- /**
- * Returns the value of the 'Link' containment reference list. The list contents
- * are of type {@link org.eclipse.papyrus.conversion.di2.DiagramLink}.
- *
- * If the meaning of the 'Link' containment reference list isn't clear, there really
- * should be more of a description here...
- *
- *
- *
- * @return the value of the 'Link' containment reference list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_Link()
- * @model containment="true"
- * @generated
- */
- EList getLink();
-
- /**
- * Returns the value of the 'Semantic Model' containment reference.
- *
- * If the meaning of the 'Semantic Model' containment reference isn't clear, there
- * really should be more of a description here...
- *
- *
- *
- * @return the value of the 'Semantic Model' containment reference.
- * @see #setSemanticModel(SemanticModelBridge)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_SemanticModel()
- * @model containment="true"
- * @generated
- */
- SemanticModelBridge getSemanticModel();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.GraphElement#getSemanticModel
- * Semantic Model}' containment reference.
- *
- * @param value
- * the new value of the 'Semantic Model' containment reference.
- * @see #getSemanticModel()
- * @generated
- */
- void setSemanticModel(SemanticModelBridge value);
-
- /**
- * Returns the value of the 'Position' attribute.
- *
- * If the meaning of the 'Position' attribute isn't clear, there really should be more
- * of a description here...
- *
- *
- *
- * @return the value of the 'Position' attribute.
- * @see #setPosition(Point)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getGraphElement_Position()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point"
- * @generated
- */
- Point getPosition();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.GraphElement#getPosition Position}'
- * attribute.
- *
- * @param value
- * the new value of the 'Position' attribute.
- * @see #getPosition()
- * @generated
- */
- void setPosition(Point value);
-
- /**
- * Returns the value of the 'Anchorage' containment reference list. The list
- * contents are of type {@link org.eclipse.papyrus.conversion.di2.GraphConnector}. It is
- * bidirectional and its opposite is '
- * {@link org.eclipse.papyrus.conversion.di2.GraphConnector#getGraphElement
- * Graph Element}'.
- *
- * If the meaning of the 'Anchorage' containment reference list isn't clear, there
- * really should be more of a description here...
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getPolilyne()
- * @model
- * @generated
- */
-public interface Polilyne extends GraphicPrimitive {
-
- /**
- * Returns the value of the 'Waypoints' attribute list. The list contents are of
- * type {@link org.eclipse.draw2d.geometry.Point}.
- *
- * If the meaning of the 'Waypoints' attribute list isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Waypoints' attribute list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getPolilyne_Waypoints()
- * @model dataType="com.cea.papyrus.diagraminterchange2.di2.Point" lower="2"
- * @generated
- */
- EList getWaypoints();
-
- /**
- * Returns the value of the 'Closed' attribute list. The list contents are of
- * type {@link java.lang.Boolean}.
- *
- * If the meaning of the 'Closed' attribute list isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Closed' attribute list.
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getPolilyne_Closed()
- * @model dataType="org.eclipse.uml2.uml.Boolean" lower="2"
- * @generated
- */
- EList getClosed();
-
-} // Polilyne
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Property.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Property.java
deleted file mode 100644
index 722cf36092a..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/Property.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * A representation of the model object 'Property'.
- *
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getReference()
- * @model
- * @generated
- */
-public interface Reference extends DiagramElement {
-
- /**
- * Returns the value of the 'Is Individual Representation' attribute.
- *
- * If the meaning of the 'Is Individual Representation' attribute isn't clear, there
- * really should be more of a description here...
- *
- *
- *
- * @return the value of the 'Is Individual Representation' attribute.
- * @see #setIsIndividualRepresentation(boolean)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getReference_IsIndividualRepresentation()
- * @model dataType="org.eclipse.uml2.uml.Boolean"
- * @generated
- */
- boolean isIsIndividualRepresentation();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.Reference#isIsIndividualRepresentation
- * Is Individual Representation}' attribute.
- *
- * @param value
- * the new value of the 'Is Individual Representation' attribute.
- * @see #isIsIndividualRepresentation()
- * @generated
- */
- void setIsIndividualRepresentation(boolean value);
-
- /**
- * Returns the value of the 'Referenced' reference.
- *
- * If the meaning of the 'Referenced' reference isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Referenced' reference.
- * @see #setReferenced(DiagramElement)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getReference_Referenced()
- * @model required="true"
- * @generated
- */
- DiagramElement getReferenced();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.Reference#getReferenced Referenced}'
- * reference.
- *
- * @param value
- * the new value of the 'Referenced' reference.
- * @see #getReferenced()
- * @generated
- */
- void setReferenced(DiagramElement value);
-
-} // Reference
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SemanticModelBridge.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SemanticModelBridge.java
deleted file mode 100644
index 01086766fef..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SemanticModelBridge.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * A representation of the model object '
- * Semantic Model Bridge'.
- *
- *
- *
- *
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getSemanticModelBridge()
- * @model
- * @generated
- */
-public interface SemanticModelBridge extends EObject {
-
- /**
- * Returns the value of the 'Presentation' attribute.
- *
- * If the meaning of the 'Presentation' attribute isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Presentation' attribute.
- * @see #setPresentation(String)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getSemanticModelBridge_Presentation()
- * @model dataType="org.eclipse.uml2.uml.String"
- * @generated
- */
- String getPresentation();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.SemanticModelBridge#getPresentation
- * Presentation}' attribute.
- *
- * @param value
- * the new value of the 'Presentation' attribute.
- * @see #getPresentation()
- * @generated
- */
- void setPresentation(String value);
-
- /**
- * Returns the value of the 'Graph Element' reference.
- *
- * If the meaning of the 'Graph Element' reference isn't clear, there really should be
- * more of a description here...
- *
- *
- *
- * @return the value of the 'Graph Element' reference.
- * @see #setGraphElement(GraphElement)
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#getSemanticModelBridge_GraphElement()
- * @model
- * @generated
- */
- GraphElement getGraphElement();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.papyrus.conversion.di2.SemanticModelBridge#getGraphElement
- * Graph Element}' reference.
- *
- * @param value
- * the new value of the 'Graph Element' reference.
- * @see #getGraphElement()
- * @generated
- */
- void setGraphElement(GraphElement value);
-
-} // SemanticModelBridge
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SimpleSemanticModelElement.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SimpleSemanticModelElement.java
deleted file mode 100644
index 0177655afb4..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2/src/org/eclipse/papyrus/conversion/di2/SimpleSemanticModelElement.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- *
- *
- *
- * $Id$
- */
-package org.eclipse.papyrus.conversion.di2;
-
-/**
- * A representation of the model object '
- * Simple Semantic Model Element'.
- *
- *
- * Note: the correct way to create the package is via the static factory method {@link #init
- * init()}, which also performs initialization of the package, or returns the registered
- * package, if one already exists.
- *
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.papyrus.conversion.di2.Di2Package#eNS_URI
- * @see #init()
- * @generated
- */
- private Di2PackageImpl() {
- super(eNS_URI, Di2Factory.eINSTANCE);
- }
-
- /**
- *
- *
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the Package for this model, and for any others
- * upon which it depends. Simple dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives initialization for
- * interdependent packages directly, in parallel with this package, itself.
- *
- * Of this package and its interdependencies, all packages which have not yet been registered by
- * their URI values are first created and registered. The packages are then initialized in two
- * steps: meta-model objects for all of the packages are created before any are initialized,
- * since one package's meta-model objects may refer to those of another.
- *
-
-This plugin enables to convert diagrams created using papyrus 1.X version
-into diagram editable by Papyrus MDT. This Tutorial is twofold:
-
-
-
First, it includes a user guide in order to convert your diagrams (created
- with Papyrus 1.X) into diagrams editable by Papyrus MDT
-
-
Second, it includes a developer guide in order to help developers to extend the
- conversion to other diagram not already supported.
-
-
-
-
-
How to use the converter?
-
-
-
Add the org.eclipse.papyrus.conversion.di2 + di2todi plugins to your
- eclipse configuration. These plugins are provided in the Papyrus SVN
- repository under extraplugins/conversion.
-
-
Launch eclipse, including Papyrus MDT. Import your old-version model
- created with Papyrus 1.x, let’s call it “Example”. To this aim
- you need to import two files: “Example.di2” and “Example.uml”,
- as shown in Figure 2.
-
-
-
-
-
- Import Papyrus 1.x Model
-
-
-
-
Convert your model. To this aim:
- Right click on “Example.di2”> in the menu, select “Convert
- Diagram”>then, “Di2 to Di Action”, as shown in Figure 3.
-
-
-
-
- Convert Your Model
-
-
-
-
After processing, a new model is created, compatible with Papyrus MDT.
- Indeed, the conversion creates from the di2 file (i.e., Example.di2)
- two new files, namely, “Example.notation” and “Example.di”.
- The uml file (i.e., Example.uml) is used to make reference to the
- uml graphical elements. At the end of the conversion a message
- dialog is opened to inform you of the success or the failure of your
- conversion.
-
-
-
-
- Conversion result
-
-
-
-
Open the generated di file (i.e., Example.di) to show and edit your
- model.
-
-
-
Internal Process of the conversion
-
-This process is performed transparently to user, however, this brief description aims
-to provide global overview of the internal process
-
-
1st Step
-As mentioned in the step2, the diagram
-converter requires the di2 namespace to be uniquely defined. To this
-aim as a first step of the internal process, the converter changed
-the namespace in the di2 file from “http://www.papyrusuml.org” to
-“http://www.papyrusuml.org/di2”.
-
-
-This step is meant to be transparent to the user, as the converter
-restores the di2 namespace to “http://www.papyrusuml.org”
-at the end of the conversion, in order to make your diagram editable
-by Papyrus 1.x. However,
-if the conversion fails before restoring the original name space, the
-old-version model may be no more editable by Papyrus 1.x. Hence, the
-user may need to restore it manually by editing the di2 file using a
-text editor, and removing the “/di2” from the namespace
-http://www.papyrusuml.org/di2.
-
-
2nd Step
-
-As a second step, the converter transforms elements described in the di2
-file into elements in the notation and di files according to their
-respective metamodels.
-
-The di file contains references to the different diagrams in your model.
-The notation file contains a specific description of the elements
-that are represented graphically in each diagram: size, coordinates,
-nested elements, and so on.
-To perform this step, the converter performed a set of QVT
-(Query/View/Transform) Operation mappings.
-
-
3rd Step
-
-Finally, the converter stores the result of the transformation in to two files,
-namely, notation and di file, and restores the di2 namespace to
-“http://www.papyrusuml.org”.
-
-
Supported Conversions
-
-Herein, we present two sample conversions and outline the elements supported by the converter. We start
-first with the class diagram and then, we detail the transformations in the composite diagram.
-
-
Class Diagram
-
-Tests have been done with class diagrams containing
-
-
Simple classes
-
Class with operations and attributes
-
Comments
-
Relationships between classes
-
-
Dependency
-
Association
-
Link with a comment
-
Realization
-
Generalization
-
-
-
-The screenshots have been taken with an older version that did not copy color attributes. These are now handled.
-
-
-
- Class diagram in Papyrus 1.12 (original)
-
-
- Class diagram in Papyrus MDT (conversion result)
-
-
-
Composite Diagram
-
-Tests have been done with composite diagrams containing
-
-
-
Composite classes
-
Properties within composite classes
-
Nested classes
-
Ports
-
Connection between ports: connector
-
-
-
-
- Composite diagram in Papyrus 1.12 (original)
-
-
- Composite diagram in Papyrus MDT (conversion result)
-
-
-
Developer guide
-
-To convert models from Papyrus 1.x to Papyrus MDT, this plugin uses Q/V/T operational mappings.
-The plugin contains additional Java code, it is divided into three parts:
-
-
Model Transformation libraries implemented in QVTO
-
Black Boxes implemented in Java and used by the model transformations
-
Java code that is used to call the model transformations and extend the eclipse
- context menu with the conversion action, i.e., "Convert Diagram".
-
-
-The main part of the plugin is the model transformation, which includes
-
-
General libraries:
-
-
ElementType.qvto: names of diagrams in Papyrus 1.12 and MDT.
-
GeneralMappingsandHelpers.qvto: collection of utilities
-
NotationQueries.qvto
- includes all the queries that are made to the di2 model in order to
- be used in the notation model.
-
Diagram.qvto: convert the supported diagrams, make use of diagram specific
- libraries below.
-
DiTansformation.qvto
- enable to create the elements of the di model from the di2 model.
-
-
-
Diagram specific libraries, prefixed with name of diagram, i.e. <Class>, <Composite>, <State>,
- <Profile> and <ClassAndProfile> (the letter is a particular case for edges in class and profile
- diagrams which have identical IDs in these two diagram types)
-
-
DiagEdge.qvto
- that converts all sorts of edges (realization, dependency,
- generalization, and so on).
-
DiagNodes.qvto that converts the node elements of a diagram
-
-
The main transformation
-
-
Transfo.qvto, which triggers the model transformation.
-
-
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-di2action.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-di2action.png
deleted file mode 100644
index 1e1d021cd66..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-di2action.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-project.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-project.png
deleted file mode 100644
index 5c11cc12e2e..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-project.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-result.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-result.png
deleted file mode 100644
index fe3a0e97514..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/conversion-example-result.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-mdt.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-mdt.png
deleted file mode 100644
index ae6b496d0c8..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-mdt.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-p1.12.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-p1.12.png
deleted file mode 100644
index 0a61e8d5ae5..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example-composite-diag-p1.12.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-mdt.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-mdt.png
deleted file mode 100644
index 531381a328e..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-mdt.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-p1.12.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-p1.12.png
deleted file mode 100644
index 726a5582f1b..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example1-class-diagram-p1.12.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-mdt.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-mdt.png
deleted file mode 100644
index c8112529635..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-mdt.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-p1.12.png b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-p1.12.png
deleted file mode 100644
index 8a9e3e5e824..00000000000
Binary files a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/doc/figs/example2-class-diagram-p1.12.png and /dev/null differ
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/plugin.properties b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/plugin.properties
deleted file mode 100644
index 1803ba8aee5..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-#################################################################################
-# Copyright (c) 2011 CEA LIST.
-# 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:
-# Manel Fredj, Ansgar Radermacher - Initial API and implementation
-##################################################################################
-pluginName=di2 to di conversion (Papyrus 1.x to Papyrus MDT)
-providerName=Eclipse Modeling Project
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/plugin.xml b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/plugin.xml
deleted file mode 100644
index 484692c3519..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/plugin.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/Activator.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/Activator.java
deleted file mode 100644
index c660b3cea70..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/Activator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.papyrus.conversion.di2todi;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.conversion.di2todi"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/blackboxes/UtilitiesLibrary.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/blackboxes/UtilitiesLibrary.java
deleted file mode 100644
index 9138b043865..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/blackboxes/UtilitiesLibrary.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/**
- * @author: Manel Fredj - CEA
- * This class includes all the operations that are called in the transformation QVTO from java.
- * These operations are wrapped into a black-box
- */
-
-package org.eclipse.papyrus.conversion.di2todi.blackboxes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
-import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
-import org.eclipse.m2m.qvt.oml.blackbox.java.Operation;
-import org.eclipse.papyrus.conversion.di2.GraphElement;
-import org.eclipse.papyrus.conversion.di2.SemanticModelBridge;
-import org.eclipse.papyrus.conversion.di2.Uml1SemanticModelBridge;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.uml2.uml.Association;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.ElementImport;
-import org.eclipse.uml2.uml.Generalization;
-import org.eclipse.uml2.uml.Realization;
-
-public class UtilitiesLibrary {
-
- @Operation(contextual=true)
- public static String getName(Diagram self)
- {
- return self.getName();
- }
-
- @Operation(contextual=true)
- public static EObject convertElement(Element self)
- {
- return self;
- }
-
- @Operation(contextual=true)
- public static String getElementType(Element self)
- {
- if (self instanceof Association )
- return "Association";
- if (self instanceof Generalization )
- return "Generalization";
- else return null;
- }
-
- @Operation(contextual=true)
- public static boolean isGeneralization(Element self)
- {
- if (self instanceof Generalization)
- return true;
- else return false;
- }
-
-
- @Operation(contextual=true)
- public static boolean isAssociation(Element self)
- {
- if (self instanceof Association)
- return true;
- else
- return false;
- }
-
- @Operation(contextual=true)
- public static boolean isRealization(Element self)
- {
- if (self instanceof Realization)
- return true;
- else
- return false;
- }
- @Operation(contextual=true)
- public static boolean isDependency(Element self)
- {
- if (self instanceof Dependency)
- return true;
- else
- return false;
- }
-
- @Operation(contextual=true)
- public static int dimensionGetWidth(Dimension self)
- {
- if (self!=null)
- return self.width;
- else
- return 0;
- }
-
- @Operation(contextual=true)
- public static int dimensionGetHeight(Dimension self)
- {
- if (self!=null)
- return self.height;
- else
- return 0;
- }
-
- @Operation(contextual=true)
- public static int pointGetX(Point self)
- {
- if (self!=null)
- {
-
- return self.x;
- }else
- return 0;
- }
-
- @Operation(contextual=true)
- public static int pointGetY(Point self)
- {
- if (self!=null)
- {
- return self.y;
- }
- else
- return 0;
- }
-
- @Operation(contextual=true)
- public static String showcoordinates(Point self)
- {
- if (self!=null)
- {
- return "the x is "+ self.x+ "and the y is "+ self.y;
- }
- else
- return "nothing to display";
- }
-
- @Operation(contextual=true)
- public static int rgb2int(RGB self)
- {
- if (self!=null)
- return self.blue * 0x10000 + self.green *0x100 + self.red;
- else
- return 0;
- }
-
- @Operation(contextual=true)
- public static Element getElement(Uml1SemanticModelBridge bridge) {
- // difference to using element attribute directly: getElement will try to resolve proxies
- // and thus detects elements referenced by the di2 model that do not exist (anymore) in the
- // uml model
- Element element = bridge.getElement();
- if ((element != null) && element.eIsProxy()) {
- // is still proxy (the getElement implementation of Uml1SemanticModelBridge already tried to
- // resolve) => return null
- return null;
- }
- else {
- return element;
- }
- }
-
- /**
- * Return the semantic model for a given di2 element
- * @param di2Element existing di2 element
- * @return the associated semantic model or null
- */
- @Operation(contextual=true)
- public static Uml1SemanticModelBridge getSemanticModel(GraphElement di2Element) {
- SemanticModelBridge semanticModel;
- if (di2Element instanceof org.eclipse.papyrus.conversion.di2.Diagram) {
- semanticModel =((org.eclipse.papyrus.conversion.di2.Diagram) di2Element).getOwner();
- }
- else {
- semanticModel = di2Element.getSemanticModel();
- }
- if (semanticModel instanceof Uml1SemanticModelBridge) {
- return (Uml1SemanticModelBridge) semanticModel;
- }
- return null;
- }
-
- @Operation(contextual=true)
- public static Element getElement(GraphElement di2Element) {
-
- Uml1SemanticModelBridge semanticModel = getSemanticModel(di2Element);
- if (semanticModel != null) {
- return getElement (semanticModel);
- }
- else {
- System.err.println("no bridge found for di2Node" + di2Element);
- }
- return null;
- }
-
- // may be useful for debugging (use it instead of getElement in combination with a breakpoint)
- @Operation(contextual=true)
- public static Element getElementDebug(GraphElement di2Element) {
-
- Element element = getElement(di2Element);
- return element;
- }
-
- /**
- * Papyrus 1 profile diagrams do not reference meta-class elements directly, but the
- * associated element imported
- * @param bridge
- * @return
- */
- @Operation(contextual=true)
- public static Element getMetaclassRef(Uml1SemanticModelBridge semanticModel) {
- Element element = getElement (semanticModel);
- if (element != null) {
- if (element instanceof ElementImport) {
- return ((ElementImport) element).getImportedElement();
- }
- }
- else {
- System.err.println("no element found");
- }
- return element;
- }
-
- public Object createBendpoints()
- {
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- List points = new ArrayList(2);
- points.add(new RelativeBendpoint(0,0,0,0));
- points.add(new RelativeBendpoint(0,0,0,0));
- bendpoints.setPoints(points);
- return bendpoints;
- }
-}
\ No newline at end of file
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/Di2toDiAction.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/Di2toDiAction.java
deleted file mode 100644
index 2c0729cdeda..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/Di2toDiAction.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/**
- * @author: Manel Fredj - CEA
- * This class invoke QVTO transformations that convert a diagram from di2 into di+notation
- */
-
-package org.eclipse.papyrus.conversion.di2todi.popupactions;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.m2m.internal.qvt.oml.ast.env.ModelExtentContents;
-import org.eclipse.m2m.internal.qvt.oml.common.MdaException;
-import org.eclipse.m2m.internal.qvt.oml.emf.util.ModelContent;
-import org.eclipse.m2m.internal.qvt.oml.library.Context;
-import org.eclipse.m2m.internal.qvt.oml.runtime.generator.TransformationRunner;
-import org.eclipse.m2m.internal.qvt.oml.runtime.generator.TransformationRunner.In;
-import org.eclipse.m2m.internal.qvt.oml.runtime.generator.TransformationRunner.Out;
-import org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpretedTransformation;
-import org.eclipse.m2m.internal.qvt.oml.runtime.project.TransformationUtil;
-import org.eclipse.m2m.internal.qvt.oml.trace.Trace;
-import org.eclipse.m2m.internal.qvt.oml.trace.TraceRecord;
-import org.eclipse.m2m.qvt.oml.util.IContext;
-import org.eclipse.papyrus.conversion.di2.util.Di2AdapterFactory;
-import org.eclipse.papyrus.conversion.di2todi.Activator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-@SuppressWarnings("restriction")
-public class Di2toDiAction implements IObjectActionDelegate {
-
- private static final Map, ?> options = null;
- private IPath inModelPath; //reference to selected Model
- private String inAbsolutepath;
-
- /**
- * Constructor for Action1.
- */
- public Di2toDiAction() {
- super();
- inModelPath=null;
- inAbsolutepath=null;
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (adapterFactory == null) {
- // dummy operation to force loading/initialization of di2 plugin
- adapterFactory = new Di2AdapterFactory();
- }
- // Refer to an existing transformation via URI
- final URI transformationURI =
- URI.createURI("platform:/plugin/" + Activator.PLUGIN_ID + "/TransfoQvtoDi2toDi/Transfo.qvto");
-
- //get the resources from the input URI
- final ResourceSet resourceSet = new ResourceSetImpl();
- Job job = new Job("Convert diagram " + inModelPath.toString()) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- // execute the task ...
-
- try {
- monitor.beginTask("converting ...", 4);
-
- URI inURI = URI.createPlatformResourceURI(inModelPath.toString(), true);
- Resource inResource = resourceSet.getResource(inURI, true);
- // create the inputs
- List inObjects =inResource.getContents();
- ModelContent input_di2 = new ModelContent (inObjects);
- ModelContent[] inputs = new ModelContent[1];
- inputs[0]=input_di2;
-
- // setup the execution environment details -> context
- IContext mycontext = new Context();
- Trace trace= null;
-
- QvtInterpretedTransformation transformation = new QvtInterpretedTransformation (TransformationUtil.getQvtModule(transformationURI));
- In IntransformationRunner=new TransformationRunner.In(inputs, mycontext);
- Out OuttransformationRunner=new TransformationRunner.Out(null,null, null);
-
- monitor.worked(1);
- // running the transformation
- OuttransformationRunner=transformation.run(IntransformationRunner);
-
- // retrieve the outputs
- List outputs= OuttransformationRunner.getExtents();
-
- // retrieve the trace
- trace= OuttransformationRunner.getTrace();
-
- if (trace !=null && outputs.size()==2) {
- // processing the trace
- URI Uri_trace = inURI.trimFileExtension().appendFileExtension("trace");
- EList outObjects_trace = trace.getTraceRecords();
- Resource outResource_trace = resourceSet.createResource(Uri_trace);
- outResource_trace.getContents().addAll(outObjects_trace);
-
- // processing the outputs
- ModelExtentContents output_notation = outputs.get(0);
- ModelExtentContents output_di = outputs.get(1);
- monitor.worked(1);
-
- URI Uri_notation = inURI.trimFileExtension().appendFileExtension("notation");
- URI Uri_di = inURI.trimFileExtension().appendFileExtension("di");
-
- // the output objects got captured in the output extent
- List outObjects_notation = output_notation.getAllRootElements();
- List outObjects_di = output_di.getAllRootElements();
-
- //Let's persist them using a resource for notation
- Resource outResource_notation = resourceSet.createResource(Uri_notation );
- outResource_notation.getContents().addAll(outObjects_notation);
-
- // let's persist them using a resource for di
- Resource outResource_di = resourceSet.createResource(Uri_di);
- outResource_di.getContents().addAll(outObjects_di);
-
- monitor.worked(1);
-
- try{
- outResource_notation.save(Collections.emptyMap());
- outResource_di.save(Collections.emptyMap());
- outResource_trace.save(Collections.emptyMap());
- }
- catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- monitor.worked(1);
-
- // remove trace file
- URIConverter uri= resourceSet.getURIConverter();
- uri.delete(Uri_trace, options);
- }
- }
- catch (final MdaException e) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(
- new Shell(), "Model transformation error during conversion", e.toString ());
- }
- });
- e.printStackTrace();
- }
- catch (final IOException e) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(
- new Shell(), "IO error during conversion", e.toString ());
- }
- });
- e.printStackTrace();
- }
- catch (final RuntimeException e) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(
- new Shell(), "Error during conversion", e.toString ());
- }
- });
- e.printStackTrace ();
- }
- finally {
- // when the transformation succeeds
- //1- restore the content of Di2 file i.e., di2 namespace
- PapyrusNamespace.restoreDi2Namespace(inAbsolutepath);
- }
-
- monitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setUser (true);
- job.schedule ();
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.inModelPath = null;
-
- if (!(selection instanceof IStructuredSelection)) {
- // no structured-selection
- return;
- }
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- if (selection.isEmpty()) {
- return;
- }
-
- Object firstElement = structuredSelection.getFirstElement();
-
- if (firstElement instanceof IFile) {
-
- IFile di2Select = (IFile) firstElement;
- // retrieve the path of the file
- IPath di2Path = di2Select.getFullPath();
- IPath location = di2Select.getLocation();
- if (location != null) {
- // Get the file for the location
- File file = location.toFile();
- if (file != null) {
- // Add the absolute path to the list
- this.inAbsolutepath = file.getAbsolutePath();
- }
-
- // check whether it is a .di2 file
- String di2filename = di2Path.toString();
- if (di2filename.endsWith (".di2")) {
- // change namespace of di2
- PapyrusNamespace.replaceNamespace(this.inAbsolutepath);
- this.inModelPath = di2Path;
- }
- }
- }
- }
-
- Di2AdapterFactory adapterFactory = null;
-}
-
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/PapyrusNamespace.java b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/PapyrusNamespace.java
deleted file mode 100644
index 5a17df64ff2..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/src/org/eclipse/papyrus/conversion/di2todi/popupactions/PapyrusNamespace.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * @author: Manel Fredj - CEA
- * This class enables to change the namespace of di2 metamodel from
- * replace http://www.papyrusuml.org into http://www.papyrusuml.org/di2
- */
-
-package org.eclipse.papyrus.conversion.di2todi.popupactions;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-
-public class PapyrusNamespace
-{
- /////////////////////////////////////////////////////////////////////////////////////////////
- //replace http://www.papyrusuml.org -- by -- http://www.papyrusuml.org/di2
-
- public static void replaceNamespace(String absolutepath)
- {
- try {
- String oldNameSpace = "di2=\"http://www.papyrusuml.org\"";
- String newNameSpace="di2=\"http://www.papyrusuml.org/di2\"";
- String oldtext =readFileAsString(absolutepath);
- // replace the namespace in the di2 file
- String newtext = oldtext.replaceAll (oldNameSpace, newNameSpace);
-
- FileWriter writer = new FileWriter(absolutepath);
- writer.write(newtext);writer.close();
- }
- catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-
- public static void restoreDi2Namespace(String absolutepath)
- {
- try {
- String oldNameSpace="di2=\"http://www.papyrusuml.org/di2\"";
- String newNameSpace = "di2=\"http://www.papyrusuml.org\"";
-
- String oldtext =readFileAsString(absolutepath);
- // replace the namespace in the di2 file
- String newtext = oldtext.replaceAll (oldNameSpace, newNameSpace);
-
- FileWriter writer = new FileWriter(absolutepath);
- writer.write(newtext);writer.close();
- }
- catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-
- /**
- * @param filePath the name of the file to open. Not sure if it can accept
- * cccURLs or just filenames. Path handling could be better, and buffer
- * sizes are hardcoded
- */
- private static String readFileAsString (String filePath)
- throws java.io.IOException
- {
- byte[] buffer = new byte[(int) new File(filePath).length()];
- BufferedInputStream f = null;
- try {
- f = new BufferedInputStream(new FileInputStream(filePath));
- f.read(buffer);
- }
- finally {
- if (f != null) {
- try {
- f.close();
- }
- catch (IOException ignored) {
- }
- }
- }
- return new String(buffer);
- }
-}
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/toc.xml b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/toc.xml
deleted file mode 100644
index 3057fc280ee..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/toc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/tocdev.xml b/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/tocdev.xml
deleted file mode 100644
index 53009154565..00000000000
--- a/extraplugins/conversion/org.eclipse.papyrus.conversion.di2todi/tocdev.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
--
cgit v1.2.3
From 037964361184151633bde6cc05d6ad1cab3e7253 Mon Sep 17 00:00:00 2001
From: Camille Letavernier
Date: Fri, 14 Mar 2014 19:31:58 +0100
Subject: [Releng] Move the oep.conversion plug-ins to the deprecated folder
---
.../.project | 17 ++
.../build.properties | 7 +
.../eclipse_papyrus_helios.xml | 94 ++++++++
.../epl-v10.html | 261 +++++++++++++++++++++
.../epp.product | 56 +++++
.../feature.properties | 130 ++++++++++
.../feature.xml | 65 +++++
.../license.html | 107 +++++++++
.../org.eclipse.epp.package.papyrus.feature/p2.inf | 8 +
.../plugin_customization.ini | 1 +
.../org.eclipse.epp.package.papyrus/.project | 22 ++
.../META-INF/MANIFEST.MF | 9 +
.../org.eclipse.epp.package.papyrus/about.html | 28 +++
.../org.eclipse.epp.package.papyrus/about.ini | 37 +++
.../org.eclipse.epp.package.papyrus/about.mappings | 6 +
.../about.properties | 28 +++
.../buckminster.cspex | 41 ++++
.../build.properties | 15 ++
.../org.eclipse.epp.package.papyrus/eclipse.gif | Bin 0 -> 1052 bytes
.../org.eclipse.epp.package.papyrus/eclipse.png | Bin 0 -> 654 bytes
.../org.eclipse.epp.package.papyrus/eclipse32.gif | Bin 0 -> 1706 bytes
.../org.eclipse.epp.package.papyrus/eclipse32.png | Bin 0 -> 4594 bytes
.../org.eclipse.epp.package.papyrus/eclipse48.gif | Bin 0 -> 2371 bytes
.../org.eclipse.epp.package.papyrus/eclipse48.png | Bin 0 -> 3099 bytes
.../org.eclipse.epp.package.papyrus/eclipse_lg.gif | Bin 0 -> 12710 bytes
.../intro-eclipse.png | Bin 0 -> 13739 bytes
.../org.eclipse.epp.package.papyrus/plugin.xml | 51 ++++
.../plugin_customization.ini | 37 +++
.../.project | 17 --
.../build.properties | 7 -
.../eclipse_papyrus_helios.xml | 94 --------
.../epl-v10.html | 261 ---------------------
.../epp.product | 56 -----
.../feature.properties | 130 ----------
.../feature.xml | 65 -----
.../license.html | 107 ---------
.../org.eclipse.epp.package.papyrus.feature/p2.inf | 8 -
.../plugin_customization.ini | 1 -
.../rcp/org.eclipse.epp.package.papyrus/.project | 22 --
.../META-INF/MANIFEST.MF | 9 -
.../rcp/org.eclipse.epp.package.papyrus/about.html | 28 ---
.../rcp/org.eclipse.epp.package.papyrus/about.ini | 37 ---
.../org.eclipse.epp.package.papyrus/about.mappings | 6 -
.../about.properties | 28 ---
.../buckminster.cspex | 41 ----
.../build.properties | 15 --
.../org.eclipse.epp.package.papyrus/eclipse.gif | Bin 1052 -> 0 bytes
.../org.eclipse.epp.package.papyrus/eclipse.png | Bin 654 -> 0 bytes
.../org.eclipse.epp.package.papyrus/eclipse32.gif | Bin 1706 -> 0 bytes
.../org.eclipse.epp.package.papyrus/eclipse32.png | Bin 4594 -> 0 bytes
.../org.eclipse.epp.package.papyrus/eclipse48.gif | Bin 2371 -> 0 bytes
.../org.eclipse.epp.package.papyrus/eclipse48.png | Bin 3099 -> 0 bytes
.../org.eclipse.epp.package.papyrus/eclipse_lg.gif | Bin 12710 -> 0 bytes
.../intro-eclipse.png | Bin 13739 -> 0 bytes
.../rcp/org.eclipse.epp.package.papyrus/plugin.xml | 51 ----
.../plugin_customization.ini | 37 ---
56 files changed, 1020 insertions(+), 1020 deletions(-)
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/.project
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/build.properties
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/epl-v10.html
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/epp.product
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/feature.properties
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/feature.xml
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/license.html
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/p2.inf
create mode 100644 deprecated/org.eclipse.epp.package.papyrus.feature/plugin_customization.ini
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/.project
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/META-INF/MANIFEST.MF
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/about.html
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/about.ini
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/about.mappings
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/about.properties
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/buckminster.cspex
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/build.properties
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/eclipse.gif
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/eclipse.png
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/eclipse32.gif
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/eclipse32.png
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/eclipse48.gif
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/eclipse48.png
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/eclipse_lg.gif
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/intro-eclipse.png
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/plugin.xml
create mode 100644 deprecated/org.eclipse.epp.package.papyrus/plugin_customization.ini
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/.project
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/build.properties
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epl-v10.html
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epp.product
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.properties
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.xml
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/license.html
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/p2.inf
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/plugin_customization.ini
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/.project
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/META-INF/MANIFEST.MF
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/about.html
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/about.ini
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/about.mappings
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/about.properties
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/buckminster.cspex
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/build.properties
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.gif
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.png
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.gif
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.png
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.gif
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.png
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse_lg.gif
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/intro-eclipse.png
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin.xml
delete mode 100644 extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin_customization.ini
(limited to 'extraplugins')
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/.project b/deprecated/org.eclipse.epp.package.papyrus.feature/.project
new file mode 100644
index 00000000000..5c7c9b3f00a
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/.project
@@ -0,0 +1,17 @@
+
+
+ org.eclipse.epp.package.papyrus.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/build.properties b/deprecated/org.eclipse.epp.package.papyrus.feature/build.properties
new file mode 100644
index 00000000000..7d2d8724f28
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/build.properties
@@ -0,0 +1,7 @@
+bin.includes = feature.xml,\
+ p2.inf,\
+ epl-v10.html,\
+ license.html,\
+ feature.properties,\
+ plugin_customization.ini
+includeLaunchers = false
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml b/deprecated/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml
new file mode 100644
index 00000000000..370e83fbfb4
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+ incubating components, as indicated by feature numbers less than 1.0.0 on the feature list.]]>
+
+
+ Cédric Brun
+ Markus Knauer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/epl-v10.html b/deprecated/org.eclipse.epp.package.papyrus.feature/epl-v10.html
new file mode 100644
index 00000000000..2e85bcbd1ac
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/epl-v10.html
@@ -0,0 +1,261 @@
+
+
+
+
+
+
+Eclipse Public License - Version 1.0
+
+
+
+
+
+
+
Eclipse Public License - v 1.0
+
+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.
+
+
1. DEFINITIONS
+
+
"Contribution" means:
+
+
a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and
+
b) in the case of each subsequent Contributor:
+
i) changes to the Program, and
+
ii) additions to the Program;
+
where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.
+
+
"Contributor" means any person or entity that distributes
+the Program.
+
+
"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.
+
+
"Program" means the Contributions distributed in accordance
+with this Agreement.
+
+
"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.
+
+
2. GRANT OF RIGHTS
+
+
a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.
+
+
b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.
+
+
c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.
+
+
d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.
+
+
3. REQUIREMENTS
+
+
A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:
+
+
a) it complies with the terms and conditions of this
+Agreement; and
+
+
b) its license agreement:
+
+
i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;
+
+
ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;
+
+
iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and
+
+
iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.
+
+
When the Program is made available in source code form:
+
+
a) it must be made available under this Agreement; and
+
+
b) a copy of this Agreement must be included with each
+copy of the Program.
+
+
Contributors may not remove or alter any copyright notices contained
+within the Program.
+
+
Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+
+
4. COMMERCIAL DISTRIBUTION
+
+
Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.
+
+
For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.
+
+
5. NO WARRANTY
+
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.
+
+
6. DISCLAIMER OF LIABILITY
+
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
7. GENERAL
+
+
If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.
+
+
If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.
+
+
All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.
+
+
Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.
+
+
This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.
+
+
+
+
\ No newline at end of file
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/epp.product b/deprecated/org.eclipse.epp.package.papyrus.feature/epp.product
new file mode 100644
index 00000000000..d88a8200ff1
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/epp.product
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+ Specified in the plugin.xml of the branding plugin.
+
+
+
+
+
+
+
+ -product org.eclipse.epp.package.papyrus.product
+--launcher.defaultAction openFile
+ --launcher.XXMaxPermSize
+256M
+ -Dosgi.requiredJavaVersion=1.5
+-Xms40m
+-Xmx512m
+ -XX:MaxPermSize=256m
+ -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
+-XX:MaxPermSize=256m
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
+ org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
+ org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
+ org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/feature.properties b/deprecated/org.eclipse.epp.package.papyrus.feature/feature.properties
new file mode 100644
index 00000000000..9c9df421fba
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/feature.properties
@@ -0,0 +1,130 @@
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/feature.xml b/deprecated/org.eclipse.epp.package.papyrus.feature/feature.xml
new file mode 100644
index 00000000000..9c267c277eb
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/feature.xml
@@ -0,0 +1,65 @@
+
+
+
+
+ This modeling package contains a collection of Eclipse Modeling Project components, including EMF, GMF, MDT XSD/OCL/UML2, M2M, M2T, and EMFT elements. It includes a complete SDK, developer tools and source code. Note that the Modeling package includes some incubating components, as indicated by feature numbers less than 1.0.0 on the feature list.
+
+
+
+ %license
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus.feature/license.html b/deprecated/org.eclipse.epp.package.papyrus.feature/license.html
new file mode 100644
index 00000000000..69305408635
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus.feature/license.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+Eclipse Foundation Software User Agreement
+
+
+
+
Eclipse Foundation Software User Agreement
+
April 14, 2010
+
+
Usage Of Content
+
+
THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.
+
+
Applicable Licenses
+
+
Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.
+ For purposes of the EPL, "Program" will mean the Content.
+
+
Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").
+
+
+
Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
+
Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
+
A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.
+
Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
+
+
+
The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:
+
+
+
The top-level (root) directory
+
Plug-in and Fragment directories
+
Inside Plug-ins and Fragments packaged as JARs
+
Sub-directories of the directory named "src" of certain Plug-ins
+
Feature directories
+
+
+
Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.
+
+
THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.
+
+
+
Use of Provisioning Technology
+
+
The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html
+ ("Specification").
+
+
You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:
+
+
+
A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.
+
During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.
+
Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
+
+
+
Cryptography
+
+
Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.
+
+
Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.
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 http://www.eclipse.org/legal/epl-v10.html.
+For purposes of the EPL, "Program" will mean the Content.
+
+
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 http://www.eclipse.org.
+
+
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus/about.ini b/deprecated/org.eclipse.epp.package.papyrus/about.ini
new file mode 100644
index 00000000000..408d6f3f39f
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus/about.ini
@@ -0,0 +1,37 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for feature details in the "About"
+# dialog (translated). Maximum 15 lines and 75 characters per line.
+aboutText=%blurb
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=eclipse32.png
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+windowImage=eclipse.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+aboutImage=eclipse_lg.png
+
+# Property "appName" contains name of the application (translated)
+# needed for primary features only
+appName=Eclipse
+
+# Property "welcomePage" contains path to welcome page (special XML-based format)
+# ($nl$/ prefix to permit locale-specific translations of entire file)
+#welcomePage=$nl$/welcome.xml
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
+# optional
+#tipsAndTricksHref=/org.eclipse.platform.doc.user/tips/platform_tips.html
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus/about.mappings b/deprecated/org.eclipse.epp.package.papyrus/about.mappings
new file mode 100644
index 00000000000..0dfb7355d48
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus/about.mappings
@@ -0,0 +1,6 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
diff --git a/deprecated/org.eclipse.epp.package.papyrus/about.properties b/deprecated/org.eclipse.epp.package.papyrus/about.properties
new file mode 100644
index 00000000000..80ef4348e77
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus/about.properties
@@ -0,0 +1,28 @@
+###############################################################################
+# Copyright (c) 2000, 2010 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
+###############################################################################
+# about.properties
+# contains externalized strings for about.ini
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# fill-ins are supplied by about.mappings
+# This file should be translated.
+#
+# Do not translate any values surrounded by {}
+
+blurb=Eclipse Modeling Tools\n\
+\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+(c) Copyright Eclipse contributors and others 2000, 2010. All rights reserved.\n\
+Visit http://www.eclipse.org/platform\n\
+\n\
+This product includes software developed by the\n\
+Apache Software Foundation http://www.apache.org/
diff --git a/deprecated/org.eclipse.epp.package.papyrus/buckminster.cspex b/deprecated/org.eclipse.epp.package.papyrus/buckminster.cspex
new file mode 100644
index 00000000000..3e45f2dc6c4
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus/buckminster.cspex
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus/build.properties b/deprecated/org.eclipse.epp.package.papyrus/build.properties
new file mode 100644
index 00000000000..4bcf744ecb1
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus/build.properties
@@ -0,0 +1,15 @@
+bin.includes = META-INF/,\
+ plugin_customization.ini,\
+ plugin.xml,\
+ about.html,\
+ eclipse.gif,\
+ eclipse.png,\
+ eclipse32.gif,\
+ eclipse32.png,\
+ eclipse48.gif,\
+ eclipse48.png,\
+ eclipse_lg.gif,\
+ about.mappings,\
+ intro-eclipse.png,\
+ about.properties,\
+ about.ini
diff --git a/deprecated/org.eclipse.epp.package.papyrus/eclipse.gif b/deprecated/org.eclipse.epp.package.papyrus/eclipse.gif
new file mode 100644
index 00000000000..7d7e32b2c0d
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/eclipse.gif differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/eclipse.png b/deprecated/org.eclipse.epp.package.papyrus/eclipse.png
new file mode 100644
index 00000000000..25e3bb5ea62
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/eclipse.png differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/eclipse32.gif b/deprecated/org.eclipse.epp.package.papyrus/eclipse32.gif
new file mode 100644
index 00000000000..e6ad7ccd75b
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/eclipse32.gif differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/eclipse32.png b/deprecated/org.eclipse.epp.package.papyrus/eclipse32.png
new file mode 100644
index 00000000000..568fac1d05f
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/eclipse32.png differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/eclipse48.gif b/deprecated/org.eclipse.epp.package.papyrus/eclipse48.gif
new file mode 100644
index 00000000000..80a40d68057
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/eclipse48.gif differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/eclipse48.png b/deprecated/org.eclipse.epp.package.papyrus/eclipse48.png
new file mode 100644
index 00000000000..1c939c81634
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/eclipse48.png differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/eclipse_lg.gif b/deprecated/org.eclipse.epp.package.papyrus/eclipse_lg.gif
new file mode 100644
index 00000000000..bf8b872e3d5
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/eclipse_lg.gif differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/intro-eclipse.png b/deprecated/org.eclipse.epp.package.papyrus/intro-eclipse.png
new file mode 100644
index 00000000000..015e7fc6ca4
Binary files /dev/null and b/deprecated/org.eclipse.epp.package.papyrus/intro-eclipse.png differ
diff --git a/deprecated/org.eclipse.epp.package.papyrus/plugin.xml b/deprecated/org.eclipse.epp.package.papyrus/plugin.xml
new file mode 100644
index 00000000000..35600130c0c
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus/plugin.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.epp.package.papyrus/plugin_customization.ini b/deprecated/org.eclipse.epp.package.papyrus/plugin_customization.ini
new file mode 100644
index 00000000000..d482ff007ff
--- /dev/null
+++ b/deprecated/org.eclipse.epp.package.papyrus/plugin_customization.ini
@@ -0,0 +1,37 @@
+# plugin_customization.ini
+# sets default values for plug-in-specific preferences
+# keys are qualified by plug-in id
+# e.g., com.example.acmeplugin/myproperty=myvalue
+# modeling.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in plugin_customization.properties
+# This file does not need to be translated.
+
+# WARNING: This file defines the preference overrides for the Platform build
+# (the one with no JDT or PDE), not the SDK build (aka the IDE).
+# For the SDK build, use the plugin_customization.ini file in the
+# org.eclipse.sdk plug-in instead.
+
+# Property "org.eclipse.ui/defaultPerspectiveId" controls the
+# perspective that the workbench opens initially
+org.eclipse.ui/defaultPerspectiveId=org.eclipse.jdt.ui.JavaPerspective
+
+# new-style tabs by default
+org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
+
+# put the perspective switcher on the top right
+org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
+
+# show progress on startup
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
+
+# Welcome theme to use
+org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.circles
+
+# Root page links to show in the Universal Welcome
+org.eclipse.ui.intro.universal/INTRO_ROOT_PAGES = overview,tutorials,samples,whatsnew
+
+# Initial page layout of the Universal Welcome
+org.eclipse.ui.intro.universal/INTRO_DATA = product:introData.xml
+
+# Order help books in table of contents
+org.eclipse.help/HELP_DATA = helpData.xml
\ No newline at end of file
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/.project b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/.project
deleted file mode 100644
index 5c7c9b3f00a..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- org.eclipse.epp.package.papyrus.feature
-
-
-
-
-
- org.eclipse.pde.FeatureBuilder
-
-
-
-
-
- org.eclipse.pde.FeatureNature
-
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/build.properties b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/build.properties
deleted file mode 100644
index 7d2d8724f28..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- p2.inf,\
- epl-v10.html,\
- license.html,\
- feature.properties,\
- plugin_customization.ini
-includeLaunchers = false
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml
deleted file mode 100644
index 370e83fbfb4..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/eclipse_papyrus_helios.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
- incubating components, as indicated by feature numbers less than 1.0.0 on the feature list.]]>
-
-
- Cédric Brun
- Markus Knauer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epl-v10.html b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epl-v10.html
deleted file mode 100644
index 2e85bcbd1ac..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epl-v10.html
+++ /dev/null
@@ -1,261 +0,0 @@
-
-
-
-
-
-
-Eclipse Public License - Version 1.0
-
-
-
-
-
-
-
Eclipse Public License - v 1.0
-
-
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
-DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
-AGREEMENT.
-
-
1. DEFINITIONS
-
-
"Contribution" means:
-
-
a) in the case of the initial Contributor, the initial
-code and documentation distributed under this Agreement, and
-
b) in the case of each subsequent Contributor:
-
i) changes to the Program, and
-
ii) additions to the Program;
-
where such changes and/or additions to the Program
-originate from and are distributed by that particular Contributor. A
-Contribution 'originates' from a Contributor if it was added to the
-Program by such Contributor itself or anyone acting on such
-Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in
-conjunction with the Program under their own license agreement, and (ii)
-are not derivative works of the Program.
-
-
"Contributor" means any person or entity that distributes
-the Program.
-
-
"Licensed Patents" mean patent claims licensable by a
-Contributor which are necessarily infringed by the use or sale of its
-Contribution alone or when combined with the Program.
-
-
"Program" means the Contributions distributed in accordance
-with this Agreement.
-
-
"Recipient" means anyone who receives the Program under
-this Agreement, including all Contributors.
-
-
2. GRANT OF RIGHTS
-
-
a) Subject to the terms of this Agreement, each
-Contributor hereby grants Recipient a non-exclusive, worldwide,
-royalty-free copyright license to reproduce, prepare derivative works
-of, publicly display, publicly perform, distribute and sublicense the
-Contribution of such Contributor, if any, and such derivative works, in
-source code and object code form.
-
-
b) Subject to the terms of this Agreement, each
-Contributor hereby grants Recipient a non-exclusive, worldwide,
-royalty-free patent license under Licensed Patents to make, use, sell,
-offer to sell, import and otherwise transfer the Contribution of such
-Contributor, if any, in source code and object code form. This patent
-license shall apply to the combination of the Contribution and the
-Program if, at the time the Contribution is added by the Contributor,
-such addition of the Contribution causes such combination to be covered
-by the Licensed Patents. The patent license shall not apply to any other
-combinations which include the Contribution. No hardware per se is
-licensed hereunder.
-
-
c) Recipient understands that although each Contributor
-grants the licenses to its Contributions set forth herein, no assurances
-are provided by any Contributor that the Program does not infringe the
-patent or other intellectual property rights of any other entity. Each
-Contributor disclaims any liability to Recipient for claims brought by
-any other entity based on infringement of intellectual property rights
-or otherwise. As a condition to exercising the rights and licenses
-granted hereunder, each Recipient hereby assumes sole responsibility to
-secure any other intellectual property rights needed, if any. For
-example, if a third party patent license is required to allow Recipient
-to distribute the Program, it is Recipient's responsibility to acquire
-that license before distributing the Program.
-
-
d) Each Contributor represents that to its knowledge it
-has sufficient copyright rights in its Contribution, if any, to grant
-the copyright license set forth in this Agreement.
-
-
3. REQUIREMENTS
-
-
A Contributor may choose to distribute the Program in object code
-form under its own license agreement, provided that:
-
-
a) it complies with the terms and conditions of this
-Agreement; and
-
-
b) its license agreement:
-
-
i) effectively disclaims on behalf of all Contributors
-all warranties and conditions, express and implied, including warranties
-or conditions of title and non-infringement, and implied warranties or
-conditions of merchantability and fitness for a particular purpose;
-
-
ii) effectively excludes on behalf of all Contributors
-all liability for damages, including direct, indirect, special,
-incidental and consequential damages, such as lost profits;
-
-
iii) states that any provisions which differ from this
-Agreement are offered by that Contributor alone and not by any other
-party; and
-
-
iv) states that source code for the Program is available
-from such Contributor, and informs licensees how to obtain it in a
-reasonable manner on or through a medium customarily used for software
-exchange.
-
-
When the Program is made available in source code form:
-
-
a) it must be made available under this Agreement; and
-
-
b) a copy of this Agreement must be included with each
-copy of the Program.
-
-
Contributors may not remove or alter any copyright notices contained
-within the Program.
-
-
Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-
-
4. COMMERCIAL DISTRIBUTION
-
-
Commercial distributors of software may accept certain
-responsibilities with respect to end users, business partners and the
-like. While this license is intended to facilitate the commercial use of
-the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create
-potential liability for other Contributors. Therefore, if a Contributor
-includes the Program in a commercial product offering, such Contributor
-("Commercial Contributor") hereby agrees to defend and
-indemnify every other Contributor ("Indemnified Contributor")
-against any losses, damages and costs (collectively "Losses")
-arising from claims, lawsuits and other legal actions brought by a third
-party against the Indemnified Contributor to the extent caused by the
-acts or omissions of such Commercial Contributor in connection with its
-distribution of the Program in a commercial product offering. The
-obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In
-order to qualify, an Indemnified Contributor must: a) promptly notify
-the Commercial Contributor in writing of such claim, and b) allow the
-Commercial Contributor to control, and cooperate with the Commercial
-Contributor in, the defense and any related settlement negotiations. The
-Indemnified Contributor may participate in any such claim at its own
-expense.
-
-
For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have to
-defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any other
-Contributor to pay any damages as a result, the Commercial Contributor
-must pay those damages.
-
-
5. NO WARRANTY
-
-
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
-PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
-OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
-ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with its
-exercise of rights under this Agreement , including but not limited to
-the risks and costs of program errors, compliance with applicable laws,
-damage to or loss of data, programs or equipment, and unavailability or
-interruption of operations.
-
-
6. DISCLAIMER OF LIABILITY
-
-
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
-NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-
7. GENERAL
-
-
If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of
-the remainder of the terms of this Agreement, and without further action
-by the parties hereto, such provision shall be reformed to the minimum
-extent necessary to make such provision valid and enforceable.
-
-
If Recipient institutes patent litigation against any entity
-(including a cross-claim or counterclaim in a lawsuit) alleging that the
-Program itself (excluding combinations of the Program with other
-software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the
-date such litigation is filed.
-
-
All Recipient's rights under this Agreement shall terminate if it
-fails to comply with any of the material terms or conditions of this
-Agreement and does not cure such failure in a reasonable period of time
-after becoming aware of such noncompliance. If all Recipient's rights
-under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive.
-
-
Everyone is permitted to copy and distribute copies of this
-Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The
-Agreement Steward reserves the right to publish new versions (including
-revisions) of this Agreement from time to time. No one other than the
-Agreement Steward has the right to modify this Agreement. The Eclipse
-Foundation is the initial Agreement Steward. The Eclipse Foundation may
-assign the responsibility to serve as the Agreement Steward to a
-suitable separate entity. Each new version of the Agreement will be
-given a distinguishing version number. The Program (including
-Contributions) may always be distributed subject to the version of the
-Agreement under which it was received. In addition, after a new version
-of the Agreement is published, Contributor may elect to distribute the
-Program (including its Contributions) under the new version. Except as
-expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
-rights or licenses to the intellectual property of any Contributor under
-this Agreement, whether expressly, by implication, estoppel or
-otherwise. All rights in the Program not expressly granted under this
-Agreement are reserved.
-
-
This Agreement is governed by the laws of the State of New York and
-the intellectual property laws of the United States of America. No party
-to this Agreement will bring a legal action under this Agreement more
-than one year after the cause of action arose. Each party waives its
-rights to a jury trial in any resulting litigation.
-
-
-
-
\ No newline at end of file
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epp.product b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epp.product
deleted file mode 100644
index d88a8200ff1..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/epp.product
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
- Specified in the plugin.xml of the branding plugin.
-
-
-
-
-
-
-
- -product org.eclipse.epp.package.papyrus.product
---launcher.defaultAction openFile
- --launcher.XXMaxPermSize
-256M
- -Dosgi.requiredJavaVersion=1.5
--Xms40m
--Xmx512m
- -XX:MaxPermSize=256m
- -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
--XX:MaxPermSize=256m
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
- org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
- org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
- org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.properties b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.properties
deleted file mode 100644
index 9c9df421fba..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.properties
+++ /dev/null
@@ -1,130 +0,0 @@
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-Eclipse Foundation Software User Agreement\n\
-April 14, 2010\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the\n\
-Eclipse Foundation is provided to you under the terms and conditions of\n\
-the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
-provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse Foundation source code\n\
-repository ("Repository") in software modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
-Update License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties" found within a Feature.\n\
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
-terms and conditions (or references to such terms and conditions) that\n\
-govern your use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-\n\Use of Provisioning Technology\n\
-\n\
-The Eclipse Foundation makes available provisioning software, examples of which include,\n\
-but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
-the purpose of allowing users to install software, documentation, information and/or\n\
-other materials (collectively "Installable Software"). This capability is provided with\n\
-the intent of allowing such users to install, extend and update Eclipse-based products.\n\
-Information about packaging Installable Software is available at\n\
-http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
-\n\
-You may use Provisioning Technology to allow other parties to install Installable Software.\n\
-You shall be responsible for enabling the applicable license agreements relating to the\n\
-Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
-in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
-making it available in accordance with the Specification, you further acknowledge your\n\
-agreement to, and the acquisition of all necessary rights to permit the following:\n\
-\n\
- 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
- the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
- extending or updating the functionality of an Eclipse-based product.\n\
- 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
- Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
- 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
- govern the use of the Installable Software ("Installable Software Agreement") and such\n\
- Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
- with the Specification. Such Installable Software Agreement must inform the user of the\n\
- terms and conditions that govern the Installable Software and must solicit acceptance by\n\
- the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
- indication of agreement by the user, the provisioning Technology will complete installation\n\
- of the Installable Software.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use, and\n\
-re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.xml b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.xml
deleted file mode 100644
index 9c267c277eb..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/feature.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- This modeling package contains a collection of Eclipse Modeling Project components, including EMF, GMF, MDT XSD/OCL/UML2, M2M, M2T, and EMFT elements. It includes a complete SDK, developer tools and source code. Note that the Modeling package includes some incubating components, as indicated by feature numbers less than 1.0.0 on the feature list.
-
-
-
- %license
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/license.html b/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/license.html
deleted file mode 100644
index 69305408635..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus.feature/license.html
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-Eclipse Foundation Software User Agreement
-
-
-
-
Eclipse Foundation Software User Agreement
-
April 14, 2010
-
-
Usage Of Content
-
-
THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.
-
-
Applicable Licenses
-
-
Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.
- For purposes of the EPL, "Program" will mean the Content.
-
-
Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
- repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").
-
-
-
Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
-
Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
-
A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.
-
Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
-
-
-
The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
-Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:
-
-
-
The top-level (root) directory
-
Plug-in and Fragment directories
-
Inside Plug-ins and Fragments packaged as JARs
-
Sub-directories of the directory named "src" of certain Plug-ins
-
Feature directories
-
-
-
Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.
-
-
THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.
-
-
-
Use of Provisioning Technology
-
-
The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html
- ("Specification").
-
-
You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
- in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
- Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:
-
-
-
A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology
- on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based
- product.
-
During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.
-
Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
- Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
- the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
- indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
-
-
-
Cryptography
-
-
Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.
-
-
Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.
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 http://www.eclipse.org/legal/epl-v10.html.
-For purposes of the EPL, "Program" will mean the Content.
-
-
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 http://www.eclipse.org.
-
-
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.ini b/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.ini
deleted file mode 100644
index 408d6f3f39f..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.ini
+++ /dev/null
@@ -1,37 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for feature details in the "About"
-# dialog (translated). Maximum 15 lines and 75 characters per line.
-aboutText=%blurb
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.png
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-windowImage=eclipse.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-aboutImage=eclipse_lg.png
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-appName=Eclipse
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# ($nl$/ prefix to permit locale-specific translations of entire file)
-#welcomePage=$nl$/welcome.xml
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-#tipsAndTricksHref=/org.eclipse.platform.doc.user/tips/platform_tips.html
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.mappings b/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.mappings
deleted file mode 100644
index 0dfb7355d48..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.properties b/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.properties
deleted file mode 100644
index 80ef4348e77..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus/about.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2010 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
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Eclipse Modeling Tools\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2000, 2010. All rights reserved.\n\
-Visit http://www.eclipse.org/platform\n\
-\n\
-This product includes software developed by the\n\
-Apache Software Foundation http://www.apache.org/
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/buckminster.cspex b/extraplugins/rcp/org.eclipse.epp.package.papyrus/buckminster.cspex
deleted file mode 100644
index 3e45f2dc6c4..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus/buckminster.cspex
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/build.properties b/extraplugins/rcp/org.eclipse.epp.package.papyrus/build.properties
deleted file mode 100644
index 4bcf744ecb1..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-bin.includes = META-INF/,\
- plugin_customization.ini,\
- plugin.xml,\
- about.html,\
- eclipse.gif,\
- eclipse.png,\
- eclipse32.gif,\
- eclipse32.png,\
- eclipse48.gif,\
- eclipse48.png,\
- eclipse_lg.gif,\
- about.mappings,\
- intro-eclipse.png,\
- about.properties,\
- about.ini
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.gif b/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.gif
deleted file mode 100644
index 7d7e32b2c0d..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.gif and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.png b/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.png
deleted file mode 100644
index 25e3bb5ea62..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse.png and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.gif b/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75b..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.gif and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.png b/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.png
deleted file mode 100644
index 568fac1d05f..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse32.png and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.gif b/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.gif
deleted file mode 100644
index 80a40d68057..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.gif and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.png b/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.png
deleted file mode 100644
index 1c939c81634..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse48.png and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse_lg.gif b/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse_lg.gif
deleted file mode 100644
index bf8b872e3d5..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/eclipse_lg.gif and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/intro-eclipse.png b/extraplugins/rcp/org.eclipse.epp.package.papyrus/intro-eclipse.png
deleted file mode 100644
index 015e7fc6ca4..00000000000
Binary files a/extraplugins/rcp/org.eclipse.epp.package.papyrus/intro-eclipse.png and /dev/null differ
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin.xml b/extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin.xml
deleted file mode 100644
index 35600130c0c..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin_customization.ini b/extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin_customization.ini
deleted file mode 100644
index d482ff007ff..00000000000
--- a/extraplugins/rcp/org.eclipse.epp.package.papyrus/plugin_customization.ini
+++ /dev/null
@@ -1,37 +0,0 @@
-# plugin_customization.ini
-# sets default values for plug-in-specific preferences
-# keys are qualified by plug-in id
-# e.g., com.example.acmeplugin/myproperty=myvalue
-# modeling.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in plugin_customization.properties
-# This file does not need to be translated.
-
-# WARNING: This file defines the preference overrides for the Platform build
-# (the one with no JDT or PDE), not the SDK build (aka the IDE).
-# For the SDK build, use the plugin_customization.ini file in the
-# org.eclipse.sdk plug-in instead.
-
-# Property "org.eclipse.ui/defaultPerspectiveId" controls the
-# perspective that the workbench opens initially
-org.eclipse.ui/defaultPerspectiveId=org.eclipse.jdt.ui.JavaPerspective
-
-# new-style tabs by default
-org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
-
-# put the perspective switcher on the top right
-org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
-
-# show progress on startup
-org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
-
-# Welcome theme to use
-org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.circles
-
-# Root page links to show in the Universal Welcome
-org.eclipse.ui.intro.universal/INTRO_ROOT_PAGES = overview,tutorials,samples,whatsnew
-
-# Initial page layout of the Universal Welcome
-org.eclipse.ui.intro.universal/INTRO_DATA = product:introData.xml
-
-# Order help books in table of contents
-org.eclipse.help/HELP_DATA = helpData.xml
\ No newline at end of file
--
cgit v1.2.3
From 68a81567379b95f0e11e40b529435098c5bbda36 Mon Sep 17 00:00:00 2001
From: Camille Letavernier
Date: Fri, 14 Mar 2014 19:33:25 +0100
Subject: [Releng] Move the umltools.clazz plug-in to the deprecated folder
---
.../.classpath | 7 +
.../.project | 28 +++
.../META-INF/MANIFEST.MF | 12 +
.../build.properties | 4 +
.../icons/ClassDiagram.gif | Bin 0 -> 120 bytes
.../plugin.xml | 72 ++++++
.../umltools/clazz/ClassDiagramEditorFactory.java | 124 ++++++++++
.../umltools/clazz/ClassDiagramEditorModel.java | 155 ++++++++++++
.../umltools/clazz/CreateClassDiagramHandler.java | 259 +++++++++++++++++++++
.../clazz/UmlClassDiagramForMultiEditor.java | 161 +++++++++++++
.../.classpath | 7 -
.../.project | 28 ---
.../META-INF/MANIFEST.MF | 12 -
.../build.properties | 4 -
.../icons/ClassDiagram.gif | Bin 120 -> 0 bytes
.../plugin.xml | 72 ------
.../umltools/clazz/ClassDiagramEditorFactory.java | 124 ----------
.../umltools/clazz/ClassDiagramEditorModel.java | 155 ------------
.../umltools/clazz/CreateClassDiagramHandler.java | 259 ---------------------
.../clazz/UmlClassDiagramForMultiEditor.java | 161 -------------
20 files changed, 822 insertions(+), 822 deletions(-)
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.classpath
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.project
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/build.properties
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java
create mode 100644 deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.classpath
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.project
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/build.properties
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java
delete mode 100644 extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java
(limited to 'extraplugins')
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.classpath b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.classpath
new file mode 100644
index 00000000000..45f024e850e
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.project b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.project
new file mode 100644
index 00000000000..62152d80745
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.papyrus.diagram.umltools.clazz
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.pde.PluginNature
+
+
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..44c7a0051e4
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Clazz
+Bundle-SymbolicName: org.eclipse.papyrus.diagram.umltools.clazz;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Export-Package: org.eclipse.papyrus.diagram.umltools.clazz
+Require-Bundle: org.eclipse.uml2.diagram.clazz;bundle-version="0.9.0",
+ org.eclipse.ui.ide;bundle-version="3.5.1",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.2.0",
+ org.eclipse.emf.common.ui;bundle-version="2.5.0",
+ org.eclipse.papyrus.core;bundle-version="0.7.0",
+ org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.7.0"
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/build.properties b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/build.properties
new file mode 100644
index 00000000000..53c8b373787
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif
new file mode 100644
index 00000000000..edf2be7e83d
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif differ
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml
new file mode 100644
index 00000000000..dff8aaf444b
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java
new file mode 100644
index 00000000000..ea4e01b9a6c
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java
@@ -0,0 +1,124 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.Dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.diagram.umltools.clazz;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.core.extension.diagrameditor.EditorDescriptor;
+import org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.sasheditor.contentprovider.IPageModel;
+
+/**
+ * @author dumoulin
+ *
+ */
+public class ClassDiagramEditorFactory implements IPluggableEditorFactory {
+
+ /**
+ * Expected diagram type
+ */
+ private String expectedType;
+
+ /**
+ * Main service Registry.
+ * Initialized when the factory is registered to the main editor.
+ */
+ private ServicesRegistry servicesRegistry;
+
+ /**
+ * Editor Descriptor containing data from the Eclipse extension declaration.
+ */
+ private EditorDescriptor editorDescriptor;
+
+ /**
+ * @param diagramClass
+ * @param expectedType
+ */
+ public ClassDiagramEditorFactory() {
+ expectedType = getDiagramNotationID();
+ }
+
+ /**
+ * Initialize the factory.
+ * @see org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory#init(org.eclipse.papyrus.core.services.ServicesRegistry, org.eclipse.papyrus.core.extension.diagrameditor.EditorDescriptor)
+ *
+ * @param serviceRegistry
+ * @param editorDescriptor
+ */
+ public void init(ServicesRegistry serviceRegistry, EditorDescriptor editorDescriptor) {
+ this.servicesRegistry = serviceRegistry;
+ this.editorDescriptor = editorDescriptor;
+
+ }
+
+ /**
+ * Return true if this PageModelFactory can create a PageModel for the specified pageIdentifier.
+ * The pageIdentifier is an instance of Diagram.
+ *
+ * @see org.eclipse.papyrus.core.extension.diagrameditor.IEditorFactory#isPageModelFactoryFor(java.lang.Object)
+ * @param pageIdentifier
+ * @return
+ *
+ */
+ public boolean isPageModelFactoryFor(Object pageIdentifier) {
+
+ if(pageIdentifier instanceof Diagram) {
+ Diagram diagram = (Diagram)pageIdentifier;
+ final String type = diagram.getType();
+ return getExpectedType().equals(type);
+ }
+ // no
+ return false;
+
+ }
+
+ /**
+ * Create a new instance of the EditorModel for the specified pageIdentifier.
+ * @see org.eclipse.papyrus.core.editorsfactory.IEditorFactory#createIPageModel(java.lang.Object)
+ *
+ * @param pageIdentifier
+ * @return
+ */
+ public IPageModel createIPageModel(Object pageIdentifier) {
+ return new ClassDiagramEditorModel((Diagram)pageIdentifier, servicesRegistry, editorDescriptor);
+ }
+
+ /**
+ * @return the diagramClass
+ */
+// private Class> getDiagramClass() {
+// return diagramClass;
+// }
+
+
+ /**
+ * @return the expectedType
+ */
+ private String getExpectedType() {
+ return expectedType;
+ }
+
+ /**
+ * Get the ID identifying the type of the Diagram.
+ * {@inheritDoc}
+ */
+ protected String getDiagramNotationID() {
+ return org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart.MODEL_ID;
+ }
+
+
+
+
+}
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java
new file mode 100644
index 00000000000..cd6f7df4192
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java
@@ -0,0 +1,155 @@
+package org.eclipse.papyrus.diagram.umltools.clazz;
+
+import java.lang.reflect.Constructor;
+
+import org.eclipse.gef.ui.parts.GraphicalEditor;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.extension.diagrameditor.EditorDescriptor;
+import org.eclipse.papyrus.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorActionBarContributor;
+
+/**
+ * IEditorModel used by the SashEditor to create a nested editor.
+ * Each nested editor instance is associated to one and only one instance of this model.
+ *
+ * @author cedric dumoulin
+ *
+ */
+class ClassDiagramEditorModel implements IEditorModel {
+
+ /**
+ * The Diagram object describing the diagram.
+ */
+ private Diagram diagram;
+
+ /**
+ * The servicesRegistry provided at creation.
+ */
+ private ServicesRegistry servicesRegistry;
+
+ /**
+ * Editor Descriptor containing data from the Eclipse extension
+ */
+ private EditorDescriptor editorDescriptor;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param pageIdentifier
+ * @param servicesRegistry
+ * @param editorDescriptor
+ */
+ public ClassDiagramEditorModel(Diagram pageIdentifier, ServicesRegistry servicesRegistry, EditorDescriptor editorDescriptor) {
+ diagram = pageIdentifier;
+ this.servicesRegistry = servicesRegistry;
+ this.editorDescriptor = editorDescriptor;
+ }
+
+ /**
+ * Create the IEditor for the diagram.
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel#createIEditorPart()
+ * @return
+ * @throws PartInitException
+ *
+ */
+ public IEditorPart createIEditorPart() throws PartInitException {
+ GraphicalEditor editor;
+ try {
+ editor = new UmlClassDiagramForMultiEditor(servicesRegistry, diagram);
+ } catch (BackboneException e) {
+ throw new PartInitException("Can't create instance of " + UmlClassDiagramForMultiEditor.class.getName(), e);
+ } catch (ServiceException e) {
+ throw new PartInitException("Can't create instance of " + UmlClassDiagramForMultiEditor.class.getName(), e);
+ }
+
+ return editor;
+
+ }
+
+ /**
+ * Get the action bar requested by the Editor.
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel#getActionBarContributor()
+ * @return
+ *
+ */
+ public EditorActionBarContributor getActionBarContributor() {
+
+ String actionBarId = editorDescriptor.getActionBarContributorId();
+
+ // Do nothing if no EditorActionBarContributor is specify.
+ if(actionBarId == null || actionBarId.length() == 0) {
+ return null;
+ }
+
+ // Try to get it.
+
+ // Get ServiceRegistry
+ // ServicesRegistry serviceRegistry = getServicesRegistry();
+ ActionBarContributorRegistry registry;
+ try {
+ registry = (ActionBarContributorRegistry)servicesRegistry.getService(ActionBarContributorRegistry.class);
+ } catch (ServiceException e) {
+ // Service not found
+ // TODO Log the error
+ e.printStackTrace();
+ return null;
+ }
+
+ try {
+ return registry.getActionBarContributor(actionBarId);
+ } catch (BackboneException e) {
+ // TODO Log the error and throw an exception instead
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Get the underlying RawModel. Return the Diagram.
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getRawModel()
+ * @return
+ *
+ */
+ public Object getRawModel() {
+ return diagram;
+ }
+
+ /**
+ * Get the icon to be shown by Tabs
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabIcon()
+ * @return
+ *
+ */
+ public Image getTabIcon() {
+ ImageDescriptor imageDescriptor = editorDescriptor.getIcon();
+ if(imageDescriptor == null)
+ return null;
+
+ return imageDescriptor.createImage();
+ }
+
+ /**
+ * Get the title of the Diagram.
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabTitle()
+ * @return
+ *
+ */
+ public String getTabTitle() {
+ return diagram.getName();
+ }
+
+}
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java
new file mode 100644
index 00000000000..3711c1a54e5
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java
@@ -0,0 +1,259 @@
+/**
+ *
+ */
+package org.eclipse.papyrus.diagram.umltools.clazz;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.core.utils.BusinessModelResolver;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.papyrus.sasheditor.contentprovider.di.IPageMngr;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
+import org.eclipse.uml2.uml.UMLFactory;
+
+
+/**
+ * A Handler responsible to create the EObject representing a UmlTools class diagram.
+ * The handler also add the created EObject to the SashContainerProvider. In reaction, the SashEditor
+ * will instanciate the corresponding Editor.
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class CreateClassDiagramHandler extends AbstractHandler implements IHandler {
+
+ /**
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ // Choose one of the two execution mode.
+ executeAsTransaction(event);
+// doExecute(event);
+ // Return null, as required by the API
+ return null;
+ }
+
+ /**
+ * Execute the handler in a undoable transaction.
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+
+ public void executeAsTransaction(final ExecutionEvent event) throws ExecutionException {
+
+ TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+
+ // Create a transactional command.
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain,"Create Class Diagram", Collections.EMPTY_LIST) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+
+ CommandResult commandResult;
+ try {
+ // Call the real implementation
+ CreateClassDiagramHandler.this.doExecute(event);
+ commandResult = CommandResult.newOKCommandResult();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ commandResult = CommandResult.newErrorCommandResult("Error during diagram creation");
+ }
+ return commandResult;
+ }
+ };
+
+ // Execute the command
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ e.printStackTrace();
+ // TODO log the error
+ }
+ }
+
+ /**
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+
+ public void doExecute(ExecutionEvent event) throws ExecutionException {
+
+ // First, create the EObject used to represent the Editor.
+ // This is generally the root object used to instantiate the corresponding editor.
+ EObject editorRootObject = createEditorRootObject();
+ // Then add the root object to the SashContainerProvider
+ IPageMngr pageMngr = EditorUtils.getIPageMngr();
+ pageMngr.openPage(editorRootObject);
+ }
+
+ /**
+ * Create the root object used to find the type of the editor to create, and provided to the new instance.
+ *
+ * @return
+ */
+ private EObject createEditorRootObject() {
+
+ String diagramName = "newDiagram";
+ EObject associatedDomainRoot = getDomainRoot();
+ Resource diagramResource = getDiagramResource();
+
+ Diagram diagram = ViewService.createDiagram(associatedDomainRoot, getDiagramNotationID(), getPreferenceHint());
+ if(diagram != null) {
+ diagram.setName(diagramName);
+ // TODO : required ??
+ diagram.setElement(associatedDomainRoot);
+ diagramResource.getContents().add(diagram);
+// initializeModel(owner);
+// initializeDiagram(diagram);
+ }
+
+
+ return diagram;
+ }
+
+ /**
+ * Get the domain element that will be associated to the Diagram.
+ * chack if the selected element can be used as domain element.
+ * If nothing is found, create a domain element.
+ * @return The domain element that will be associated to the diagram.
+ *
+ */
+ private EObject getDomainRoot() {
+
+ EObject domainElement = getSelectedDomainElement();
+ if( domainElement != null)
+ return domainElement;
+
+ // Create one
+ return createDomainElement();
+ }
+
+ /**
+ * Create the domain element that will be associated to the Diagram.
+ * @return
+ */
+ protected EObject createDomainElement() {
+ return UMLFactory.eINSTANCE.createModel();
+
+ }
+
+ /**
+ * Get the domain element associated to the current selection.
+ * @return The domain EObject associated to the current Eclipse selection, or null.
+ */
+ private EObject getSelectedDomainElement() {
+ EObject eObject = null;
+ Object selection = getCurrentSelection();
+ if(selection != null) {
+ Object businessObject = getDomainModel(selection);
+ if(businessObject instanceof EObject) {
+ eObject = (EObject)businessObject;
+ }
+ }
+ return eObject;
+ }
+
+ /**
+ * Get current selection first element.
+ *
+ * @return the selected element or null.
+ */
+ private Object getCurrentSelection() {
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ return structuredSelection.getFirstElement();
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the domain object associated to the provided object, if any.
+ * The provided object is a graphical artifact (EditPart, View, ...)
+ * This method navigate throw the object if the object is a graphical artifact or a
+ * diagram artifact.
+ *
+ * @param object Graphical artifact associated to a domain object.
+ * @return Object The domain object associated to the graphical artifact.
+ */
+ private Object getDomainModel(Object object) {
+ if(object instanceof EditPart) {
+ // Check model. It can be a GraphNode.
+ Object model = ((EditPart)object).getModel();
+ // Check if it is a notation View
+ if(model instanceof View) {
+ return ((View)model).getElement();
+
+ } else
+ return model;
+
+ }
+ else if(object instanceof View) {
+ return ((View)object).getElement();
+ }
+ else
+ return object;
+
+ }
+
+
+ /**
+ * Get the resource containing notation.Diagram.
+ * @return
+ */
+ private Resource getDiagramResource() {
+ return EditorUtils.getDiResourceSet().getNotationResource();
+ }
+
+ /**
+ * Get the ID identifying the type of the Diagram.
+ * {@inheritDoc}
+ */
+ protected String getDiagramNotationID() {
+ return org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart.MODEL_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected PreferencesHint getPreferenceHint() {
+ return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
+ }
+
+}
diff --git a/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java
new file mode 100644
index 00000000000..36c7a2a6d99
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java
@@ -0,0 +1,161 @@
+/**
+ *
+ */
+package org.eclipse.papyrus.diagram.umltools.clazz;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.l10n.EditorMessages;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor;
+
+/**
+ * An editor to be used in multitabs editor. This editor extends the original UML Activity Diagram.
+ *
+ * @author dumoulin
+ *
+ */
+public class UmlClassDiagramForMultiEditor extends UMLDiagramEditor {
+
+ /**
+ * The diagram shown by this editor.
+ */
+ private Diagram diagram;
+
+ /**
+ *
+ */
+ private ServicesRegistry servicesRegistry;
+
+ /**
+ * Constructor for SashSystem v2. Context and required objects are retrieved from the
+ * ServiceRegistry.
+ *
+ * @throws BackboneException
+ * @throws ServiceException
+ *
+ */
+ public UmlClassDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws BackboneException, ServiceException {
+ this.servicesRegistry = servicesRegistry;
+ this.diagram = diagram;
+
+ // Share the same editing provider
+ TransactionalEditingDomain editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
+ GmfMultiDiagramDocumentProvider documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
+
+ // overrides editing domain created by super constructor
+ setDocumentProvider(documentProvider);
+
+ }
+
+ /**
+ * @return the diagram
+ */
+ public Diagram getDiagram() {
+ return diagram;
+ }
+
+ /**
+ * @param diagram
+ * the diagram to set
+ */
+ public void setDiagram(Diagram diagram) {
+ this.diagram = diagram;
+ }
+
+ /**
+ * Change visibility to public.
+ */
+ @Override
+ public GraphicalViewer getGraphicalViewer() {
+ return super.getGraphicalViewer();
+ }
+
+ /**
+ *
+ */
+ final protected IDocumentProvider getDocumentProvider(IEditorInput input) {
+ // System.out.println("getDocumentProvider(IEditorInput input)");
+ if (input instanceof IFileEditorInput || input instanceof URIEditorInput) {
+ throw new UnsupportedOperationException("TODO !!!");
+ }
+ return super.getDocumentProvider(input);
+ }
+
+ /**
+ * @generated
+ */
+ protected void setDocumentProvider(IEditorInput input) {
+ // Already set in the constructor.
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ super.init(site, input);
+ // Set name after calling super.init()
+ setPartName(getDiagram().getName());
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void setInput(IEditorInput input) {
+ try {
+ // We are in a nested editor.
+ // Provide an URI with fragment in order to reuse the same Resource and to
+ // set the diagram to the fragment.
+ // First, compute the URI
+ URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(diagram));
+ System.err.println(this.getClass().getSimpleName() + ".setInput(" + uriInput.toString() + ")");
+ doSetInput(uriInput, true);
+ } catch (CoreException x) {
+ String title = EditorMessages.Editor_error_setinput_title;
+ String msg = EditorMessages.Editor_error_setinput_message;
+ Shell shell = getSite().getShell();
+ ErrorDialog.openError(shell, title, msg, x.getStatus());
+ }
+
+ }
+
+ Composite splitter;
+
+ @Override
+ protected void createGraphicalViewer(Composite parent) {
+ System.out.println("store Composite " + parent);
+ splitter = parent;
+ super.createGraphicalViewer(parent);
+ }
+
+ @Override
+ public void setFocus() {
+
+ // System.out.println("setFocus( " + ((Object)splitter).hashCode() + "):" + splitter.getChildren());
+ splitter.setFocus();
+
+ super.setFocus();
+ }
+
+ public String getEditingDomainID() {
+ return "org.eclipse.uml2.diagram.clazz.EditingDomain";
+ }
+
+}
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.classpath b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.classpath
deleted file mode 100644
index 45f024e850e..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.project b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.project
deleted file mode 100644
index 62152d80745..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- org.eclipse.papyrus.diagram.umltools.clazz
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
- org.eclipse.pde.PluginNature
-
-
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF
deleted file mode 100644
index 44c7a0051e4..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Clazz
-Bundle-SymbolicName: org.eclipse.papyrus.diagram.umltools.clazz;singleton:=true
-Bundle-Version: 0.7.0.qualifier
-Export-Package: org.eclipse.papyrus.diagram.umltools.clazz
-Require-Bundle: org.eclipse.uml2.diagram.clazz;bundle-version="0.9.0",
- org.eclipse.ui.ide;bundle-version="3.5.1",
- org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.2.0",
- org.eclipse.emf.common.ui;bundle-version="2.5.0",
- org.eclipse.papyrus.core;bundle-version="0.7.0",
- org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.7.0"
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/build.properties b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/build.properties
deleted file mode 100644
index 53c8b373787..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif
deleted file mode 100644
index edf2be7e83d..00000000000
Binary files a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/icons/ClassDiagram.gif and /dev/null differ
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml
deleted file mode 100644
index dff8aaf444b..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/plugin.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java
deleted file mode 100644
index ea4e01b9a6c..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorFactory.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * 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:
- * Cedric Dumoulin Cedric.Dumoulin@lifl.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.diagram.umltools.clazz;
-
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.core.extension.diagrameditor.EditorDescriptor;
-import org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.sasheditor.contentprovider.IPageModel;
-
-/**
- * @author dumoulin
- *
- */
-public class ClassDiagramEditorFactory implements IPluggableEditorFactory {
-
- /**
- * Expected diagram type
- */
- private String expectedType;
-
- /**
- * Main service Registry.
- * Initialized when the factory is registered to the main editor.
- */
- private ServicesRegistry servicesRegistry;
-
- /**
- * Editor Descriptor containing data from the Eclipse extension declaration.
- */
- private EditorDescriptor editorDescriptor;
-
- /**
- * @param diagramClass
- * @param expectedType
- */
- public ClassDiagramEditorFactory() {
- expectedType = getDiagramNotationID();
- }
-
- /**
- * Initialize the factory.
- * @see org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory#init(org.eclipse.papyrus.core.services.ServicesRegistry, org.eclipse.papyrus.core.extension.diagrameditor.EditorDescriptor)
- *
- * @param serviceRegistry
- * @param editorDescriptor
- */
- public void init(ServicesRegistry serviceRegistry, EditorDescriptor editorDescriptor) {
- this.servicesRegistry = serviceRegistry;
- this.editorDescriptor = editorDescriptor;
-
- }
-
- /**
- * Return true if this PageModelFactory can create a PageModel for the specified pageIdentifier.
- * The pageIdentifier is an instance of Diagram.
- *
- * @see org.eclipse.papyrus.core.extension.diagrameditor.IEditorFactory#isPageModelFactoryFor(java.lang.Object)
- * @param pageIdentifier
- * @return
- *
- */
- public boolean isPageModelFactoryFor(Object pageIdentifier) {
-
- if(pageIdentifier instanceof Diagram) {
- Diagram diagram = (Diagram)pageIdentifier;
- final String type = diagram.getType();
- return getExpectedType().equals(type);
- }
- // no
- return false;
-
- }
-
- /**
- * Create a new instance of the EditorModel for the specified pageIdentifier.
- * @see org.eclipse.papyrus.core.editorsfactory.IEditorFactory#createIPageModel(java.lang.Object)
- *
- * @param pageIdentifier
- * @return
- */
- public IPageModel createIPageModel(Object pageIdentifier) {
- return new ClassDiagramEditorModel((Diagram)pageIdentifier, servicesRegistry, editorDescriptor);
- }
-
- /**
- * @return the diagramClass
- */
-// private Class> getDiagramClass() {
-// return diagramClass;
-// }
-
-
- /**
- * @return the expectedType
- */
- private String getExpectedType() {
- return expectedType;
- }
-
- /**
- * Get the ID identifying the type of the Diagram.
- * {@inheritDoc}
- */
- protected String getDiagramNotationID() {
- return org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart.MODEL_ID;
- }
-
-
-
-
-}
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java
deleted file mode 100644
index cd6f7df4192..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/ClassDiagramEditorModel.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package org.eclipse.papyrus.diagram.umltools.clazz;
-
-import java.lang.reflect.Constructor;
-
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.core.editor.BackboneException;
-import org.eclipse.papyrus.core.extension.diagrameditor.EditorDescriptor;
-import org.eclipse.papyrus.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.EditorActionBarContributor;
-
-/**
- * IEditorModel used by the SashEditor to create a nested editor.
- * Each nested editor instance is associated to one and only one instance of this model.
- *
- * @author cedric dumoulin
- *
- */
-class ClassDiagramEditorModel implements IEditorModel {
-
- /**
- * The Diagram object describing the diagram.
- */
- private Diagram diagram;
-
- /**
- * The servicesRegistry provided at creation.
- */
- private ServicesRegistry servicesRegistry;
-
- /**
- * Editor Descriptor containing data from the Eclipse extension
- */
- private EditorDescriptor editorDescriptor;
-
- /**
- *
- * Constructor.
- *
- * @param pageIdentifier
- * @param servicesRegistry
- * @param editorDescriptor
- */
- public ClassDiagramEditorModel(Diagram pageIdentifier, ServicesRegistry servicesRegistry, EditorDescriptor editorDescriptor) {
- diagram = pageIdentifier;
- this.servicesRegistry = servicesRegistry;
- this.editorDescriptor = editorDescriptor;
- }
-
- /**
- * Create the IEditor for the diagram.
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel#createIEditorPart()
- * @return
- * @throws PartInitException
- *
- */
- public IEditorPart createIEditorPart() throws PartInitException {
- GraphicalEditor editor;
- try {
- editor = new UmlClassDiagramForMultiEditor(servicesRegistry, diagram);
- } catch (BackboneException e) {
- throw new PartInitException("Can't create instance of " + UmlClassDiagramForMultiEditor.class.getName(), e);
- } catch (ServiceException e) {
- throw new PartInitException("Can't create instance of " + UmlClassDiagramForMultiEditor.class.getName(), e);
- }
-
- return editor;
-
- }
-
- /**
- * Get the action bar requested by the Editor.
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel#getActionBarContributor()
- * @return
- *
- */
- public EditorActionBarContributor getActionBarContributor() {
-
- String actionBarId = editorDescriptor.getActionBarContributorId();
-
- // Do nothing if no EditorActionBarContributor is specify.
- if(actionBarId == null || actionBarId.length() == 0) {
- return null;
- }
-
- // Try to get it.
-
- // Get ServiceRegistry
- // ServicesRegistry serviceRegistry = getServicesRegistry();
- ActionBarContributorRegistry registry;
- try {
- registry = (ActionBarContributorRegistry)servicesRegistry.getService(ActionBarContributorRegistry.class);
- } catch (ServiceException e) {
- // Service not found
- // TODO Log the error
- e.printStackTrace();
- return null;
- }
-
- try {
- return registry.getActionBarContributor(actionBarId);
- } catch (BackboneException e) {
- // TODO Log the error and throw an exception instead
- e.printStackTrace();
- return null;
- }
- }
-
- /**
- * Get the underlying RawModel. Return the Diagram.
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getRawModel()
- * @return
- *
- */
- public Object getRawModel() {
- return diagram;
- }
-
- /**
- * Get the icon to be shown by Tabs
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabIcon()
- * @return
- *
- */
- public Image getTabIcon() {
- ImageDescriptor imageDescriptor = editorDescriptor.getIcon();
- if(imageDescriptor == null)
- return null;
-
- return imageDescriptor.createImage();
- }
-
- /**
- * Get the title of the Diagram.
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabTitle()
- * @return
- *
- */
- public String getTabTitle() {
- return diagram.getName();
- }
-
-}
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java
deleted file mode 100644
index 3711c1a54e5..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/CreateClassDiagramHandler.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/**
- *
- */
-package org.eclipse.papyrus.diagram.umltools.clazz;
-
-import java.util.Collections;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.core.utils.BusinessModelResolver;
-import org.eclipse.papyrus.core.utils.EditorUtils;
-import org.eclipse.papyrus.sasheditor.contentprovider.di.IPageMngr;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
-import org.eclipse.uml2.uml.UMLFactory;
-
-
-/**
- * A Handler responsible to create the EObject representing a UmlTools class diagram.
- * The handler also add the created EObject to the SashContainerProvider. In reaction, the SashEditor
- * will instanciate the corresponding Editor.
- *
- * @author cedric dumoulin
- *
- */
-public class CreateClassDiagramHandler extends AbstractHandler implements IHandler {
-
- /**
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- // Choose one of the two execution mode.
- executeAsTransaction(event);
-// doExecute(event);
- // Return null, as required by the API
- return null;
- }
-
- /**
- * Execute the handler in a undoable transaction.
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
-
- public void executeAsTransaction(final ExecutionEvent event) throws ExecutionException {
-
- TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
-
- // Create a transactional command.
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain,"Create Class Diagram", Collections.EMPTY_LIST) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
-
- CommandResult commandResult;
- try {
- // Call the real implementation
- CreateClassDiagramHandler.this.doExecute(event);
- commandResult = CommandResult.newOKCommandResult();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- commandResult = CommandResult.newErrorCommandResult("Error during diagram creation");
- }
- return commandResult;
- }
- };
-
- // Execute the command
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- e.printStackTrace();
- // TODO log the error
- }
- }
-
- /**
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
-
- public void doExecute(ExecutionEvent event) throws ExecutionException {
-
- // First, create the EObject used to represent the Editor.
- // This is generally the root object used to instantiate the corresponding editor.
- EObject editorRootObject = createEditorRootObject();
- // Then add the root object to the SashContainerProvider
- IPageMngr pageMngr = EditorUtils.getIPageMngr();
- pageMngr.openPage(editorRootObject);
- }
-
- /**
- * Create the root object used to find the type of the editor to create, and provided to the new instance.
- *
- * @return
- */
- private EObject createEditorRootObject() {
-
- String diagramName = "newDiagram";
- EObject associatedDomainRoot = getDomainRoot();
- Resource diagramResource = getDiagramResource();
-
- Diagram diagram = ViewService.createDiagram(associatedDomainRoot, getDiagramNotationID(), getPreferenceHint());
- if(diagram != null) {
- diagram.setName(diagramName);
- // TODO : required ??
- diagram.setElement(associatedDomainRoot);
- diagramResource.getContents().add(diagram);
-// initializeModel(owner);
-// initializeDiagram(diagram);
- }
-
-
- return diagram;
- }
-
- /**
- * Get the domain element that will be associated to the Diagram.
- * chack if the selected element can be used as domain element.
- * If nothing is found, create a domain element.
- * @return The domain element that will be associated to the diagram.
- *
- */
- private EObject getDomainRoot() {
-
- EObject domainElement = getSelectedDomainElement();
- if( domainElement != null)
- return domainElement;
-
- // Create one
- return createDomainElement();
- }
-
- /**
- * Create the domain element that will be associated to the Diagram.
- * @return
- */
- protected EObject createDomainElement() {
- return UMLFactory.eINSTANCE.createModel();
-
- }
-
- /**
- * Get the domain element associated to the current selection.
- * @return The domain EObject associated to the current Eclipse selection, or null.
- */
- private EObject getSelectedDomainElement() {
- EObject eObject = null;
- Object selection = getCurrentSelection();
- if(selection != null) {
- Object businessObject = getDomainModel(selection);
- if(businessObject instanceof EObject) {
- eObject = (EObject)businessObject;
- }
- }
- return eObject;
- }
-
- /**
- * Get current selection first element.
- *
- * @return the selected element or null.
- */
- private Object getCurrentSelection() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- return structuredSelection.getFirstElement();
- }
-
- return null;
- }
-
- /**
- * Get the domain object associated to the provided object, if any.
- * The provided object is a graphical artifact (EditPart, View, ...)
- * This method navigate throw the object if the object is a graphical artifact or a
- * diagram artifact.
- *
- * @param object Graphical artifact associated to a domain object.
- * @return Object The domain object associated to the graphical artifact.
- */
- private Object getDomainModel(Object object) {
- if(object instanceof EditPart) {
- // Check model. It can be a GraphNode.
- Object model = ((EditPart)object).getModel();
- // Check if it is a notation View
- if(model instanceof View) {
- return ((View)model).getElement();
-
- } else
- return model;
-
- }
- else if(object instanceof View) {
- return ((View)object).getElement();
- }
- else
- return object;
-
- }
-
-
- /**
- * Get the resource containing notation.Diagram.
- * @return
- */
- private Resource getDiagramResource() {
- return EditorUtils.getDiResourceSet().getNotationResource();
- }
-
- /**
- * Get the ID identifying the type of the Diagram.
- * {@inheritDoc}
- */
- protected String getDiagramNotationID() {
- return org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart.MODEL_ID;
- }
-
- /**
- * {@inheritDoc}
- */
- protected PreferencesHint getPreferenceHint() {
- return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
-}
diff --git a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java b/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java
deleted file mode 100644
index 36c7a2a6d99..00000000000
--- a/extraplugins/umltools/org.eclipse.papyrus.diagram.umltools.clazz/src/org/eclipse/papyrus/diagram/umltools/clazz/UmlClassDiagramForMultiEditor.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- *
- */
-package org.eclipse.papyrus.diagram.umltools.clazz;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.l10n.EditorMessages;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider;
-import org.eclipse.papyrus.core.editor.BackboneException;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor;
-
-/**
- * An editor to be used in multitabs editor. This editor extends the original UML Activity Diagram.
- *
- * @author dumoulin
- *
- */
-public class UmlClassDiagramForMultiEditor extends UMLDiagramEditor {
-
- /**
- * The diagram shown by this editor.
- */
- private Diagram diagram;
-
- /**
- *
- */
- private ServicesRegistry servicesRegistry;
-
- /**
- * Constructor for SashSystem v2. Context and required objects are retrieved from the
- * ServiceRegistry.
- *
- * @throws BackboneException
- * @throws ServiceException
- *
- */
- public UmlClassDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws BackboneException, ServiceException {
- this.servicesRegistry = servicesRegistry;
- this.diagram = diagram;
-
- // Share the same editing provider
- TransactionalEditingDomain editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
- GmfMultiDiagramDocumentProvider documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
-
- // overrides editing domain created by super constructor
- setDocumentProvider(documentProvider);
-
- }
-
- /**
- * @return the diagram
- */
- public Diagram getDiagram() {
- return diagram;
- }
-
- /**
- * @param diagram
- * the diagram to set
- */
- public void setDiagram(Diagram diagram) {
- this.diagram = diagram;
- }
-
- /**
- * Change visibility to public.
- */
- @Override
- public GraphicalViewer getGraphicalViewer() {
- return super.getGraphicalViewer();
- }
-
- /**
- *
- */
- final protected IDocumentProvider getDocumentProvider(IEditorInput input) {
- // System.out.println("getDocumentProvider(IEditorInput input)");
- if (input instanceof IFileEditorInput || input instanceof URIEditorInput) {
- throw new UnsupportedOperationException("TODO !!!");
- }
- return super.getDocumentProvider(input);
- }
-
- /**
- * @generated
- */
- protected void setDocumentProvider(IEditorInput input) {
- // Already set in the constructor.
- }
-
- /**
- *
- */
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
- // Set name after calling super.init()
- setPartName(getDiagram().getName());
- }
-
- /**
- *
- */
- @Override
- public void setInput(IEditorInput input) {
- try {
- // We are in a nested editor.
- // Provide an URI with fragment in order to reuse the same Resource and to
- // set the diagram to the fragment.
- // First, compute the URI
- URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(diagram));
- System.err.println(this.getClass().getSimpleName() + ".setInput(" + uriInput.toString() + ")");
- doSetInput(uriInput, true);
- } catch (CoreException x) {
- String title = EditorMessages.Editor_error_setinput_title;
- String msg = EditorMessages.Editor_error_setinput_message;
- Shell shell = getSite().getShell();
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
-
- }
-
- Composite splitter;
-
- @Override
- protected void createGraphicalViewer(Composite parent) {
- System.out.println("store Composite " + parent);
- splitter = parent;
- super.createGraphicalViewer(parent);
- }
-
- @Override
- public void setFocus() {
-
- // System.out.println("setFocus( " + ((Object)splitter).hashCode() + "):" + splitter.getChildren());
- splitter.setFocus();
-
- super.setFocus();
- }
-
- public String getEditingDomainID() {
- return "org.eclipse.uml2.diagram.clazz.EditingDomain";
- }
-
-}
--
cgit v1.2.3
From 060a85b6c7afda80ccd6c983d828a6eea252c653 Mon Sep 17 00:00:00 2001
From: Camille Letavernier
Date: Fri, 14 Mar 2014 19:40:28 +0100
Subject: [Releng] Move the adaptor.modisco plug-in to the deprecated folder
---
.../org.eclipse.papyrus.adaptor.modisco/.classpath | 7 +
.../org.eclipse.papyrus.adaptor.modisco/.project | 28 +++
.../META-INF/MANIFEST.MF | 13 ++
.../build.properties | 5 +
.../icons/full/logoMoDiscoMini.gif | Bin 0 -> 1078 bytes
.../org.eclipse.papyrus.adaptor.modisco/plugin.xml | 61 +++++++
.../papyrus/adapters/modisco/Activator.java | 50 ++++++
.../modisco/CreateModiscoBrowserHandler.java | 32 ++++
.../adapters/modisco/ModiscoBrowserEditor.java | 123 +++++++++++++
.../modisco/ModiscoBrowserEditorFactory.java | 197 +++++++++++++++++++++
.../org.eclipse.papyrus.adaptor.modisco/.classpath | 7 -
.../org.eclipse.papyrus.adaptor.modisco/.project | 28 ---
.../META-INF/MANIFEST.MF | 13 --
.../build.properties | 5 -
.../icons/full/logoMoDiscoMini.gif | Bin 1078 -> 0 bytes
.../org.eclipse.papyrus.adaptor.modisco/plugin.xml | 61 -------
.../papyrus/adapters/modisco/Activator.java | 50 ------
.../modisco/CreateModiscoBrowserHandler.java | 32 ----
.../adapters/modisco/ModiscoBrowserEditor.java | 123 -------------
.../modisco/ModiscoBrowserEditorFactory.java | 197 ---------------------
20 files changed, 516 insertions(+), 516 deletions(-)
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/.classpath
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/.project
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/build.properties
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/plugin.xml
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java
create mode 100644 deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.classpath
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.project
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/build.properties
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/plugin.xml
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java
delete mode 100644 extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java
(limited to 'extraplugins')
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/.classpath b/deprecated/org.eclipse.papyrus.adaptor.modisco/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/.project b/deprecated/org.eclipse.papyrus.adaptor.modisco/.project
new file mode 100644
index 00000000000..12cd199fb89
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.papyrus.adaptor.modisco
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..2b559853ded
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Modisco
+Bundle-SymbolicName: org.eclipse.papyrus.adaptor.modisco;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.adapters.modisco.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.core;bundle-version="0.7.0",
+ org.eclipse.gmt.modisco.infra.browser;bundle-version="0.8.1",
+ org.eclipse.papyrus.core.adaptor.emf;bundle-version="0.7.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/build.properties b/deprecated/org.eclipse.papyrus.adaptor.modisco/build.properties
new file mode 100644
index 00000000000..6f20375d6c7
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif b/deprecated/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif
new file mode 100644
index 00000000000..19c468b1c61
Binary files /dev/null and b/deprecated/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif differ
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/plugin.xml b/deprecated/org.eclipse.papyrus.adaptor.modisco/plugin.xml
new file mode 100644
index 00000000000..d7529c833c3
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/plugin.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java
new file mode 100644
index 00000000000..77dee147dc0
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.papyrus.adapters.modisco;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.adapters.modisco";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java
new file mode 100644
index 00000000000..8c7d7b56a3f
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.adapters.modisco;
+
+import org.eclipse.papyrus.core.adaptor.emf.CreateDiagramHandler;
+
+/**
+ * Eclipse handler to create a Modisco Browser Editor.
+ * @todo Let it extends a class that is not emf related.
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class CreateModiscoBrowserHandler extends CreateDiagramHandler {
+
+ @Override
+ protected void addNewDiagram() {
+ addNewDiagram("Modisco Browser", ModiscoBrowserEditorFactory.MODISCO_EDITOR_TYPE, null);
+ }
+
+}
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java
new file mode 100644
index 00000000000..2cc203c331d
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java
@@ -0,0 +1,123 @@
+/**
+ *
+ */
+package org.eclipse.papyrus.adapters.modisco;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.ResourceSetChangeEvent;
+import org.eclipse.emf.transaction.ResourceSetListener;
+import org.eclipse.emf.transaction.RollbackException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.core.utils.DiResourceSet;
+import org.eclipse.ui.IEditorPart;
+
+
+/**
+ * @author dumoulin
+ *
+ */
+public class ModiscoBrowserEditor extends EcoreBrowser {
+
+ /**
+ * ResourceSet shared by Papyrus.
+ */
+ private ResourceSet resourceSet;
+
+ private Resource modelResource;
+
+ private ServicesRegistry servicesRegistry;
+
+ /**
+ * Listen to model changes
+ */
+ private final ResourceSetListener resourceSetListener = new ResourceSetListener() {
+
+ public NotificationFilter getFilter() {
+ return null;
+ }
+
+ public boolean isAggregatePrecommitListener() {
+ return false;
+ }
+
+ public boolean isPostcommitOnly() {
+ return true;
+ }
+
+ public boolean isPrecommitOnly() {
+ return false;
+ }
+
+ public void resourceSetChanged(ResourceSetChangeEvent event) {
+ if(event.getTransaction() != null && event.getTransaction().getStatus().isOK()) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ reloadModel();
+ }
+ });
+ }
+ }
+
+ public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException {
+ return null;
+ }
+
+ };
+
+
+ /**
+ * Constructor.
+ * @param servicesRegistry Service Registry used to retrieve service needed by this editor.
+ *
+ */
+ public ModiscoBrowserEditor(ServicesRegistry servicesRegistry) throws ServiceException, BackboneException {
+
+
+ this.servicesRegistry = servicesRegistry;
+
+ // Share the same editing provider
+ TransactionalEditingDomain editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
+
+ this.resourceSet = editingDomain.getResourceSet();
+
+ // Get the model
+ DiResourceSet resourceMngr = servicesRegistry.getService(DiResourceSet.class);
+ modelResource = resourceMngr.getModelResource();
+
+ // Let's listen to the resource set change
+ editingDomain.addResourceSetListener(resourceSetListener);
+
+ }
+
+ /**
+ * @see org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser#createModel()
+ *
+ * @return
+ */
+ @Override
+ protected Resource createModel() {
+
+// return super.createModel();
+ return modelResource;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser#createResourceSet()
+ *
+ */
+ @Override
+ protected ResourceSet createResourceSet() {
+ return resourceSet;
+ }
+
+
+}
diff --git a/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java
new file mode 100644
index 00000000000..4e8aebe7ea9
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java
@@ -0,0 +1,197 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.Dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.adapters.modisco;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.extension.diagrameditor.AbstractEditorFactory;
+import org.eclipse.papyrus.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel;
+import org.eclipse.papyrus.sasheditor.contentprovider.IPageModel;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorActionBarContributor;
+
+/**
+ * @author cedric dumoulin
+ *
+ */
+public class ModiscoBrowserEditorFactory extends AbstractEditorFactory {
+
+ /** name of the emf diagram in Di2 type diagram
+ * TODO Use something else than a Diagram to mark the editor. Add a class in sashdi.
+ */
+ public static final String MODISCO_EDITOR_TYPE = "modiscoBrowser";
+
+ /**
+ * @param diagramClass
+ * @param expectedType
+ */
+ public ModiscoBrowserEditorFactory() {
+ // TODO remove next once the unused methods will be removed
+ super(null, null);
+ }
+
+
+ /**
+ * TODO Implements next methods
+ *
+ * @see org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory#createIPageModel(java.lang.Object)
+ * @param pageIdentifier
+ * @return
+ *
+ */
+ public IPageModel createIPageModel(Object pageIdentifier) {
+ return new ModiscoBrowserPageModel((Diagram)pageIdentifier, getServiceRegistry());
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory#isPageModelFactoryFor(java.lang.Object)
+ * @param pageIdentifier
+ * @return
+ *
+ */
+ public boolean isPageModelFactoryFor(Object pageIdentifier) {
+ if(pageIdentifier instanceof Diagram) {
+ Diagram diagram = (Diagram)pageIdentifier;
+
+ if(MODISCO_EDITOR_TYPE.equals(diagram.getType())) {
+ return true;
+ }
+ }
+ // no
+ return false;
+ }
+
+
+ /**
+ * Inner class.
+ * A model representing the modisco browser in the sasheditor provider.
+ * @author dumoulin
+ *
+ */
+ public class ModiscoBrowserPageModel implements IEditorModel {
+
+ /**
+ * The object used as page identifier and rawModel.
+ */
+ private Diagram pageIdentifier;
+
+ private ServicesRegistry servicesRegistry;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param pageIdentifier
+ * @param servicesRegistry
+ */
+ public ModiscoBrowserPageModel(Diagram pageIdentifier, ServicesRegistry servicesRegistry) {
+ this.pageIdentifier = pageIdentifier;
+ this.servicesRegistry = servicesRegistry;
+ }
+
+ /**
+ * Create the instance of the editor.
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel#createIEditorPart()
+ * @return
+ * @throws PartInitException
+ *
+ */
+ public IEditorPart createIEditorPart() throws PartInitException {
+ try {
+ return new ModiscoBrowserEditor(servicesRegistry);
+ } catch (ServiceException e) {
+ throw new PartInitException("Can't create ModiscoEditor.", e);
+ } catch (BackboneException e) {
+ throw new PartInitException("Can't create ModiscoEditor.", e);
+ }
+ }
+
+ public EditorActionBarContributor getActionBarContributor() {
+
+ String actionBarId = editorDescriptor.getActionBarContributorId();
+
+ // Do nothing if no EditorActionBarContributor is specify.
+ if(actionBarId == null || actionBarId.length() == 0) {
+ return null;
+ }
+
+ // Try to get it.
+
+ // Get ServiceRegistry
+ ActionBarContributorRegistry registry;
+ try {
+ registry = (ActionBarContributorRegistry)servicesRegistry
+ .getService(ActionBarContributorRegistry.class);
+ } catch (ServiceException e) {
+ // Service not found
+ // TODO Log the error
+ e.printStackTrace();
+ return null;
+ }
+
+ try {
+ return registry.getActionBarContributor(actionBarId);
+ } catch (BackboneException e) {
+ // TODO Log the error and throw an exception instead
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getRawModel()
+ * @return
+ *
+ */
+ public Object getRawModel() {
+ return pageIdentifier;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabIcon()
+ * @return
+ *
+ */
+ public Image getTabIcon() {
+ ImageDescriptor imageDescriptor = editorDescriptor.getIcon();
+ if(imageDescriptor == null)
+ return null;
+
+ return imageDescriptor.createImage();
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabTitle()
+ * @return
+ *
+ */
+ public String getTabTitle() {
+ return "Modisco";
+ }
+
+
+ }
+}
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.classpath b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.classpath
deleted file mode 100644
index 2d1a4302f04..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.project b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.project
deleted file mode 100644
index 12cd199fb89..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- org.eclipse.papyrus.adaptor.modisco
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF
deleted file mode 100644
index 2b559853ded..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Modisco
-Bundle-SymbolicName: org.eclipse.papyrus.adaptor.modisco;singleton:=true
-Bundle-Version: 0.7.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.adapters.modisco.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.core;bundle-version="0.7.0",
- org.eclipse.gmt.modisco.infra.browser;bundle-version="0.8.1",
- org.eclipse.papyrus.core.adaptor.emf;bundle-version="0.7.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/build.properties b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/build.properties
deleted file mode 100644
index 6f20375d6c7..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif
deleted file mode 100644
index 19c468b1c61..00000000000
Binary files a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/icons/full/logoMoDiscoMini.gif and /dev/null differ
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/plugin.xml b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/plugin.xml
deleted file mode 100644
index d7529c833c3..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/plugin.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java
deleted file mode 100644
index 77dee147dc0..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/Activator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.papyrus.adapters.modisco;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.adapters.modisco";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java
deleted file mode 100644
index 8c7d7b56a3f..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/CreateModiscoBrowserHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.adapters.modisco;
-
-import org.eclipse.papyrus.core.adaptor.emf.CreateDiagramHandler;
-
-/**
- * Eclipse handler to create a Modisco Browser Editor.
- * @todo Let it extends a class that is not emf related.
- *
- * @author cedric dumoulin
- *
- */
-public class CreateModiscoBrowserHandler extends CreateDiagramHandler {
-
- @Override
- protected void addNewDiagram() {
- addNewDiagram("Modisco Browser", ModiscoBrowserEditorFactory.MODISCO_EDITOR_TYPE, null);
- }
-
-}
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java
deleted file mode 100644
index 2cc203c331d..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditor.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- *
- */
-package org.eclipse.papyrus.adapters.modisco;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.ResourceSetChangeEvent;
-import org.eclipse.emf.transaction.ResourceSetListener;
-import org.eclipse.emf.transaction.RollbackException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser;
-import org.eclipse.papyrus.core.editor.BackboneException;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.core.utils.DiResourceSet;
-import org.eclipse.ui.IEditorPart;
-
-
-/**
- * @author dumoulin
- *
- */
-public class ModiscoBrowserEditor extends EcoreBrowser {
-
- /**
- * ResourceSet shared by Papyrus.
- */
- private ResourceSet resourceSet;
-
- private Resource modelResource;
-
- private ServicesRegistry servicesRegistry;
-
- /**
- * Listen to model changes
- */
- private final ResourceSetListener resourceSetListener = new ResourceSetListener() {
-
- public NotificationFilter getFilter() {
- return null;
- }
-
- public boolean isAggregatePrecommitListener() {
- return false;
- }
-
- public boolean isPostcommitOnly() {
- return true;
- }
-
- public boolean isPrecommitOnly() {
- return false;
- }
-
- public void resourceSetChanged(ResourceSetChangeEvent event) {
- if(event.getTransaction() != null && event.getTransaction().getStatus().isOK()) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- reloadModel();
- }
- });
- }
- }
-
- public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException {
- return null;
- }
-
- };
-
-
- /**
- * Constructor.
- * @param servicesRegistry Service Registry used to retrieve service needed by this editor.
- *
- */
- public ModiscoBrowserEditor(ServicesRegistry servicesRegistry) throws ServiceException, BackboneException {
-
-
- this.servicesRegistry = servicesRegistry;
-
- // Share the same editing provider
- TransactionalEditingDomain editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
-
- this.resourceSet = editingDomain.getResourceSet();
-
- // Get the model
- DiResourceSet resourceMngr = servicesRegistry.getService(DiResourceSet.class);
- modelResource = resourceMngr.getModelResource();
-
- // Let's listen to the resource set change
- editingDomain.addResourceSetListener(resourceSetListener);
-
- }
-
- /**
- * @see org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser#createModel()
- *
- * @return
- */
- @Override
- protected Resource createModel() {
-
-// return super.createModel();
- return modelResource;
- }
-
- /**
- *
- * @see org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser#createResourceSet()
- *
- */
- @Override
- protected ResourceSet createResourceSet() {
- return resourceSet;
- }
-
-
-}
diff --git a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java b/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java
deleted file mode 100644
index 4e8aebe7ea9..00000000000
--- a/extraplugins/modisco/org.eclipse.papyrus.adaptor.modisco/src/org/eclipse/papyrus/adapters/modisco/ModiscoBrowserEditorFactory.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * 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:
- * Cedric Dumoulin Cedric.Dumoulin@lifl.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.adapters.modisco;
-
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.core.editor.BackboneException;
-import org.eclipse.papyrus.core.extension.diagrameditor.AbstractEditorFactory;
-import org.eclipse.papyrus.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel;
-import org.eclipse.papyrus.sasheditor.contentprovider.IPageModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.EditorActionBarContributor;
-
-/**
- * @author cedric dumoulin
- *
- */
-public class ModiscoBrowserEditorFactory extends AbstractEditorFactory {
-
- /** name of the emf diagram in Di2 type diagram
- * TODO Use something else than a Diagram to mark the editor. Add a class in sashdi.
- */
- public static final String MODISCO_EDITOR_TYPE = "modiscoBrowser";
-
- /**
- * @param diagramClass
- * @param expectedType
- */
- public ModiscoBrowserEditorFactory() {
- // TODO remove next once the unused methods will be removed
- super(null, null);
- }
-
-
- /**
- * TODO Implements next methods
- *
- * @see org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory#createIPageModel(java.lang.Object)
- * @param pageIdentifier
- * @return
- *
- */
- public IPageModel createIPageModel(Object pageIdentifier) {
- return new ModiscoBrowserPageModel((Diagram)pageIdentifier, getServiceRegistry());
- }
-
- /**
- *
- * @see org.eclipse.papyrus.core.extension.diagrameditor.IPluggableEditorFactory#isPageModelFactoryFor(java.lang.Object)
- * @param pageIdentifier
- * @return
- *
- */
- public boolean isPageModelFactoryFor(Object pageIdentifier) {
- if(pageIdentifier instanceof Diagram) {
- Diagram diagram = (Diagram)pageIdentifier;
-
- if(MODISCO_EDITOR_TYPE.equals(diagram.getType())) {
- return true;
- }
- }
- // no
- return false;
- }
-
-
- /**
- * Inner class.
- * A model representing the modisco browser in the sasheditor provider.
- * @author dumoulin
- *
- */
- public class ModiscoBrowserPageModel implements IEditorModel {
-
- /**
- * The object used as page identifier and rawModel.
- */
- private Diagram pageIdentifier;
-
- private ServicesRegistry servicesRegistry;
-
- /**
- *
- * Constructor.
- *
- * @param pageIdentifier
- * @param servicesRegistry
- */
- public ModiscoBrowserPageModel(Diagram pageIdentifier, ServicesRegistry servicesRegistry) {
- this.pageIdentifier = pageIdentifier;
- this.servicesRegistry = servicesRegistry;
- }
-
- /**
- * Create the instance of the editor.
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel#createIEditorPart()
- * @return
- * @throws PartInitException
- *
- */
- public IEditorPart createIEditorPart() throws PartInitException {
- try {
- return new ModiscoBrowserEditor(servicesRegistry);
- } catch (ServiceException e) {
- throw new PartInitException("Can't create ModiscoEditor.", e);
- } catch (BackboneException e) {
- throw new PartInitException("Can't create ModiscoEditor.", e);
- }
- }
-
- public EditorActionBarContributor getActionBarContributor() {
-
- String actionBarId = editorDescriptor.getActionBarContributorId();
-
- // Do nothing if no EditorActionBarContributor is specify.
- if(actionBarId == null || actionBarId.length() == 0) {
- return null;
- }
-
- // Try to get it.
-
- // Get ServiceRegistry
- ActionBarContributorRegistry registry;
- try {
- registry = (ActionBarContributorRegistry)servicesRegistry
- .getService(ActionBarContributorRegistry.class);
- } catch (ServiceException e) {
- // Service not found
- // TODO Log the error
- e.printStackTrace();
- return null;
- }
-
- try {
- return registry.getActionBarContributor(actionBarId);
- } catch (BackboneException e) {
- // TODO Log the error and throw an exception instead
- e.printStackTrace();
- return null;
- }
- }
-
- /**
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getRawModel()
- * @return
- *
- */
- public Object getRawModel() {
- return pageIdentifier;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabIcon()
- * @return
- *
- */
- public Image getTabIcon() {
- ImageDescriptor imageDescriptor = editorDescriptor.getIcon();
- if(imageDescriptor == null)
- return null;
-
- return imageDescriptor.createImage();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.sasheditor.contentprovider.IPageModel#getTabTitle()
- * @return
- *
- */
- public String getTabTitle() {
- return "Modisco";
- }
-
-
- }
-}
--
cgit v1.2.3
From 5efb25129cdd8ecbb235b7ab8fb9df7772f366a3 Mon Sep 17 00:00:00 2001
From: Camille Letavernier
Date: Fri, 14 Mar 2014 19:41:48 +0100
Subject: [Releng] Move the oep.diagramqueryresult plug-in to the deprecated
folder
---
.../.classpath | 7 ++
.../.project | 28 +++++
.../.settings/org.eclipse.jdt.core.prefs | 8 ++
.../META-INF/MANIFEST.MF | 20 ++++
.../build.properties | 5 +
.../plugin.properties | 16 +++
.../plugin.xml | 12 +++
.../papyrus/diagramqueryresult/Activator.java | 63 +++++++++++
.../DiagramQueryResultDisplayer.java | 119 +++++++++++++++++++++
.../.classpath | 7 --
.../.project | 28 -----
.../.settings/org.eclipse.jdt.core.prefs | 8 --
.../META-INF/MANIFEST.MF | 20 ----
.../build.properties | 5 -
.../plugin.properties | 16 ---
.../plugin.xml | 12 ---
.../papyrus/diagramqueryresult/Activator.java | 63 -----------
.../DiagramQueryResultDisplayer.java | 119 ---------------------
18 files changed, 278 insertions(+), 278 deletions(-)
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/.classpath
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/.project
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/build.properties
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.properties
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.xml
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java
create mode 100644 deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/.classpath
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/.project
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/build.properties
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.properties
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.xml
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java
delete mode 100644 extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java
(limited to 'extraplugins')
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/.classpath b/deprecated/org.eclipse.papyrus.diagramqueryresult/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/.project b/deprecated/org.eclipse.papyrus.diagramqueryresult/.project
new file mode 100644
index 00000000000..f2ccb673650
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/.project
@@ -0,0 +1,28 @@
+
+
+ org.eclipse.papyrus.diagramqueryresult
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs b/deprecated/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..5f279a814d0
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue May 25 14:26:52 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..f39e39761a7
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.diagramqueryresult;singleton:=true
+Bundle-Version: 0.7.0
+Bundle-Activator: org.eclipse.papyrus.diagramqueryresult.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.uml2.uml;bundle-version="3.1.0",
+ org.eclipse.papyrus.core;bundle-version="0.7.0",
+ org.eclipse.papyrus.editor;bundle-version="0.7.0",
+ org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.7.0",
+ org.eclipse.gmt.modisco.infra.query.ui;bundle-version="0.8.0",
+ org.eclipse.gmt.modisco.infra.query;bundle-version="0.8.0",
+ org.eclipse.papyrus.diagram.clazz;bundle-version="0.7.0",
+ org.eclipse.papyrus.diagram.common;bundle-version="0.7.0",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.4.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/build.properties b/deprecated/org.eclipse.papyrus.diagramqueryresult/build.properties
new file mode 100644
index 00000000000..6f20375d6c7
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.properties b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.properties
new file mode 100644
index 00000000000..d0bf9665000
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.properties
@@ -0,0 +1,16 @@
+##########################################################################################
+# Copyright (c) 2010 CEA LIST.
+#
+#
+# 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:
+# Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+#
+########################################################################################
+providerName=Eclipse.org
+pluginName= org.eclipse.papyrus.diagramqueryresult (Incubation)
+
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.xml b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.xml
new file mode 100644
index 00000000000..48397355a76
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java
new file mode 100644
index 00000000000..2b689b6d427
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.diagramqueryresult;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.diagramqueryresult"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java
new file mode 100644
index 00000000000..1a7ebb55819
--- /dev/null
+++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java
@@ -0,0 +1,119 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.diagramqueryresult;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.services.layout.LayoutType;
+import org.eclipse.gmt.modisco.infra.query.runtime.ModelQueryResult;
+import org.eclipse.gmt.modisco.infra.query.ui.views.queryExecution.QueryResultDisplayer;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.extension.commands.ICreationCommand;
+import org.eclipse.papyrus.core.utils.DiResourceSet;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.papyrus.diagram.clazz.CreateClassDiagramCommand;
+import org.eclipse.papyrus.diagram.clazz.UmlClassDiagramForMultiEditor;
+import org.eclipse.papyrus.diagram.clazz.part.UMLDiagramEditor;
+import org.eclipse.papyrus.diagram.common.command.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Element;
+
+
+public class DiagramQueryResultDisplayer implements QueryResultDisplayer {
+
+ /** The diagram editor. */
+ protected UMLDiagramEditor diagramEditor=null;
+
+ /** The clazzdiagramedit part. */
+ protected DiagramEditPart clazzdiagrameditPart;
+
+
+
+ /** The papyrus editor. */
+ protected PapyrusMultiDiagramEditor papyrusEditor;
+
+ public DiagramQueryResultDisplayer() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public void displayQueryResult(List result) {
+ while( !(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()instanceof IMultiDiagramEditor)){}
+ IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ DiResourceSet diResourceSet=EditorUtils.getDiResourceSet();
+ papyrusEditor=((PapyrusMultiDiagramEditor)editorPart);
+ CreateClassDiagramCommand command= new CreateClassDiagramCommand();
+ command.createDiagram(diResourceSet, null, "result");
+
+ Iterator resultIterator= result.iterator();
+ while(resultIterator.hasNext()) {
+ ModelQueryResult modelQueryResult = (ModelQueryResult)resultIterator.next();
+
+ if(modelQueryResult.getValue() instanceof Collection){
+ Iterator iter= ((Collection)modelQueryResult.getValue()).iterator();
+ int i=0;
+ while(iter.hasNext()) {
+ Object object = (Object)iter.next();
+
+ if( object instanceof Element){
+ DropObjectsRequest dropObjectsRequest= new DropObjectsRequest();
+ ArrayList list = new ArrayList();
+ list.add((Element)object);
+ dropObjectsRequest.setObjects(list);
+ dropObjectsRequest.setLocation(new Point(20,100*i));
+ Command commandDrop= getDiagramEditPart().getCommand(dropObjectsRequest);
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(commandDrop);
+ i++;
+ }
+ }
+ }
+ }
+ List operationSet = getDiagramEditPart().getChildren();
+ ArrangeRequest aRequest = new ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL, LayoutType.DEFAULT);
+ //aRequest.setType(ActionIds.ACTION_ARRANGE_ALL);
+ ArrayList toarrange= new ArrayList();
+ toarrange.add(getDiagramEditPart());
+ aRequest.setPartsToArrange(toarrange);
+ Command commandArrangeAll = getDiagramEditPart().getCommand(aRequest);
+ //getDiagramEditPart().getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(commandArrangeAll));
+
+
+
+
+ }
+
+ /**
+ * Gets the diagram edit part.
+ *
+ * @return the diagram edit part
+ */
+ protected DiagramEditPart getDiagramEditPart(){
+ diagramEditor= (UmlClassDiagramForMultiEditor)papyrusEditor.getActiveEditor();
+ clazzdiagrameditPart = (DiagramEditPart)diagramEditor.getGraphicalViewer().getEditPartRegistry().get(diagramEditor.getDiagram());
+ return clazzdiagrameditPart;
+ }
+
+}
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/.classpath b/extraplugins/org.eclipse.papyrus.diagramqueryresult/.classpath
deleted file mode 100644
index 2d1a4302f04..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/.project b/extraplugins/org.eclipse.papyrus.diagramqueryresult/.project
deleted file mode 100644
index f2ccb673650..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- org.eclipse.papyrus.diagramqueryresult
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs b/extraplugins/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 5f279a814d0..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Tue May 25 14:26:52 CEST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF b/extraplugins/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF
deleted file mode 100644
index f39e39761a7..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.diagramqueryresult;singleton:=true
-Bundle-Version: 0.7.0
-Bundle-Activator: org.eclipse.papyrus.diagramqueryresult.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.uml2.uml;bundle-version="3.1.0",
- org.eclipse.papyrus.core;bundle-version="0.7.0",
- org.eclipse.papyrus.editor;bundle-version="0.7.0",
- org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.7.0",
- org.eclipse.gmt.modisco.infra.query.ui;bundle-version="0.8.0",
- org.eclipse.gmt.modisco.infra.query;bundle-version="0.8.0",
- org.eclipse.papyrus.diagram.clazz;bundle-version="0.7.0",
- org.eclipse.papyrus.diagram.common;bundle-version="0.7.0",
- org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.4.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %providerName
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/build.properties b/extraplugins/org.eclipse.papyrus.diagramqueryresult/build.properties
deleted file mode 100644
index 6f20375d6c7..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.properties b/extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.properties
deleted file mode 100644
index d0bf9665000..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-##########################################################################################
-# Copyright (c) 2010 CEA LIST.
-#
-#
-# 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:
-# Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
-#
-########################################################################################
-providerName=Eclipse.org
-pluginName= org.eclipse.papyrus.diagramqueryresult (Incubation)
-
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.xml b/extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.xml
deleted file mode 100644
index 48397355a76..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/plugin.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java b/extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java
deleted file mode 100644
index 2b689b6d427..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramqueryresult;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.diagramqueryresult"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java b/extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java
deleted file mode 100644
index 1a7ebb55819..00000000000
--- a/extraplugins/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramqueryresult;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.services.layout.LayoutType;
-import org.eclipse.gmt.modisco.infra.query.runtime.ModelQueryResult;
-import org.eclipse.gmt.modisco.infra.query.ui.views.queryExecution.QueryResultDisplayer;
-import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.core.extension.commands.ICreationCommand;
-import org.eclipse.papyrus.core.utils.DiResourceSet;
-import org.eclipse.papyrus.core.utils.EditorUtils;
-import org.eclipse.papyrus.diagram.clazz.CreateClassDiagramCommand;
-import org.eclipse.papyrus.diagram.clazz.UmlClassDiagramForMultiEditor;
-import org.eclipse.papyrus.diagram.clazz.part.UMLDiagramEditor;
-import org.eclipse.papyrus.diagram.common.command.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Element;
-
-
-public class DiagramQueryResultDisplayer implements QueryResultDisplayer {
-
- /** The diagram editor. */
- protected UMLDiagramEditor diagramEditor=null;
-
- /** The clazzdiagramedit part. */
- protected DiagramEditPart clazzdiagrameditPart;
-
-
-
- /** The papyrus editor. */
- protected PapyrusMultiDiagramEditor papyrusEditor;
-
- public DiagramQueryResultDisplayer() {
- // TODO Auto-generated constructor stub
- }
-
- public void displayQueryResult(List result) {
- while( !(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()instanceof IMultiDiagramEditor)){}
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- DiResourceSet diResourceSet=EditorUtils.getDiResourceSet();
- papyrusEditor=((PapyrusMultiDiagramEditor)editorPart);
- CreateClassDiagramCommand command= new CreateClassDiagramCommand();
- command.createDiagram(diResourceSet, null, "result");
-
- Iterator resultIterator= result.iterator();
- while(resultIterator.hasNext()) {
- ModelQueryResult modelQueryResult = (ModelQueryResult)resultIterator.next();
-
- if(modelQueryResult.getValue() instanceof Collection){
- Iterator iter= ((Collection)modelQueryResult.getValue()).iterator();
- int i=0;
- while(iter.hasNext()) {
- Object object = (Object)iter.next();
-
- if( object instanceof Element){
- DropObjectsRequest dropObjectsRequest= new DropObjectsRequest();
- ArrayList list = new ArrayList();
- list.add((Element)object);
- dropObjectsRequest.setObjects(list);
- dropObjectsRequest.setLocation(new Point(20,100*i));
- Command commandDrop= getDiagramEditPart().getCommand(dropObjectsRequest);
- diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(commandDrop);
- i++;
- }
- }
- }
- }
- List operationSet = getDiagramEditPart().getChildren();
- ArrangeRequest aRequest = new ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL, LayoutType.DEFAULT);
- //aRequest.setType(ActionIds.ACTION_ARRANGE_ALL);
- ArrayList toarrange= new ArrayList();
- toarrange.add(getDiagramEditPart());
- aRequest.setPartsToArrange(toarrange);
- Command commandArrangeAll = getDiagramEditPart().getCommand(aRequest);
- //getDiagramEditPart().getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(commandArrangeAll));
-
-
-
-
- }
-
- /**
- * Gets the diagram edit part.
- *
- * @return the diagram edit part
- */
- protected DiagramEditPart getDiagramEditPart(){
- diagramEditor= (UmlClassDiagramForMultiEditor)papyrusEditor.getActiveEditor();
- clazzdiagrameditPart = (DiagramEditPart)diagramEditor.getGraphicalViewer().getEditPartRegistry().get(diagramEditor.getDiagram());
- return clazzdiagrameditPart;
- }
-
-}
--
cgit v1.2.3