Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2015-01-26 12:27:12 +0000
committerVincent Lorenzo2015-01-26 12:31:59 +0000
commit6893a76ad3a996a7a00eb83663ab37e414c9c6fe (patch)
tree50d0016dc35e37f30caf8cc58897fb5811348b89 /sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse
parent4671c0502e943fae700d7fe791513d1b4de0b607 (diff)
downloadorg.eclipse.papyrus-6893a76ad3a996a7a00eb83663ab37e414c9c6fe.tar.gz
org.eclipse.papyrus-6893a76ad3a996a7a00eb83663ab37e414c9c6fe.tar.xz
org.eclipse.papyrus-6893a76ad3a996a7a00eb83663ab37e414c9c6fe.zip
Clean sandbox : remove all plugins concerning table efacet and old table pluginslast/org.eclipse.papyrus.infra.efacet
Diffstat (limited to 'sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse')
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java56
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/HideNewColumnsListener.java141
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java68
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java40
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java46
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java34
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/CustomizationUtils.java84
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/TableInstanceCommandFactory.java285
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java45
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java22
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java47
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java69
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java17
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java20
14 files changed, 0 insertions, 974 deletions
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java
deleted file mode 100644
index afbc92c7b9a..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor;
-
-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.infra.table.efacet.nestededitor"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- public static LogHelper log;
-
- /**
- * 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;
- log = new LogHelper(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/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/HideNewColumnsListener.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/HideNewColumnsListener.java
deleted file mode 100644
index 3ec2e5d9a99..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/HideNewColumnsListener.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.editor;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Column;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.FeatureColumn;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Row;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.TableFactory;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.TablePackage;
-import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidget;
-import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetInternal;
-import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.validation.internal.modeled.model.validation.Feature;
-import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.infra.table.efacet.common.listener.AbstractTableTriggerListener;
-import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
-import org.eclipse.papyrus.infra.table.efacet.nestededitor.internal.copy.TableInstanceCommandFactory;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-
-public class HideNewColumnsListener extends AbstractTableTriggerListener {
-
- /**
- * features already managed
- */
- private Set<ETypedElement> featuresAlreadyManaged = new HashSet<ETypedElement>();
-
- public HideNewColumnsListener(final PapyrusTable table) {
- super(table);
- for(final Column column : table.getTable().getColumns()) {
- if(column instanceof FeatureColumn) {
- final ETypedElement element = ((FeatureColumn)column).getFeature();
- if(element instanceof EStructuralFeature) {
- featuresAlreadyManaged.add((EStructuralFeature)element);
- }
- }
- }
- }
-
- /**
- *
- * @param notification
- * a notification
- * @return
- * all the features of the object added in the table
- */
- private Set<ETypedElement> getAllFeaturesObject(final Notification notification) {
- final Set<ETypedElement> newFeatures = new HashSet<ETypedElement>();
- final Object newValue = notification.getNewValue();
- if(newValue instanceof Row) {
- Row row = (Row)newValue;
- EObject element = row.getElement();
- Collection<EStructuralFeature> allFeatures = element.eClass().getEAllStructuralFeatures();
- newFeatures.addAll(allFeatures);
- newFeatures.removeAll(featuresAlreadyManaged);
- }
-
- return newFeatures;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.table.efacet.common.listener.AbstractTableTriggerListener#isManagedNotification(org.eclipse.emf.common.notify.Notification)
- *
- * @param notification
- * @return
- */
- @Override
- protected boolean isManagedNotification(Notification notification) {
- if(notification.getEventType() == Notification.ADD && notification.getNotifier() == this.table.getTable() && notification.getFeature() == TableFactory.eINSTANCE.getTablePackage().getTable_Rows()) {
- Object newValue = notification.getNewValue();
- if(newValue != null && newValue instanceof Row) {
- return true;//there is something to do for each new row
- }
- }
- return false;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.table.efacet.common.listener.AbstractTableTriggerListener#getCommandName(org.eclipse.emf.common.notify.Notification)
- *
- * @param notification
- * @return
- */
- @Override
- protected String getCommandName(Notification notification) {
- return "Hide new columns command";
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.table.efacet.common.listener.AbstractTableTriggerListener#getSynchronizationCommand(org.eclipse.emf.transaction.TransactionalEditingDomain, org.eclipse.emf.common.notify.Notification)
- *
- * @param domain
- * @param notification
- * @return
- */
- @Override
- protected Command getSynchronizationCommand(final TransactionalEditingDomain domain, final Notification notification) {
- final Collection<ETypedElement> features = getAllFeaturesObject(notification);
- if(!features.isEmpty()) {
- featuresAlreadyManaged.addAll(features);
- final ITableWidgetInternal widget = getWidget();
- return TableInstanceCommandFactory.createHideColumnCommand(widget, domain, table.getTable(), features);
- }
- return null;
- }
-
- /**
- * TODO EMF-Facet should provides a best way to hide columns programmatically
- * @return
- */
- private ITableWidgetInternal getWidget() {
- final IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Assert.isTrue(editor instanceof CoreMultiDiagramEditor);
- final IEditorPart activeEditor = ((CoreMultiDiagramEditor)editor).getActiveEditor();
- ITableWidgetProvider provider = (ITableWidgetProvider)activeEditor.getAdapter(ITableWidgetProvider.class);
- ITableWidget widget = provider.getTableWidget();
- if(widget instanceof ITableWidgetInternal) {
- return (ITableWidgetInternal)widget;
- }
- return null;
- }
-
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java
deleted file mode 100644
index 393d9a95db6..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java
+++ /dev/null
@@ -1,68 +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.infra.table.efacet.nestededitor.editor;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.TriggerListener;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.table.efacet.common.editor.AbstractSynchronizedTableEditor;
-import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
-
-
-public class NestedEditorTableEditor extends AbstractSynchronizedTableEditor {
-
- /** the type of the editor */
- public static final String EDITOR_TYPE = "PapyrusNestedEditorTable"; //$NON-NLS-1$
-
- /** the default name for this table */
- public static final String DEFAULT_NAME = "NestedEditorTable"; //$NON-NLS-1$
-
- /**
- * This listener allows to hide all new columns
- */
- private TriggerListener hideNewColmumnsListener;
-
- /**
- * @param servicesRegistry
- * @param rawModel
- *
- */
- public NestedEditorTableEditor(final ServicesRegistry servicesRegistry, final PapyrusTable rawModel) {
- super(servicesRegistry, rawModel);
- }
-
- /**
- * add listeners on the context of the table and on the table itself
- */
- @Override
- protected void configureEditorEditingDomain() {
- super.configureEditorEditingDomain();
- final EditingDomain editingDomain = getEditingDomain();
- Assert.isTrue(editingDomain instanceof TransactionalEditingDomain);
-
- this.hideNewColmumnsListener = new HideNewColumnsListener(this.rawModel);
- ((TransactionalEditingDomain)editingDomain).addResourceSetListener(this.hideNewColmumnsListener);
-
-
- }
-
- @Override
- public void dispose() {
- super.dispose();
- ((TransactionalEditingDomain)getEditingDomain()).removeResourceSetListener(this.hideNewColmumnsListener);
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java
deleted file mode 100644
index 98cee421dfa..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java
+++ /dev/null
@@ -1,40 +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.infra.table.efacet.nestededitor.factory;
-
-import org.eclipse.papyrus.infra.table.efacet.common.factory.AbstractTableEditorFactory;
-import org.eclipse.papyrus.infra.table.efacet.nestededitor.editor.NestedEditorTableEditor;
-
-
-/**
- *
- *
- */
-public class NestedEditorTableEditorFactory extends AbstractTableEditorFactory {
-
-
- /**
- * Constructor.
- *
- * @param diagramClass
- * @param expectedType
- */
- public NestedEditorTableEditorFactory() {
- super(NestedEditorTableEditor.class, NestedEditorTableEditor.EDITOR_TYPE);
- }
-
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java
deleted file mode 100644
index a69b9c6d916..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java
+++ /dev/null
@@ -1,46 +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.infra.table.efacet.nestededitor.handler;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler;
-import org.eclipse.papyrus.infra.table.efacet.nestededitor.Activator;
-import org.eclipse.papyrus.infra.table.efacet.nestededitor.editor.NestedEditorTableEditor;
-
-public class CreateNestedEditorTableEditorHandler extends AbstractCreateTableEditorHandler {
-
- /**
- *
- * Constructor.
- *
- */
- public CreateNestedEditorTableEditorHandler() {
- super(NestedEditorTableEditor.EDITOR_TYPE, NestedEditorTableEditor.DEFAULT_NAME);
- }
-
-
- /**
- *
- * @see org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler#getPapyrusTableConfigurationURI()
- *
- * @return
- */
- @Override
- protected URI getPapyrusTableConfigurationURI() {
- final String symbolicName = Activator.getDefault().getBundle().getSymbolicName();
- final URI uri = URI.createPlatformPluginURI(symbolicName + "/resources/nested_editor_table.papyrustableconfiguration", true); //$NON-NLS-1$
- return uri;
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java
deleted file mode 100644
index 17074b19535..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java
+++ /dev/null
@@ -1,34 +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.infra.table.efacet.nestededitor.handler;
-
-
-
-public class CreateNestedEditorTableEditorHandlerWithoutDialog extends CreateNestedEditorTableEditorHandler {
-
- /**
- *
- * Constructor.
- *
- */
- public CreateNestedEditorTableEditorHandlerWithoutDialog() {
- super();
- }
-
-
- @Override
- protected boolean shouldOpenNameDialog() {
- return false;
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/CustomizationUtils.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/CustomizationUtils.java
deleted file mode 100644
index 9d88cfbf75c..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/CustomizationUtils.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Mia-Software.
- * 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) - Bug 367700 - [Unit Test Failure][0.2/3.8] org.eclipse.emf.facet.widgets.table.tests.internal.v0_2.swtbot.NatTableUITests.testOpenLoadCustomizationDialog
- * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
- * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
- * Gregoire Dupe (Mia-Software) - Bug 375087 - [Table] ITableWidget.addColumn(List<ETypedElement>, List<FacetSet>)
- * Gregoire Dupe (Mia-Software) - Bug 376576 - [EFacet] Change the multiplicity of Facet::extendedFacet
- *******************************************************************************/
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.internal.copy;
-
-import java.util.Collection;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.FacetCustomization;
-import org.eclipse.emf.facet.efacet.core.FacetUtils;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
-
-//TODO duplicated and adapted code from EMF-Facet
-//EMF-Facet should provides a best way to hide columns
-public final class CustomizationUtils {
-
- private CustomizationUtils() {
- // Must not be used.
- }
-
- /** @return the {@link Facet}s customized by the given customizations. */
- public static Set<FacetSet> findFacetsCustomizedBy(final List<Customization> customizations) {
- final Set<FacetSet> referencedFS = new HashSet<FacetSet>();
- for(Customization customization : customizations) {
- for(EClassifier eClassifier : customization.getEClassifiers()) {
- if(eClassifier instanceof FacetCustomization) {
- final FacetCustomization facetCustom = (FacetCustomization)eClassifier;
- for(Facet extFacet : facetCustom.getExtendedFacets()) {
- referencedFS.add((FacetSet)extFacet.getEPackage());
- }
- }
- }
- }
- return referencedFS;
- }
-
- /** Returns the first customization among the given list of customizations that extends the given EPackage. */
- public static Customization findCustomizationExtendingEPackage(final List<Customization> customizations, final EPackage ePackage) {
- if(ePackage == null) {
- throw new IllegalArgumentException("ePackage must not be null"); //$NON-NLS-1$
- }
- Customization result = null;
- for(Customization customization : customizations) {
- if(customization != null && ePackage.equals(FacetUtils.getExtendedEPackage(customization))) {
- result = customization;
- break;
- }
- }
- return result;
- }
-
- /** Returns the first {@link Facet} among the given list of facets that extends the given EClass. */
- public static Facet findFacetByExtendedMetaclass(final Collection<Facet> facets, final EClass extendedMetaClass) {
- Facet result = null;
- for(Facet facet : facets) {
- Facet candidate = facet;
- if(candidate.getExtendedMetaclass() == extendedMetaClass) {
- result = candidate;
- break;
- }
- }
- return result;
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/TableInstanceCommandFactory.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/TableInstanceCommandFactory.java
deleted file mode 100644
index 12842edd2ef..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/internal/copy/TableInstanceCommandFactory.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011, 2012 Mia-Software.
- * 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:
- * Nicolas Bros (Mia-Software) - Bug 331203 - table model editor - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 332437 - NatTable : pluggable cell editors
- * Nicolas Guyomar (Mia-Software) - Bug 331442 - To be able to add and remove lines (model elements) from the table
- * Nicolas Bros (Mia-Software) - Bug 332226 - To be able to create or delete model element from the table
- * Nicolas Guyomar (Mia-Software) - Bug 332226 - To be able to create or delete model element from the table
- * Nicolas Bros (Mia-Software) - Bug 332438 - NatTable : table type
- * Nicolas Bros (Mia-Software) - Bug 332440 - NatTable : force cell editors
- * Nicolas Bros (Mia-Software) - Bug 331675 - NatTable : copy cells as text
- * Nicolas Bros (Mia-Software) - Bug 331900 - customizable NatTable
- * Nicolas Bros (Mia-Software) - Bug 332010 - view Facet customizations on NatTable
- * Nicolas Bros (Mia-Software) - Bug 332215 - customizable NatTable column headers
- * Nicolas Guyomar (Mia-Software) - Bug 332215 - customizable NatTable column headers
- * Nicolas Guyomar (Mia-Software) - Bug 332924 - To be able to save the table
- * Nicolas Guyomar (Mia-Software) - Bug 332998 - To be able to add a column and fill it with the result of a query
- * Gregoire Dupe (Mia-Software) - Bug 332998 - To be able to add a column and fill it with the result of a query
- * Gregoire Dupe (Mia-Software) - Bug 333015 - To be able to hide columns
- * Nicolas Guyomar (Mia-Software) - Bug 333015 - To be able to hide columns
- * Nicolas Guyomar (Mia-Software) - Bug 333029 - To be able to save the size of the lines and the columns
- * Nicolas Guyomar (Mia-Software) - Bug 333414 - The user must be able to save the column order
- * Nicolas Guyomar (Mia-Software) - Bug 335154 - Sort Column By Type : Cannot modify resource set without a write transaction
- * Nicolas Guyomar (Mia-Software) - Bug 335155 - Hide Empty Column : Cannot modify resource set without a write transaction
- * Nicolas Guyomar (Mia-Software) - Bug 335156 - Only Show Common column : Cannot modify resource set without a write transaction
- * Nicolas Guyomar (Mia-Software) - Bug 335020 - Nattable widget should use the Eclipse framework
- * Nicolas Guyomar (Mia-Software) - Bug 337322 - [TableConfiguration] Customization declared in the file tableconfiguration is not loaded
- * Nicolas Guyomar (Mia-Software) - Bug 338536 - Problem with the refresh of the table : the scrollbar returns to this initial position
- * Nicolas Bros (Mia-Software) - Bug 338536 - Problem with the refresh of the table : the scrollbar returns to this initial position
- * Nicolas Guyomar (Mia-Software) - Bug 337454 - We can't delete a query Column
- * Nicolas Guyomar (Mia-Software) - Bug 337395 - Unused columns should be destroyed
- * Nicolas Guyomar (Mia-Software) - Bug 339554 - org.eclipse.emf.facet.widgets.celleditors API cleaning
- * Nicolas Guyomar (Mia-Software) - Bug 339922 - INatTableWidget method isCellSelected should use the plural
- * Nicolas Guyomar (Mia-Software) - Bug 340681 - Facet column implementation
- * Vincent Lorenzo (CEA-LIST) - Bug 337326 - Show/Hide Column : Sort the columns by name
- * Nicolas Guyomar (Mia-Software) - Bug 340940 - To be able to view facet attributes and facet references in a table
- * Vincent Lorenzo (CEA-LIST) - Bug 337408 - Add an action to sort columns by name
- * Nicolas Guyomar (Mia-Software) - Bug 336482 - KeyBinding to edit element in Table : F2
- * Vincent Lorenzo (CEA-LIST) - Bug 341238 - We need to be able to specify which column have to be hidden/visible using the customization mechanism
- * Gregoire Dupe (Mia-Software) - Bug 341238 - We need to be able to specify which column have to be hidden/visible using the customization mechanism
- * Nicolas Guyomar (Mia-Software) - Bug 342451 - To be able to edit derived facet attributes and derived facet references in a table
- * Vincent Lorenzo (CEA-LIST) - Bug 341238 - We need to be able to specify which column have to be hidden/visible using the customization mechanism
- * Nicolas Guyomar (Mia-Software) - Bug 343411 - [Table] Create new elements does not support IJavaModelQuery anymore
- * Gregoire Dupe (Mia-Software) - Bug 343811 - EMF Facet Regression : Created elements in a table are not serialized
- * Vincent Lorenzo (CEA-LIST) - Bug 344125 - The API should provide a method selectRows(List<EObject> elementsToSelect)
- * Nicolas Guyomar (Mia-Software) - Bug 344274 - SWT BOT fail on Hudson
- * Nicolas Guyomar (Mia-Software) - Bug 344475 - To be able to select a cell by EStructuralFeature in the table
- * Nicolas Guyomar (Mia-Software) - Bug 342028 - Field can be edited even if they are marked as N/A
- * Nicolas Guyomar (Mia-Software) - Bug 344413 - Facet Columns are never created when we begin with an empty table
- * Gregoire Dupe (Mia-Software) - Bug 343859 - The local customizations are not applied when we reopen a table
- * Nicolas Guyomar (Mia-Software) - Bug 344670 - Problems with the columns creation : very slow + scrollbar blinked
- * Vincent Lorenzo (CEA LIST) - Bug 341238 - We need to be able to specify which column have to be hidden/visible using the customization mechanism
- * Nicolas Guyomar (Mia-Software) - Bug 344925 - Undo/Redo after the action Show Columns
- * Gregoire Dupe (Mia-Software) - Bug 344925 - Undo/Redo after the action Show Columns - Regression fix
- * Nicolas Guyomar (Mia-Software) - Bug 345665 - Columns are duplicated when you drop many elements in the same time
- * Nicolas Guyomar (Mia-Software) - Bug 346465 - [EMF Facet Table] Remove line does not remove obsolete column
- * Gregoire Dupe (Mia-Software) - Bug 345730 - Deleting an element in the model breaks the table
- * Gregoire Dupe (Mia-Software) - Bug 354224 - mutually exclusive Facets
- * Grégoire Dupé (Mia-Software) - Bug 356795 - [Unit Test Failure][0.2/4.2][0.2/3.8] org.eclipse.emf.facet.widgets.nattable.tests.Bug344413Test.testBug344413
- * Gregoire Dupe (Mia-Software) - Bug 366804 - [Restructuring] Table widget upgrade
- * Gregoire Dupe (Mia-Software) - Bug 367613 - Table widget refactoring
- * Gregoire Dupe (Mia-Software) - Bug 367700 - [Unit Test Failure][0.2/3.8] org.eclipse.emf.facet.widgets.table.tests.internal.v0_2.swtbot.NatTableUITests.testOpenLoadCustomizationDialog
- * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
- * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
- * Gregoire Dupe (Mia-Software) - Bug 375087 - [Table] ITableWidget.addColumn(List<ETypedElement>, List<FacetSet>)
- * Gregoire Dupe (Mia-Software) - Bug 372626 - Aggregates
- * Gregoire Dupe (Mia-Software) - Bug 376158 - [Table] Unexpected columns when customizations are loaded
- * Nicolas Bros (Mia-Software) - Bug 378475 - unit test failures after table refactoring
- * Olivier Remaud (Soft-Maint) - Bug 378499 - optimizing table opening
- * Gregoire Dupe (Mia-Software) - Bug 387008 - [Table] Papyrus needs methods provided by TableInstanceCommandFactory
- *******************************************************************************/
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.internal.copy;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
-import org.eclipse.emf.facet.custom.ui.internal.exported.ICustomizationCommandFactory;
-import org.eclipse.emf.facet.custom.ui.internal.exported.ICustomizationCommandFactoryFactory;
-import org.eclipse.emf.facet.efacet.core.FacetUtils;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.IsOneOfQuery;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.QueryFactory;
-import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.QueryPackage;
-import org.eclipse.emf.facet.util.emf.core.command.ICommandFactoryResult;
-import org.eclipse.emf.facet.util.emf.core.command.ICommandFactoryResultFactory;
-import org.eclipse.emf.facet.widgets.celleditors.ICommandFactoriesRegistry;
-import org.eclipse.emf.facet.widgets.celleditors.ICommandFactory;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.FeatureColumn;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.TablePackage;
-import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetInternal;
-
-//TODO duplicated and adapted code from EMF-Facet
-//EMF-Facet should provides a best way to hide columns
-public final class TableInstanceCommandFactory {
-
-
- /**
- *
- * @param column
- * a column
- * @param isHidden
- * the new feature value for this column
- * @param customizedFeatureName
- * the customized feature name
- * @return
- */
- public static Command createHideColumnCommand(final ITableWidgetInternal widgetController, final EditingDomain domain, final Table table, final Collection<ETypedElement> featuresToHide) {
- final FacetOperation isVisibleProperty = widgetController.getCustomPropertiesHandler().getIsVisible();
- final CompoundCommand resultCmd = new CompoundCommand("Show/hide column"); //$NON-NLS-1$
- final EditingDomain editingDomain = domain;
- final ICommandFactory commandFactory = ICommandFactoriesRegistry.INSTANCE.getCommandFactoryFor(editingDomain);
- // final EStructuralFeature featureOfTheColumn = featureColumn
- // .getFeature();
- // EObject packageLevel = featureOfTheColumn.eContainer().eContainer();
- // if (!(packageLevel instanceof EPackage)) {
- // throw new IllegalStateException(
- // "Unexpected feature container type " + packageLevel + " found. (EPackage is execpected)"); //$NON-NLS-1$ //$NON-NLS-2$
- // }
- // final EPackage customizedEPackage = (EPackage) packageLevel;
- // 1 we look for the corresponding customization
- final List<Customization> localCustomizations = table.getLocalCustomizations();
- Customization customization = null;
- if(!localCustomizations.isEmpty()) {
- customization = localCustomizations.get(0);
- }
- final ICustomizationCommandFactory customCmdFactory = ICustomizationCommandFactoryFactory.DEFAULT.createCustomizationCommandFactory(editingDomain, commandFactory);
- // If the wanted customization does not exist then we create it.
- if(customization == null) {
- // final TableCommandFactory factory = new TableCommandFactory(table, domain, commandFactory, null);
- final ICommandFactoryResult<Customization> cmdFactoryResult = createCreateLocalCustom(editingDomain, commandFactory, table, EcorePackage.eINSTANCE);
- customization = cmdFactoryResult.getResult();
- resultCmd.append(cmdFactoryResult.getCommand());
- }
- Facet typeCustomization = CustomizationUtils.findFacetByExtendedMetaclass(FacetUtils.getFacets(customization), EcorePackage.eINSTANCE.getETypedElement());
- IsOneOfQuery conformanceQuery;
- if(typeCustomization == null) {
- conformanceQuery = QueryFactory.eINSTANCE.createIsOneOfQuery();
- ICommandFactoryResult<EClassCustomization> createEClassCustom = customCmdFactory.createEClassCustomization(customization, EcorePackage.eINSTANCE.getETypedElement(), conformanceQuery);
- typeCustomization = createEClassCustom.getResult();
- resultCmd.append(createEClassCustom.getCommand());
- } else {
- if(!(typeCustomization instanceof EClassCustomization)) {
- // throw new TableWidgetRuntimeException("Unexpected type for the variable 'featureContainer'"); //$NON-NLS-1$
- //TODO
- }
- DerivedTypedElement conformanceTE = (DerivedTypedElement)typeCustomization.getConformanceTypedElement();
- conformanceQuery = (IsOneOfQuery)conformanceTE.getQuery();
- }
-// final HashSet<ETypedElement> featuresToHide = new HashSet<ETypedElement>();
-// for(FeatureColumn column : featureColumns) {
-// featuresToHide.add(column.getFeature());
-// }
- final Command initQuery = commandFactory.createSetCommand(editingDomain, conformanceQuery, QueryPackage.eINSTANCE.getIsOneOfQuery_ExpectedEObjects(), new ArrayList<ETypedElement>(featuresToHide));
- resultCmd.append(initQuery);
- final Query query = QueryFactory.eINSTANCE.createFalseLiteralQuery();
- final ICommandFactoryResult<Facet> propConfigCmd = customCmdFactory.setPropertyConfig(typeCustomization, null, isVisibleProperty, query);
- resultCmd.append(propConfigCmd.getCommand());
- return resultCmd;
- }
-
- private TableInstanceCommandFactory() {
- // Prevents instantiation
- }
-
-
- public static ICommandFactoryResult<Customization> createCreateLocalCustom(final EditingDomain editingDomain, final ICommandFactory commandFactory, final Table table, final EPackage ePackage) {
- final ICustomizationCommandFactory customCmdFactory = ICustomizationCommandFactoryFactory.DEFAULT.createCustomizationCommandFactory(editingDomain, commandFactory);
- final List<Command> cmdList = new CommandList();
- final ICommandFactoryResult<Customization> cmdFactoryResult = customCmdFactory.createCustomization("Column hiding customization for " //$NON-NLS-1$
- + ePackage.getName());
- final Customization customization = cmdFactoryResult.getResult();
- cmdList.add(cmdFactoryResult.getCommand());
- final Command addToLocalCmd = commandFactory.createAddCommand(editingDomain, table, TablePackage.eINSTANCE.getTable_LocalCustomizations(), customization);
- cmdList.add(addToLocalCmd);
- final Command addAllCmd = commandFactory.createAddCommand(editingDomain, table, TablePackage.eINSTANCE.getTable_Customizations(), customization);
- cmdList.add(addAllCmd);
- final Command cmd = createResult(cmdList, "Create a local custom."); //$NON-NLS-1$
- return ICommandFactoryResultFactory.DEFAULT.createCommandFactoryResult(cmd, customization);
-
- }
-
- private static Command createResult(final List<Command> commandList, final String label) {
- Command result = null;
- while(commandList.contains(null)) {
- commandList.remove(null);
- }
- if(!commandList.isEmpty()) {
- result = new CompoundCommand(label, commandList);
- }
- return result;
- }
-
-
-
- // /**
- // * This method retruns an EMF command deleting the a collection of EObject
- // *
- // * @param label
- // * This label will be visible in the menu 'Edit'.
- // * @param eObjects
- // * @param controller
- // * @return
- // */
- // public static Command delete(final String label, final Collection<? extends EObject> eObjects, final TableWidgetController controller) {
- // List<Command> cmdList = new ArrayList<Command>();
- // for(EObject eObject : eObjects) {
- // Command command = controller.getCommandFactory().createDeleteCommand(controller.getEditingDomain(), eObject);
- // cmdList.add(command);
- // }
- // Command result = null;
- // if(!cmdList.isEmpty()) {
- // result = new CompoundCommand(label, cmdList);
- // }
- // return result;
- // }
- //
- // /**
- // * This method create a command deleting use less row and columns.
- // *
- // * @param controller
- // * @return null if no action has to be performed.
- // */
- // public static final Command createRemoveUselessRowsAndColumnsCommand(final TableWidgetController controller) {
- // List<Command> cmdList = new ArrayList<Command>();
- // List<Row> rowsToRemove = TableInstanceUtils.findUselessRow(controller.getTable());
- // if(TableWidgetController.DEBUG_REMOVE_USELESS_ROWS_AND_COLUMNS) {
- // DebugUtils.debug("Rows to be removed: " + rowsToRemove.size()); //$NON-NLS-1$
- // }
- // final Command deleteRows = TableInstanceCommandFactory.delete(Messages.TableWidgetController_DeleteUselessRows, rowsToRemove, controller);
- // if(deleteRows != null) {
- // cmdList.add(deleteRows);
- // }
- // final TableCommandFactory tableCmdFactory = new TableCommandFactory(controller.getTable(), controller.getEditingDomain(), controller.getCommandFactory(), null);
- // final Command removeColumnCommand = tableCmdFactory.createRemoveUselessColumnsCommand(rowsToRemove, null);
- // if(removeColumnCommand != null) {
- // if(!removeColumnCommand.canExecute()) {
- // throw new TableWidgetRuntimeException("Command cannot be executed"); //$NON-NLS-1$
- // }
- // cmdList.add(removeColumnCommand);
- // }
- // CompoundCommand command = null;
- // if(!cmdList.isEmpty()) {
- // command = new CompoundCommand(Messages.TableWidgetController_RemoveUselessRowsAndColumns, cmdList);
- // }
- // return command;
- // }
- private static class CommandList extends LinkedList<Command> {
-
- /**
- *
- */
- private static final long serialVersionUID = 4393120485370832319L;
-
- @Override
- public boolean add(final Command command) {
- boolean result;
- if(command == null) {
- result = false;
- } else {
- result = super.add(command);
- }
- return result;
- }
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java
deleted file mode 100644
index 2351ba3e2bb..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
-
-import java.util.Collections;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.facet.query.java.core.IJavaQuery2;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
-import org.eclipse.papyrus.infra.table.efacet.nestededitor.Activator;
-
-
-public abstract class AbstractNestedEditorQuery<T2> implements IJavaQuery2<EObject, T2> {
-
- protected ServicesRegistry getServiceRegistry(final EObject object) {
- ServicesRegistry serviceRegistry = null;
- final Resource res = object.eResource();
- if(res != null) {
- try {
- serviceRegistry = ServiceUtilsForResource.getInstance().getServiceRegistry(res);
- } catch (ServiceException e) {
- Activator.log.error("Service Registry not found!", e);
- }
- }
- return serviceRegistry;
- }
-
- protected IPageMngr getPageMngr(final EObject object) {
- IPageMngr pageManager = null;
- final ServicesRegistry serviceRegistry = getServiceRegistry(object);
-
- if(serviceRegistry != null) {
- try {
- pageManager = ServiceUtils.getInstance().getIPageMngr(serviceRegistry);
- } catch (ServiceException e) {
- Activator.log.error("PageManager not found", e);
- }
- }
- return pageManager;
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java
deleted file mode 100644
index 1077a7ddf5e..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.efacet.core.IFacetManager;
-import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
-import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
-
-public class GetAllNestedEditorsQuery extends AbstractNestedEditorQuery<Object> {
-
- public List<Object> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- IPageMngr pageMngr = getPageMngr(source);
- if(pageMngr != null) {
- return pageMngr.allPages();
- }
- return Collections.emptyList();
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java
deleted file mode 100644
index a24c6d60e19..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
-
-import java.util.ArrayList;
-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.efacet.core.IFacetManager;
-import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
-import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
-import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
-
-
-public class GetEditorContextQuery extends AbstractNestedEditorQuery<EObject> {
-
- private static List<String> possibleContextFieldName = null;
-
- public EObject evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- EObject context = null;
- if(source instanceof PapyrusTable) {
- context = ((PapyrusTable)source).getTable().getContext();
- } else {
- if(possibleContextFieldName == null) {
- initContextFieldName();
- }
- Iterator<String> iter = possibleContextFieldName.iterator();
-
- while(iter.hasNext() && context == null) {
- final String currentName = iter.next();
- final EStructuralFeature feature = source.eClass().getEStructuralFeature(currentName);
- if(feature != null) {
- context = (EObject)source.eGet(feature);
- }
-
- }
- }
- return context;
- }
-
- private static final void initContextFieldName() {
- possibleContextFieldName = new ArrayList<String>();
- possibleContextFieldName.add("context");
- possibleContextFieldName.add("element");
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java
deleted file mode 100644
index e9d6d0a34a8..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.efacet.core.IFacetManager;
-import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
-import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
-import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
-import org.eclipse.papyrus.infra.table.efacet.nestededitor.Activator;
-
-
-public class GetEditorNameQuery extends AbstractNestedEditorQuery<String> {
-
- private static List<String> possibleNameFieldName = null;
-
- public String evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
-
-
-
- String editorName = null;
- if(source instanceof PapyrusTable) {
- editorName = ((PapyrusTable)source).getName();
- } else {
- if(possibleNameFieldName == null) {
- initContextFieldName();
- }
- final Iterator<String> iter = possibleNameFieldName.iterator();
- Field contextField = null;
- while(iter.hasNext() && contextField == null) {
- final String currentName = iter.next();
- try {
- contextField = source.getClass().getDeclaredField(currentName);
- } catch (SecurityException e) {
- Activator.log.error(e);
- } catch (NoSuchFieldException e) {
- Activator.log.error(e);
- }
- }
- if(contextField != null) {
- boolean oldAccessibilityValue = contextField.isAccessible();
- contextField.setAccessible(true);
- Object tmp = null;
- try {
- tmp = contextField.get(source);
- } catch (IllegalArgumentException e) {
- Activator.log.error(e);
- } catch (IllegalAccessException e) {
- Activator.log.error(e);
- }
- if(tmp instanceof String) {
- editorName = (String)tmp;
- }
- contextField.setAccessible(oldAccessibilityValue);
- }
- }
- return editorName;
- }
-
-
- private static final void initContextFieldName() {
- possibleNameFieldName = new ArrayList<String>();
- possibleNameFieldName.add("name");
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java
deleted file mode 100644
index d577fe0c137..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.efacet.core.IFacetManager;
-import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
-import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
-
-
-public class GetOpenEditorStatusQuery extends AbstractNestedEditorQuery<Boolean> {
-
- public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- IPageMngr pageMManager = getPageMngr(source);
- return pageMManager.isOpen(source);
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java
deleted file mode 100644
index dd41950599a..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.efacet.core.IFacetManager;
-import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
-import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
-
-//TOD0 currently this class is not used, we should complete the tableconfiguration (can be presented in the table)
-public class IsAllowedInNestedEditortableQuery extends AbstractNestedEditorQuery<Boolean> {
-
- public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- final IPageMngr pageManager = getPageMngr(source);
- if(pageManager != null) {
- return pageManager.allPages().contains(source);
- }
- return false;
- }
-
-}

Back to the top