Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.NullProgressMonitor


         
          // configure tomcat
          Map<String,String> variables = new HashMap<String,String>();
          TomcatUtils.getInstance().initConfDir(runtime.getCatalinaConf().getLocation().toFile(), variables);       
 
          _project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        }
      }
    } catch (Exception e) {
      WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), Display.getCurrent().getActiveShell(), "Migration to WGA Runtime failed.", "Unable to migrate project '" + _project + "' to runtime.", e);
    }
View Full Code Here


      sortedProperties.putAll(_props);
      FileOutputStream labelFileStream = null;
      try {
        labelFileStream = new FileOutputStream(_file.getLocation().toString());
        sortedProperties.store(labelFileStream, null);
        _file.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
      } catch (IOException e) {
        WGADesignerPlugin.getDefault().logInfo("Unable to store file: " + _file.getLocation(), e);
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logInfo("Unable to refresh resource on: " + _file.getLocation(), e);
      } finally {
View Full Code Here

                foldersToCreate.add((IFolder)parent);
              }
              parent = parent.getParent();
            }
            for (int i=foldersToCreate.size() - 1; i >= 0; i--) {
              foldersToCreate.get(i).create(false, true, new NullProgressMonitor());
            }           
            // create tml file           
                  String header = Plugin.getDefault().getHeaderFileMap().get(Plugin.HEADER_TML_MODUL).getHeaderForProject(fileToCreate.getProject())
                  fileToCreate.create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());             
            // open editor
            WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), fileToCreate, ResourceIDs.EDITOR_TML);
          } catch (CoreException e) {
          }       
        }
View Full Code Here

                foldersToCreate.add((IFolder)parent);
              }
              parent = parent.getParent();
            }
            for (int i=foldersToCreate.size() - 1; i >= 0; i--) {
              foldersToCreate.get(i).create(false, true, new NullProgressMonitor());
            }           
            // create tml file
            fileToCreate.create(new ByteArrayInputStream(new byte[0]), true, new NullProgressMonitor());
            // open editor
            WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), fileToCreate);
          } catch (CoreException e) {
          }       
        }
View Full Code Here

    IFolder container = getFileContainer("labels_" + language.toLowerCase());
    if (container == null) {
      container = getFileContainerRoot().getFolder(new Path("labels_" + language.toLowerCase()));
    }
    if (!container.exists()) {
      container.create(false, true, new NullProgressMonitor());
    }
    return container;
  }
View Full Code Here

    if (!labelFile.exists()) {
      try {
        if (!labelFile.getParent().exists()) {
          if (labelFile.getParent() instanceof IFolder) {
            IFolder parentFolder = (IFolder) labelFile.getParent();
            parentFolder.create(false, true, new NullProgressMonitor());
          }
        }
        ByteArrayInputStream byteStream = new ByteArrayInputStream("".getBytes());
        labelFile.create(byteStream, true, new NullProgressMonitor());
       
      } catch (CoreException e) {
        Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, "Can't create propertyfile : " + labelFile.getLocation(), e));
      }      
    }

    // stores labelfile
    FileOutputStream labelFileStream = null;
    BufferedWriter writer = null;
    try {
      if (isSortLabelFiles()) {
        Properties labelProperties = loadLabel(labelFile);
        labelProperties.setProperty(key, value);
        SortedProperties sortedProperties = new SortedProperties();
        sortedProperties.putAll(labelProperties);
        labelFileStream = new FileOutputStream(labelFile.getLocation().toString());
        sortedProperties.store(labelFileStream, null);
     
       
      } else {
        // append new label to existing file
        Properties labelProperties = loadLabel(labelFile);
        if (!labelProperties.containsKey(key)) {
          writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(labelFile.getLocation().toFile(), true), "8859_1"));
          if(labelProperties.entrySet().size()>0){
            writer.newLine();
          }         
          writer.write(LabelFileEncodingHelper.saveConvert(key, true));
          writer.write("=");
          writer.write(LabelFileEncodingHelper.saveConvert(value, false));         
          writer.flush();
       
        }
      }
      labelFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
    } catch (FileNotFoundException e) {
      Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, "Can't find propertyfile : " + labelFile.getLocation(), e));
    } catch (IOException e) {
      Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, "Can't write propertyfile : " + labelFile.getLocation(), e));
    } catch (CoreException e) {
View Full Code Here

    IFolder portletFolder = (IFolder) portletFolderResource;     
   
    String tmlInclude = header + "\n<tml:include ref=\"{'::mode-' + portlet.mode}\"/>";   
    ByteArrayInputStream input = new ByteArrayInputStream(tmlInclude.getBytes());
    IFile portletFile = portletFolder.getFile("portlet.tml");
    portletFile.create(input, true, new NullProgressMonitor());
   
    portletFolder.getFile("form.tml").create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());   
    //TODO Form for form.tml
   
   
   
    Iterator<String> it = modes.iterator();   
    while (it.hasNext()) {
      String current = it.next();
      portletFolder.getFile("mode-"+current+".tml").create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());     
    }   
    return portletFile;
  }
View Full Code Here

    return false;     
  }
 
  public void enforceDesignEncoding() throws CoreException {
   
    getDesignRoot().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
   
    final Map<String,String> fDefaultCharsetsByExtension = new HashMap<String,String>();
    fDefaultCharsetsByExtension.put("xml", "UTF-8");
    fDefaultCharsetsByExtension.put("css", "UTF-8");
   
    // no explicit encoding for design root & file container root
    if (getDesignRoot() != null && getDesignRoot().isAccessible()) {
      getDesignRoot().setDefaultCharset(null, new NullProgressMonitor());
    }
    if (getFileContainerRoot() != null && getFileContainerRoot().isAccessible()) {
      getFileContainerRoot().setDefaultCharset(null, new NullProgressMonitor());
    }
   
    // set explicit encodings where necessary
    final String fEncoding = determineDesignEncoding();
    if (getTmlRoot() != null && getTmlRoot().isAccessible()) {
      getTmlRoot().setDefaultCharset(fEncoding, new NullProgressMonitor());
    }
    if (getScriptsRoot() != null && getScriptsRoot().isAccessible()) {
      getScriptsRoot().setDefaultCharset(fEncoding, new NullProgressMonitor());
      getScriptsRoot().accept(new IResourceVisitor() {
 
        public boolean visit(IResource resource) throws CoreException {
          if (resource instanceof IFile) {
            IFile file = (IFile) resource;
            String defaultEncoding = fDefaultCharsetsByExtension.get(file.getFileExtension().toLowerCase());
            if (defaultEncoding != null) {
              String resourceCharset = file.getCharset();
              if (resourceCharset == null) {
                resourceCharset = defaultEncoding;
              }
              if (!fEncoding.equals(resourceCharset)) {
                // if design encoding differ from default encoding we define it explicit
                file.setCharset(fEncoding, new NullProgressMonitor());
              } else {
                file.setCharset(null, new NullProgressMonitor());
              }
            }
          }
          return true;
        }
View Full Code Here

        catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {

            private Map<String, String> _imports = new HashMap<String, String>();
           
            @Override
View Full Code Here

            WGUtils.inToOut(reader, writer, 1024);
        }
        catch (IOException e) {
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {
            private Map<String, String> _imports = new HashMap<String, String>();

            @Override
            public void endVisit(ImportDeclaration node) {
View Full Code Here

TOP

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

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.