Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/components/TemplateParameterBasePropertiesEditionComponent.java')
-rw-r--r--deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/components/TemplateParameterBasePropertiesEditionComponent.java283
1 files changed, 0 insertions, 283 deletions
diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/components/TemplateParameterBasePropertiesEditionComponent.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/components/TemplateParameterBasePropertiesEditionComponent.java
deleted file mode 100644
index 064bafe33a6..00000000000
--- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/components/TemplateParameterBasePropertiesEditionComponent.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Obeo.
- * 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:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.tabbedproperties.uml.components;
-
-// Start of user code for imports
-
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.common.command.IdentityCommand;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.eef.runtime.EMFPropertiesRuntime;
-import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
-import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener;
-import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
-import org.eclipse.emf.eef.runtime.api.providers.IPropertiesEditionPartProvider;
-import org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent;
-import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
-import org.eclipse.emf.eef.runtime.impl.services.PropertiesContextService;
-import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPartProviderService;
-import org.eclipse.papyrus.tabbedproperties.uml.parts.TemplateParameterPropertiesEditionPart;
-import org.eclipse.papyrus.tabbedproperties.uml.parts.UMLViewsRepository;
-import org.eclipse.uml2.uml.TemplateParameter;
-
-// End of user code
-
-/**
- * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
- */
-public class TemplateParameterBasePropertiesEditionComponent extends StandardPropertiesEditionComponent {
-
- public static String BASE_PART = "Base"; //$NON-NLS-1$
-
- private String[] parts = { BASE_PART };
-
- /**
- * The EObject to edit
- */
- private TemplateParameter templateParameter;
-
- /**
- * The Base part
- */
- private TemplateParameterPropertiesEditionPart basePart;
-
- /**
- * Default constructor
- */
- public TemplateParameterBasePropertiesEditionComponent(EObject templateParameter, String editing_mode) {
- if(templateParameter instanceof TemplateParameter) {
- this.templateParameter = (TemplateParameter)templateParameter;
- if(IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode)) {
- semanticAdapter = initializeSemanticAdapter();
- this.templateParameter.eAdapters().add(semanticAdapter);
- }
- }
- this.editing_mode = editing_mode;
- }
-
- /**
- * Initialize the semantic model listener for live editing mode
- *
- * @return the semantic model listener
- */
- private AdapterImpl initializeSemanticAdapter() {
- return new EContentAdapter() {
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- public void notifyChanged(Notification msg) {
- if(basePart == null)
- TemplateParameterBasePropertiesEditionComponent.this.dispose();
- else {
-
-
- }
- }
-
- };
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#translatePart(java.lang.String)
- */
- public java.lang.Class translatePart(String key) {
- if(BASE_PART.equals(key))
- return UMLViewsRepository.TemplateParameter.class;
- return super.translatePart(key);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#partsList()
- */
- public String[] partsList() {
- return parts;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#getPropertiesEditionPart (java.lang.String, java.lang.String)
- */
- public IPropertiesEditionPart getPropertiesEditionPart(int kind, String key) {
- if(templateParameter != null && BASE_PART.equals(key)) {
- if(basePart == null) {
- IPropertiesEditionPartProvider provider = PropertiesEditionPartProviderService.getInstance().getProvider(UMLViewsRepository.class);
- if(provider != null) {
- basePart = (TemplateParameterPropertiesEditionPart)provider.getPropertiesEditionPart(UMLViewsRepository.TemplateParameter.class, kind, this);
- addListener((IPropertiesEditionListener)basePart);
- }
- }
- return (IPropertiesEditionPart)basePart;
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent# setPropertiesEditionPart(java.lang.Class, int,
- * org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart)
- */
- public void setPropertiesEditionPart(java.lang.Class key, int kind, IPropertiesEditionPart propertiesEditionPart) {
- if(key == UMLViewsRepository.TemplateParameter.class)
- this.basePart = (TemplateParameterPropertiesEditionPart)propertiesEditionPart;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Class, int, org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.ecore.resource.ResourceSet)
- */
- public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
- if(basePart != null && key == UMLViewsRepository.TemplateParameter.class) {
- ((IPropertiesEditionPart)basePart).setContext(elt, allResource);
- final TemplateParameter templateParameter = (TemplateParameter)elt;
- // init values
-
- // init filters
- }
- // init values for referenced views
-
- // init filters for referenced views
-
- }
-
-
-
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#getPropertiesEditionCommand
- * (org.eclipse.emf.edit.domain.EditingDomain)
- */
- public CompoundCommand getPropertiesEditionCommand(EditingDomain editingDomain) {
- CompoundCommand cc = new CompoundCommand();
- if(templateParameter != null) {
-
-
- }
- if(!cc.isEmpty())
- return cc;
- cc.append(IdentityCommand.INSTANCE);
- return cc;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#getPropertiesEditionObject()
- */
- public EObject getPropertiesEditionObject(EObject source) {
- if(source instanceof TemplateParameter) {
- TemplateParameter templateParameterToUpdate = (TemplateParameter)source;
-
-
- return templateParameterToUpdate;
- } else
- return null;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.common.notify.Notification)
- */
- public void firePropertiesChanged(PropertiesEditionEvent event) {
- super.firePropertiesChanged(event);
- if(PropertiesEditionEvent.COMMIT == event.getState() && IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode)) {
- CompoundCommand command = new CompoundCommand();
-
-
- if(!command.isEmpty() && !command.canExecute()) {
- EMFPropertiesRuntime.getDefault().logError("Cannot perform model change command.", null);
- } else {
- liveEditingDomain.getCommandStack().execute(command);
- }
- } else if(PropertiesEditionEvent.CHANGE == event.getState()) {
- Diagnostic diag = this.validateValue(event);
- if(diag != null && diag.getSeverity() != Diagnostic.OK) {
-
-
- } else {
-
-
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.common.notify.Notification)
- */
- public Diagnostic validateValue(PropertiesEditionEvent event) {
- Diagnostic ret = null;
- if(event.getNewValue() != null) {
- String newStringValue = event.getNewValue().toString();
- try {
-
- } catch (IllegalArgumentException iae) {
- ret = BasicDiagnostic.toDiagnostic(iae);
- }
- }
- return ret;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validate()
- */
- public Diagnostic validate() {
- Diagnostic validate = null;
- if(IPropertiesEditionComponent.BATCH_MODE.equals(editing_mode)) {
- EObject copy = EcoreUtil.copy(PropertiesContextService.getInstance().entryPointElement());
- copy = PropertiesContextService.getInstance().entryPointComponent().getPropertiesEditionObject(copy);
- validate = Diagnostician.INSTANCE.validate(copy);
- } else if(IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode))
- validate = Diagnostician.INSTANCE.validate(templateParameter);
- // Start of user code for custom validation check
-
- // End of user code
-
- return validate;
- }
-
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#dispose()
- */
- public void dispose() {
- if(semanticAdapter != null)
- templateParameter.eAdapters().remove(semanticAdapter);
- }
-
-}

Back to the top