本文整理匯總了Java中org.eclipse.core.runtime.IStatus.ERROR屬性的典型用法代碼示例。如果您正苦於以下問題:Java IStatus.ERROR屬性的具體用法?Java IStatus.ERROR怎麽用?Java IStatus.ERROR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.runtime.IStatus
的用法示例。
在下文中一共展示了IStatus.ERROR屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: openInbuiltOperationClass
private void openInbuiltOperationClass(String operationName, PropertyDialogButtonBar propertyDialogButtonBar) {
String operationClassName = null;
Operations operations = XMLConfigUtil.INSTANCE.getComponent(FilterOperationClassUtility.INSTANCE.getComponentName())
.getOperations();
List<TypeInfo> typeInfos = operations.getStdOperation();
for (int i = 0; i < typeInfos.size(); i++) {
if (typeInfos.get(i).getName().equalsIgnoreCase(operationName)) {
operationClassName = typeInfos.get(i).getClazz();
break;
}
}
propertyDialogButtonBar.enableApplyButton(true);
javaProject = FilterOperationClassUtility.getIJavaProject();
if (javaProject != null) {
try {
IType findType = javaProject.findType(operationClassName);
JavaUI.openInEditor(findType);
} catch (JavaModelException | PartInitException e) {
Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,Messages.CLASS_NOT_EXIST,null);
StatusManager.getManager().handle(status, StatusManager.BLOCK);
logger.error(e.getMessage(), e);
}
} else {
WidgetUtility.errorMessage(Messages.SAVE_JOB_MESSAGE);
}
}
示例2: validateLinkedResource
/**
* Checks whether the linked resource target is valid. Sets the error
* message accordingly and returns the status.
*
* @return IStatus validation result from the CreateLinkedResourceGroup
*/
protected IStatus validateLinkedResource() {
IPath containerPath = resourceGroup.getContainerFullPath();
IPath newFilePath = containerPath.append(resourceGroup.getResource());
IFile newFileHandle = createFileHandle(newFilePath);
IStatus status = linkedResourceGroup
.validateLinkLocation(newFileHandle);
if (status.getSeverity() == IStatus.ERROR) {
if (firstLinkCheck) {
setMessage(status.getMessage());
setErrorMessage(null);
} else {
setErrorMessage(status.getMessage());
}
} else if (status.getSeverity() == IStatus.WARNING) {
setMessage(status.getMessage(), WARNING);
setErrorMessage(null);
}
return status;
}
示例3: performFinish
/**
* Creates the project, all the directories and files and open the .odesign.
*
* @return true if successful
*/
@Override
public boolean performFinish() {
try {
// if user do not reach page 2, the VSM name is defined according to
// the project name
if (!newOdesignPage.isVsmNameChanged) {
newOdesignPage.modelName.setText(newOdesignPage
.extractModelName(newOdesignPage.firstPage
.getProjectName()));
}
ViewpointSpecificationProject
.createNewViewpointSpecificationProject(workbench,
newProjectPage.getProjectName(), newProjectPage
.getLocationPath(), newOdesignPage
.getModelName().getText(), newOdesignPage
.getInitialObjectName(), newOdesignPage
.getEncoding(), getContainer());
return true;
} catch (final CoreException e) {
final IStatus status = new Status(IStatus.ERROR,
SiriusEditorPlugin.PLUGIN_ID, IStatus.OK, e.getMessage(), e);
SiriusEditorPlugin.getPlugin().getLog().log(status);
return false;
}
}
示例4: setVisible
@Override
public void setVisible ( final boolean visible )
{
super.setVisible ( visible );
if ( visible )
{
try
{
getContainer ().run ( false, false, new IRunnableWithProgress () {
@Override
public void run ( final IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException
{
setMergeResult ( PreviewPage.this.mergeController.merge ( wrap ( monitor ) ) );
}
} );
}
catch ( final Exception e )
{
final Status status = new Status ( IStatus.ERROR, Activator.PLUGIN_ID, Messages.PreviewPage_StatusErrorFailedToMerge, e );
StatusManager.getManager ().handle ( status );
ErrorDialog.openError ( getShell (), Messages.PreviewPage_TitleErrorFailedToMerge, Messages.PreviewPage_MessageErrorFailedToMerge, status );
}
}
}
示例5: validate
@Override
public IStatus validate ( final Object value )
{
if ( ! ( value instanceof Number ) )
{
return new Status ( IStatus.ERROR, Activator.PLUGIN_ID, "Value must be a number" );
}
final int port = ( (Number)value ).intValue ();
if ( port < MIN || port > MAX )
{
return new Status ( IStatus.ERROR, Activator.PLUGIN_ID, String.format ( "Port number must be between %s and %s (inclusive)", MIN, MAX ) );
}
if ( port < 1024 && isUnix () )
{
return new Status ( IStatus.WARNING, Activator.PLUGIN_ID, String.format ( "Port numbers below 1024 are reserved for privileged users (root) and may not be available for use." ) );
}
return Status.OK_STATUS;
}
示例6: getContent
@Override
public InputStream getContent(@NonNull TaskRepository repository, @NonNull ITask task,
@NonNull TaskAttribute attachmentAttribute, @Nullable IProgressMonitor monitor) throws CoreException {
try {
return connector.getClient(repository).getAttachment(task, attachmentAttribute, monitor);
} catch (CharmException e) {
throw new CoreException(new Status(IStatus.ERROR, CharmCorePlugin.PLUGIN_ID,
NLS.bind("Downloading attachment failed: {0}", e.getMessage(), e)));
}
}
示例7: postContent
@Override
public void postContent(@NonNull TaskRepository repository, @NonNull ITask task,
@NonNull AbstractTaskAttachmentSource source, @Nullable String comment,
@Nullable TaskAttribute attachmentAttribute, @Nullable IProgressMonitor monitor) throws CoreException {
monitor.beginTask("Uploading attachment", 1);
CharmClient client = connector.getClient(repository);
try {
byte attachment[] = readData(source, monitor);
String filename = source.getName();
String description = source.getDescription();
if (CONTEXT_DESCRIPTION.equals(source.getDescription()))
filename = CONTEXT_DESCRIPTION + "-" + dateFormat.format(new Date()) + ".zip";
else if (attachmentAttribute != null) {
TaskAttachmentMapper mapper = TaskAttachmentMapper.createFrom(attachmentAttribute);
if (mapper.getFileName() != null)
filename = mapper.getFileName();
if (mapper.getDescription() != null)
description = mapper.getDescription();
}
client.putAttachmentData(task, filename, source.getContentType(), description, attachment, monitor);
Policy.advance(monitor, 1);
} catch (IOException | CharmHttpException e) {
throw new CoreException(new Status(IStatus.ERROR, CharmCorePlugin.PLUGIN_ID,
NLS.bind("Uploading attachment failed: {0}", e.getMessage(), e)));
} finally {
monitor.done();
}
}
示例8: getContents
@Override
public InputStream getContents() throws CoreException {
URIHandler handler = schemeHelper.createURIHandler(URIConverter.INSTANCE);
try {
return handler.createInputStream(getURI(), Collections.emptyMap());
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.n4js.ts.ui", "Cannot load "
+ getFullPath(), e));
}
}
示例9: getContents
@Override
public InputStream getContents() throws CoreException {
try {
return URIConverter.INSTANCE.createInputStream(uri);
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.n4js.ts.ui", "Cannot load "
+ getFullPath(), e));
}
}
示例10: createInitialModel
@Override
protected void createInitialModel(Resource resource) {
Configuration rootObject = OCCIFactory.eINSTANCE.createConfiguration();
resource.getContents().add(rootObject);
try {
Importer.importFromOcciServer(rootObject, occiServerUrl);
rootObject.setLocation(occiServerUrl);
} catch (Throwable throwable) {
Shell shell = Display.getCurrent().getActiveShell();
Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, null, throwable);
ErrorDialog.openError(shell, null, throwable.getMessage(), status);
throwable.printStackTrace(System.err);
return;
}
}
示例11: getCSVDebugFileLocation
private String getCSVDebugFileLocation() {
String csvDebugFileLocation = null;
try {
csvDebugFileLocation = getDebugFilePathFromDebugService();
} catch (IOException e) {
Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
showDetailErrorMessage(Messages.UNABLE_TO_RELOAD_DEBUG_FILE + ": unable to reload files ,please check if service is running", status);
logger.error("Failed to get csv debug file path from service", e);
return csvDebugFileLocation;
}
return csvDebugFileLocation;
}
示例12: reportError
public static void reportError(Throwable t) {
Throwable cause = t.getCause();
if (cause != null && cause != t) {
reportError(cause);
return;
}
Status status = new Status(IStatus.ERROR, PLUGIN_ID, t.getLocalizedMessage(), t);
StatusManager.getManager().handle(status, StatusManager.LOG | StatusManager.BLOCK);
}
示例13: convertStatus
public static IStatus convertStatus ( final String pluginId, final String message, final Throwable e )
{
if ( e == null )
{
return Status.OK_STATUS;
}
if ( e instanceof CoreException )
{
return ( (CoreException)e ).getStatus ();
}
return new Status ( IStatus.ERROR, pluginId, message, e );
}
示例14: getComponentConfig
/** Reads the xml configuration files stored under the platform installation.
* These files contain the configuration required to create the component on UI.
* @return see {@link Component}
* @throws RuntimeException
* @throws IOException
* @throws SAXException
*/
public List<Component> getComponentConfig() throws RuntimeException, SAXException, IOException {
if(componentList != null && !componentList.isEmpty()){
return componentList;
}
else{
try{
JAXBContext jaxbContext = JAXBContext.newInstance(Config.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
String[] configFileList = getFilteredFiles(XML_CONFIG_FILES_PATH, getFileNameFilter(Messages.XMLConfigUtil_FILE_EXTENTION));
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setExpandEntityReferences(false);
dbf.setFeature(Constants.DISALLOW_DOCTYPE_DECLARATION,true);
DocumentBuilder builder = dbf.newDocumentBuilder();
for (int i = 0; i < configFileList.length; i++){
logger.trace("Creating palette component: ", configFileList[i]);
if(validateXMLSchema(COMPONENT_CONFIG_XSD_PATH, XML_CONFIG_FILES_PATH + SEPARATOR + configFileList[i])){
Document document = builder.parse(new File(XML_CONFIG_FILES_PATH + SEPARATOR + configFileList[i]));
Config config = (Config) unmarshaller.unmarshal(document);
componentList.addAll(config.getComponent());
builder.reset();
}
}
validateAndFillComponentConfigList(componentList);
return componentList;
}catch(JAXBException | SAXException | IOException | ParserConfigurationException exception){
Status status = new Status(IStatus.ERROR,Activator.PLUGIN_ID, "XML read failed", exception);
StatusManager.getManager().handle(status, StatusManager.BLOCK);
logger.error(exception.getMessage());
throw new RuntimeException("Faild in reading XML Config files", exception); //$NON-NLS-1$
}
}
}
示例15: throwCoreException
private void throwCoreException(String message) throws CoreException {
IStatus status = new Status(IStatus.ERROR, EditorConfigPlugin.PLUGIN_ID, IStatus.OK, message, null);
throw new CoreException(status);
}