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


Java Status.ERROR属性代码示例

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


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

示例1: run

@Override
protected IStatus run(IProgressMonitor monitor) {
    SubMonitor pm = SubMonitor.convert(
            monitor, Messages.commitPartDescr_commiting, 2);

    Log.log(Log.LOG_INFO, "Applying diff tree to db"); //$NON-NLS-1$
    pm.newChild(1).subTask(Messages.commitPartDescr_modifying_db_model); // 1
    pm.newChild(1).subTask(Messages.commitPartDescr_exporting_db_model); // 2

    try {
        Collection<TreeElement> checked = new TreeFlattener()
                .onlySelected()
                .onlyEdits(dbProject.getDbObject(), dbRemote.getDbObject())
                .flatten(tree);
        new ProjectUpdater(dbRemote.getDbObject(), dbProject.getDbObject(),
                checked, proj).updatePartial();
        monitor.done();
    } catch (IOException | CoreException e) {
        return new Status(Status.ERROR, PLUGIN_ID.THIS,
                Messages.ProjectEditorDiffer_commit_error, e);
    }
    if (monitor.isCanceled()) {
        return Status.CANCEL_STATUS;
    }
    return Status.OK_STATUS;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:26,代码来源:ProjectEditorDiffer.java

示例2: createFile

public static IFile createFile(IProject project, IFile file, InputStream contentStream, IProgressMonitor monitor) throws CoreException {
	if (!file.exists()) 
	{
		IPath path = file.getProjectRelativePath();
		if (path.segmentCount() > 1) {
			IPath currentFolderPath = new Path("");
			for (int i=0; i<path.segmentCount()-1; i++) {
				currentFolderPath = currentFolderPath.append(path.segment(i));
				createFolder(project, currentFolderPath, monitor);
			}				
		}
		try
		{
			file.create(contentStream, true, monitor);
		}
		finally
		{
			try {
				contentStream.close();
			} catch (IOException e) {
				throw new CoreException(new Status(Status.ERROR, "", "Could not close stream for file " + file.getFullPath(), e));
			}
		}
	}
	return file;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:26,代码来源:IProjectUtils.java

示例3: setFileContent

public static void setFileContent(IProject project, IFile file, String fileContent, IProgressMonitor monitor) throws CoreException 
{
	if (file.exists()) 
	{
		ByteArrayInputStream contentStream = new ByteArrayInputStream(fileContent.getBytes());
		try
		{
			file.setContents(contentStream, true, true, monitor);
		}
		finally
		{
			try {
				contentStream.close();
			} catch (IOException e) {
				throw new CoreException(new Status(Status.ERROR, "", "Could not close stream for file " + file.getFullPath(), e));
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:19,代码来源:IProjectUtils.java

示例4: instanciate

protected Object instanciate(String attributeName) throws CoreException {
	try
	{
		return _configurationElement.createExecutableExtension(attributeName);
	}
	catch(CoreException e)
	{
		String message = "Instanciation of one agent failed: " + e.getMessage() + " (see inner exception for more detail).";
		CoreException exception = new CoreException(new Status(Status.ERROR, Activator.PLUGIN_ID, message, e));
		throw exception;
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:12,代码来源:Extension.java

示例5: throwInstanciationCoreException

protected void throwInstanciationCoreException() throws CoreException {
	String message = "Instanciation succeeded but object is not of correct type.";
	CoreException exception = new CoreException(new Status(Status.ERROR, Activator.PLUGIN_ID, message));
	throw exception;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:5,代码来源:Extension.java


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