Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IProject


  }

  @Override
  public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    super.init(site, input);
    IProject project = ((IFileEditorInput)input).getFile().getProject();
    try {
      if (project.hasNature(WGADesignerPlugin.NATURE_WGA_RUNTIME)) {
        _wgaRuntime = (WGARuntime) project.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
        setPartName("Runtime (" + _wgaRuntime.getName() + ")");
        _model = new WGARuntimeConfigurationModel();
        try {         
          _model.init(_wgaRuntime);
        } catch (IncompatibleWGAConfigVersion e) {
View Full Code Here


        }
        else {
            if (!_actionGroup.getWorkingSet().isEmpty()) {
                for (IAdaptable current : _actionGroup.getWorkingSet().getElements()) {
                    if (current instanceof IProject) {
                        IProject currentProject = (IProject) current;
                        _projectsInWorkingSet.add(currentProject);
                    }
                }
            }
            else if(_actionGroup.getWorkingSet().isEmpty() && _actionGroup.getWorkingSet().isAggregateWorkingSet()){
View Full Code Here

    if (_selection instanceof IStructuredSelection) {
      IStructuredSelection treeSel = (IStructuredSelection) _selection;
      Object selectedElement = treeSel.getFirstElement();

      if (selectedElement instanceof IResource) {
        IProject selectedRuntimeProject = ((IResource)selectedElement).getProject();
        try {
          _selectedRuntime = (WGARuntime) selectedRuntimeProject.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
        } catch (CoreException e) {
          WGADesignerPlugin.getDefault().logError("This project does not exist. This project is not open. The project nature extension could not be found.", e);
        }
      }
    }
View Full Code Here

    }
    return resource;
  }
   
  public static IContainer retrieveVirtualPluginRoot(WGARuntime runtime) {
      IProject project = runtime.getProject();
      return project.getFolder("plugins");
  }
View Full Code Here

  }

  public boolean performFinish() {
    //WGADesignStructureHelper.createDirklink(targetFolder, (IContainer) _treeViewer.getTree().getSelection()[0].getData(), _linkNameText.getText());
   
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(_page.getPluginName());
    if (project != null && project.exists()) {
      String message = "A project with name '" + project.getName() + "' already exists in the workspace.";
      WorkbenchUtils.showErrorDialog(getShell(), "Plugin creation failed", message);
      return false;
    } else {
      try {
        // create new project
View Full Code Here

        }
    
       
        if (selection instanceof IResource){
            IResource resource = (IResource) selection;
            IProject project = resource.getProject();
            IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
          
           
           
            for(IWorkingSet currentSet : workingSets){
View Full Code Here

  }


  public boolean performFinish() {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();   
    IProject project = root.getProject(_page.getDesignName());
   
    if(!project.exists()){
      try {               
        WGADesign design = WGADesignFactory.createDesign(project, _page.getTemplate());
               
        try {
          WGADesignStructureHelper helper = new WGADesignStructureHelper(design.getDesignFolder());
          WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(helper.getSyncInfo()));
          WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(design.getDesignFolder()));
        } catch (Exception e) {       
        }
       
        return true;
      } catch (CoreException e) {
        WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), getShell(), "Design creation failed", "Unable to create new project '" + project.getName() + "'.", e);
      }     
    } else {
      WorkbenchUtils.showErrorDialog(getShell(), "Design creation failed", "A project with name '" + project.getName() + "' already exists in the workspace.");
    }
    return false;
   
  }
View Full Code Here

  protected void doFinish(String runtimeName, WGADeployment deployment, IProgressMonitor monitor, List<String> workingSetsToAddTo) throws CoreException {
    monitor.beginTask("Creating WGA runtime '" + runtimeName + "'", 5);
   
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();   
   
    IProject project = root.getProject(runtimeName);
    if (project.exists()) {
      throwCoreException("A project with name '" + runtimeName + "' already exists in the workspace.");
    } else {
      // create project     
      project.create(new SubProgressMonitor(monitor, 1));     
      project.open(new SubProgressMonitor(monitor, 1));
     
      JDTUtils.addNature(project, WGADesignerPlugin.NATURE_WGA_RUNTIME);     
     
      _wgaRuntime = (WGARuntime) project.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
      _wgaRuntime.getConfiguration().setWgaDistribution(deployment.getName());
      _wgaRuntime.flushConfig();
      monitor.worked(1);
     
           if(workingSetsToAddTo!=null && workingSetsToAddTo.size()>0){
               List<IWorkingSet> workingSets = new ArrayList<IWorkingSet>();//workingSetsToAddTo.size()              
               for(String currentWorkingSet : workingSetsToAddTo){
                   if(!currentWorkingSet.equals("")){
                       workingSets.add(PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(currentWorkingSet));
                   }
                  
               }
               PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(_wgaRuntime.getProject(), workingSets.toArray(new IWorkingSet[0]));
           }
     
      // configure tomcat
      try {
        Map<String,String> variables = new HashMap<String,String>();
        TomcatUtils.getInstance().initConfDir(_wgaRuntime.getCatalinaConf().getLocation().toFile(), variables);       
        monitor.worked(1);
      } catch (IOException e) {
        throwCoreException(e.getMessage(), e);
      }  
     

      project.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1));
    }
  }
View Full Code Here

      StructuredSelection treeSel = (StructuredSelection) _selection;
      Object selectedElement = treeSel.getFirstElement();

      if (selectedElement instanceof IResource) {
        IResource resource = (IResource) selectedElement;
        IProject selectedRuntimeProject = resource.getProject();
        try {
          _selectedRuntime = (WGARuntime) selectedRuntimeProject.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
        } catch (CoreException e) {
          WGADesignerPlugin.getDefault().logError("This project does not exist. This project is not open. The project nature extension could not be found.", e);
        }
      }     
    }
View Full Code Here

    if (getRuntime() != null && getRuntime().hasPlugin(pluginName)) {
      applyStatus("A plugin with name '" + pluginName + "' already exists in runtime '" + getRuntime().getName() + "'.", IStatus.ERROR);
      setPageComplete(false);
      return;
    }
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(pluginName);
    if (project != null && project.exists()) {
      applyStatus("A project with name '" + pluginName + "' already exists in the workspace.", IStatus.ERROR);
      setPageComplete(false);
      return;
    }
   
View Full Code Here

TOP

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

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.