Examples of IContainer


Examples of org.eclipse.core.resources.IContainer

        }
      return mediaKeys;
  }
 
  public static IContainer retrieveDesignContainerFromSelection(IStructuredSelection selection) {
      IContainer container = null;
      if (selection.getFirstElement() instanceof IContainer) {
          container = (IContainer) selection.getFirstElement();
      } else if (selection.getFirstElement() instanceof IFile) {
          container = ((IFile)selection.getFirstElement()).getParent();
      } else if (selection.getFirstElement() instanceof IJavaProject) {
          container = ((IJavaProject)selection.getFirstElement()).getProject();
      }
     
      if (container != null) {
            if (WGADesignStructureHelper.isDesignFolder(container)) {
                return container;
            }
            container = container.getParent();
            while (container != null) {               
                if (WGADesignStructureHelper.isDesignFolder(container)) {
                    return container;
                }
                container = container.getParent();
            }
        }
      return null;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    List<IStatus> list = new ArrayList<IStatus>();

    if (!(getTreeViewer().getTree().getSelectionCount() > 0)) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is no designfolder in workspace."));
    } else {
      IContainer treeSelection = (IContainer) getTreeViewer().getTree().getSelection()[0].getData();

      if (!WGADesignStructureHelper.isValidTMLLocation(treeSelection)) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "You cannot create a TML module here. Please select a folder below the tml folder."));
      }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    } else if (!WGADesignStructureHelper.isValidModuleName(innerLayoutName)) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "The name for the innerlayout contains invalid characters. Only alphanumeric ascii characters and '.', '_', '-' and '$' are allowed."));
    }
   
    // check if the resources already exist
    IContainer designRoot = null;
    if (getPreviousPage() instanceof DesignFolderSelectionPage) {
      designRoot = (IContainer)((DesignFolderSelectionPage)getPreviousPage()).getSelectedResource();
    }
    if (designRoot == null) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "No design folder selected."));
View Full Code Here

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

Examples of org.eclipse.core.resources.IContainer

  }
 
  @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

Examples of org.eclipse.core.resources.IContainer

  @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

Examples of org.eclipse.core.resources.IContainer

   
    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

Examples of org.eclipse.core.resources.IContainer

  }

  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

Examples of org.eclipse.core.resources.IContainer

  }

  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

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.isValidTMLLocation(container)){
        _tmlValidFolderSelected  = true;
      }
    }else if(selection.getFirstElement() instanceof IFile){
      IFile file = (IFile) selection.getFirstElement();
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.