Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IContainer


 
  //TODO put into abstract class ?
  public void init(IWorkbench workbench, IStructuredSelection selection) {   
    _selection = selection;
    if(selection.getFirstElement() instanceof IContainer){
      IContainer container =  (IContainer)selection.getFirstElement();     
      if(WGADesignStructureHelper.isValidPortletLocation((container))){
        _portletValidFolderSelected  = true;
      }
    }else if(selection.getFirstElement() instanceof IFile){
      IFile file = (IFile) selection.getFirstElement();
View Full Code Here


  }
 
  @Override
  public boolean performFinish() {
    try {
      IContainer designRoot = (IContainer) _designFolderSelectionPage.getSelectedResource();
      String outerLayoutName = _layoutPage.getOuterLayoutName();
      String innerLayoutName = _layoutPage.getInnerLayoutName();
     
      WGADesignStructureHelper helper = new WGADesignStructureHelper(designRoot);
      IFolder html = helper.getTmlRoot().getFolder("html");
View Full Code Here

  @Override
  public List<IStatus> validate() {
    List<IStatus> list = new ArrayList<IStatus>();
    if (getTreeViewer().getTree().getSelectionCount() > 0) {
      IContainer treeSelection = (IContainer) getTreeViewer().getTree().getSelection()[0].getData();
      if (!WGADesignStructureHelper.isValidPortletLocation(treeSelection)) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "You cannot create a portlet here. Please select a folder below the tml folder."));
      }
    } else {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is no designfolder in workspace."));
View Full Code Here

   
    if(container.isAccessible()){
      currentIResources = container.members();
      for (int i = 0; i < currentIResources.length; i++) {
        if (currentIResources[i] instanceof IContainer) {
          IContainer current = (IContainer) currentIResources[i];
          insertFiles(current, path);
        }
        if (currentIResources[i] instanceof IFile) {
          IFile ifile = (IFile) currentIResources[i];
          addIntoDB(ifile);
View Full Code Here

  }

  public Set<String> getTMLpaths(IFile file, String medium) {
    Set<String> resources = new HashSet<String>();

    IContainer design = new WGADesignStructureHelper(file).getDesignRoot();
    if (design != null) {

      String expression = "SELECT * FROM references WHERE Project = ? AND FileType = ? AND Medium = ? AND Path Like ?";
      PreparedStatement st = null;
      ResultSet rs = null;
      try {
        st = _conn.prepareStatement(expression);
        st.setString(1, file.getProject().getName());
        st.setString(2, "tml");
        st.setString(3, medium);
        st.setString(4, design.getProjectRelativePath() + "/tml/%");

        rs = st.executeQuery();

        while (rs.next()) {
          String resource = rs.getString("Path");
          if (!resource.endsWith("/")) {
            resource += "/";
          }
          resource += rs.getString("File");
          resources.add(resource);
        }
      } catch (SQLException e) {
        Plugin.getDefault().logError("Unable to lookup tml paths for project '" + file.getProject().getName() + "' and designRoot '" + design.getLocation().toString() + "'.", e);
      } finally {
        cleanupSQLResources(st, rs);
      }
    }

View Full Code Here

  }

  public Set<String> getMediumKeys(IFile file) {
    IProject project = file.getProject();
    Set<String> resources = new HashSet<String>();
    IContainer design = new WGADesignStructureHelper(file).getDesignRoot();
    String expression = "SELECT distinct Medium FROM references WHERE Project = ? AND Path Like ?";
   
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = _conn.prepareStatement(expression);
      st.setString(1, project.getName());
      st.setString(2, "designs/" + design.getName() + "/tml/%");

      rs = st.executeQuery();

      while (rs.next()) {
        if (!rs.getString("Medium").equals("") && !rs.getString("Medium").startsWith(".")) {
          resources.add(rs.getString("Medium"));
        }

      }
    } catch (SQLException e) {
      Plugin.getDefault().logError("Unable to lookup medium keys for project '" + project.getName() + "' and designRoot '" + design.getLocation().toString() + "'.", e);
    } finally {
      cleanupSQLResources(st, rs);
    }
    return resources;
  }
View Full Code Here

  }
  //TODO put into abstract class ?
  public void init(IWorkbench workbench, IStructuredSelection selection) {   
    _selection = selection;
    if(selection.getFirstElement() instanceof IContainer){
      IContainer container =  (IContainer)selection.getFirstElement();     
      if(WGADesignStructureHelper.isValidTMLLocation(container)){
        _tmlValidFolderSelected  = true;
      }
    }else if(selection.getFirstElement() instanceof IFile){
      IFile file = (IFile) selection.getFirstElement();
View Full Code Here

  }

  public void init(IWorkbench workbench, IStructuredSelection selection) {
    _selection = selection;
    if (selection.getFirstElement() instanceof IContainer) {
      IContainer container = (IContainer) selection.getFirstElement();
      if (WGADesignStructureHelper.isValidScriptLocation(container)) {
        _scriptValidFolderSelected = true;
      }
    } else if (selection.getFirstElement() instanceof IFile) {
      IFile file = (IFile) selection.getFirstElement();
View Full Code Here

    if (_txtPortletName.getText().equals("")) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please specify a name for the portlet"));
    } else if (!WGADesignStructureHelper.isValidModuleName(_txtPortletName.getText())) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Invalid chars in portlet name."));
    } else {
      IContainer targetContainer = _selectedContainer.getFolder(new Path(_txtPortletName.getText()));
      IFile targetFile = _selectedContainer.getFile(new Path(_txtPortletName.getText()));

      if (targetContainer == null || targetContainer.exists()) {

        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a folder named \"" + _txtPortletName.getText() + "\" below \"" + _selectedContainer.getName() + "\"."));
      } else if (targetFile == null || targetFile.exists()) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a file named \"" + _txtPortletName.getText() + "\" below \"" + _selectedContainer.getName() + "\"."));
View Full Code Here

    // folder based design selected?
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IContainer) {
        IContainer container = (IContainer) selectedElement;

        IFile dirlink = container.getFile(new Path("dirlink.xml"));
        if (dirlink.exists()) {
          File linkedFile = WGUtils.resolveDirLink(container.getLocation().toFile());
          container = (IContainer) container.getWorkspace().getRoot().findContainersForLocationURI(linkedFile.toURI())[0];

        }

        if (WGADesignStructureHelper.isDesignFolder(container)) {
          _designContainer = container;
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.