本文整理汇总了Java中org.eclipse.emf.common.util.Diagnostic.OK属性的典型用法代码示例。如果您正苦于以下问题:Java Diagnostic.OK属性的具体用法?Java Diagnostic.OK怎么用?Java Diagnostic.OK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.emf.common.util.Diagnostic
的用法示例。
在下文中一共展示了Diagnostic.OK属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createModel
/**
* This is the method called to load a resource into the editing domain's resource set based on the editor's input.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createModel ()
{
URI resourceURI = EditUIUtil.getURI ( getEditorInput (), editingDomain.getResourceSet ().getURIConverter () );
Exception exception = null;
Resource resource = null;
try
{
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet ().getResource ( resourceURI, true );
}
catch ( Exception e )
{
exception = e;
resource = editingDomain.getResourceSet ().getResource ( resourceURI, false );
}
Diagnostic diagnostic = analyzeResourceProblems ( resource, exception );
if ( diagnostic.getSeverity () != Diagnostic.OK )
{
resourceToDiagnosticMap.put ( resource, analyzeResourceProblems ( resource, exception ) );
}
editingDomain.getResourceSet ().eAdapters ().add ( problemIndicationAdapter );
}
示例2: createModel
/**
* This is the method called to load a resource into the editing domain's resource set based on the editor's input.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createModel() {
URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
Exception exception = null;
Resource resource = null;
try {
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
示例3: notifyChanged
@Override
public void notifyChanged(Notification notification) {
if (notification.getNotifier() instanceof Resource) {
switch (notification.getFeatureID(Resource.class)) {
case Resource.RESOURCE__IS_LOADED:
case Resource.RESOURCE__ERRORS:
case Resource.RESOURCE__WARNINGS: {
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
resourceToDiagnosticMap.remove(resource);
}
dispatchUpdateProblemIndication();
break;
}
}
}
else {
super.notifyChanged(notification);
}
}
示例4: createModel
/**
* This is the method called to load a resource into the editing domain's resource set based on the editor's input.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createModel ()
{
URI resourceURI = EditUIUtil.getURI ( getEditorInput () );
Exception exception = null;
Resource resource = null;
try
{
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet ().getResource ( resourceURI, true );
}
catch ( Exception e )
{
exception = e;
resource = editingDomain.getResourceSet ().getResource ( resourceURI, false );
}
Diagnostic diagnostic = analyzeResourceProblems ( resource, exception );
if ( diagnostic.getSeverity () != Diagnostic.OK )
{
resourceToDiagnosticMap.put ( resource, analyzeResourceProblems ( resource, exception ) );
}
editingDomain.getResourceSet ().eAdapters ().add ( problemIndicationAdapter );
}
示例5: notifyChanged
@Override
public void notifyChanged ( Notification notification )
{
if ( notification.getNotifier () instanceof Resource )
{
switch ( notification.getFeatureID ( Resource.class ) )
{
case Resource.RESOURCE__IS_LOADED:
case Resource.RESOURCE__ERRORS:
case Resource.RESOURCE__WARNINGS:
{
Resource resource = (Resource)notification.getNotifier ();
Diagnostic diagnostic = analyzeResourceProblems ( resource, null );
if ( diagnostic.getSeverity () != Diagnostic.OK )
{
resourceToDiagnosticMap.put ( resource, diagnostic );
}
else
{
resourceToDiagnosticMap.remove ( resource );
}
if ( updateProblemIndication )
{
getSite ().getShell ().getDisplay ().asyncExec ( new Runnable () {
public void run ()
{
updateProblemIndication ();
}
} );
}
break;
}
}
}
else
{
super.notifyChanged ( notification );
}
}
示例6: notifyChanged
@Override
public void notifyChanged(Notification notification) {
if (notification.getNotifier() instanceof Resource) {
switch (notification.getFeatureID(Resource.class)) {
case Resource.RESOURCE__IS_LOADED:
case Resource.RESOURCE__ERRORS:
case Resource.RESOURCE__WARNINGS: {
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
resourceToDiagnosticMap.remove(resource);
}
if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
updateProblemIndication();
}
});
}
break;
}
}
}
else {
super.notifyChanged(notification);
}
}
示例7: validate
/**
* Validates a given OCCI object according to the EMF and OCL constraints of its
* metamodel.
*
* @param occiObject
* the given OCCI object.
*/
public static boolean validate(EObject occiObject) {
Diagnostic diagnostic = Diagnostician.INSTANCE.validate(occiObject);
if (diagnostic.getSeverity() != Diagnostic.OK) {
StringBuffer stringBuffer = printDiagnostic(diagnostic, "", new StringBuffer());
LOGGER.warn(stringBuffer.toString());
return false;
}
return true;
}