Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRunnable


   * @throws CoreException if this method fails
   * @see IResource#createMarker(java.lang.String)
   */
  public static void createMarker(final IResource resource, final Map attributes, final String markerType) throws CoreException {

    IWorkspaceRunnable r= new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        IMarker marker= resource.createMarker(markerType);
        marker.setAttributes(attributes);
      }
    };
View Full Code Here


  /*
   * @see AbstractMarkerAnnotationModel#deleteMarkers(IMarker[])
   */
  protected void deleteMarkers(final IMarker[] markers) throws CoreException {
    fWorkspace.run(new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        for (int i= 0; i < markers.length; ++i) {
          markers[i].delete();
        }
      }
View Full Code Here

            throws PolicyFileAccessException {

        // create the new policy and cache it if successful
        final IFile newPolicyFile = createPolicyHandle(newPolicyPath);

        IWorkspaceRunnable workspaceOp = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                monitor.subTask(policyName);
                ContainerGenerator generator =
                        new ContainerGenerator(newPolicyPath.removeLastSegments(1));
                generator.generateContainer(monitor);
View Full Code Here

    /**
     * Validate a document given document and update the markers on the
     * IStorage of this XMLDocumentValidator accordingly.
     * */
    public void validate(final IDocument document) {
        IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
            public void run(IProgressMonitor iProgressMonitor) {
                try {
                    removeOldMarkers();
                    String contents = document.get();
                    StringReader reader = new StringReader(contents);
View Full Code Here

            this.listenerList = listenerList;
        }

        // javadoc inherited
        protected IStatus run(IProgressMonitor monitor) {
            IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
                public void run(IProgressMonitor iProgressMonitor) {
                    validator.validate(rootElement);
                }
            };
View Full Code Here

    addAction(menu,GROUP_HTML,ACTION_GEN_XSD);
  }
 
  protected void doValidate() {
    try {
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          IFileEditorInput input = (IFileEditorInput)getEditorInput();
          IFile file = input.getFile();
         
          file.deleteMarkers(IMarker.PROBLEM,false,0);
View Full Code Here

        if(file.getProject().hasNature(natureIds[i])){
          return;
        }
      }
     
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          try {
            IFileEditorInput input = (IFileEditorInput)getEditorInput();
            IFile file = input.getFile();
            file.deleteMarkers(IMarker.PROBLEM,false,0);
View Full Code Here

   * Validates the XML document.
   * If getValidation() returns false, this method do nothing.
   */
  protected void doValidate(){
    try {
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          try {
            IFileEditorInput input = (IFileEditorInput)getEditorInput();
            String xml = getDocumentProvider().getDocument(input).get();
            IFile resource = input.getFile();
View Full Code Here

   * Validates HTML document.
   * If the editor provides other validation, do override at the subclass.
   */
  protected void doValidate(){
    try {
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          try {
            IFileEditorInput input = (IFileEditorInput)getEditorInput();
            IFile file = input.getFile();
            file.deleteMarkers(IMarker.PROBLEM,false,0);
View Full Code Here

  */
 
  public void dispose() {
    if(isFileEditorInput() && validation){
      try {
        ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
          public void run(IProgressMonitor monitor) throws CoreException {
            try {
              IFileEditorInput input = (IFileEditorInput)getEditorInput();
              HTMLProjectParams params = new HTMLProjectParams(input.getFile().getProject());
              if(params.getRemoveMarkers()){
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IWorkspaceRunnable

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.