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


Java Diagnostic.OK属性代码示例

本文整理汇总了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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:30,代码来源:RecipeEditor.java

示例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);
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:26,代码来源:MappingEditor.java

示例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);
	}
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:24,代码来源:OCCIEditor.java

示例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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:30,代码来源:ConfigurationEditor.java

示例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 );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:40,代码来源:GlobalizeEditor.java

示例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);
	}
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:32,代码来源:Time4sysEditor.java

示例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;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:16,代码来源:OcciHelper.java


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