Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IContainer


                }
            }          
        }
       
        if (_runtime != null && _webApplication == null) {
            IContainer designContainer = WGADesignStructureHelper.retrieveDesignContainerFromSelection(selection);
            if (designContainer != null) {
                try {
                    Map<String,IContainer> connectedDesigns = _runtime.getConnectedDesignContainers();
                    Iterator<String> dbkeys = connectedDesigns.keySet().iterator();
                    while (dbkeys.hasNext()) {
                        String dbkey = dbkeys.next();
                        IContainer container = connectedDesigns.get(dbkey);
                        if (container != null && container.equals(designContainer)) {
                            if (_webApplication == null) {
                                _webApplication = dbkey;
                            } else {
                                // more than one cs with this design - user must choose one
                                _webApplication = null;
View Full Code Here


  private Combo _combo;

  class NameSorter extends ViewerSorter {
    public int compare(Viewer viewer, Object e1, Object e2) {
      if (e1 instanceof IContainer && e2 instanceof IContainer) {
        IContainer ct1 = (IContainer) e1;
        IContainer ct2 = (IContainer) e2;
        return ct1.getName().toLowerCase().compareTo(ct2.getName().toLowerCase());
      }
      return 0;

    }
View Full Code Here

      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IFile) {
        _file = (IFile) selectedElement;
        if (_file.getFileExtension().equals("properties")) {
          IContainer container = _file.getParent();
          if (container.getName().startsWith("labels_")) {
            Properties props = WGADesignStructureHelper.loadLabel(_file);
            if (!props.isEmpty()) {
              _props = props;
              action.setEnabled(true);
            }
View Full Code Here

               
                            
                Map<String, IContainer> contentDesign = currentRuntime.getConnectedDesignContainers();               
               
                for(String key : contentDesign.keySet()){
                    IContainer currentDesignFolder = contentDesign.get(key);
                    WGADesignStructureHelper helper = new WGADesignStructureHelper(currentDesignFolder);
                    if(helper.isWGADesignResourceOfCurrentDesign(tmlfile)){
                        return key;
                    }
                }  
View Full Code Here

      int matchingSegments = getRuntime().getDesignRoot().getFullPath().matchingFirstSegments(getLocal().getFullPath());     
      return getLocal().getFullPath().removeFirstSegments(matchingSegments).makeRelative().toString();
    } else {
      if (_localState != null && _localState.isDirLink()) {
        String linkName = _localState.getDirLinkName();
        IContainer linkTarget = _localState.getDirLinkTarget();
        int matchingSegments = linkTarget.getFullPath().matchingFirstSegments(getLocal().getFullPath());     
        return new Path(linkName).append(getLocal().getFullPath().removeFirstSegments(matchingSegments)).makeRelative().toString();       
      } else if (getRemote() != null) {
        FSDesignResourceState remoteState = ((WGAFSDesignResourceVariant)getRemote()).getState();
        if (remoteState != null) {
          return remoteState.getPath();
View Full Code Here

      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();   
        if (selectedElement instanceof IProject || selectedElement instanceof IJavaProject) {
          _selectedProject = (IProject) selectedElement;         
        } else if (selectedElement instanceof IContainer) {
          IContainer container = (IContainer) selectedElement;
          if (container.getParent() instanceof IProject &&
              (container.getName().equalsIgnoreCase("designs") || container.getName().equalsIgnoreCase("plugins"))) {
            _selectedProject = container.getProject();           
        }
      }
    }
   
    try {
View Full Code Here

        IFolder tmlFolder = new WGADesignStructureHelper(referer).getTmlRoot();
        IFile fileToCreate = tmlFolder.getFile(new Path(_refPath));
        if (!fileToCreate.exists()) {
          try {
            // mkdir
            IContainer parent = fileToCreate.getParent();
            List<IFolder> foldersToCreate = new ArrayList<IFolder>();
            while (!parent.exists()) {
              if (parent instanceof IFolder) {
                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           
View Full Code Here

        IFolder scriptFolder = helper.getScriptsRoot();
        IFile fileToCreate = scriptFolder.getFile(new Path(_refPath));
        if (!fileToCreate.exists()) {
          try {
            // mkdir
            IContainer parent = fileToCreate.getParent();
            List<IFolder> foldersToCreate = new ArrayList<IFolder>();
            while (!parent.exists()) {
              if (parent instanceof IFolder) {
                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
View Full Code Here

  @Override
  public boolean select(Viewer viewer, Object parentElement, Object element) {   
    _resourceOk = false;
    if (element instanceof IContainer) {
      IContainer container = (IContainer) element;
      try {
        container.accept(new IResourceVisitor() {
          public boolean visit(IResource resource) throws CoreException {
            if (!_resourceOk && resource instanceof IContainer) {
              IContainer container = (IContainer) resource;
              if (isValidLocation(container)) {
                _resourceOk = true;
                return false;
              }
              return true;
            }
            return false;
          }
        });
      } catch (CoreException e) {
        Activator.getDefault().logWarning("Error while searching for valid children in resource " + container.getLocation().toString(), e);
      }   
      return _resourceOk;
    } else {
      return false;
    }
View Full Code Here

 
 
 
 
  public static IFile determineSyncInfo(IContainer container) {   
    IContainer parent = container;
    while (parent instanceof IFolder) {
      parent = parent.getParent();
      IFile syncInfo = parent.getFile(new Path(DesignDirectory.DESIGN_DEFINITION_FILE));
      if (syncInfo.exists()) {
        return syncInfo;
      }
      syncInfo = parent.getFile(new Path(DesignDirectory.SYNCINFO_FILE));
      if (syncInfo.exists()) {
        return syncInfo;
      }
    }
    return null;
View Full Code Here

TOP

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

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.