Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspace$ProjectOrder


   */
  private ArrayList determineAffectedPackageFragments(IPath location) throws JavaModelException {
    ArrayList fragments = new ArrayList();
 
    // see if this will cause any package fragments to be affected
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IResource resource = null;
    if (location != null) {
      resource = workspace.getRoot().findMember(location);
    }
    if (resource != null && resource.getType() == IResource.FOLDER) {
      IFolder folder = (IFolder) resource;
      // only changes if it actually existed
      IClasspathEntry[] classpath = this.project.getExpandedClasspath();
View Full Code Here


   */
  public abstract String getMainTaskName();

  protected ISchedulingRule getSchedulingRule() {
    IResource resource = getCompilationUnit().getResource();
    IWorkspace workspace = resource.getWorkspace();
    return workspace.getRuleFactory().modifyRule(resource);
  }
View Full Code Here

        IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(Workspace.CNFDIR);
        project.open(monitor);
    }

    protected void importCnf(IProgressMonitor monitor) throws CoreException {
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IPath location = operation.getLocation();
        IContainer container = workspace.getRoot().getContainerForLocation(location);
        if (container == null) {
            IProjectDescription projDesc = workspace.loadProjectDescription(location.append(IProjectDescription.DESCRIPTION_FILE_NAME));
            IProject project = workspace.getRoot().getProject(Workspace.CNFDIR);
            project.create(projDesc, monitor);
            project.open(monitor);
        } else if (container.getType() == IResource.PROJECT) {
            IProject project = (IProject) container;
            if (project.exists()) {
View Full Code Here

     */
    private final class Validator implements Observer {

        public void update(Observable o, Object arg) {

            final IWorkspace workspace = JavaPlugin.getWorkspace();

            final String name = null;// fNameGroup.getName();

            // check whether the project name field is empty
            if ((name == null) || (name.length() == 0)) {
                setErrorMessage(null);
                setMessage("Enter a project name.");
                setPageComplete(false);
                return;
            }

            // check whether the project name is valid
            @SuppressWarnings("unused")
            final IStatus nameStatus = workspace.validateName(name, IResource.PROJECT);
            if (!nameStatus.isOK()) {
                setErrorMessage(nameStatus.getMessage());
                setPageComplete(false);
                return;
            }

            // check whether project already exists
            final IProject handle = workspace.getRoot().getProject(name);
            if (handle.exists()) {
                setErrorMessage("A project with this name already exists.");
                setPageComplete(false);
                return;
            }
View Full Code Here

        if (!PROTOCOL.equals(protocol))
            throw new MalformedURLException("Unsupported protocol");

        IPath path = new Path(url.getPath());

        IWorkspace workspace = (IWorkspace) workspaceTracker.getService();
        if (workspace == null)
            throw new IOException("Workspace is not available");

        IPath workspaceLocation = workspace.getRoot().getLocation();
        if (workspaceLocation == null)
            throw new IOException("Cannot determine workspace location.");

        IPath location = workspaceLocation.append(path);
View Full Code Here

        } catch (final Exception e) {
            return null;
        }

        IPath bundlePath = path;
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IWorkspaceRoot root = workspace.getRoot();
        IResource resource = root.findMember(path);
        if (resource != null) {
            bundlePath = resource.getLocation();
        }
View Full Code Here

        if (suggestedVersion != null) {
            result.add(new IMarkerResolution() {
                @Override
                public void run(IMarker marker) {
                    final IFile file = (IFile) marker.getResource();
                    final IWorkspace workspace = file.getWorkspace();
                    try {
                        workspace.run(new IWorkspaceRunnable() {
                            @Override
                            public void run(IProgressMonitor monitor) throws CoreException {
                                String input = "version " + suggestedVersion;
                                ByteArrayInputStream stream = new ByteArrayInputStream(input.getBytes());
                                file.setContents(stream, false, true, monitor);
View Full Code Here

    }

    public static IResource toWorkspaceResource(File file) {
        IPath path = new Path(file.toString());

        final IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IWorkspaceRoot workspaceRoot = workspace.getRoot();
        IPath workspacePath = workspaceRoot.getLocation();

        if (workspacePath.isPrefixOf(path)) {
            final IPath relativePath = path.removeFirstSegments(workspacePath.segmentCount());
            IResource resource;
View Full Code Here

        } catch (final Exception e) {
            return null;
        }

        IPath bundlePath = path;
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IWorkspaceRoot root = workspace.getRoot();
        IResource resource = root.findMember(path);
        if (resource != null) {
            bundlePath = resource.getLocation();
        }
View Full Code Here

        final String suggestedVersion = marker.getAttribute(PROP_SUGGESTED_VERSION, null);
        if (suggestedVersion != null) {
            result.add(new IMarkerResolution() {
                public void run(IMarker marker) {
                    final IFile file = (IFile) marker.getResource();
                    final IWorkspace workspace = file.getWorkspace();
                    try {
                        workspace.run(new IWorkspaceRunnable() {
                            public void run(IProgressMonitor monitor) throws CoreException {
                                String input = "version " + suggestedVersion;
                                ByteArrayInputStream stream = new ByteArrayInputStream(input.getBytes());
                                file.setContents(stream, false, true, monitor);
                            }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IWorkspace$ProjectOrder

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.