Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFile.create()


            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


            }
            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 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
   
   
View Full Code Here

     
      IFile outerLayoutFile = html.getFile(new Path(outerLayoutName + ".tml"));
      InputStream outerLayoutTemplate = null;
      try {
        outerLayoutTemplate = Plugin.getDefault().getResourceAsStream("resources/templates/defaultOuterLayout.template");
        outerLayoutFile.create(outerLayoutTemplate, true, new NullProgressMonitor());
      } finally {
        if (outerLayoutTemplate != null) {
          try {
            outerLayoutTemplate.close();
          } catch (IOException e) {
View Full Code Here

     
      IFile innerLayoutFile = inner.getFile(innerLayoutName + ".tml");
      InputStream innerLayoutTemplate = null;
      try {
        innerLayoutTemplate = Plugin.getDefault().getResourceAsStream("resources/templates/defaultInnerLayout.template");       
        innerLayoutFile.create(innerLayoutTemplate, true, new NullProgressMonitor());
      } finally  {
        if (innerLayoutTemplate != null) {
          try {
            innerLayoutTemplate.close();
          } catch (IOException e) {
View Full Code Here

      tmlFile = _tmlModulePage.getTmlFile();
      boolean isDirectAccess = _tmlModulePage.getIsTmlFileDirectAccess();
      boolean isCachable = _tmlModulePage.getIsTmlFileCachable();
     
          String header = Plugin.getDefault().getHeaderFileMap().get(Plugin.HEADER_TML_MODUL).getHeaderForProject(tmlFile.getProject())
          tmlFile.create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());   
     
      if(isCachable || isDirectAccess){
        TMLFileMetadataModel model = new TMLFileMetadataModel(tmlFile);
        model.setCachable(isCachable);
        model.setDirectAccess(isDirectAccess);
View Full Code Here

  public boolean performFinish() {
    IFile target = _modulePage.getTargetFile();
        String header = Plugin.getDefault().getHeaderFileMap().get(_fileExtToHeader.get(target.getFileExtension())).getHeaderForProject(target.getProject());  
    if (_modulePage.getCopyFromFile() != null) {
      try {
        target.create(new ByteArrayInputStream((header + "\n").getBytes()), true, new NullProgressMonitor());
        target.appendContents(Plugin.getDefault().getResourceAsStream(_modulePage.getCopyFromFile()), true, false, new NullProgressMonitor());     
      } catch (CoreException e) {
        Plugin.getDefault().logError("Unable to create file " + target.getLocation(), e);
        return false;
      } catch (IOException e) {
View Full Code Here

        Plugin.getDefault().logError("Unable to cpoy from template in file " + target.getLocation(), e);
        return false;
      }
    }else{
      try {     
        target.create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());
      } catch (CoreException e) {
        Plugin.getDefault().logError("Unable to create file " + target.getLocation(), e);
        return false;
      }
    }
View Full Code Here

      } else {
        try {
          monitor.beginTask("Saving document", 2000);
          ContainerCreator creator = new ContainerCreator(file.getWorkspace(), file.getParent().getFullPath());
          creator.createContainer(new SubProgressMonitor(monitor, 1000));
          file.create(stream, false, new SubProgressMonitor(monitor, 1000));
        }
        finally {
          monitor.done();
        }
      }
View Full Code Here

            throws CoreException {
        String fileName = "org/drools/ide/resource/Rules.java.drl.template";
        IFolder folder = project.getProject().getFolder("src/rules");
        IFile file = folder.getFile("Rules.java.drl");
        InputStream inputstream = getClass().getClassLoader().getResourceAsStream(fileName);
        file.create(inputstream, true, null);
    }

    protected void initializeDefaultPageImageDescriptor() {
        ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(
                "org.eclipse.ui.ide", "icons/full/wizban/newprj_wiz.gif");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.