Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IContainer


  }

  private static IPath computeNewLinkTarget(DirlinkRefactoringInformation info) {
    if (info.getArguments() instanceof RenameArguments) {
      RenameArguments arguments = (RenameArguments) info.getArguments();
      IContainer currentDirLinkTarget = WGADesignStructureHelper.resolveDirLink(info.getFile());
     
      // compute newTargetPath up to renamed resource
      IPath newTarget = info.getElement().getLocation().removeLastSegments(1).append(arguments.getNewName());
     
      // build full target path
      int segments = currentDirLinkTarget.getLocation().matchingFirstSegments(newTarget);
      newTarget = newTarget.append(currentDirLinkTarget.getLocation().removeFirstSegments(segments + 1));
      return newTarget;
    }else if(info.getArguments() instanceof MoveArguments){
      MoveArguments moveArguments = (MoveArguments) info.getArguments();
      IContainer currentDirLinkTarget = WGADesignStructureHelper.resolveDirLink(info.getFile());
      if(moveArguments.getDestination() instanceof IContainer){
        IContainer destinationContainer = (IContainer)moveArguments.getDestination();
       
        IPath newTarget = destinationContainer.getLocation().append(info.getElement().getName());   
       
        int segments = currentDirLinkTarget.getLocation().matchingFirstSegments(((IFolder)info.getElement()).getLocation());       
       
        newTarget = newTarget.append(currentDirLinkTarget.getLocation().removeFirstSegments(segments));
     
View Full Code Here


  }

  protected void updateOKStatus() {
    updateStatus(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please select a Design or Plugin"));
    if (_treeViewer.getTree().getSelection().length>0 && _treeViewer.getTree().getSelection()[0] != null) {
      IContainer treeSelection = (IContainer) _treeViewer.getTree().getSelection()[0].getData();
      if (WGADesignStructureHelper.isDesignFolder(treeSelection)) {
        _target = treeSelection;
        updateStatus(new Status(Status.OK, WGADesignerPlugin.PLUGIN_ID, ""));
      }
    }
View Full Code Here

  private IContainer _target;

  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

  }

  protected void updateOKStatus() {
    if (_treeViewer.getTree().getSelection().length > 0 && _treeViewer.getTree().getSelection()[0] != null) {
      _combo.setEnabled(true);
      IContainer treeSelection = (IContainer) _treeViewer.getTree().getSelection()[0].getData();

      if (WGADesignStructureHelper.isDesignPluginFolder(treeSelection)) {
        _combo.setText("plugin");
      } else if (WGADesignStructureHelper.isDesignFolder(treeSelection)) {
        _combo.setText("design");
        _combo.setEnabled(false);
      }

      _linkNameText.setText(treeSelection.getProject().getName());

    }else{
      updateStatus(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please select a Design or Plugin"));
    }
  }
View Full Code Here

    TreeItem[] selections = _treeViewer.getTree().getSelection();
    updateStatus(new Status(Status.OK, WGADesignerPlugin.PLUGIN_ID, ""));
    if (selections.length>0 && selections != null ) {
      Object selection = selections[0].getData();
      if (selection instanceof IContainer) {
        IContainer selectedContainer = (IContainer) selection;
        if (WGADesignStructureHelper.isDesignFolder(selectedContainer)) {

          String target = "designs";

          if (_combo.getText().equals("design")) {
View Full Code Here

      try {           
        WebApplication app = _webAppModel.getBeans().get(_tblWebApplications.getTable().getSelectionIndex());           
        Map<String, IContainer> connectedDesigns;
        try {
          connectedDesigns = _model.getWgaRuntime().getConnectedDesignContainers();
          IContainer design = connectedDesigns.get(app.getContentStore().getKey())
          if (design !=null && design.exists()){
            WGADesignStructureHelper helper = new WGADesignStructureHelper(design);
            WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), helper.getSyncInfo(), ExternalResourceIDs.EDITOR_WGA_DESIGN);
          }
          else {
            MessageDialog.openWarning(getSite().getShell(), "Unable to determine design", "Unable to determine design for application '" + app.getContentStore().getKey() + "'.");   
View Full Code Here

  }

  @Override
  protected boolean initialize(Object element) {
    if (element instanceof IContainer) {
      IContainer container = (IContainer) element;
      try {
        _refactoringInformations = RefactoringManager.getAffectedResources(container, getArguments());
      } catch (Exception e) {
        _refactoringStatus .addEntry(new  RefactoringStatusEntry(RefactoringStatus.ERROR,"Unable to gather refactoring information. See error log for details. Essential refactoring operations will be skipped. Workspace structure might get invalid."));
        WGADesignerPlugin.getDefault().logError("Unable to gather refactoring information.", e);         
View Full Code Here

  }

  @Override
  protected boolean initialize(Object element) {
    if (element instanceof IContainer) {
      IContainer container = (IContainer) element;
      try {
        _refactoringInformations  = RefactoringManager.getAffectedResources(container, getArguments());
      } catch (Exception e) {
        _refactoringStatus.addEntry(new  RefactoringStatusEntry(RefactoringStatus.ERROR,"Unable to gather refactoring information. See error log for details. Essential refactoring operations will be skipped. Workspace structure might get invalid."));
        WGADesignerPlugin.getDefault().logError("Unable to gather refactoring information.", e);         
View Full Code Here

  @Override
  public boolean select(Viewer viewer, Object parentElement, Object element) {

    if (element instanceof IContainer) {
      IContainer container = (IContainer) element;
      Iterator<IContainer> designs = _designResources.iterator();
      while (designs.hasNext()) {
        IContainer design = designs.next();
        if (design.getLocation().equals(container.getLocation()) || container.getLocation().isPrefixOf(design.getLocation())) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

                for (int i = 0; i < sourceLength; i++) {
                    IPath sourcePath = new Path(sourceFolders[i]);
                    int segmentCount = sourcePath.segmentCount();
                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
                                sourcePath.segment(j)));
                            if (!folder.exists()) {
                                folder.create(true, true, null);
                            }
                            container = folder;
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.