Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.TreeItem$TreeItemAnimation


    }    
    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);
      TreeItem addResourceTreeItem = new TreeItem(addResourcePanel);
      addResourceTreeItem.setUserObject(ApplicationItem.button + WadlXml.resourceNode);
      parentTreeItem.addItem(addResourceTreeItem);
    }
   
    WadlTreeRoot.addButtons(buttonTreeItems, parentTreeItem);
   
View Full Code Here


  public static void listResources(final ApplicationNode application, final TreeItem applicationTreeItem) {
    Vector buttonTreeItems = WadlTreeRoot.removeChildrenXKeepButtons(applicationTreeItem, WadlXml.resourcesNode);
   
    ResourcesNode resources = application.getResources();
    if (resources != null) {     
      TreeItem resourcesTreeItem = new TreeItem(new ResourcesItem(resources, applicationTreeItem));
      resourcesTreeItem.setUserObject(WadlXml.resourcesNode);
      applicationTreeItem.addItem(resourcesTreeItem);     
         
      //  list all resource items   
      ResourceItem.listResources(resources, resourcesTreeItem);
      resourcesTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);
     
      // close resources item
      TreeItem resourcesCloseItem = new TreeItem(new GenericClosingItem(WadlXml.resourcesNode));
      resourcesCloseItem.setUserObject(WadlXml.resourcesNode);
      applicationTreeItem.addItem(resourcesCloseItem);
    }
    else {
      if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.resourcesNode)) {     
        // add resources button     
        HorizontalPanel addResourcesPanel = new HorizontalPanel();
             
        Button addResourcesButton = new Button(GuiFactory.strings.addResources());
        addResourcesButton.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {         
            application.addResources(new ResourcesNode(GuiFactory.strings.newResources(), application));
            listResources(application, applicationTreeItem);                   
          }
        });
        addResourcesPanel.add(addResourcesButton);
        TreeItem addResourcesTreeItem = new TreeItem(addResourcesPanel);
        addResourcesTreeItem.setUserObject(ApplicationItem.button + WadlXml.resourcesNode);
        applicationTreeItem.addItem(addResourcesTreeItem);
      }
    }
    WadlTreeRoot.addButtons(buttonTreeItems, applicationTreeItem);
   
