Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Status


      getLog().log(new Status(Status.INFO, PLUGIN_ID, message));
  }

  public void logWarning(String message, Throwable e) {
    if (e != null)
      getLog().log(new Status(Status.WARNING, PLUGIN_ID, message, e));
    else
      getLog().log(new Status(Status.WARNING, PLUGIN_ID, message));
  }
View Full Code Here


          protected IStatus run(IProgressMonitor monitor) {
            try {
              runnable.run(monitor);
              return Status.OK_STATUS;
            } catch (Exception e) {
              return new Status(Status.ERROR, Plugin.PLUGIN_ID, "Validation failed", e);
            }
          }
         
        };
        job.setPriority(Job.SHORT);
View Full Code Here

        } else {
          _encoding = new WGADesignStructureHelper(((IFileEditorInput) element).getFile()).determineDesignEncoding();         
        }
        return super.createDocument(element)
      } else {
        throw new CoreException(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unsupported editorinput."))
      }
    } else {
      throw new CoreException(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unsupported editorinput. Please import files into an eclipse project first."));
    }   
  }
View Full Code Here

      Charset charset;
      try {
        charset= Charset.forName(encoding);
      } catch (UnsupportedCharsetException ex) {
        String message= "Unsupported encoding '" + encoding + "'.";
        IStatus s= new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.OK, message, ex);
        throw new CoreException(s);
      } catch (IllegalCharsetNameException ex) {
        String message= "Unsupported encoding '" + encoding + "'.";
        IStatus s= new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.OK, message, ex);
        throw new CoreException(s);
      }

      CharsetEncoder encoder= charset.newEncoder();
      encoder.onMalformedInput(CodingErrorAction.REPLACE);
      encoder.onUnmappableCharacter(CodingErrorAction.REPORT);

      InputStream stream;

      try {
        byte[] bytes;
        ByteBuffer byteBuffer= encoder.encode(CharBuffer.wrap(document.get()));
        if (byteBuffer.hasArray())
          bytes= byteBuffer.array();
        else {
          bytes= new byte[byteBuffer.limit()];
          byteBuffer.get(bytes);
        }
        stream= new ByteArrayInputStream(bytes, 0, byteBuffer.limit());
      } catch (CharacterCodingException ex) {
        Assert.isTrue(ex instanceof UnmappableCharacterException);
        String message= "Charset mapping failed.";
        IStatus s= new Status(IStatus.ERROR, Plugin.PLUGIN_ID, EditorsUI.CHARSET_MAPPING_FAILED, message, null);
        throw new CoreException(s);
      }

      if (file.exists()) {
View Full Code Here

      List<String> languages = new ArrayList<String>();
      WGADesignStructureHelper helper = new WGADesignStructureHelper(getDesignRoot());
      try {
        languages.addAll(helper.getAvailableLableLanguages());         
      } catch (CoreException e) {
        Plugin.getDefault().getLog().log(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unable to retrieve configured label languages.", e));
      }
      if (languages.isEmpty()) {
        languages.add(WGADesignStructureHelper.DEFAULT_DESIGN_DEV_LANGUAGE);
      }
      _comboLanguage.setItems(languages.toArray(new String[0]));
     
      // set combo default     
      int index = 0;     
      try {
        String devLang = helper.getDevelopmentLanguage();
        int pos = _comboLanguage.indexOf(devLang);
        if (pos != -1) {
          index = pos;
        }
      } catch (CoreException e) {
        Plugin.getDefault().getLog().log(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unable to retrieve dev language of resource '" + getDesignRoot().getLocation() + "'.", e));
      }     
      _comboLanguage.select(index);
     
      label = new Label(composite, SWT.None);
      label.setText("AutoSort label files:");
View Full Code Here

    try {
      WGADesignStructureHelper helper = new WGADesignStructureHelper(getDesignRoot());
      helper.setDevelopmentLanguage(_comboLanguage.getText());
      helper.setSortLabelFiles(_chkSortLabelFiles.getSelection());
    } catch (Exception e) {
      Plugin.getDefault().getLog().log(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unable to save design metadata of resource '" + getDesignRoot().getLocation() + "'.", e));
    }
    return true;
  }
View Full Code Here

        dialog.setValidator(new ISelectionStatusValidator() {
           
            public IStatus validate(Object[] selection) {
                if (selection != null && selection.length == 1) {
                    if (selection[0] instanceof IFile) {
                        return new Status(Status.OK, Plugin.PLUGIN_ID, ((IFile)selection[0]).getFullPath().toString());
                    }
                }
                return new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please select a tml layout file.");
            }
        });
        // first try to find reference in medium "html" - otherwise check all available mediaKeys in design
        IFile preSelection = helper.findReferencedTMLModule(textControl.getText(), "html");
        if (preSelection == null) {
View Full Code Here

        }
      } else {       
        manager.createDeployment(getProject(), monitor);
      }
    } catch (Exception e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to create or update wga deployment.", e));
    }
    return null;
  }
View Full Code Here

          } catch (InputStreamCanceledException e) {
            logWarning("WGA distribution download has been canceled by user.");
            return Status.CANCEL_STATUS;
          } catch (UnknownHostException e) {
            logError("Download of current OpenWGA release failed", e);
            return new Status(Status.ERROR, PLUGIN_ID, "Download of current OpenWGA release from '" + fDownloadURL + "' failed. Unknown host.");
          } catch (Exception e) {
            logError("Download of current WGA release failed.", e);
            return new Status(Status.ERROR, PLUGIN_ID, "Download of current OpenWGA release from '" + fDownloadURL + "' failed. See log for details.");         
          } finally {
            monitor.done();
          }
        }
 
View Full Code Here

    return false;
  }

  public void logError(String message, Throwable e) {
    if (e != null)
      getLog().log(new Status(Status.ERROR, PLUGIN_ID, message, e));
    else
      getLog().log(new Status(Status.ERROR, PLUGIN_ID, message));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.Status

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.