Examples of BPListElement


Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

    }

    List<BPListElement> buildpathEntries = new ArrayList<BPListElement>();
    if (buildPath != null) {
      for (IBuildpathEntry buildpathEntry : buildPath) {
        BPListElement createFromExisting = BPListElement.createFromExisting(buildpathEntry,
                scriptProject);
        if (createFromExisting.getBuildpathEntry().getEntryKind() != IBuildpathEntry.BPE_SOURCE) {
          buildpathEntries.add(createFromExisting);
        }
      }
    }
    IBuildpathEntry newSourceEntry = DLTKCore.newSourceEntry(srcFolder.getFullPath());
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

 
  @Override
  protected IWizard createWizard() {
   
    BPListElement elem = new BPListElement(scriptProject, IBuildpathEntry.BPE_SOURCE, false);
   
    ComposerProject composerProject = new ComposerProject(scriptProject.getProject());
    IPath path = scriptProject.getPath().append(composerProject.getVendorDir());
    elem.setPath(path);
   
    IEclipsePreferences projectPreferences = ComposerPlugin.getDefault().getProjectPreferences(scriptProject.getProject());
    String stored = projectPreferences.get(ComposerPreferenceConstants.BUILDPATH_INCLUDES_EXCLUDES, null);
   
    if (stored != null) {
      IBuildpathEntry buildpathEntry = scriptProject.decodeBuildpathEntry(stored);
      for (IPath includePath : buildpathEntry.getInclusionPatterns()) {
        elem.addToInclusion(path.append(includePath));
      }
      for (IPath excludePath : buildpathEntry.getExclusionPatterns()) {
        elem.addToExclusions(path.append(excludePath));
      }
    }
   
    return wizard = new BuildPathExclusionWizard(new BPListElement[]{}, elem);
  }
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

  @Override
  @SuppressWarnings("unchecked")
  protected void applyChanges() {
   
    List<BPListElement> elements = wizard.getModifiedElements();
    BPListElement element = (BPListElement) elements.get(0);
    IBuildpathEntry buildpathEntry = element.getBuildpathEntry();
   
    if (buildpathEntry instanceof BuildpathEntry) {
      BuildpathEntry entry = (BuildpathEntry) buildpathEntry;
      String encodeBuildpathEntry = scriptProject.encodeBuildpathEntry(entry);
      IEclipsePreferences projectPreferences = ComposerPlugin.getDefault().getProjectPreferences(scriptProject.getProject());
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

      CoreUtility.createFolder(utilsFolder, true, true, new SubProgressMonitor(monitor, 1));
    }

    List<BPListElement> buildpathEntries = new ArrayList<BPListElement>();
    for (IBuildpathEntry buildpathEntry : fSecondPage.getRawBuildPath()) {
      BPListElement createFromExisting = BPListElement.createFromExisting(buildpathEntry,
              fSecondPage.getScriptProject());
      if (createFromExisting.getBuildpathEntry().getEntryKind() != IBuildpathEntry.BPE_SOURCE) {
        buildpathEntries.add(createFromExisting);
      }
    }
    IBuildpathEntry newSourceEntry = DLTKCore.newSourceEntry(srcFolder.getFullPath());
    buildpathEntries.add(BPListElement.createFromExisting(newSourceEntry,
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

    fModifiedElements = new HashSet();
    fInsertedElements = new HashSet();
    fNonExistingFolders = new Hashtable();

    for (int i = 0; i < existingElements.length; i++) {
      BPListElement cur = existingElements[i];
      if (cur.getResource() == null || !cur.getResource().exists()) {
        addFakeFolder(fScriptProject.getProject(), cur);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

        return result;
      }

      protected Object createFolder(final IContainer container) {
        final Object[] result = new Object[1];
        final BPListElement newElement = new BPListElement(
            fScriptProject, IBuildpathEntry.BPE_SOURCE, false);
        final AddSourceFolderWizard wizard = newSourceFolderWizard(
            newElement, fExistingElements, container);
        AbstractOpenWizardAction action = new AbstractOpenWizardAction() {
          protected INewWizard createWizard() throws CoreException {
            return wizard;
          }
        };
        action.addPropertyChangeListener(new IPropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(IAction.RESULT)) {
              if (event.getNewValue().equals(Boolean.TRUE)) {
                result[0] = addFakeFolder(
                    fScriptProject.getProject(), newElement);
              } else {
                wizard.cancel();
              }
            }
          }
        });
        action.run();
        return result[0];
      }
    };
    dialog.setExisting(existingContainers.toArray());
    dialog.setTitle(title);
    dialog.setMessage(message);
    dialog.addFilter(filter);
    dialog.setInput(fScriptProject.getProject().getParent());
    dialog.setInitialFocus(fScriptProject.getProject());

    if (dialog.open() == Window.OK) {
      Object[] elements = dialog.getResult();
      for (int i = 0; i < elements.length; i++) {
        IResource res = (IResource) elements[i];
        fInsertedElements.add(new BPListElement(fScriptProject,
            IBuildpathEntry.BPE_SOURCE, res.getFullPath(), res,
            false));
      }

      if (fExistingElements.length == 1) {
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

    if (newBuildpath == null) {
      newBuildpath = getDefaultBuildpath(jproject);
    }
    List exportedEntries = new ArrayList();
    for (int i = 0; i < newBuildpath.size(); i++) {
      BPListElement curr = (BPListElement) newBuildpath.get(i);
      if (curr.isExported()
          || curr.getEntryKind() == IBuildpathEntry.BPE_SOURCE) {
        exportedEntries.add(curr);
      }
    }
    // inits the dialog field
    fBuildPathDialogField.enableButton(project.exists());
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

  private String getEncodedSettings() {
    StringBuffer buf = new StringBuffer();
    int nElements = fBuildPathList.getSize();
    buf.append('[').append(nElements).append(']');
    for (int i = 0; i < nElements; i++) {
      BPListElement elem = (BPListElement) fBuildPathList.getElement(i);
      elem.appendEncodedSettings(buf);
    }
    return buf.toString();
  }
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

  public IBuildpathEntry[] getRawBuildPath() {
    List elements = fBuildPathList.getElements();
    int nElements = elements.size();
    IBuildpathEntry[] entries = new IBuildpathEntry[elements.size()];
    for (int i = 0; i < nElements; i++) {
      BPListElement currElement = (BPListElement) elements.get(i);
      entries[i] = currElement.getBuildpathEntry();
    }
    return entries;
  }
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement

          && sourceFolderName.length() > 0) {
        srcFolder = jproj.getProject().getFolder(sourceFolderName);
      } else {
        srcFolder = jproj.getProject();
      }
      list.add(new BPListElement(jproj, IBuildpathEntry.BPE_SOURCE,
          srcFolder.getFullPath(), srcFolder, false));
    }
    if (DLTKCore.DEBUG) {
      System.err.println("Add default library"); //$NON-NLS-1$
    }
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.