View Full Code Here

    }   
    Iterator allRepresentationsIterator = allRepresentations.iterator();
    while (allRepresentationsIterator.hasNext()) {
      RepresentationNode representation = (RepresentationNode) allRepresentationsIterator.next();
      RepresentationItem representationItem = new RepresentationItem(representation, parentNode, parentTreeItem);
      TreeItem representationTreeItem = new TreeItem(representationItem);
      representationTreeItem.setUserObject(WadlXml.representationNode);
      parentTreeItem.addItem(representationTreeItem);     
     
      if (representation.getHref() == null) {
        String requestString = "";
        if (representation.getApplication() != null) {
          requestString = representation.getApplication().getAnalyzer().getRequestString();
        }
        ParamItem.listParams(
            representation,
            representationTreeItem,
            requestString);    
     
        // close representation item
        GenericClosingItem representationCloseItem = new GenericClosingItem(WadlXml.representationNode);
        TreeItem representationCloseTreeItem = new TreeItem(representationCloseItem);
        representationCloseTreeItem.setUserObject(WadlXml.representationNode);
        parentTreeItem.addItem(representationCloseTreeItem);
      }
    }
   
    if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.representationNode)) {
      // add representation button           
      HorizontalPanel addRepresentationPanel = new HorizontalPanel();     
      Button addRepresentationButton = new Button(GuiFactory.strings.addRepresentation());
      addRepresentationButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          if (parentNode instanceof RequestNode) {
            ((RequestNode) parentNode).addRepresentation(new RepresentationNode(GuiFactory.strings.newRepresentation(), application_xml, (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
          }
          else if (parentNode instanceof ResponseNode) {
            ((ResponseNode) parentNode).addRepresentation(new RepresentationNode(GuiFactory.strings.newRepresentation(), application_xml, (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
          }
          else if (parentNode instanceof ApplicationNode) {
            RepresentationNode representation = new RepresentationNode(GuiFactory.strings.newRepresentation(), application_xml, (GenericNode) parentNode, ((GenericNode) parentNode).getApplication());
            representation.setId(GuiFactory.strings.newId());
            ((ApplicationNode) parentNode).addRepresentation(representation);           
          }       
          listRepresentations(parentNode, parentTreeItem);               
        }
      });
      addRepresentationPanel.add(addRepresentationButton);
      TreeItem addRepresentationTreeItem = new TreeItem(addRepresentationPanel);  
     
      addRepresentationTreeItem.setUserObject(ApplicationItem.button + WadlXml.representationNode);
      parentTreeItem.addItem(addRepresentationTreeItem);
    }
   
    WadlTreeRoot.addButtons(buttonTreeItems, parentTreeItem);
   
View Full Code Here

  }
 
  public Tree buildTree(ApplicationNode application) {
    // application root item
    ApplicationItem applicationItem = new ApplicationItem(application);
    TreeItem applicationTreeItem = new TreeItem(applicationItem)
    tree.addItem(applicationTreeItem);
   
    // grammars item   
    GrammarsItem.listGrammars(application, applicationTreeItem);   
   
    // resources item         
    ResourcesItem.listResources(application, applicationTreeItem);            
   
    String requestString = "";
    if (application.getApplication() != null) {
      requestString = application.getApplication().getAnalyzer().getRequestString();
    }
    // method items   
    MethodItem.listMethods(application, applicationTreeItem, requestString);  
   
    // representations
    RepresentationItem.listRepresentations(application, applicationTreeItem);
   
    // faults
    FaultItem.listFaults(application, applicationTreeItem);
   
    // params   
    ParamItem.listParams(
        application,
        applicationTreeItem,
        requestString);   
   
    // resource_types
    ResourceTypeItem.listResourceTypes(application, applicationTreeItem);
   
    // close applications item
    GenericClosingItem applicationCloseItem = new GenericClosingItem(WadlXml.applicationNode);
    tree.addItem(applicationCloseItem);
    applicationTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);
   
    return tree; 
 
View Full Code Here

 
  public static Vector removeChildrenXKeepButtons(TreeItem parentTreeItem, String name) {   
    Vector itemsToDelete = new Vector();
    Vector buttonTreeItems = new Vector();   
    for (int i = 0; i < parentTreeItem.getChildCount(); i++) {
      TreeItem treeItem = parentTreeItem.getChild(i);     
      if (treeItem.getUserObject() != null) {       
        if (treeItem.getUserObject().equals(name)) {        
          itemsToDelete.add(treeItem);       
        }
        else if (((String) treeItem.getUserObject()).startsWith(ApplicationItem.button)) {         
          buttonTreeItems.add(treeItem);
          itemsToDelete.add(treeItem);     
        }
      }     
    }   
View Full Code Here

  }
 
  public static void addButtons(Vector buttonTreeItems, TreeItem parentTreeItem) {   
    Iterator buttonTreeItemIterator = buttonTreeItems.iterator();
    while(buttonTreeItemIterator.hasNext()) {     
      TreeItem treeItem = (TreeItem) buttonTreeItemIterator.next();  
      parentTreeItem.addItem(treeItem);     
    }
  }
View Full Code Here

  }
 
  public static boolean containsButton(Vector buttonTreeItems, String buttonName) {   
    Iterator buttonTreeItemIterator = buttonTreeItems.iterator();
    while(buttonTreeItemIterator.hasNext()) {     
      TreeItem treeItem = (TreeItem) buttonTreeItemIterator.next();     
      if (treeItem.getUserObject().equals(buttonName)) {       
        return true;
      }
    }   
    return false;
  }
View Full Code Here

        public void onClick(Widget sender) {             
          method.addResponse(new ResponseNode(method, method.getApplication()));         
          listResponse(method, methodTreeItem);         
        }
      });
      TreeItem addResponseTreeItem = new TreeItem(addResponseButton);
      addResponseTreeItem.setUserObject(WadlXml.responseNode);
      methodTreeItem.addItem(addResponseTreeItem);
      return;
    }
    ResponseItem responseItem = new ResponseItem(method, methodTreeItem);
    TreeItem responseTreeItem = new TreeItem(responseItem);
    responseTreeItem.setUserObject(WadlXml.responseNode);
   
    methodTreeItem.addItem(responseTreeItem);
    responseTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);
   
    // representations
    RepresentationItem.listRepresentations(response, responseTreeItem);
   
    // faults
    FaultItem.listFaults(response, responseTreeItem);
   
    // parameters
    String requestString = "";
    if (response.getApplication() != null) {
      requestString = response.getApplication().getAnalyzer().getRequestString();
    }
    ParamItem.listParams(response,
        responseTreeItem,
        requestString);
   
    GenericClosingItem responseCloseItem = new GenericClosingItem(WadlXml.responseNode);
    TreeItem responseCloseTreeItem = new TreeItem(responseCloseItem);
    responseCloseTreeItem.setUserObject(WadlXml.responseNode);
    methodTreeItem.addItem(responseCloseTreeItem);
   
    WadlTreeRoot.addButtons(buttonTreeItems, methodTreeItem);
   
    methodTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);   
