From 9a7d8af0e3cfe943f2333cdf435aa732dc6a26ad Mon Sep 17 00:00:00 2001 From: Laurent Wouters Date: Fri, 4 Apr 2014 16:10:45 +0200 Subject: [clean] Retiring org.eclipse.papyrus.infra.table.menu Signed-off-by: Laurent Wouters --- .../.classpath | 7 - .../org.eclipse.papyrus.infra.table.menu/.project | 28 -- .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 8 - .../META-INF/MANIFEST.MF | 28 -- .../about.html | 28 -- .../build.properties | 7 - .../icons/empty.gif | Bin 919 -> 0 bytes .../icons/empty.png | Bin 1341 -> 0 bytes .../icons/not_NA.gif | Bin 918 -> 0 bytes .../icons/not_NA.png | Bin 1283 -> 0 bytes .../icons/rename.gif | Bin 922 -> 0 bytes .../icons/select_column_to_hide.gif | Bin 983 -> 0 bytes .../icons/select_column_to_hide.png | Bin 1340 -> 0 bytes .../icons/select_column_to_hide_2.gif | Bin 982 -> 0 bytes .../icons/select_column_to_hide_2.png | Bin 1333 -> 0 bytes .../icons/table.gif | Bin 965 -> 0 bytes .../plugin.properties | 3 - .../plugin.xml | 319 --------------------- .../papyrus/infra/table/menu/Activator.java | 67 ----- .../AbstractTableExtensionContributionFactory.java | 61 ---- .../table/menu/handler/CommonColumnHandler.java | 56 ---- .../CreateNewElementInPopupContributionItem.java | 130 --------- ...reateNewElementInTableMenuContributionItem.java | 212 -------------- .../menu/handler/HideEmptyColumnsHandler.java | 50 ---- .../infra/table/menu/messages/Messages.java | 34 --- .../infra/table/menu/messages/messages.properties | 3 - .../infra/table/menu/providers/TableTester.java | 79 ----- 28 files changed, 1123 deletions(-) delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/.classpath delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/.project delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.core.resources.prefs delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.jdt.core.prefs delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/META-INF/MANIFEST.MF delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/about.html delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/build.properties delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.gif delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.png delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.gif delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.png delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/rename.gif delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.gif delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.png delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.gif delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.png delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/icons/table.gif delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/plugin.properties delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/plugin.xml delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/Activator.java delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/AbstractTableExtensionContributionFactory.java delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CommonColumnHandler.java delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInPopupContributionItem.java delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInTableMenuContributionItem.java delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/HideEmptyColumnsHandler.java delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/Messages.java delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/messages.properties delete mode 100644 deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/providers/TableTester.java diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/.classpath b/deprecated/org.eclipse.papyrus.infra.table.menu/.classpath deleted file mode 100644 index 2d1a4302f04..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/.project b/deprecated/org.eclipse.papyrus.infra.table.menu/.project deleted file mode 100644 index 2db93db7442..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.infra.table.menu - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.core.resources.prefs b/deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index f6b3322e995..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri Nov 04 17:02:25 CET 2011 -eclipse.preferences.version=1 -encoding//src/org/eclipse/papyrus/infra/table/menu/messages/messages.properties=ISO-8859-1 diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.jdt.core.prefs b/deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 62e64d3aa81..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Fri Feb 11 11:37:09 CET 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.infra.table.menu/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.infra.table.menu/META-INF/MANIFEST.MF deleted file mode 100644 index 896f3742600..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.expressions, - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.0", - org.eclipse.papyrus.uml.diagram.menu;bundle-version="1.0.0", - org.eclipse.emf.facet.infra.common.core;bundle-version="0.1.0", - org.eclipse.papyrus.infra.table.common;bundle-version="1.0.0", - org.eclipse.emf.facet.widgets.nattable, - org.eclipse.emf.facet.widgets.nattable.instance;bundle-version="0.1.0", - org.eclipse.emf.facet.widgets.nattable.workbench;bundle-version="0.1.0", - org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0", - org.eclipse.papyrus.editor;bundle-version="1.0.0", - org.eclipse.papyrus.infra.core;bundle-version="1.0.0", - org.eclipse.ui.ide;bundle-version="3.8.0", - org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0" -Export-Package: org.eclipse.papyrus.infra.table.menu, - org.eclipse.papyrus.infra.table.menu.handler, - org.eclipse.papyrus.infra.table.menu.providers -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.infra.table.menu.Activator -Bundle-SymbolicName: org.eclipse.papyrus.infra.table.menu;singleton:=t - rue -Bundle-RequiredExecutionEnvironment: J2SE-1.5 - diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/about.html b/deprecated/org.eclipse.papyrus.infra.table.menu/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/build.properties b/deprecated/org.eclipse.papyrus.infra.table.menu/build.properties deleted file mode 100644 index 16e737b65fa..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -# -#Mon Sep 12 09:30:19 CEST 2011 -bin.includes=META-INF/,.,plugin.xml,plugin.properties,icons/,about.html -output..=bin/ -src.includes = about.html -source..=src/ -bin..=bin/ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.gif b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.gif deleted file mode 100644 index 30c569ad03e..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.gif and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.png b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.png deleted file mode 100644 index 91e5ec5fa2d..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/empty.png and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.gif b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.gif deleted file mode 100644 index 125919fbd84..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.gif and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.png b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.png deleted file mode 100644 index 7e2aeeeb7ed..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/not_NA.png and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/rename.gif b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/rename.gif deleted file mode 100644 index e6f786eca9a..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/rename.gif and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.gif b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.gif deleted file mode 100644 index 4df20a606f6..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.gif and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.png b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.png deleted file mode 100644 index 9202230bd24..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide.png and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.gif b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.gif deleted file mode 100644 index d046cff4062..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.gif and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.png b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.png deleted file mode 100644 index 64e9d00387c..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/select_column_to_hide_2.png and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/table.gif b/deprecated/org.eclipse.papyrus.infra.table.menu/icons/table.gif deleted file mode 100644 index 4c9048708b0..00000000000 Binary files a/deprecated/org.eclipse.papyrus.infra.table.menu/icons/table.gif and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/plugin.properties b/deprecated/org.eclipse.papyrus.infra.table.menu/plugin.properties deleted file mode 100644 index 596bb8a7d4d..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/plugin.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Properties file for org.eclipse.papyrus.infra.table.menu -providerName = Eclipse Modeling Project -pluginName = Papyrus Table Menu (Incubation) \ No newline at end of file diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/plugin.xml b/deprecated/org.eclipse.papyrus.infra.table.menu/plugin.xml deleted file mode 100644 index 8ec17253a83..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/plugin.xml +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/Activator.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/Activator.java deleted file mode 100644 index 4db2eb8032c..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/Activator.java +++ /dev/null @@ -1,67 +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.infra.table.menu; - -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 ID = "org.eclipse.papyrus.infra.table.menu"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/AbstractTableExtensionContributionFactory.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/AbstractTableExtensionContributionFactory.java deleted file mode 100644 index cf94a5db334..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/AbstractTableExtensionContributionFactory.java +++ /dev/null @@ -1,61 +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.infra.table.menu.handler; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidgetProvider; -import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.menus.ExtensionContributionFactory; -import org.eclipse.ui.menus.IContributionRoot; -import org.eclipse.ui.services.IServiceLocator; - - -public abstract class AbstractTableExtensionContributionFactory extends ExtensionContributionFactory { - - /** - * The service locator - */ - protected IServiceLocator serviceLocator; - - /** - * - * {@inheritDoc} - */ - @Override - public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) { - this.serviceLocator = serviceLocator; - } - - /** - * - * @return - * the {@link INatTableWidgetProvider} or null if not found - */ - protected INatTableWidgetProvider getINatTableWidgetProvider() { - INatTableWidgetProvider provider = null;; - if(PlatformUI.getWorkbench() != null && PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null && PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) { - IWorkbenchPart activePart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); - if(activePart != null) { - if(activePart instanceof CoreMultiDiagramEditor) { - IEditorPart activeEditor = ((CoreMultiDiagramEditor)activePart).getActiveEditor(); - if(activeEditor instanceof IAdaptable) { - provider = (INatTableWidgetProvider)activeEditor.getAdapter(INatTableWidgetProvider.class); - } - } - } - } - return provider; - } -} diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CommonColumnHandler.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CommonColumnHandler.java deleted file mode 100644 index d8dc8a0008a..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CommonColumnHandler.java +++ /dev/null @@ -1,56 +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.infra.table.menu.handler; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidget; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidgetProvider; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.handlers.HandlerUtil; - -/** - * This class provides the handler to show only the common columns or to display all the columns - * - * - * - */ -public class CommonColumnHandler extends AbstractHandler implements IHandler { - - - - - /** - * - * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) - * - * @param event - * @return - * @throws ExecutionException - */ - public Object execute(ExecutionEvent event) throws ExecutionException { - IEditorPart editor = HandlerUtil.getActiveEditor(event); - INatTableWidgetProvider provider = (INatTableWidgetProvider)editor.getAdapter(INatTableWidgetProvider.class); - if(provider != null) { - INatTableWidget widget = provider.getNatTableWidget(); - widget.setOnlyShowCommonColumns(!widget.getTableInstance().isOnlyShowCommonColumns()); - //change the state of the command - HandlerUtil.toggleCommandState(event.getCommand()); - } - return null; - } - -} diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInPopupContributionItem.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInPopupContributionItem.java deleted file mode 100644 index 916dfd3ac1a..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInPopupContributionItem.java +++ /dev/null @@ -1,130 +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.infra.table.menu.handler; - - -import org.eclipse.core.expressions.EvaluationResult; -import org.eclipse.core.expressions.Expression; -import org.eclipse.core.expressions.IEvaluationContext; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidget; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidgetProvider; -import org.eclipse.emf.facet.widgets.nattable.tableconfiguration.InstantiationMethod; -import org.eclipse.jface.action.ContributionItem; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.papyrus.infra.table.menu.messages.Messages; -import org.eclipse.papyrus.uml.diagram.common.Activator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.ui.menus.IContributionRoot; -import org.eclipse.ui.services.IServiceLocator; - - -/** - * - * This class create a menu to get the action to create new elements in the table in the popup menu. - * This code is adapted from the class org.eclipse.emf.facet.widgets.nattable.workbench.internal.handlers.CreateNewElementContributionItem - */ -public class CreateNewElementInPopupContributionItem extends AbstractTableExtensionContributionFactory { - - /** - * - * Constructor. - * - */ - public CreateNewElementInPopupContributionItem() { - } - - /** - * - * {@inheritDoc} - */ - @Override - public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) { - super.createContributionItems(serviceLocator, additions); - final INatTableWidgetProvider provider = getINatTableWidgetProvider(); - if(provider != null) { - final INatTableWidget natTableWidget = provider.getNatTableWidget(); - MenuManager manager = new MenuManager(Messages.CreateMenuForNewElementInPopupContributionItem_CreateNewElementMenu) { - - /** - * - * {@inheritDoc} - */ - @Override - public void fill(Menu parent, int index) { - super.fill(parent, index); - getMenu().getParentItem().setEnabled(natTableWidget.getInstantionMethodHistory().size() != 0); - Image image = Activator.getImage("IMG_OBJ_ADD"); //$NON-NLS-1$ - getMenu().getParentItem().setImage(image); - } - - }; - - manager.setVisible(true); - IContributionItem item = new ContributionItem() { - - /** - * - * {@inheritDoc} - */ - @Override - public void fill(final Menu menu, int index) { - for(int i = 0; i < natTableWidget.getInstantionMethodHistory().size(); i++) { - final InstantiationMethod meth = natTableWidget.getInstantionMethodHistory().get(i); - MenuItem menuItem = new MenuItem(menu, SWT.CHECK); - menuItem.setText(i + " " + meth.getName()); //$NON-NLS-1$ - menuItem.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(final SelectionEvent e) { - for(MenuItem menuItem2 : menu.getItems()) { - menuItem2.setSelection(false); - } - MenuItem localMenuItem = (MenuItem)e.widget; - localMenuItem.setSelection(true); - natTableWidget.createNewElement(meth); - } - }); - } - boolean enabled = menu.getItemCount() != 0; - menu.setEnabled(enabled); - } - }; - - Menu menu = manager.getMenu(); - if(menu != null) { - menu.setEnabled(false); - } - manager.add(item); - Expression visibleWhen = new Expression() { - - /** - * - * {@inheritDoc} - */ - @Override - public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { - return EvaluationResult.TRUE; - } - }; - - additions.addContributionItem(manager, visibleWhen); - } - } - -} diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInTableMenuContributionItem.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInTableMenuContributionItem.java deleted file mode 100644 index 39bee33f3a1..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/CreateNewElementInTableMenuContributionItem.java +++ /dev/null @@ -1,212 +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.infra.table.menu.handler; -import java.util.List; - -import org.eclipse.core.expressions.EvaluationResult; -import org.eclipse.core.expressions.Expression; -import org.eclipse.core.expressions.IEvaluationContext; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidget; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidgetProvider; -import org.eclipse.emf.facet.widgets.nattable.tableconfiguration.InstantiationMethod; -import org.eclipse.jface.action.ContributionItem; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.papyrus.infra.table.menu.messages.Messages; -import org.eclipse.papyrus.uml.diagram.common.Activator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.ISelectionService; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.menus.IContributionRoot; -import org.eclipse.ui.services.IServiceLocator; - - -/** - * - * This class create a menu to get the action to create new elements in the table in the popup menu. - * This code is adapted from the class org.eclipse.emf.facet.widgets.nattable.workbench.internal.handlers.CreateNewElementContributionItem - */ -public class CreateNewElementInTableMenuContributionItem extends AbstractTableExtensionContributionFactory { - - /** - * A listener on the selection - */ - private ISelectionListener listener; - - /** - * - * Constructor. - * - */ - public CreateNewElementInTableMenuContributionItem() { - this.listener = null; - } - - /** - * - * {@inheritDoc} - */ - @Override - public void createContributionItems(final IServiceLocator serviceLocator, IContributionRoot additions) { - super.createContributionItems(serviceLocator, additions); - final MenuManager manager = new MenuManager(Messages.CreateMenuForNewElementInPopupContributionItem_CreateNewElementMenu) { - - /** - * - * {@inheritDoc} - */ - @Override - public void fill(Menu parent, int index) { - super.fill(parent, index); - Image image = Activator.getImage("IMG_OBJ_ADD"); //$NON-NLS-1$ - getMenu().getParentItem().setImage(image); - INatTableWidgetProvider provider = CreateNewElementInTableMenuContributionItem.this.getINatTableWidgetProvider(); - if(provider != null) { - List methods = provider.getNatTableWidget().getInstantionMethodHistory(); - getMenu().getParentItem().setEnabled(methods.size() != 0); - } - } - - /** - * - * {@inheritDoc} - */ - @Override - public void dispose() { - if(CreateNewElementInTableMenuContributionItem.this.listener != null) { - ISelectionService selectionService = (ISelectionService)serviceLocator.getService(ISelectionService.class); - selectionService.removeSelectionListener(listener); - } - super.dispose(); - } - - /** - * - * {@inheritDoc} - */ - @Override - public boolean isDynamic() { - return true; - } - - }; - - final IContributionItem item = new ContributionItem() { - - /** - * - * {@inheritDoc} - */ - @Override - public void fill(final Menu menu, int index) { - INatTableWidgetProvider provider = getINatTableWidgetProvider(); - if(provider != null) { - final INatTableWidget natTableWidget = provider.getNatTableWidget(); - for(int i = 0; i < natTableWidget.getInstantionMethodHistory().size(); i++) { - final InstantiationMethod meth = natTableWidget.getInstantionMethodHistory().get(i); - MenuItem menuItem = new MenuItem(menu, SWT.CHECK); - menuItem.setText(i + " " + meth.getName()); //$NON-NLS-1$ - menuItem.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(final SelectionEvent e) { - for(MenuItem menuItem2 : menu.getItems()) { - menuItem2.setSelection(false); - } - MenuItem localMenuItem = (MenuItem)e.widget; - localMenuItem.setSelection(true); - natTableWidget.createNewElement(meth); - } - }); - - - } - boolean enabled = menu.getItemCount() != 0; - menu.setEnabled(enabled); - } - } - - /** - * - * {@inheritDoc} - */ - @Override - public boolean isDynamic() { - return true; - } - }; - - manager.add(item); - - Expression visibleWhen = new Expression() { - - /** - * - * {@inheritDoc} - */ - @Override - public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { - INatTableWidgetProvider provider = getINatTableWidgetProvider(); - if(provider != null) { - return EvaluationResult.TRUE; - } - return EvaluationResult.FALSE; - } - - }; - - additions.addContributionItem(manager, visibleWhen); - addSelectionListener(manager); - } - - /** - * Add a listener to refresh the menu when the selection changes. - * - * @param manager - * the menu manager for the contribution of this class - */ - protected void addSelectionListener(final MenuManager manager) { - ISelectionService selectionService = (ISelectionService)this.serviceLocator.getService(ISelectionService.class); - this.listener = new ISelectionListener() { - - /** - * - * {@inheritDoc} - */ - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - final INatTableWidgetProvider provider = getINatTableWidgetProvider(); - if(provider != null) { - manager.setVisible(true); - INatTableWidget widget = provider.getNatTableWidget(); - if(manager.getMenu() != null && !manager.getMenu().isDisposed()) { - manager.getMenu().getParentItem().setEnabled(widget.getInstantionMethodHistory().size() != 0); - } - } else { - manager.setVisible(false); - } - manager.updateAll(true); - - } - }; - selectionService.addSelectionListener(listener); - } - - -} diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/HideEmptyColumnsHandler.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/HideEmptyColumnsHandler.java deleted file mode 100644 index 662c29687ac..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/handler/HideEmptyColumnsHandler.java +++ /dev/null @@ -1,50 +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: - * Nicolas Guyomar (Mia-Software) - Bug 335020 - Nattable widget should use the Eclipse framework - *******************************************************************************/ -package org.eclipse.papyrus.infra.table.menu.handler; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidget; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidgetProvider; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.handlers.HandlerUtil; - -/** - * This class provides the handler to hide or show the empty column - * - * - * - */ -public class HideEmptyColumnsHandler extends AbstractHandler { - - /** - * - * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) - * - * @param event - * @return - * @throws ExecutionException - */ - public Object execute(ExecutionEvent event) throws ExecutionException { - IEditorPart editor = HandlerUtil.getActiveEditor(event); - INatTableWidgetProvider provider = (INatTableWidgetProvider)editor.getAdapter(INatTableWidgetProvider.class); - if(provider != null) { - INatTableWidget widget = provider.getNatTableWidget(); - widget.setHideEmptyColumns(!widget.getTableInstance().isHideEmptyColumns()); - //change the state of the command - HandlerUtil.toggleCommandState(event.getCommand()); - } - return null; - } - -} diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/Messages.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/Messages.java deleted file mode 100644 index d6efab40964..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/Messages.java +++ /dev/null @@ -1,34 +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.infra.table.menu.messages; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.table.menu.messages.messages"; //$NON-NLS-1$ - - public static String CreateMenuForNewElementInPopupContributionItem_CreateNewElementMenu; - - public static String EditTableHandler_EditDescription_Message; - - public static String EditTableHandler_EditDescription_Title; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/messages.properties b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/messages.properties deleted file mode 100644 index 6bd6c4265d8..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/messages/messages.properties +++ /dev/null @@ -1,3 +0,0 @@ -CreateMenuForNewElementInPopupContributionItem_CreateNewElementMenu=&Create new Element -EditTableHandler_EditDescription_Message=Enter a new description. -EditTableHandler_EditDescription_Title=Change the description diff --git a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/providers/TableTester.java b/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/providers/TableTester.java deleted file mode 100644 index bc42f8e2f28..00000000000 --- a/deprecated/org.eclipse.papyrus.infra.table.menu/src/org/eclipse/papyrus/infra/table/menu/providers/TableTester.java +++ /dev/null @@ -1,79 +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.infra.table.menu.providers; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.emf.facet.widgets.nattable.INatTableWidgetProvider; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - * This tester provides action in order to active handlers - * - * - * - */ -public class TableTester extends PropertyTester { - - /** - * the properties to tests - */ - public static final String IS_TABLE = "isTable"; //$NON-NLS-1$ - - /** - * - * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) - * - * @param receiver - * @param property - * @param args - * @param expectedValue - * @return - */ - public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { - if(IS_TABLE.equals(property) && expectedValue instanceof Boolean) { - boolean answer = isTable(); - return new Boolean(answer).equals(expectedValue); - } - return false; - } - - /** - * Tests if the current editor is a table - * - * @return - * true if the current editor is a table - */ - protected boolean isTable() { - IWorkbench wb = PlatformUI.getWorkbench(); - if (wb != null) { - IWorkbenchWindow window = wb.getActiveWorkbenchWindow(); - if (window != null) { - IWorkbenchPage page = window.getActivePage(); - if (page != null) { - IEditorPart editor = page.getActiveEditor(); - if(editor != null) { - Object provider = editor.getAdapter(INatTableWidgetProvider.class); - return provider != null; - } - } - } - } - return false; - } - -} -- cgit v1.2.3