当前位置: 首页>>代码示例>>Java>>正文


Java Diagnostic.OK_INSTANCE属性代码示例

本文整理汇总了Java中org.eclipse.emf.common.util.Diagnostic.OK_INSTANCE属性的典型用法代码示例。如果您正苦于以下问题:Java Diagnostic.OK_INSTANCE属性的具体用法?Java Diagnostic.OK_INSTANCE怎么用?Java Diagnostic.OK_INSTANCE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.emf.common.util.Diagnostic的用法示例。


在下文中一共展示了Diagnostic.OK_INSTANCE属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateValue

/**
 * {@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.event == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getUsageDemand_Event().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getUsageDemand_Event().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:25,代码来源:UsageDemandPropertiesEditionComponent.java

示例2: validateValue

/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * @generated
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (AnalysisViewsRepository.ResultContainer.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:25,代码来源:ResultContainerPropertiesEditionComponent.java

示例3: validateValue

/**
 * {@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 (HrmViewsRepository.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;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:25,代码来源:HardwareServicePropertiesEditionComponent.java

示例4: analyzeResourceProblems

/**
 * 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;
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:29,代码来源:SetupEditor.java

示例5: validateValue

/**
 * {@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;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:25,代码来源:ProtectionParameterGeneralPropertiesEditionComponent.java

示例6: analyzeResourceProblems

/**
 * 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;
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:29,代码来源:RecipeEditor.java

示例7: analyzeResourceProblems

/**
 * 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.cmf.occi.sla.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.cmf.occi.sla.editor",
				 0,
				 getString("_UI_CreateModelError_message", resource.getURI()),
				 new Object[] { exception });
	}
	else {
		return Diagnostic.OK_INSTANCE;
	}
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:33,代码来源:SlaEditor.java

示例8: validateValue

/**
 * {@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;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:18,代码来源:SoftwareInterfaceOtherPropertiesEditionComponent.java

示例9: analyzeResourceProblems

/**
 * 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.cmf.occi.crtp.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.cmf.occi.crtp.editor",
				 0,
				 getString("_UI_CreateModelError_message", resource.getURI()),
				 new Object[] { exception });
	}
	else {
		return Diagnostic.OK_INSTANCE;
	}
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:33,代码来源:CrtpEditor.java

示例10: analyzeResourceProblems

/**
 * 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.polarsys.time4sys.model.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.polarsys.time4sys.model.editor",
				 0,
				 getString("_UI_CreateModelError_message", resource.getURI()),
				 new Object[] { exception });
	}
	else {
		return Diagnostic.OK_INSTANCE;
	}
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:33,代码来源:Time4sysEditor.java

示例11: validateValue

/**
 * {@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.Timing.Properties.priorityElements == event.getAffectedEditor()) {
				BasicDiagnostic chain = new BasicDiagnostic();
				for (Iterator iterator = ((List)event.getNewValue()).iterator(); iterator.hasNext();) {
					chain.add(Diagnostician.INSTANCE.validate(SrmPackage.eINSTANCE.getSoftwareConcurrentResource_PriorityElements().getEAttributeType(), iterator.next()));
				}
				ret = chain;
			}
			if (SrmViewsRepository.Timing.Properties.arrivalPattern == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(SrmPackage.eINSTANCE.getSoftwareConcurrentResource_ArrivalPattern().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(SrmPackage.eINSTANCE.getSoftwareConcurrentResource_ArrivalPattern().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:32,代码来源:InterruptResourceTimingPropertiesEditionComponent.java


注:本文中的org.eclipse.emf.common.util.Diagnostic.OK_INSTANCE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。