Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml')
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/Activator.java68
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/handler/CreateAllocateHandler.java56
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/Messages.java21
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/messages.properties3
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/AllocationPropertyTester.java35
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/TableAllocationCreationTester.java53
6 files changed, 0 insertions, 236 deletions
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/Activator.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/Activator.java
deleted file mode 100644
index 5138a0ef4e7..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/Activator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 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.sysml.nattable.allocation.config;
-
-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.sysml.nattable.allocation.config"; //$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)
- */
- @Override
- 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)
- */
- @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/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/handler/CreateAllocateHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/handler/CreateAllocateHandler.java
deleted file mode 100644
index 46b42f09628..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/handler/CreateAllocateHandler.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 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.sysml.nattable.allocation.config.handler;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.sysml.nattable.menu.handlers.AllocateHandler;
-import org.eclipse.papyrus.uml.nattable.menu.util.TableMenuUtils;
-
-/**
- * This handler allows to create an Allocate object, only if the table is a PapyrusSysMLAllocationTable
- *
- * @author vl222926
- *
- */
-public class CreateAllocateHandler extends AllocateHandler {
-
- /**
- * the id used for the Papyrus SysML Allocation Table
- */
- public static final String TABLE_ALLOCATION_TYPE = "PapyrusSysMLAllocationTable"; //$NON-NLS-1$
-
- /**
- *
- * @see org.eclipse.papyrus.sysml.nattable.menu.handlers.AbstractSysmlNattableCreateCommandHandler#setEnabled(java.lang.Object)
- *
- * @param evaluationContext
- */
- @Override
- public void setEnabled(Object evaluationContext) {
- Command command = getCommand();
- boolean isEnabled = command.canExecute();
- INattableModelManager tableManager = TableMenuUtils.getTableManager(getActiveWorkbenchPart());
- isEnabled = isEnabled && tableManager.getTable().getTableConfiguration().getType().equals(TABLE_ALLOCATION_TYPE);
- if(isEnabled) {
- IElementType newElementType = getElementTypeToCreate();
- String id = newElementType.getId();
- isEnabled = tableManager.canCreateRowElement(id);
- }
- setBaseEnabled(isEnabled);
-
- }
-
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/Messages.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/Messages.java
deleted file mode 100644
index 6ed417c2730..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/Messages.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.papyrus.sysml.nattable.allocation.config.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.sysml.nattable.allocation.config.messages.messages"; //$NON-NLS-1$
-
- public static String TableAllocationCreationTester_NotAnUMLElement;
-
- public static String TableAllocationCreationTester_OKMessage;
-
- public static String TableAllocationCreationTester_ProfileNotApplied;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/messages.properties b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/messages.properties
deleted file mode 100644
index 45f52336124..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/messages/messages.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-TableAllocationCreationTester_NotAnUMLElement=The context is not an UML Element
-TableAllocationCreationTester_OKMessage=The context allows to create an Allocation Table
-TableAllocationCreationTester_ProfileNotApplied=The profile {0} is not applied on the model
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/AllocationPropertyTester.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/AllocationPropertyTester.java
deleted file mode 100644
index 69b8c6d62f4..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/AllocationPropertyTester.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 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.sysml.nattable.allocation.config.tester;
-
-import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.infra.nattable.utils.NattableWidgetPropertyTester;
-import org.eclipse.papyrus.sysml.nattable.allocation.config.handler.CreateAllocateHandler;
-
-
-public class AllocationPropertyTester extends NattableWidgetPropertyTester {
-
- private static final String IS_ALLOCATION_TABLE = "isAllocationTable"; //$NON-NLS-1$
-
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- final INattableModelManager manager = getNattableModelManager();
- if(manager != null) {
- if(IS_ALLOCATION_TABLE.equals(property) && expectedValue instanceof Boolean) {
- return expectedValue.equals(manager.getTable().getTableConfiguration().getType().equals(CreateAllocateHandler.TABLE_ALLOCATION_TYPE));
- }
- }
- return false;
- }
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/TableAllocationCreationTester.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/TableAllocationCreationTester.java
deleted file mode 100644
index 40e816f2bcc..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.allocation.config/src/org/eclipse/papyrus/sysml/nattable/allocation/config/tester/TableAllocationCreationTester.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 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.sysml.nattable.allocation.config.tester;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.papyrus.infra.nattable.tester.ITableTester;
-import org.eclipse.papyrus.sysml.allocations.AllocationsPackage;
-import org.eclipse.papyrus.sysml.nattable.allocation.config.Activator;
-import org.eclipse.papyrus.sysml.nattable.allocation.config.messages.Messages;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-public class TableAllocationCreationTester implements ITableTester {
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.tester.ITableTester#isAllowed(java.lang.Object)
- *
- * @param context
- * @return
- */
- public IStatus isAllowed(Object context) {
- if(context instanceof Element) {
- Element el = (Element)context;
- boolean result = context instanceof Package;
- if(result) {
- //doesn't work!
- final String packageQN = UMLUtil.getProfile(AllocationsPackage.eINSTANCE, el).getQualifiedName();
- result = result && el.getNearestPackage().getAppliedProfile(packageQN, true) != null;
- if(result) {
- return new Status(IStatus.OK, Activator.PLUGIN_ID, Messages.TableAllocationCreationTester_OKMessage);
- } else {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, String.format(Messages.TableAllocationCreationTester_ProfileNotApplied, packageQN));
- }
- }
- }
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TableAllocationCreationTester_NotAnUMLElement);
- }
-
-}

Back to the top