Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFile


    public Image decorateImage(Image image, Object element) {
       
        DirectAccessCompositeImageDescriptor descriptor = new DirectAccessCompositeImageDescriptor(image);

        if (element instanceof IFile) {
            IFile file = (IFile) element;
           
            if (file.getFileExtension() != null && file.getFileExtension().equals("tml")) {
                if (WGADesignStructureHelper.isDirectAccess(file)) {
                    descriptor.getImageData();
                    return descriptor.createImage();
                }
            }
View Full Code Here


            final List<IResource> resourcesChanged = new ArrayList<IResource>();
          
            event.getDelta().accept(new IResourceDeltaVisitor() {                  
                public boolean visit(IResourceDelta delta) throws CoreException {
                    if (delta.getResource() instanceof IFile) {
                        IFile file = (IFile)delta.getResource();
                        if (file.getFileExtension().equals("tml")) {
                            resourcesChanged.add(file);
                        } else if (file.getFileExtension().equals("xml") && WGADesignStructureHelper.isMetadataFolder(file.getParent())) {
                            resourcesChanged.addAll(Arrays.asList(file.getParent().getParent().members(IResource.FILE)));
                        }
                    } else if (delta.getResource() instanceof IFolder) {
                        IFolder folder = (IFolder) delta.getResource();
                        if (WGADesignStructureHelper.isMetadataFolder(folder)) {
                            resourcesChanged.addAll(Arrays.asList(folder.getParent().members(IResource.FILE)));
View Full Code Here

  public void doSaveAs() {
  }

  public void resourceChanged(IResourceChangeEvent event) {
    try {
      final IFile fRuntimeConfigFile = ((IFileEditorInput)getEditorInput()).getFile();
      final IFile fWGAConfigFile = _wgaRuntime.getWGAConfigFile();
      event.getDelta().accept(new IResourceDeltaVisitor() {

        public boolean visit(IResourceDelta delta) throws CoreException {
          if (delta.getResource().equals(fRuntimeConfigFile)) {
            if (delta.getResource().exists()) {
View Full Code Here

                    public boolean visit(IResource resource) throws CoreException {
                        if(resource instanceof IFolder){
                            return true;
                        }
                        if(resource instanceof IFile){
                            IFile currentFile = (IFile)resource;
                            if(("."+currentFile.getFileExtension()).equals(_filterExtension)){
                                fileList.add(currentFile);
                            }                           
                        }
                        return false;
                    }
View Full Code Here

  }


  public String getText(Object element) {
    if (element instanceof IFile) {
        IFile file = (IFile) element;
      return file.getFullPath().toString();
    } else {
      return null;
    }
  }
View Full Code Here

        for (IResource child : container.members()) {
          List<LocalFSDesignResourceState> childStates = buildFSDesignResourceStates(child, base);
          states.addAll(childStates);
        }
      } else if (resource instanceof IFile) {
        IFile file = (IFile) resource;
        state.setType(FSDesignResourceState.TYPE_FILE);
        state.setLastmodified(file.getLocalTimeStamp());
        try {
          state.setMd5sum(WGUtils.createMD5HEX(file.getContents()));
        } catch (Exception e) {
          WGADesignerPlugin.getDefault().logError("Unable to compute md5 sum of resource '" + file.getLocation().toString() + "'.", e);
        }
      }
    }
    return states;
  }
View Full Code Here

      for (IResource child : container.members()) {
        List<LocalFSDesignResourceState> childStates = buildDirLinkFSDesignResourceStates(linkTarget, linkName, child);
        states.addAll(childStates);
      }
    } else if (resource instanceof IFile) {
      IFile file = (IFile) resource;
      state.setType(FSDesignResourceState.TYPE_FILE);
      state.setLastmodified(file.getLocalTimeStamp());
      try {
        state.setMd5sum(WGUtils.createMD5HEX(file.getContents()));
      } catch (Exception e) {
        WGADesignerPlugin.getDefault().logError("Unable to compute md5 sum of resource '" + file.getLocation().toString() + "'.", e);
      }
    }   
    return states;
  }
View Full Code Here

          } catch (Exception e) {           
          }
        }
                     
        // modify plugin config and open plugin design editor
        IFile syncInfo = new WGADesignStructureHelper(designProject.getDesignFolder()).getSyncInfo();
        WGADesignConfigurationModel model = new WGADesignConfigurationModelWrapper(syncInfo);
       

                model.setVersionCompliance(Activator.DEFAULT_VERSION_COMPLIANCE);
              
View Full Code Here

        }
       
        String param = event.getParameter(PARAM_TMLFilePath);
        if (param != null) {
            Path path = new Path(param);
            IFile tmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
            String dbkey = OpenModulInBrowser.determineContentStoreOfFile(tmlFile);
            if (dbkey == null) {
                throw new ExecutionException("None of the web applications of the current runtime are connected to this design resource.");
            }
            OpenModulInBrowser.openBrowser(dbkey, tmlFile);
View Full Code Here

   * @throws IOException
   *             - when createDefaultIsMissing is true and default config
   *             cannot be created
   */
  public WGAConfiguration retrieveWGAConfig(boolean createDefaultIfMissing) throws IncompatibleWGAConfigVersion, IOException {
    IFile wgaXML = getWGAConfigFile();
    if (wgaXML == null) {
      // this nature is not configured yet
      return null;
    }
    if (!wgaXML.exists()) {
      if (!createDefaultIfMissing) {
        return null;
      } else {
        // create default config
        WGAConfiguration config = WGAConfiguration.createDefaultConfig();
        // int segmentCount =
        // _wgaBase.getLocation().matchingFirstSegments(_luceneRoot.getLocation());
        // IPath relativeLucenePath =
        // _luceneRoot.getLocation().removeFirstSegments(segmentCount);
        // config.getLuceneManagerConfiguration().setPath(relativeLucenePath.toString());
        // config.getDesignConfiguration().getDesignSource(Constants.DESIGNCOL_FILESYSTEM).getOptions().put("path",
        // "../designs");
        Domain defaultDomain = config.getDefaultDomain();
        defaultDomain.setDefaultManager("managers");
        defaultDomain.createFileBasedAuthentication("auth.xml");

        config.getServerOptions().put(WGAConfiguration.SERVEROPTION_SERVER_NAME, getName());
        if (getRootURL() != null) {
          config.getServerOptions().put(WGAConfiguration.SERVEROPTION_ROOT_URL, getRootURL().toString());
        }

        // disable install wizard
        config.setRunWizard(false);
       
        saveWGAConfig(config);
        return config;
      }
    } else {

      synchronized (_wgaConfigLock) {
        FileInputStream wgaXMLStream = null;
        try {
          wgaXMLStream = new FileInputStream(wgaXML.getLocation().toFile());
          WGAConfiguration conf = WGAConfiguration.read(wgaXMLStream);
          return conf;
        } catch (Exception e) {
          IncompatibleWGAConfigVersion notConfigurable = new IncompatibleWGAConfigVersion("Unable to read wga configuration.", e);
          throw notConfigurable;
View Full Code Here

TOP

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

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.