Examples of ResourceNode


Examples of civquest.map.resource.ResourceNode

    return true;
  }
 
  public Long getResourceEdge(Long sourceResourceNodeID,
                Long destResourceNodeID) {
    ResourceNode sourceNode = game.getResourceNode(sourceResourceNodeID);
    ResourceNode destNode = game.getResourceNode(destResourceNodeID);
    return sourceNode.getOutResourceEdge(destNode).getID();
  }
View Full Code Here

Examples of com.google.code.apis.rest.client.Wadl.ResourceNode

    else if (parentNode instanceof ResourcesNode) {
      allResources = ((ResourcesNode) parentNode).getAllResources();
    }    
    Iterator allResourcesIterator = allResources.iterator();
    while (allResourcesIterator.hasNext()) {     
      final ResourceNode resource = (ResourceNode) allResourcesIterator.next();
      ResourceItem resourceItem = new ResourceItem(resource, parentNode, parentTreeItem);
      final TreeItem resourceTreeItem = new TreeItem(resourceItem);     
      resourceTreeItem.setUserObject(WadlXml.resourceNode);
      parentTreeItem.addItem(resourceTreeItem);
      resourceTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);    
                 
      String requestString = "";
      if (resource.getApplication() != null) {
        requestString = resource.getApplication().getAnalyzer().getRequestString();
      }
      // parameters     
      ParamItem.listParams(
          resource,
          resourceTreeItem,
          requestString);
     
      // methods     
      MethodItem.listMethods(resource, resourceTreeItem, requestString);    
     
      // resource    
      listResources((Object) resource, resourceTreeItem);    
     
      // close resource item
      GenericClosingItem resourceCloseItem = new GenericClosingItem(WadlXml.resourceNode);
      TreeItem resourceCloseTreeItem = new TreeItem(resourceCloseItem);
      resourceCloseTreeItem.setUserObject(WadlXml.resourceNode);
      parentTreeItem.addItem(resourceCloseTreeItem);
    }
   
   if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.resourceNode)) {
      // add resource button
      HorizontalPanel addResourcePanel = new HorizontalPanel();           
      Button addResourceButton = new Button(GuiFactory.strings.addResource());
      addResourceButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {    
          if (parentNode instanceof ResourceNode) {
            ((ResourceNode) parentNode).addResource(new ResourceNode(GuiFactory.strings.newResource(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));
          }
          else if (parentNode instanceof ResourcesNode) {
            ((ResourcesNode) parentNode).addResource(new ResourceNode(GuiFactory.strings.newResource(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));
          }                     
          listResources(parentNode, parentTreeItem);       
        }
      });
      addResourcePanel.add(addResourceButton);
View Full Code Here

Examples of com.google.code.apis.rest.client.Wadl.ResourceNode

    else if (parent instanceof ResourceNode) {
      allResources = ((ResourceNode) parent).getAllResources();
    }
    Iterator allResourcesIterator = allResources.iterator();         
    while(allResourcesIterator.hasNext()) {
      ResourceNode resource = (ResourceNode) allResourcesIterator.next();
      if (resource.getAllMethods() != null) {
        Vector allMethods = resource.getAllMethods();
        Iterator allMethodsIterator = allMethods.iterator();
        while(allMethodsIterator.hasNext()) {
          MethodNode method = (MethodNode) allMethodsIterator.next();
          if (id.equals(method.getHref().substring(1))) {
            ResourceNode resourceNode = ((ResourceNode) method.getParent());
            String name = resourceNode.getPath();
            String absoluteAddress = resourceNode.getAbsolutePath() + resourceNode.getPath();                 
            // check if we have a template parameter
            while (resource.getPath().matches(Analyzer.templateParamRegExp)) {
              // don't confuse: param is from the WADL, parameter is for code generation
              String path = resource.getPath();       
              int indexOfOpen = path.indexOf(Analyzer.templateParamOpenChar);
View Full Code Here

Examples of com.google.code.apis.rest.client.Wadl.ResourceNode

    String httpMethodName = thisRequestsMethod.getName();  
    String absoluteAddress = null;
    String name = null;
    Object thisRequestsMethodsParent = (Object) thisRequestsMethod.getParent();
    if (thisRequestsMethodsParent instanceof ResourceNode) {
      ResourceNode resource = (ResourceNode) thisRequestsMethodsParent;
      name = resource.getPath();
      absoluteAddress = resource.getAbsolutePath() + resource.getPath();     
      // check if we have template parameters
      while (resource.getPath().matches(Analyzer.templateParamRegExp)) {
        // don't confuse: param is from the WADL, parameter is for code generation
        String path = resource.getPath();       
        int indexOfOpen = path.indexOf(Analyzer.templateParamOpenChar);
        int indexOfClose = path.indexOf(Analyzer.templateParamCloseChar);       
        while(indexOfOpen >= 0 &&
            indexOfClose > 0 &&
            indexOfOpen < indexOfClose) {         
          String templateParamName = path.substring(indexOfOpen + 1, indexOfClose);
          // from all the potential params find the one that matches the template {name}
          Vector templateParams = resource.getAllParams();
          Iterator templateParamsIterator = templateParams.iterator();         
          ParamNode templateParam = null;
          if (templateParamsIterator.hasNext()) {
            templateParam = (ParamNode) templateParamsIterator.next();
          }
          while(!templateParam.getName().equals(templateParamName)) {
            templateParam = (ParamNode) templateParamsIterator.next();
          }
          // now generate the code generation parameter      
          Parameter templateParameter = new Parameter(
              templateParamName + SettingsDialog.templateSuffix,
              templateParam.getType(),
              Parameter.accessPrivate,
              templateParam.getIsRequired(),              
              language,
              true);
          variables.insertElementAt(templateParameter, 0);
         
          path = path.substring(indexOfClose + 1);
          indexOfOpen = path.indexOf(Analyzer.templateParamOpenChar);
          indexOfClose = path.indexOf(Analyzer.templateParamCloseChar);         
        }
        if (resource.getParent().getParent() instanceof ResourceNode) {
          resource = (ResourceNode) resource.getParent().getParent();
        }
        else {
          break;
        }
      }           
View Full Code Here

Examples of com.google.code.apis.rest.client.Wadl.ResourceNode

      }
    } 
    // do this every time
    Iterator allResourcesIterator = allResources.iterator();
    while(allResourcesIterator.hasNext()) {
      ResourceNode resource = (ResourceNode) allResourcesIterator.next();     
      if (!resource.getAllMethods().isEmpty()) {
        Vector allMethods = resource.getAllMethods();
        Iterator allMethodsIterator = allMethods.iterator();
        while(allMethodsIterator.hasNext()) {
          MethodNode method = (MethodNode) allMethodsIterator.next();         
          if (method.getRequest() != null) {
            RequestNode request = method.getRequest();                   
            if (!request.getAllParams().isEmpty()) {            
              examineParams(request.getAllParams());
              return;
            }
          }         
        }
      }   
      // recursive call for inner resources (a resource in a resource)
      addParamsToListBox(resource.getAllResources(), false);     
    }
  }  
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

      int index=0;
      for(int i=0; i<selectedNodes.length; i++)
      {
        if(selectedNodes[i] instanceof ResourceNode)
        {
          ResourceNode rn = (ResourceNode)selectedNodes[i];

          this.clipboard[index] = (HumanResource)rn.getUserObject();
          if(cut)
          {
            this.appli.getHumanResourceManager().remove(this.clipboard[index], this.appli.getUndoManager());
          }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

      index++;
      return index;
    }

    public ResourceNode getNodeForResource(ProjectResource resource) {
        ResourceNode res = null;
        Enumeration childs = root.children();
        while (childs.hasMoreElements() && res == null) {
            ResourceNode rn = (ResourceNode) childs.nextElement();
            if (resource.equals(rn.getUserObject()))
                res = rn;
        }
        return res;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

        return res;
    }

    private ResourceNode buildTree() {

        ResourceNode root = new ResourceNode(null);
        List listResources = myResourceManager.getResources();
        Iterator itRes = listResources.iterator();

        while (itRes.hasNext()) {
            ProjectResource pr = (ProjectResource) itRes.next();

            ResourceAssignment[] tra = pr.getAssignments();
            ResourceNode rnRes = new ResourceNode(pr); // the first for the
            // resource
            root.add(rnRes);
        }
        return root;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

        ProjectResource[] listResources = myResourceManager.getResourcesArray();

        for (int idxResource=0; idxResource<listResources.length; idxResource++) {
            ProjectResource pr = listResources[idxResource];

            ResourceNode rnRes = exists(pr);
            if (rnRes == null) {
                rnRes = new ResourceNode(pr);
            }
            buildAssignmentsSubtree(rnRes);
//            for (int i = 0; i < tra.length; i++) {
//                AssignmentNode an = exists(rnRes, tra[i]);
//                if (an == null) {
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

        // this.setRoot(root);

    }

    ResourceNode exists(ProjectResource pr) {
        ResourceNode res = null;
        Enumeration en = root.children();
        while (res == null && en.hasMoreElements()) {
            ResourceNode rn = (ResourceNode) en.nextElement();
            if (rn.getUserObject().equals(pr))
                res = rn;
        }
        return res;
    }
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.