Commit cea68ed6 authored by Gianina Sadi's avatar Gianina Sadi
Browse files

Bug 567814 - [Validation] The EMF validation framework reports multiple


identical validation problems

Changes after review over test

Change-Id: I99fdcb642af4bde9594c863f634cec91b60777b7
Signed-off-by: default avatarGianina Sadi <Gianina.Sadi@elektrobit.com>
parent 5d6781e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -106,3 +106,4 @@ _UI_Translation_resourceURI_feature = Resource URI
_UI_LanguageCultureName_enUS_literal = en-US
_UI_LanguageCultureName_deDE_literal = de-DE
_UI_LanguageCultureName_frFR_literal = fr-FR
_UI_CustomApplication_type = Custom Application
+127 −0
Original line number Diff line number Diff line
/**
 * <copyright>
 * 
 * Copyright (c) 2008-2014 See4sys, itemis and others.
 * 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: 
 *     See4sys - Initial API and implementation
 *     itemis - Enhancements and maintenance
 * 
 * </copyright>
 */
package org.eclipse.sphinx.examples.hummingbird20.instancemodel.edit;


import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.StyledString;

import org.eclipse.sphinx.examples.hummingbird20.instancemodel.CustomApplication;

/**
 * This is the item provider adapter for a {@link org.eclipse.sphinx.examples.hummingbird20.instancemodel.CustomApplication} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class CustomApplicationItemProvider extends ApplicationItemProvider {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CustomApplicationItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

		}
		return itemPropertyDescriptors;
	}

	/**
	 * This returns CustomApplication.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/CustomApplication")); //$NON-NLS-1$
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		return ((StyledString)getStyledText(object)).getString();
	}

	/**
	 * This returns the label styled text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getStyledText(Object object) {
		String label = ((CustomApplication)object).getName();
    	StyledString styledLabel = new StyledString();
		if (label == null || label.length() == 0) {
			styledLabel.append(getString("_UI_CustomApplication_type"), StyledString.Style.QUALIFIER_STYLER);  //$NON-NLS-1$
		} else {
			styledLabel.append(getString("_UI_CustomApplication_type"), StyledString.Style.QUALIFIER_STYLER).append(" " + label); //$NON-NLS-1$ //$NON-NLS-2$
		}
		return styledLabel;
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);
	}

}
+24 −0
Original line number Diff line number Diff line
@@ -224,6 +224,29 @@ public class InstanceModel20ItemProviderAdapterFactory extends InstanceModel20Ad
		return formulaItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link org.eclipse.sphinx.examples.hummingbird20.instancemodel.CustomApplication} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CustomApplicationItemProvider customApplicationItemProvider;

	/**
	 * This creates an adapter for a {@link org.eclipse.sphinx.examples.hummingbird20.instancemodel.CustomApplication}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCustomApplicationAdapter() {
		if (customApplicationItemProvider == null) {
			customApplicationItemProvider = new CustomApplicationItemProvider(this);
		}

		return customApplicationItemProvider;
	}

	/**
	 * This returns the root adapter factory that contains this factory.
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -328,6 +351,7 @@ public class InstanceModel20ItemProviderAdapterFactory extends InstanceModel20Ad
		if (parameterValueItemProvider != null) parameterValueItemProvider.dispose();
		if (parameterExpressionItemProvider != null) parameterExpressionItemProvider.dispose();
		if (formulaItemProvider != null) formulaItemProvider.dispose();
		if (customApplicationItemProvider != null) customApplicationItemProvider.dispose();
	}

}
+6 −0
Original line number Diff line number Diff line
@@ -143,4 +143,10 @@
    <xsd:attribute name="value" type="xsd:string"/>
  </xsd:complexType>
  <xsd:element name="Formula" type="im:Formula"/>
  <xsd:complexType name="CustomApplication">
    <xsd:complexContent>
      <xsd:extension base="im:Application"/>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:element name="CustomApplication" type="im:CustomApplication"/>
</xsd:schema>
Loading