本文整理汇总了Java中org.eclipse.emf.common.util.BasicDiagnostic类的典型用法代码示例。如果您正苦于以下问题:Java BasicDiagnostic类的具体用法?Java BasicDiagnostic怎么用?Java BasicDiagnostic使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BasicDiagnostic类属于org.eclipse.emf.common.util包,在下文中一共展示了BasicDiagnostic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateValue
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* {@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 (MetamodelViewsRepository.Poisson.Properties.interval == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getPoisson_Interval().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getPoisson_Interval().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例2: validateValue
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* {@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 (MetamodelViewsRepository.Scalar.Properties.value == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getScalar_Value().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getScalar_Value().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例3: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
(Diagnostic.ERROR,
"org.eclipse.gemoc.trace.annotations.editor",
0,
getString("_UI_CreateModelError_message", resource.getURI()),
new Object [] { exception == null ? (Object)resource : exception });
basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
return basicDiagnostic;
}
else if (exception != null) {
return
new BasicDiagnostic
(Diagnostic.ERROR,
"org.eclipse.gemoc.trace.annotations.editor",
0,
getString("_UI_CreateModelError_message", resource.getURI()),
new Object[] { exception });
}
else {
return Diagnostic.OK_INSTANCE;
}
}
示例4: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
if ( !resource.getErrors ().isEmpty () || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
( Diagnostic.ERROR, "org.eclipse.scada.protocol.ngp.model.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.protocol.ngp.model.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例5: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the
* resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public Diagnostic analyzeResourceProblems ( final Resource resource,
final Exception exception )
{
if ( !resource.getErrors ().isEmpty ()
|| !resource.getWarnings ().isEmpty () )
{
final BasicDiagnostic basicDiagnostic = new BasicDiagnostic (
Diagnostic.ERROR, "org.eclipse.scada.ui.chart.model.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource
: exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.ui.chart.model.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例6: validateQuestion_multipleTextHasItems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Validates the multipleTextHasItems constraint of '<em>Question</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateQuestion_multipleTextHasItems(Question question, DiagnosticChain diagnostics, Map context) {
// TODO implement the constraint
// -> specify the condition that violates the constraint
// -> verify the diagnostic details, including severity, code, and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
DIAGNOSTIC_SOURCE,
0,
EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { "multipleTextHasItems", getObjectLabel(question, context) }),
new Object[] { question }));
}
return false;
}
return true;
}
示例7: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
if ( !resource.getErrors ().isEmpty () || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
( Diagnostic.ERROR, "org.eclipse.scada.vi.model.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.vi.model.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例8: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
boolean hasErrors = !resource.getErrors ().isEmpty ();
if ( hasErrors || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic = new BasicDiagnostic ( hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, "org.eclipse.scada.configuration.world.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.world.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例9: validateValue
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* {@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 (SrmViewsRepository.General.Properties.name == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例10: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
boolean hasErrors = !resource.getErrors ().isEmpty ();
if ( hasErrors || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic = new BasicDiagnostic ( hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, "org.eclipse.scada.configuration.recipe.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.recipe.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例11: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
boolean hasErrors = !resource.getErrors ().isEmpty ();
if ( hasErrors || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic = new BasicDiagnostic ( hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, "org.eclipse.scada.configuration.infrastructure.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.infrastructure.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例12: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
if ( !resource.getErrors ().isEmpty () || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
( Diagnostic.ERROR, "org.eclipse.scada.configuration.security.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.security.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例13: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
if ( !resource.getErrors ().isEmpty () || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
( Diagnostic.ERROR, "org.eclipse.scada.configuration.item.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.item.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例14: analyzeResourceProblems
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
if ( !resource.getErrors ().isEmpty () || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
( Diagnostic.ERROR, "org.eclipse.scada.da.server.exec.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.da.server.exec.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
示例15: validateValue
import org.eclipse.emf.common.util.BasicDiagnostic; //导入依赖的package包/类
/**
* {@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 (GrmViewsRepository.General.Properties.name == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}