本文整理汇总了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;
}
示例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;
}
示例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));
}
}
}
}
示例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;
}
}
示例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;
}