Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IResource


      _labelFilename = markerAnnotation.getMarker().getAttribute(TMLLabelTagValidator.ATTRIBUTE_LABELFILENAME, "general");
      _labelKey = markerAnnotation.getMarker().getAttribute(TMLLabelTagValidator.ATTRIBUTE_LABELKEY, "")
    }

    public void apply(IDocument document) {
      IResource resource = _markerAnnotation.getMarker().getResource();
      if (resource instanceof IFile) {
        IFile referer = (IFile) resource;
        WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);
       
        try {
View Full Code Here


   * @param tmlfile
   * @return
   */
  public static String determineMediaKey(IFile tmlFile) {
    if (tmlFile != null) {
      IResource parent = tmlFile.getParent();
      while (parent != null && parent.getParent() != null && !parent.getParent().getName().equals("tml")) {
        parent = parent.getParent();
      }
      if (parent != null) {
        return parent.getName().toLowerCase();
      }
    }
    return null;
  }
View Full Code Here

   * @return
   */
 
  public static String getScriptTypeOf(IContainer selectedContainer) {
    if(selectedContainer instanceof IFolder){
       IResource resourceVar = selectedContainer;
       while(resourceVar!=null && resourceVar instanceof IFolder){
         if(resourceVar.getParent().getName().equals("scripts") &&  isDesignFolder(resourceVar.getParent().getParent())){
           return resourceVar.getName();
         }
         resourceVar = resourceVar.getParent();
      
    }
    return null;
  }
View Full Code Here

   * @param container
   * @return true/false
   */
  public static boolean isValidScriptLocation(IContainer container){
     if(container instanceof IFolder){
       IResource resourceVar = container;
       while(resourceVar!=null && resourceVar instanceof IFolder){
         if(resourceVar.getParent().getName().equals("scripts") &&  isDesignFolder(resourceVar.getParent().getParent())){
           return true;
         }
         resourceVar = resourceVar.getParent();
       }      
     }  
     return false;
   }
View Full Code Here

  public static IFile createPortlet(List<String> modes, String portletName, IFolder parent, String header) throws CoreException {
      if(header==null){
          header ="";
      }
     
    IResource portletFolderResource = FileUtils.createFolder(parent, portletName);
    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");
View Full Code Here

    super(title);
    setTitle(title);
    setPageComplete(false);
    setDescription(description);
    if (selection != null && selection.getFirstElement() instanceof IResource) {
      IResource selectedResource = (IResource) selection.getFirstElement();

      if (selectedResource instanceof IContainer) {
        _selectedContainer = (IContainer) selection.getFirstElement();
      }
      if(selectedResource instanceof IFile){
View Full Code Here

    super(title);
    setTitle(title);
    setPageComplete(false);
    setDescription(description);
    if (selection != null && selection.getFirstElement() instanceof IResource) {
      IResource selectedResource = (IResource) selection.getFirstElement();

      if (selectedResource instanceof IContainer) {
        _selectedContainer = (IContainer) selection.getFirstElement();
      }
      if(selectedResource instanceof IFile){
View Full Code Here

      public boolean visit(IResourceDelta delta) {

        if (delta.getKind() != IResourceDelta.REMOVED)
          return true;

        IResource resource = delta.getResource();

        if (resource.getType() == IResource.FILE) {
          removed.add(resource);
        }
        return true;
      }
    };

    final ArrayList<IResource> added = new ArrayList<IResource>();
    IResourceDeltaVisitor avisitor = new IResourceDeltaVisitor() {
      public boolean visit(IResourceDelta delta) {

        if (delta.getKind() != IResourceDelta.ADDED)
          return true;

        IResource resource = delta.getResource();

        if (resource.getType() == IResource.FILE) {
          added.add(resource);
        }
        return true;
      }
    };
View Full Code Here

    super(title);
    setTitle(title);
    setPageComplete(false);
    setDescription(description);
    if (selection != null && selection.getFirstElement() instanceof IResource) {
      IResource selectedResource = (IResource) selection.getFirstElement();
      if (selectedResource instanceof IContainer) {
        _selectedContainer = (IContainer) selection.getFirstElement();
      }
      if(selectedResource instanceof IFile){
        _selectedContainer = ((IFile) selection.getFirstElement()).getParent();
View Full Code Here

  }

  @Override
  public List<IStatus> validate() {
    List<IStatus> messages = new ArrayList<IStatus>();
    IResource selected = getSelectedResource();
    if (selected == null || !(selected instanceof IContainer) || !getFilter().isValidLocation((IContainer)selected)) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please select a valid design folder."));
    }
    return messages;
  }
View Full Code Here

TOP

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

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.