View Full Code Here

    int paramCounter = 0;
    Iterator paramIterator = allParams.iterator();   
    while (paramIterator.hasNext()) {     
      ParamNode param = (ParamNode) paramIterator.next();
      ParamItem paramItem = new ParamItem(param, (GenericNode) parentNode, parentTreeItem, paramCounter, requestString);
      TreeItem parameterTreeItem = new TreeItem(paramItem);
      parameterTreeItem.setUserObject(WadlXml.paramNode);
      parentTreeItem.addItem(parameterTreeItem);     
      parameterTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);
      paramCounter++;
    }
   
    if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.paramNode)) {
      // add param button
      HorizontalPanel addParamPanel = new HorizontalPanel();
         
      Button addParamButton = new Button(GuiFactory.strings.addParam());
      addParamButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {         
          Analyzer analyzer = null;
          if (parentNode instanceof RequestNode) {   
            ((RequestNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((RequestNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ResponseNode) {     
            ((ResponseNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((ResponseNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ResourceTypeNode) {     
            ((ResourceTypeNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((ResourceTypeNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ResourceNode) {     
            ((ResourceNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((ResourceNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof FaultNode) {     
            ((FaultNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((FaultNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof RepresentationNode) {     
            ((RepresentationNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((RepresentationNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ApplicationNode) {
            ParamNode param = new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, (ApplicationNode) parentNode);
            param.setId(GuiFactory.strings.newId());
            ((ApplicationNode) parentNode).addParam(param);           
            analyzer = ((ApplicationNode) parentNode).getAnalyzer();
          }        
          String newRequestString = analyzer.getRequestString();
          if (!newRequestString.equals("")) {
            TextBox requestUriTextBox = ReferenceManager.getRequestUriTextBox(newRequestString);
            Uri uri = new Uri(requestUriTextBox.getText());
            String newUri = uri.getScheme() + "://" + uri.getAuthority() + uri.getPath() + "?";
            String[] queryParameters = uri.getQueryParameters();
            String[] queryValues = uri.getQueryValues();
            for (int i = 0; i < queryParameters.length; i++) {         
              if (i > 0) newUri += "&";      
              newUri += queryParameters[i] + "=" + queryValues[i];
            }
            if (queryParameters.length > 0) {
              newUri += "&";
            }
            newUri += GuiFactory.strings.newParam() + "=" + GuiFactory.strings.paramValue();         
            ListBox httpMethodListBox = ReferenceManager.getHttpMethodListBox(newRequestString);
            ParameterTree parameterTree = ReferenceManager.getParameterTree(newRequestString);
            parameterTree.updateReferences(requestUriTextBox, newUri);
            parameterTree.updateTree();         
            newRequestString = httpMethodListBox.getItemText(httpMethodListBox.getSelectedIndex()) + " " + newUri;
            analyzer.setRequestString(newRequestString);
          }
          listParams(parentNode, parentTreeItem, newRequestString);
        }
      });
      addParamPanel.add(addParamButton);
      TreeItem addParamTreeItem = new TreeItem(addParamPanel);
      addParamTreeItem.setUserObject(ApplicationItem.button + WadlXml.paramNode);   
      parentTreeItem.addItem(addParamTreeItem);
   }
   
    WadlTreeRoot.addButtons(buttonTreeItems, parentTreeItem);
   
View Full Code Here

    Vector allResourceTypes = application.getAllResourceTypes();
    Iterator allResourceTypesIterator = allResourceTypes.iterator();
    while (allResourceTypesIterator.hasNext()) {
      ResourceTypeNode resourceType = (ResourceTypeNode) allResourceTypesIterator.next();
      ResourceTypeItem resourceTypeItem = new ResourceTypeItem(resourceType, applicationTreeItem);
      TreeItem resourceTypeTreeItem = new TreeItem(resourceTypeItem);
      applicationTreeItem.addItem(resourceTypeTreeItem);
      resourceTypeTreeItem.setUserObject(WadlXml.resourceTypeNode);
      resourceTypeTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);
     
      String requestString = "";
      if (resourceType.getApplication() != null) {
        requestString = resourceType.getApplication().getAnalyzer().getRequestString();
      }
      // methods     
      MethodItem.listMethods(resourceType, resourceTypeTreeItem, requestString);     
     
      // params     
      ParamItem.listParams(
          resourceType,
          resourceTypeTreeItem,
          requestString);
     
      // close resource type item
      GenericClosingItem resourceTypeCloseItem = new GenericClosingItem(WadlXml.resourceTypeNode);
      TreeItem resourceTypeCloseTreeItem = new TreeItem(resourceTypeCloseItem);
      resourceTypeCloseTreeItem.setUserObject(WadlXml.resourceTypeNode);
      applicationTreeItem.addItem(resourceTypeCloseTreeItem);     
    }  
   
    if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.resourceTypeNode)) {
      // add resource type button
      HorizontalPanel addResourceTypePanel = new HorizontalPanel();           
      Button addResourceTypeButton = new Button(GuiFactory.strings.addResourceType());
      addResourceTypeButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {         
          application.addResourceType(new ResourceTypeNode(GuiFactory.strings.newResourceType(), application));                              
          listResourceTypes(application, applicationTreeItem);       
        }
      });
      addResourceTypePanel.add(addResourceTypeButton);
      TreeItem addResourceTypeTreeItem = new TreeItem(addResourceTypePanel);
      addResourceTypeTreeItem.setUserObject(ApplicationItem.button + WadlXml.resourceTypeNode);
      applicationTreeItem.addItem(addResourceTypeTreeItem);
    }   
    WadlTreeRoot.addButtons(buttonTreeItems, applicationTreeItem);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.TreeItem$TreeItemAnimation

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.