Java Code Examples for org.eclipse.emf.common.util.BasicDiagnostic#toDiagnostic()

The following examples show how to use org.eclipse.emf.common.util.BasicDiagnostic#toDiagnostic() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServiceActivatorPropertiesEditionComponent.java    From eip-designer with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (EipViewsRepository.ServiceActivator.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
Example 2
Source File: InvocableEndpointPropertiesEditionComponent.java    From eip-designer with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (EipViewsRepository.InvocableEndpoint.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
Example 3
Source File: GatewayPropertiesEditionComponent.java    From eip-designer with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (EipViewsRepository.Gateway.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
Example 4
Source File: TransformerPropertiesEditionComponent.java    From eip-designer with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (EipViewsRepository.Transformer.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
Example 5
Source File: CompositeProcessorPropertiesEditionComponent.java    From eip-designer with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (EipViewsRepository.CompositeProcessor.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
Example 6
Source File: ConditionalRoutePropertiesEditionComponent.java    From eip-designer with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (EipViewsRepository.ConditionalRoute.Properties.condition == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(EipPackage.eINSTANCE.getConditionalRoute_Condition().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(EipPackage.eINSTANCE.getConditionalRoute_Condition().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
Example 7
Source File: SplitterPropertiesEditionComponent.java    From eip-designer with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (EipViewsRepository.Splitter.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(EipPackage.eINSTANCE.getEndpoint_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
Example 8
Source File: EIPModelPropertiesEditionComponent.java    From eip-designer with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}