summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-04-04 10:16:06 (EDT)
committerLaurent Wouters2014-04-04 10:16:06 (EDT)
commitddf972b1fbcc3d6e55ba6b878c574c2fc508f49b (patch)
treea2315dd405d4197ec31ad919e2a6012e68241823
parent2ef4626fbfb2b1e01a6151b6c990d97a552c6f80 (diff)
downloadorg.eclipse.papyrus-ddf972b1fbcc3d6e55ba6b878c574c2fc508f49b.zip
org.eclipse.papyrus-ddf972b1fbcc3d6e55ba6b878c574c2fc508f49b.tar.gz
org.eclipse.papyrus-ddf972b1fbcc3d6e55ba6b878c574c2fc508f49b.tar.bz2
[clean] Retiring org.eclipse.papyrus.uml.table.widgets.celleditorslast/org.eclipse.papyrus.uml.table.widgets.celleditors
Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.classpath7
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.project28
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/META-INF/MANIFEST.MF31
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/about.html28
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/build.properties7
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.properties3
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.xml11
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/resources/umlCellEditors.modelcelleditors33
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/Activator.java73
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumComposite.java144
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumerationComposite.java91
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/PapyrusEnumeratorComposite.java63
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/UnaryReferencePapyrusCellEditorComposite.java330
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/BooleanCellEditor.java78
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumerationLiteralCellEditor.java66
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumeratorEditor.java85
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/IntCellEditor.java64
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/LiteralUnlimitedNaturalCellEditor.java65
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/NaryReferencePapyrusCellEditor.java143
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/StringMultiCellEditor.java77
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/UnaryReferencePapyrusCellEditor.java128
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/NoReferencedElement.java60
-rw-r--r--deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/StereotypePropertyFacetElementUtils.java70
24 files changed, 0 insertions, 1693 deletions
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.classpath b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.classpath
deleted file mode 100644
index 2d1a430..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.project b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.project
deleted file mode 100644
index c94ccff..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.table.widgets.celleditors</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.settings/org.eclipse.jdt.core.prefs b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 945dfdf..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Fri Apr 29 15:57:42 CEST 2011
-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.uml.table.widgets.celleditors/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/META-INF/MANIFEST.MF
deleted file mode 100644
index ff99f85..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.emf.facet.widgets.celleditors,
- org.eclipse.emf.facet.widgets.celleditors.ecore;bundle-version="0.1.0",
- org.eclipse.emf.facet.util.core,
- org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
- org.eclipse.uml2.uml,
- org.eclipse.emf.facet.widgets,
- org.eclipse.emf.facet.infra.common.core,
- org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.profilefacet;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.profilefacet.metamodel;bundle-version="1.0.0"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.0.0.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.uml.table.widget.celleditors.Act
- ivator
-Bundle-SymbolicName: org.eclipse.papyrus.uml.table.widgets.celleditors
- ;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/about.html b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/about.html
deleted file mode 100644
index 82d49bf..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/build.properties b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/build.properties
deleted file mode 100644
index 5674ff8..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-#Mon Sep 12 09:30:19 CEST 2011
-bin.includes=META-INF/,.,plugin.xml,resources/,plugin.properties,about.html
-output..=bin/
-src.includes = about.html
-source..=src/
-bin..=bin/
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.properties b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.properties
deleted file mode 100644
index d470be8..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-#Properties file for org.eclipse.papyrus.table.widgets.celleditors.uml
-providerName = Eclipse Modeling Project
-pluginName = Cell Editors for Papyrus Tables (Incubation) \ No newline at end of file
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.xml b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.xml
deleted file mode 100644
index d6997f1..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/plugin.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.emf.facet.widgets.celleditors.celleditors">
- <cellEditorsModel
- path="resources/umlCellEditors.modelcelleditors">
- </cellEditorsModel>
- </extension>
-
-</plugin>
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/resources/umlCellEditors.modelcelleditors b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/resources/umlCellEditors.modelcelleditors
deleted file mode 100644
index 68ecb17..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/resources/umlCellEditors.modelcelleditors
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<modelCellEditor:ModelCellEditorDeclarations xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:modelCellEditor="http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor">
- <modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="uml_boolean_cell_papyrus" basicCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.BooleanCellEditor">
- <cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//Boolean"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="uml_string_cell_papyrus" basicCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.StringMultiCellEditor">
- <cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="uml_int_cell_papyrus" basicCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.IntCellEditor">
- <cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//Integer"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:UnaryReferenceCellEditor" cellId="uml_enumeration_literal_cell_papyrus" unaryReferenceCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.EnumerationLiteralCellEditor">
- <cellType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/4.0.0/UML#//EnumerationLiteral"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="uml_unlimited_natural_cell_papyrus" basicCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.LiteralUnlimitedNaturalCellEditor">
- <cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//UnlimitedNatural"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:UnaryReferenceCellEditor" cellId="uml_unary_reference_cell_papyrus" unaryReferenceCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.UnaryReferencePapyrusCellEditor">
- <cellType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:UnaryReferenceCellEditor" cellId="ecore_unary_reference_cell_papyrus" unaryReferenceCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.UnaryReferencePapyrusCellEditor">
- <cellType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="emf_enumerator_cell_papyrus" basicCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.EnumeratorEditor">
- <cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EEnumerator"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:NaryFeatureCellEditor" cellId="uml_nary_reference_cell_papyrus" naryFeatureCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.NaryReferencePapyrusCellEditor">
- <cellType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
- </modelCellEditors>
- <modelCellEditors xsi:type="modelCellEditor:NaryFeatureCellEditor" cellId="ecore_nary_reference_cell_papyrus" naryFeatureCellEditorImpl="org.eclipse.papyrus.uml.table.widget.celleditors.editors.NaryReferencePapyrusCellEditor">
- <cellType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- </modelCellEditors>
-</modelCellEditor:ModelCellEditorDeclarations>
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/Activator.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/Activator.java
deleted file mode 100644
index ccae3ae..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/Activator.java
+++ /dev/null
@@ -1,73 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-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.uml.table.widgets.celleditors"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /** Logging helper */
- public static LogHelper log;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- // register the login helper
- log = new LogHelper(plugin);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(final 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.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumComposite.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumComposite.java
deleted file mode 100644
index 3f81fbe..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumComposite.java
+++ /dev/null
@@ -1,144 +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:
- * Gregoire Dupe (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 339664 - org.eclipse.emf.facet.widgets.celleditors API cleaning
- * Nicolas Bros (Mia-Software) - Bug 334539 - [celleditors] change listener
- * Gregoire Dupe (Mia-Software) - Bug 344563 - NPE with Enum Editor
- * Nicolas Guyomar (Mia-Software) - Bug 344563 - NPE with Enum Editor
- * Vincent Lorenzo (CEA-LIST) - Bug 344461: [Table Editor] Papyrus Table Editor needs to provides editors for TableInstance
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.composite;
-
-import org.eclipse.emf.facet.util.core.Logger;
-import org.eclipse.emf.facet.widgets.celleditors.AbstractCellEditorComposite;
-import org.eclipse.emf.facet.widgets.celleditors.internal.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- *
- * This class is a copy of the internal class : org.eclipse.emf.facet.widgets.celleditors.internal.core.composite
- * I duplicate it in order to extend it with EnumerationComposite without have problems if there is change in the original class.
- *
- * @param <T>
- */
-public abstract class EnumComposite<T> extends AbstractCellEditorComposite<T> {
-
- /** the control that is used to edit the contents of the cell */
- private Combo combo = null;
-
- private final Composite parentControl;
-
- private T lastValue;
-
- public EnumComposite(final Composite parent) {
- super(parent);
- setLayout(new FillLayout());
- this.parentControl = parent;
- this.combo = new Combo(this, SWT.NONE);
- final Listener clickListener = new Listener() {
-
- public void handleEvent(final Event event) {
- if(event.widget instanceof Control) {
- Control control = (Control)event.widget;
- if(control.getShell() == EnumComposite.this.getParentControl().getShell()) {
- if(event.widget != EnumComposite.this.getCombo()) {
- EnumComposite.this.commit();
- }
- }
- }
- }
- };
-
- this.combo.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(final SelectionEvent e) {
- fireChanged();
- }
- });
-
- this.combo.addKeyListener(new KeyAdapter() {
-
- @Override
- public void keyPressed(final KeyEvent event) {
- // Enter key pressed
- if((event.keyCode == SWT.CR && event.stateMask == 0) || (event.keyCode == SWT.KEYPAD_CR && event.stateMask == 0)) {
- commit();
- } else if(event.keyCode == SWT.ESC && event.stateMask == 0) {
- // Escape key pressed
- close();
- }
- }
- });
-
- Display.getDefault().addFilter(SWT.MouseDown, clickListener);
- // this listener is only here to remove
- // the other listener from the Display
- addDisposeListener(new DisposeListener() {
-
- public void widgetDisposed(final DisposeEvent e) {
- Display.getDefault().removeFilter(SWT.MouseDown, clickListener);
- }
- });
-
- this.combo.forceFocus();
- }
-
- protected void commit() {
- fireCommit();
- }
-
- public void setValue(final T value) {
- this.lastValue = value;
- if(value == null) {
- this.combo.setText(""); //$NON-NLS-1$
- } else {
- String strValue = getEnumString(value);
- this.combo.setText(strValue);
- }
- }
-
- public T getValue() {
- try {
- this.lastValue = this.getEnumValue(this.combo.getText());
- } catch (Exception e) {
- Logger.logError(e, Activator.getDefault());
- }
- return this.lastValue;
- }
-
- protected abstract T getEnumValue(String text);
-
- protected abstract String getEnumString(T value);
-
- protected abstract String[] getEnumStrings();
-
- public Combo getCombo() {
- return this.combo;
- }
-
- protected Composite getParentControl() {
- return this.parentControl;
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumerationComposite.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumerationComposite.java
deleted file mode 100644
index c64fdb3..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/EnumerationComposite.java
+++ /dev/null
@@ -1,91 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.composite;
-
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.uml2.uml.Enumeration;
-import org.eclipse.uml2.uml.EnumerationLiteral;
-
-/**
- *
- * This Composite allows to edit the Enumeration in Papyrus table.
- * Useful to edit the property of the stereotyped element when the property is typed with an Enumeration.
- *
- */
-public class EnumerationComposite extends EnumComposite<EnumerationLiteral> {
-
- /**
- * the enumeration
- */
- private Enumeration enumeration;
-
- /**
- *
- * Constructor.
- *
- * @param parent
- */
- public EnumerationComposite(final Composite parent) {
- super(parent);
- }
-
- /**
- *
- * @param enumeration
- */
- public void setEnumeration(final Enumeration enumeration) {
- this.enumeration = enumeration;
- getCombo().setItems(getEnumStrings());
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.internal.core.composite.EnumComposite#getEnumValue(java.lang.String)
- *
- * {@inheritDoc}
- */
- @Override
- protected EnumerationLiteral getEnumValue(final String text) {
- return this.enumeration.getOwnedLiteral(text);
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.internal.core.composite.EnumComposite#getEnumString(java.lang.Object)
- *
- * {@inheritDoc}
- */
- @Override
- protected String getEnumString(final EnumerationLiteral value) {
- return value.getName();
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.internal.core.composite.EnumComposite#getEnumStrings()
- *
- * {@inheritDoc}
- */
- @Override
- protected String[] getEnumStrings() {
- int size = this.enumeration.getOwnedLiterals().size();
- String[] strs = new String[size];
- for(int i = 0; i < size; i++) {
- strs[i] = this.enumeration.getOwnedLiterals().get(i).getName();
- }
- return strs;
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/PapyrusEnumeratorComposite.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/PapyrusEnumeratorComposite.java
deleted file mode 100644
index 0377bad..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/PapyrusEnumeratorComposite.java
+++ /dev/null
@@ -1,63 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.composite;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.swt.widgets.Composite;
-
-
-
-public class PapyrusEnumeratorComposite<T extends Enumerator> extends org.eclipse.emf.facet.widgets.celleditors.internal.core.composite.EnumeratorComposite {
-
- /**
- * the enumeration
- */
- private EEnum myEEnum;
-
- /**
- *
- * {@inheritDoc}
- *
- */
- public PapyrusEnumeratorComposite(Composite parent) {
- super(parent);
- }
-
- /**
- *
- * {@inheritDoc}
- *
- */
- @Override
- public void setEEnum(EEnum eenum2) {
- super.setEEnum(eenum2);
- this.myEEnum = eenum2;
- }
-
-
- /**
- *
- * {@inheritDoc}
- *
- */
- @Override
- protected Enumerator getEnumValue(String text) {
- if(this.myEEnum.getEEnumLiteralByLiteral(text) == null) {
- return super.getEnumValue(text);
- }
- EEnumLiteral enumLiteral = myEEnum.getEEnumLiteral(text);
- return enumLiteral.getInstance();
-
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/UnaryReferencePapyrusCellEditorComposite.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/UnaryReferencePapyrusCellEditorComposite.java
deleted file mode 100644
index 9b90f50..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/composite/UnaryReferencePapyrusCellEditorComposite.java
+++ /dev/null
@@ -1,330 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.table.widget.celleditors.composite;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeMap;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.EModelElementImpl;
-import org.eclipse.emf.facet.widgets.celleditors.AbstractCellEditorComposite;
-import org.eclipse.emf.facet.widgets.celleditors.internal.Messages;
-import org.eclipse.emf.facet.widgets.internal.CustomizableLabelProvider;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.fieldassist.ComboContentAdapter;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.papyrus.infra.widgets.editors.ReferenceCombo;
-import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
-import org.eclipse.papyrus.uml.profilefacet.metamodel.profilefacet.StereotypePropertyElement;
-import org.eclipse.papyrus.uml.profilefacet.utils.StereotypePropertyUtils;
-import org.eclipse.papyrus.uml.table.widget.celleditors.utils.StereotypePropertyFacetElementUtils;
-import org.eclipse.papyrus.uml.table.widget.celleditors.utils.NoReferencedElement;
-import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-public class UnaryReferencePapyrusCellEditorComposite extends AbstractCellEditorComposite<EObject> {
-
- private static final int GRID_DATA_HEIGHT = 50;
-
- private final Button button;
-
- private final Combo combo;
-
- private final Control parentControl;
-
- private final EObject source;
-
- private final Map<String, EObject> fElements = new TreeMap<String, EObject>();
-
-
- private final EStructuralFeature feature;
-
- /**
- * @param parent
- * the parent composite
- * @param eObjects
- * the possible choices
- */
- public UnaryReferencePapyrusCellEditorComposite(final Composite parent, final List<EObject> eObjects, final EObject source1, final EStructuralFeature feature1) {
- super(parent);
- assert source1 instanceof Element;
- this.source = StereotypePropertyFacetElementUtils.getRealSource(source1, feature1);
- this.feature = StereotypePropertyFacetElementUtils.getRealFeature(source1, feature1);
- Stereotype ste = null;
- if(feature1 instanceof StereotypePropertyElement) {
- ste = StereotypePropertyUtils.getAppliedStereotype((Element)source1, (StereotypePropertyElement)feature1);
- }
- this.parentControl = parent;
- final ILabelProvider labelProvider = new UMLLabelProvider();
- final ILabelProvider customizableLabelProvider = new CustomizableLabelProvider();
- final UMLContentProvider provider;
- if(ste != null) {
- provider = new UMLContentProvider(source, feature, ste, source.eResource().getResourceSet());
- } else {
- provider = new UMLContentProvider(source1, feature1, null, source.eResource().getResourceSet());
- }
-
- EObject noReferencedElement = null;
-
- for(EObject eObject : eObjects) {
- String label;
- if(eObject instanceof NoReferencedElement) {
- label = eObject.toString();
- noReferencedElement = eObject;
- } else {
- label = customizableLabelProvider.getText(eObject);;
- }
- // find a unique label
- if(this.fElements.get(label) != null) {
- int suffix = 2;
- while(this.fElements.get(label + " (" + suffix + ")") != null) { //$NON-NLS-1$ //$NON-NLS-2$
- suffix++;
- }
- this.fElements.put(label + " (" + suffix + ")", eObject); //$NON-NLS-1$//$NON-NLS-2$
- } else {
- this.fElements.put(label, eObject);
- }
- }
-
- GridLayout compositeLayout = new GridLayout(2, false);
- compositeLayout.marginHeight = 0;
- compositeLayout.marginWidth = 0;
- compositeLayout.horizontalSpacing = 0;
- setLayout(compositeLayout);
-
- this.combo = new Combo(this, SWT.DROP_DOWN);
-
- // reduce the font so that the Combo fits in the cell
- FontData[] fontData = Display.getDefault().getSystemFont().getFontData();
- fontData[0].setHeight(fontData[0].getHeight()/* - 2 */);
- Font font = new Font(Display.getDefault(), fontData);
- this.combo.setFont(font);
- for(String label : this.fElements.keySet()) {
- this.combo.add(label);
- }
-
- //we force the null value to the first place
- if(noReferencedElement != null) {
- this.combo.remove(noReferencedElement.toString());
- this.combo.add(noReferencedElement.toString(), 0);
- }
-
- GridData comboGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- this.combo.setLayoutData(comboGridData);
- addCompletionHandler(this.combo, this.fElements.keySet());
-
- //we set the initial value in the combo :
- Object currentValue = this.source.eGet(this.feature);
- if(currentValue == null) {
- if(noReferencedElement != null) {
- int index = this.combo.indexOf(noReferencedElement.toString());
- if(index > -1) {
- this.combo.select(index);
- }
- }
- } else {
- final String txt = customizableLabelProvider.getText(currentValue);
- int index = this.combo.indexOf(txt);
- if(index > -1) {
- this.combo.select(index);
- }
- }
- this.combo.addKeyListener(new KeyAdapter() {
-
- @Override
- public void keyPressed(final KeyEvent event) {
- // Enter key pressed
- if((event.keyCode == SWT.CR && event.stateMask == 0) || (event.keyCode == SWT.KEYPAD_CR && event.stateMask == 0)) {
- if(isValid()) {
- commit();
- } else {
- MessageDialog.openWarning(parent.getShell(), Messages.UnaryReferenceCellEditorComposite_0, Messages.UnaryReferenceCellEditorComposite_1);
- }
- } else if(event.keyCode == SWT.ESC && event.stateMask == 0) {
- // Escape key pressed
- close();
- }
- }
- });
-
- this.button = new Button(this, SWT.PUSH);
- this.button.setText("..."); //$NON-NLS-1$
- GridData buttonGridData = new GridData(SWT.FILL, SWT.FILL, false, true);
- buttonGridData.heightHint = UnaryReferencePapyrusCellEditorComposite.GRID_DATA_HEIGHT;
- this.button.setLayoutData(buttonGridData);
- this.button.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(final SelectionEvent e) {
- TreeSelectorDialog dialog = new TreeSelectorDialog(Display.getCurrent().getActiveShell()) {
-
- @Override
- public void okPressed() {
- Object selectedElements[] = new Object[this.getResult().length];
- Object result[] = this.getResult();
- for(int i = 0; i < result.length; i++) {
- Object adapted = provider.getAdaptedValue(result[i]);
- selectedElements[i] = adapted;
- }
- String selectedElementLabel = null;
-
- if(selectedElements.length > 0) {
- Set<Entry<String, EObject>> entrySet = UnaryReferencePapyrusCellEditorComposite.this.getfElements().entrySet();
- for(Entry<String, EObject> entry : entrySet) {
- if(entry.getValue() == selectedElements[0]) {
- selectedElementLabel = entry.getKey();
- break;
- }
- }
- }
- UnaryReferencePapyrusCellEditorComposite.this.getCombo().setText(selectedElementLabel);
- commit();
- super.okPressed();
- super.close();
- }
-
- };
-
-
- dialog.setLabelProvider(labelProvider);
- dialog.setContentProvider(provider);
- if(source != null) {
- dialog.setInitialElementSelections(Collections.singletonList(source.eGet(feature)));
- }
-
- dialog.setTitle(feature.getEType().getName());
-
- dialog.open();
-
- }
- });
-
- // commit the cell editor when the mouse is clicked
- // anywhere outside the text field
- final Listener clickListener = new Listener() {
-
- public void handleEvent(final Event event) {
- if(event.widget instanceof Control) {
- Control control = (Control)event.widget;
- if(control.getShell() == UnaryReferencePapyrusCellEditorComposite.this.getParentControl().getShell() && event.widget != UnaryReferencePapyrusCellEditorComposite.this.getButton() && event.widget != UnaryReferencePapyrusCellEditorComposite.this.getCombo()) {
- if(isValid()) {
- commit();
- }
- }
- }
-
- }
- };
- Display.getDefault().addFilter(SWT.MouseDown, clickListener);
-
- // this listener is only here to remove
- // the other listener from the Display
- addDisposeListener(new DisposeListener() {
-
- public void widgetDisposed(final DisposeEvent e) {
- Display.getDefault().removeFilter(SWT.MouseDown, clickListener);
- }
- });
-
- this.combo.addModifyListener(new ModifyListener() {
-
- public void modifyText(final ModifyEvent e) {
- fireChanged();
- }
- });
-
-
-
- this.combo.forceFocus();
- }
-
- protected boolean isValid() {
- return this.fElements.get(this.combo.getText()) != null;
- }
-
- private static void addCompletionHandler(final Combo comboBox, final Collection<String> completions) {
- String[] completionsArray = completions.toArray(new String[completions.size()]);
- SimpleContentProposalProvider contentProposalProvider = new SimpleContentProposalProvider(completionsArray);
- contentProposalProvider.setFiltering(true);
- ContentProposalAdapter adapter = new ContentProposalAdapter(comboBox, new ComboContentAdapter(), contentProposalProvider, null, null);
- // adapter.setFilterStyle(ContentProposalAdapter.FILTER_CHARACTER);
- adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
-
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IWidget#getValue()
- *
- * @return
- */
- public EObject getValue() {
- return this.fElements.get(this.combo.getText());
- }
-
- protected void commit() {
- fireCommit();
- }
-
-
- protected Button getButton() {
- return this.button;
- }
-
- protected Combo getCombo() {
- return this.combo;
- }
-
- protected Control getParentControl() {
- return this.parentControl;
- }
-
- protected Map<String, EObject> getfElements() {
- return this.fElements;
- }
-
- public void setValue(EObject value) {
- //not used
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/BooleanCellEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/BooleanCellEditor.java
deleted file mode 100644
index 3731a19..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/BooleanCellEditor.java
+++ /dev/null
@@ -1,78 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.facet.widgets.celleditors.AbstractCellEditorComposite;
-import org.eclipse.emf.facet.widgets.celleditors.ICompositeEditorFactory;
-import org.eclipse.emf.facet.widgets.celleditors.IListener;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor;
-import org.eclipse.emf.facet.widgets.celleditors.core.composite.registries.ICompositeEditorFactoriesRegistry;
-import org.eclipse.papyrus.uml.table.widget.celleditors.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/** A cell editor for Boolean */
-public class BooleanCellEditor implements IModelCellEditor {
-
-
-
- /**
- * The boolean composite
- */
- private AbstractCellEditorComposite<Boolean> composite = null;
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
- * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
- *
- * {@inheritDoc}
- */
- public Control activateCell(final Composite parent, final Object originalValue, final IModelCellEditHandler editHandler, final EStructuralFeature feature, final EObject source) {
- ICompositeEditorFactory<Boolean> compositeEditorFactory = ICompositeEditorFactoriesRegistry.INSTANCE.getCompositeEditorFactory(Boolean.class);
- this.composite = compositeEditorFactory.createCompositeEditor(parent, SWT.NONE);
- if(originalValue != null) {
- if(originalValue instanceof Boolean) {
- this.composite.setValue((Boolean)originalValue);
- } else {
- Activator.log.info("An instance of Integer was expected"); //$NON-NLS-1$
- }
- }
- this.composite.addCommitListener(new IListener() {
-
- public void handleEvent() {
- editHandler.commit();
- }
- });
- return this.composite;
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#getValue()
- *
- * @return
- */
- public Object getValue() {
- if(this.composite != null) {
- return this.composite.getValue();
- }
- return null;
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumerationLiteralCellEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumerationLiteralCellEditor.java
deleted file mode 100644
index bd14a5a..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumerationLiteralCellEditor.java
+++ /dev/null
@@ -1,66 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.facet.widgets.celleditors.IListener;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor;
-import org.eclipse.papyrus.uml.table.widget.celleditors.composite.EnumerationComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.uml2.uml.EnumerationLiteral;
-
-/**
- * A cell editor for String
- */
-public class EnumerationLiteralCellEditor implements IModelCellEditor {
-
- /** the composite */
- private EnumerationComposite composite = null;
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
- * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
- *
- * {@inheritDoc}
- */
- public Control activateCell(final Composite parent, final Object originalValue, final IModelCellEditHandler editHandler, final EStructuralFeature feature, final EObject source) {
- this.composite = new EnumerationComposite(parent);
- this.composite.setEnumeration(((EnumerationLiteral)originalValue).getEnumeration());
- this.composite.setValue((EnumerationLiteral)originalValue);
- this.composite.addCommitListener(new IListener() {
-
- public void handleEvent() {
- editHandler.commit();
- }
- });
- return this.composite;
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#getValue()
- *
- * {@inheritDoc}
- */
- public Object getValue() {
- if(this.composite != null) {
- return this.composite.getValue();
- }
- return null;
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumeratorEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumeratorEditor.java
deleted file mode 100644
index 144e0a8..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/EnumeratorEditor.java
+++ /dev/null
@@ -1,85 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.EcoreFactoryImpl;
-import org.eclipse.emf.facet.widgets.celleditors.IListener;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor;
-import org.eclipse.emf.facet.widgets.celleditors.internal.core.composite.EnumeratorComposite;
-import org.eclipse.papyrus.uml.table.widget.celleditors.composite.PapyrusEnumeratorComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- *
- * This class provides an Editor for EMF Enumerator.
- *
- * FIXME : this class doesn't depend on UML.
- */
-
-public class EnumeratorEditor implements IModelCellEditor {
-
- /** the composite for this editor */
- private EnumeratorComposite<Enumerator> composite = null;
-
- /**
- * {@inheritDoc}
- *
- * @return <code>null</code> when the Enumeration constains only one EnumLiteral
- */
- public Control activateCell(Composite parent, Object originalValue, final IModelCellEditHandler editHandler, EStructuralFeature feature, EObject source) {
- if(originalValue instanceof Enumerator) {
- Class<?> class_ = originalValue.getClass();
- Object[] constants = class_.getEnumConstants();
- EEnum myEEnum = EcoreFactoryImpl.eINSTANCE.createEEnum();
- myEEnum.setName(class_.getSimpleName());
- myEEnum.setInstanceClassName(class_.getName());
- for(int i = 0; i < constants.length; i++) {
- EEnumLiteral literal = EcoreFactoryImpl.eINSTANCE.createEEnumLiteral();
- literal.setInstance((Enumerator)constants[i]);
- myEEnum.getELiterals().add(literal);
-
- }
-
- if(myEEnum.getELiterals().size() > 2) {//we don't return the editor when there is only one value in the enumeration
- this.composite = new PapyrusEnumeratorComposite<Enumerator>(parent);
- this.composite.setEEnum(myEEnum);
- this.composite.setValue((Enumerator)originalValue);
- this.composite.addCommitListener(new IListener() {
-
- public void handleEvent() {
- editHandler.commit();
- }
- });
- return this.composite;
- }
- }
- return null;
- }
-
-
- /**
- *
- * {@inheritDoc}
- *
- */
- public Object getValue() {
- return this.composite.getValue();
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/IntCellEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/IntCellEditor.java
deleted file mode 100644
index 93579c6..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/IntCellEditor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.facet.widgets.celleditors.AbstractCellEditorComposite;
-import org.eclipse.emf.facet.widgets.celleditors.ICompositeEditorFactory;
-import org.eclipse.emf.facet.widgets.celleditors.IListener;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor;
-import org.eclipse.emf.facet.widgets.celleditors.core.composite.registries.ICompositeEditorFactoriesRegistry;
-import org.eclipse.papyrus.uml.table.widget.celleditors.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public class IntCellEditor implements IModelCellEditor {
-
-
-
- /**
- * The boolean composite
- */
- protected AbstractCellEditorComposite<Integer> composite = null;
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
- * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
- *
- * {@inheritDoc}
- */
- public Control activateCell(final Composite parent, final Object originalValue, final IModelCellEditHandler editHandler, final EStructuralFeature feature, final EObject source) {
- ICompositeEditorFactory<Integer> compositeEditorFactory = ICompositeEditorFactoriesRegistry.INSTANCE.getCompositeEditorFactory(Integer.class);
- this.composite = compositeEditorFactory.createCompositeEditor(parent, SWT.NONE);
- if(originalValue != null) {
- if(originalValue instanceof Integer) {
- this.composite.setValue((Integer)originalValue);
- } else {
- Activator.log.info("An instance of Integer was expected"); //$NON-NLS-1$
- }
- }
- this.composite.addCommitListener(new IListener() {
-
- public void handleEvent() {
- editHandler.commit();
- }
- });
- return this.composite;
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#getValue()
- *
- * @return
- */
- public Object getValue() {
- if(this.composite != null) {
- return this.composite.getValue();
- }
- return null;
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/LiteralUnlimitedNaturalCellEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/LiteralUnlimitedNaturalCellEditor.java
deleted file mode 100644
index 54ed998..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/LiteralUnlimitedNaturalCellEditor.java
+++ /dev/null
@@ -1,65 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-public class LiteralUnlimitedNaturalCellEditor extends IntCellEditor {
-
- /** the original value */
- private Object originalValue;
-
- /**
- *
- * @see org.eclipse.papyrus.uml.table.widget.celleditors.editors.IntCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
- * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
- *
- * @param parent
- * @param originalValue
- * @param editHandler
- * @param feature
- * @param source
- * @return
- */
- @Override
- public Control activateCell(Composite parent, Object originalValue, IModelCellEditHandler editHandler, EStructuralFeature feature, EObject source) {
- this.originalValue = originalValue;
- return super.activateCell(parent, originalValue, editHandler, feature, source);
- }
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#getValue()
- *
- * @return
- */
- @Override
- public Object getValue() {
- if(this.composite != null) {
- Object value = this.composite.getValue();
- if(value instanceof Integer) {
- Integer integer = (Integer)value;
- if(integer.intValue() >= -1) {
- return integer;
- }
- }
- }
- return this.originalValue;
- }
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/NaryReferencePapyrusCellEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/NaryReferencePapyrusCellEditor.java
deleted file mode 100644
index 9cc1063..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/NaryReferencePapyrusCellEditor.java
+++ /dev/null
@@ -1,143 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.emf.facet.widgets.celleditors.internal.core.NaryReferenceCellEditor;
-import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectorDialog;
-import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
-import org.eclipse.papyrus.uml.profilefacet.metamodel.profilefacet.StereotypePropertyElement;
-import org.eclipse.papyrus.uml.profilefacet.utils.StereotypePropertyUtils;
-import org.eclipse.papyrus.uml.table.widget.celleditors.utils.StereotypePropertyFacetElementUtils;
-import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- * NAry editor for Papyrus. When the edited element is not an instance of Element, we call the default EMF-Facet editor
- *
- * @author vl222926
- *
- * @param <T>
- */
-public class NaryReferencePapyrusCellEditor<T extends EObject> extends NaryReferenceCellEditor<T> {
-
- /** the dialog used for the selection */
- private MultipleValueSelectorDialog dialog;
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.internal.core.NaryReferenceCellEditor#activateCell(org.eclipse.swt.widgets.Composite,
- * java.util.List, java.util.List, org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.ecore.EStructuralFeature)
- *
- * @param parent
- * @param values
- * @param availableValues
- * @param editHandler
- * @param source
- * @param feature
- * @return
- */
- public Control activateCell(final Composite parent, final List<T> values, final List<T> availableValues, final IModelCellEditHandler editHandler, final EObject source, final EStructuralFeature feature) {
- if(!(source instanceof Element)) {
- return super.activateCell(parent, values, availableValues, editHandler, source, feature);
- } else {
- final Composite placeholderComposite = new Composite(parent, SWT.NONE);
- final EObject realSource = StereotypePropertyFacetElementUtils.getRealSource(source, feature);
- final EStructuralFeature realFeature = StereotypePropertyFacetElementUtils.getRealFeature(source, feature);
- final UMLContentProvider p;
- if(feature instanceof StereotypePropertyElement) {
- assert source instanceof Element;
- final Stereotype ste = StereotypePropertyUtils.getAppliedStereotype((Element)source, (StereotypePropertyElement)feature);
- p = new UMLContentProvider(realSource, realFeature, ste, source.eResource().getResourceSet());
- } else {
- p = new UMLContentProvider(source, feature, null, source.eResource().getResourceSet());
- }
-
- final String title = realFeature.getName();
- final boolean unique = realFeature.isUnique();
- final boolean ordered = realFeature.isOrdered();
- final int upperBound = realFeature.getUpperBound();
- final ReferenceSelector selector = new ReferenceSelector(unique);
- selector.setContentProvider(p);
- selector.setLabelProvider(new UMLLabelProvider());
- final Object value = (Collection<?>)realSource.eGet(realFeature);
-
- dialog = new MultipleValueSelectorDialog(Display.getCurrent().getActiveShell(), selector, title, unique, ordered, upperBound) {
-
- @Override
- protected void okPressed() {
- super.okPressed();
- editHandler.commit();
- }
-
- @Override
- public boolean close() {
- placeholderComposite.dispose();
- return super.close();
- }
- };
- dialog.setLabelProvider(new UMLLabelProvider());
- if(value != null && value instanceof Collection) {
- Collection<?> coll = (Collection<?>)value;
- if(!coll.isEmpty()) {
- dialog.setInitialSelections(coll.toArray());
- }
- }
-
- dialog.open();
-
- return placeholderComposite;
- }
- }
-
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.internal.core.NaryReferenceCellEditor#getValue()
- *
- * @return
- */
- @Override
- public List<T> getValue() {
- Object[] result;
- if(this.dialog == null) {
- return super.getValue();
- } else {
- result = dialog.getResult();
- }
- if(result == null) {
- return Collections.emptyList();
- }
- final List<T> values = new ArrayList<T>();
- for(final Object current : result) {
- values.add((T)current);
- }
- return values;
-
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/StringMultiCellEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/StringMultiCellEditor.java
deleted file mode 100644
index 2653a97..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/StringMultiCellEditor.java
+++ /dev/null
@@ -1,77 +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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.facet.widgets.celleditors.AbstractCellEditorComposite;
-import org.eclipse.emf.facet.widgets.celleditors.ICompositeEditorFactory;
-import org.eclipse.emf.facet.widgets.celleditors.IListener;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor;
-import org.eclipse.emf.facet.widgets.celleditors.core.composite.registries.ICompositeEditorFactoriesRegistry;
-import org.eclipse.papyrus.uml.table.widget.celleditors.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A cell editor for String
- */
-public class StringMultiCellEditor implements IModelCellEditor {
-
- /**
- * The boolean composite
- */
- private AbstractCellEditorComposite<String> composite = null;
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
- * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
- *
- * {@inheritDoc}
- */
- public Control activateCell(final Composite parent, final Object originalValue, final IModelCellEditHandler editHandler, final EStructuralFeature feature, final EObject source) {
- ICompositeEditorFactory<String> compositeEditorFactory = ICompositeEditorFactoriesRegistry.INSTANCE.getCompositeEditorFactory(String.class);
- this.composite = compositeEditorFactory.createCompositeEditor(parent, SWT.NONE);
- if(originalValue != null) {
- if(originalValue instanceof String) {
- this.composite.setValue((String)originalValue);
- } else {
- Activator.log.info("An instance of Integer was expected"); //$NON-NLS-1$
- }
- }
- this.composite.addCommitListener(new IListener() {
-
- public void handleEvent() {
- editHandler.commit();
- }
- });
- return this.composite;
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#getValue()
- *
- * @return
- */
- public Object getValue() {
- if(this.composite != null) {
- return this.composite.getValue();
- }
- return null;
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/UnaryReferencePapyrusCellEditor.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/UnaryReferencePapyrusCellEditor.java
deleted file mode 100644
index 23e775a..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/editors/UnaryReferencePapyrusCellEditor.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.editors;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.facet.widgets.celleditors.AbstractCellEditorComposite;
-import org.eclipse.emf.facet.widgets.celleditors.IListener;
-import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
-import org.eclipse.emf.facet.widgets.celleditors.internal.core.UnaryReferenceCellEditor;
-import org.eclipse.papyrus.infra.emf.utils.TransactionalUnsetter;
-import org.eclipse.papyrus.infra.widgets.providers.HierarchicToFlatContentProvider;
-import org.eclipse.papyrus.infra.widgets.providers.TreeToFlatContentProvider;
-import org.eclipse.papyrus.uml.profilefacet.metamodel.profilefacet.StereotypePropertyElement;
-import org.eclipse.papyrus.uml.profilefacet.utils.StereotypePropertyUtils;
-import org.eclipse.papyrus.uml.table.widget.celleditors.composite.UnaryReferencePapyrusCellEditorComposite;
-import org.eclipse.papyrus.uml.table.widget.celleditors.utils.NoReferencedElement;
-import org.eclipse.papyrus.uml.table.widget.celleditors.utils.StereotypePropertyFacetElementUtils;
-import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- *
- * @This cell editor is declared on UML element AND on EObject (for StereotypeFacetPropertyReference
- *
- */
-public class UnaryReferencePapyrusCellEditor extends UnaryReferenceCellEditor {
-
-
- private AbstractCellEditorComposite<EObject> cellEditorComposite;
-
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
- * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
- *
- * @param parent
- * @param originalValue
- * @param editHandler
- * @param feature
- * @param source
- * @return
- */
- public Control activateCell(final Composite parent, final Object originalValue, final IModelCellEditHandler editHandler, final EStructuralFeature feature, final EObject source) {
- if(!(source instanceof Element)) { //we do the same things than EMF-Facet
- cellEditorComposite = (AbstractCellEditorComposite<EObject>)super.activateCell(parent, originalValue, editHandler, feature, source);
- } else {//we are working with UML
- final EStructuralFeature realFeature = StereotypePropertyFacetElementUtils.getRealFeature(source, feature);
- final EObject realSource = StereotypePropertyFacetElementUtils.getRealSource(source, feature);
- final UMLContentProvider p;
- if(feature instanceof StereotypePropertyElement) {
- assert source instanceof Element;
- final Stereotype ste = StereotypePropertyUtils.getAppliedStereotype((Element)source, (StereotypePropertyElement)feature);
- p = new UMLContentProvider(realSource, realFeature, ste, source.eResource().getResourceSet());
- } else {
- p = new UMLContentProvider(source, feature, null, source.eResource().getResourceSet());
- }
-
- final TreeToFlatContentProvider flatP = new HierarchicToFlatContentProvider(p);
- final List<Object> list = Arrays.asList(flatP.getElements());
- final List<EObject> availableValues = new ArrayList<EObject>();
- final Iterator<Object> iter = list.iterator();
- while(iter.hasNext()) {
- final Object current = iter.next();
- if(current instanceof EObject) {
- availableValues.add((EObject)current);
- }
- }
-
- //add the possibility to set the Null value (or a reset to the default value;
- availableValues.add(0, new NoReferencedElement("null")); //$NON-NLS-1$
-
- this.cellEditorComposite = new UnaryReferencePapyrusCellEditorComposite(parent, availableValues, source, feature);
- this.cellEditorComposite.addCommitListener(new IListener() {
-
- public void handleEvent() {
- final EObject value = cellEditorComposite.getValue();
- if(value instanceof NoReferencedElement && !realFeature.isUnsettable()) {
- //tricks because many properties are unsettable, and EMF-Facet calls isUnsettable() before to do set(null) -> we can't do a set(null) when the feature isUnsettable
- //we doesn't do a set null, but an unset
- final TransactionalUnsetter unsetter = new TransactionalUnsetter(realSource, realFeature);
- unsetter.doUnset();
- cellEditorComposite.dispose();
- } else {
- editHandler.commit();
- }
- }
- });
- }
- return this.cellEditorComposite;
-
- }
-
- /**
- *
- * @see org.eclipse.emf.facet.widgets.celleditors.internal.core.UnaryReferenceCellEditor#getValue()
- *
- * @return
- * the new value for the feature.
- */
- public Object getValue() {
- final Object selectedValue = this.cellEditorComposite.getValue();
- if(selectedValue instanceof NoReferencedElement) {
- return null;
- }
- return selectedValue;
- }
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/NoReferencedElement.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/NoReferencedElement.java
deleted file mode 100644
index a2f0d7a..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/NoReferencedElement.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.utils;
-
-import org.eclipse.emf.ecore.impl.EModelElementImpl;
-
-/**
- *
- * This class allows to simulate <code>null</code> value in the combo editor
- *
- */
-public class NoReferencedElement extends EModelElementImpl {
-
- /**
- * the text displayed by the {@link #toString()} method
- */
- private final String text;
-
- /**
- * default text used by {@link #toString()}
- */
- private static final String DEFAULT_TEXT = "<Undefined>"; //$NON-NLS-1$
-
- /**
- *
- * Constructor.
- * the default text for the {@link #toString()} method will be used
- *
- */
- public NoReferencedElement() {
- this(DEFAULT_TEXT);
- }
-
- /**
- *
- * Constructor.
- *
- * @param text
- * the text to display by the method {@link #toString()}
- */
- public NoReferencedElement(final String text) {
- this.text = text;
- }
-
- public String toString() {
- return this.text;
- };
-
-}
diff --git a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/StereotypePropertyFacetElementUtils.java b/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/StereotypePropertyFacetElementUtils.java
deleted file mode 100644
index 4e5dfea..0000000
--- a/deprecated/org.eclipse.papyrus.uml.table.widgets.celleditors/src/org/eclipse/papyrus/uml/table/widget/celleditors/utils/StereotypePropertyFacetElementUtils.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.table.widget.celleditors.utils;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.uml.profilefacet.metamodel.profilefacet.StereotypePropertyElement;
-import org.eclipse.papyrus.uml.profilefacet.utils.StereotypePropertyUtils;
-import org.eclipse.uml2.uml.Element;
-
-/**
- *
- * this class provides useful method to find to real elements represented by elements of the ProfileFacetSet metamodel
- *
- */
-public class StereotypePropertyFacetElementUtils {
-
-
- private StereotypePropertyFacetElementUtils() {
- //to prevent instanciation
- }
-
- /**
- *
- * @param source
- * the source eobject
- * @param feature
- * the feature
- * @return
- * the real element according to the source and the feature
- */
- public static final EObject getRealSource(final EObject source, final EStructuralFeature feature) {
- if(feature instanceof StereotypePropertyElement) {
- final EObject realSource = StereotypePropertyUtils.getStereotypeApplication((Element)source, (StereotypePropertyElement)feature);
- assert realSource != null;
- return realSource;
- }
- return source;
- }
-
- /**
- *
- * @param source
- * the source
- * @param feature
- * the feature
- * @return
- * the real feature, according to source and the feature
- */
- public static final EStructuralFeature getRealFeature(final EObject source, final EStructuralFeature feature) {
- if(feature instanceof StereotypePropertyElement) {
- final EStructuralFeature realFeature = StereotypePropertyUtils.getEStructuralFeature((Element)source, (StereotypePropertyElement)feature);
- assert realFeature != null;
- return realFeature;
- }
- return feature;
- }
-
-}