Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspace


import org.eclipse.core.runtime.IPath;

@SuppressWarnings("all")
public class PathResolver {
  public Collection<IPath> resolvePaths(final Collection<IPath> paths) {
    IWorkspace _workspace = ResourcesPlugin.getWorkspace();
    final IPathVariableManager pathVariableManager = _workspace.getPathVariableManager();
    int _size = paths.size();
    final List<IPath> result = Lists.<IPath>newArrayListWithCapacity(_size);
    for (final IPath path : paths) {
      {
        URI _uRI = URIUtil.toURI(path);
View Full Code Here


    }
    return Collections.<IPath>unmodifiableCollection(result);
  }
 
  public IPath resolvePath(final IPath path) {
    IWorkspace _workspace = ResourcesPlugin.getWorkspace();
    final IPathVariableManager pathVariableManager = _workspace.getPathVariableManager();
    URI _uRI = URIUtil.toURI(path);
    URI _resolveURI = pathVariableManager.resolveURI(_uRI);
    return URIUtil.toPath(_resolveURI);
  }
View Full Code Here

     * @see ResourcesPlugin#getEncoding()
     */
    public static String getEncoding() {
        // Verify that workspace is not shutting down (see bug
        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=60687)
        final IWorkspace workspace = getWorkspace();
        if (workspace != null) {
            try {
                return workspace.getRoot().getDefaultCharset();
            } catch (final CoreException e) {
                // fails silently and return plugin global encoding if core
                // exception occurs
            }
        }
View Full Code Here

     * @return an <code>IFile</code> object of the given path
     * @throws IOException
     *             if the given path could not be found on the workspace
     */
    private IFile findEclipseRepresentation(final String anOldPath) throws IOException {
        final IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IWorkspaceRoot root = workspace.getRoot();
        final Path p = new Path(anOldPath);
        @SuppressWarnings("deprecation")
        final IFile[] files = root.findFilesForLocation(p);
        if (files == null || files.length != 1) {
            throw new IOException("File not found");
View Full Code Here

   * returns all IProjects in the workspace
   *
   * @return an array of IProject objects
   */
  public static List<IProject> getIProjects() {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot();
    // get all projects in the workspace
    IProject[] projects = root.getProjects();

    return Arrays.asList(projects);
  }
View Full Code Here

   * returns selected IProjects in the workspace
   *
   * @return an array of IProject objects
   */
  public static List<IProject> getIProjects(String[] projectNames) {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot();
    // get all projects in the workspace
    IProject[] projects = root.getProjects();
    List<IProject> projectsSelected = new ArrayList<IProject>();
    for (IProject project : projects) {
      for (String str : projectNames) {
View Full Code Here

   * Initialises instances variables which will be used as sample parameters
   * @throws Exception
   */
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot()
    //get all projects in the workspace
    projects = root.getProjects();
    All: for(IProject project : projects){
      if(project.isNatureEnabled("org.eclipse.jdt.core.javanature")&&project.isOpen()){
        javaProject=JavaCore.create(project);
View Full Code Here

   * Initialises instances variables which will be used as sample parameters
   * @throws Exception
   */
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot()
    //get all projects in the workspace
    projects = root.getProjects();
   
    All: for(IProject tempProject : projects){
      if (tempProject.isNatureEnabled("org.eclipse.jdt.core.javanature")&&tempProject.isOpen()){
View Full Code Here

   * @param hdfsURI
   * @return
   * @throws CoreException
   */
  private IProject createIProject(String name, java.net.URI hdfsURI) throws CoreException {
    final IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IProject project = workspace.getRoot().getProject(name);
    IProjectDescription pd = workspace.newProjectDescription(name);
    pd.setLocationURI(hdfsURI);
    project.create(pd, new NullProgressMonitor());
    project.open(new NullProgressMonitor());
    RepositoryProvider.map(project, HDFSTeamRepositoryProvider.ID);
    return project;
View Full Code Here

        logInfo("starting IvyDE plugin");
        ivyResolveJob = new IvyResolveJob();

        retrieveSetupManager = new RetrieveSetupManager();

        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        workspace.addSaveParticipant(this, retrieveSetupManager);

        colorManager = new ColorManager();
        Display.getDefault().asyncExec(new Runnable() {
            public void run() {
                colorManager.refreshFromStore(getPreferenceStore());
            }
        });

        prefStoreHelper = new IvyDEPreferenceStoreHelper(getPreferenceStore());

        propertyListener = new IPropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent event) {
                try {
                    if (PreferenceConstants.ALL.contains(event.getProperty())) {
                        prefStoreChanged();
                    }
                } catch (JavaModelException e) {
                    MessageDialog.openError(IvyPlugin.getDefault().getWorkbench()
                            .getActiveWorkbenchWindow().getShell(),
                        "Unable to trigger the update the IvyDE classpath containers", e
                                .getMessage());
                }
            }
        };
        getPreferenceStore().addPropertyChangeListener(propertyListener);

        Display.getDefault().asyncExec(new Runnable() {
            public void run() {
                try {
                    console = new IvyConsole();
                    if (prefStoreHelper.isOpenIvyConsoleOnStartup()) {
                        IvyConsoleFactory.showConsole();
                    }
                } catch (RuntimeException e) {
                    // Don't let the console bring down the IvyDE UI
                    logError("Errors occurred starting the Ivy console", e);
                }
            }
        });

        // Listen for project open/close events to auto-update inter-project dependencies
        workspaceListener = new WorkspaceResourceChangeListener();
        workspace.addResourceChangeListener(workspaceListener);
        ivyFileListener = new IvyFileResourceListener();
        workspace.addResourceChangeListener(ivyFileListener, IResourceChangeEvent.PRE_BUILD);

        ivyMarkerManager = new IvyMarkerManager();

        File stateLocation = getStateLocation().toFile();
        ivyAttachementManager = new IvyAttachementManager(new File(stateLocation,
View Full Code Here

TOP

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

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.