Package com.google.code.apis.rest.client.Wadl

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


    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.add(new HTML("   "));
    Button addExtNamespaceButton = new Button(GuiFactory.strings.addExtNamespace());
    addExtNamespaceButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        NamespaceAttribute namespace = new NamespaceAttribute(null, GuiFactory.strings.newExtNamespace());
        application.addNamespace(namespace);
        listExtNamespaces(application, namespacePanelRight);
      }
    });
    buttonPanel.add(addExtNamespaceButton);
View Full Code Here


    namespacePanelRight.add(new HTML(SyntaxHighlighter.highlight(WadlXml.application_xmlns + "=\"" + WadlXml.xmlns + "\"")));
    final Iterator namespaceIterator = namespaces.iterator();   
    namespaceCounter = 0;
    while (namespaceIterator.hasNext()) {
      final HorizontalPanel extNamespacePanel = new HorizontalPanel();
      final NamespaceAttribute namespace = (NamespaceAttribute) namespaceIterator.next();
      if (namespace.getName() == null) {
        extNamespacePanel.add(new HTML(SyntaxHighlighter.highlight(WadlXml.application_xmlns_extNs + namespaceCounter + "=\"")));
      }
      else {
        extNamespacePanel.add(new HTML(SyntaxHighlighter.highlight(namespace.getName() + "=\"")));
      }
     
      final TextBox input = new TextBox();     
      input.setText(namespace.getValue());
      input.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          application.updateNamespace(namespace.getValue(), input.getText());         
        }
      });
      extNamespacePanel.add(input);    
     
      extNamespacePanel.add(new HTML(SyntaxHighlighter.highlight("\"")));
View Full Code Here

        public void onClick(Widget sender) {
          Iterator addNamespaceIterator = reallyAddDefaultNamespace.iterator();
          while (addNamespaceIterator.hasNext()) {
            String namespace = (String) addNamespaceIterator.next();           
            Analyzer.application.addNamespace(
                new NamespaceAttribute(null, namespace));
          }
          WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
          Tree wadlTree = wadlTreeRoot.buildTree(Analyzer.application);
          WadlPanel.wadlArea.clear();
          WadlPanel.wadlArea.setWidget(wadlTree);
        }         
      });
      containerPanel.add(addNamespaceButton);
    }
    final Button addOtherNamespacesButton = new Button(GuiFactory.strings.addOtherNamespace());
    // other namespaces
    if (!otherNamespaces.isEmpty()) {
      final Vector reallyAddOtherNamespaces = new Vector();
      containerPanel.add(new HTML("<br />" + GuiFactory.strings.otherNamespaces()));
      ScrollPanel otherNamespacesContainerPanel = new ScrollPanel();
      otherNamespacesContainerPanel.setStyleName("restDescribe-wadlArea");     
      otherNamespacesContainerPanel.setHeight(panelHeight);
      VerticalPanel otherNamespacesPanel = new VerticalPanel();
      otherNamespacesContainerPanel.add(otherNamespacesPanel);
      containerPanel.add(otherNamespacesContainerPanel);
     
      Iterator otherNamespacesIterator = otherNamespaces.iterator();
      int i = 0;
      HorizontalPanel horizontalNamespacePanel = new HorizontalPanel();
      otherNamespacesPanel.add(horizontalNamespacePanel);
      Grid grid = new Grid(otherNamespaces.size(), 2);
      horizontalNamespacePanel.add(grid);
      while (otherNamespacesIterator.hasNext()) {       
        final String otherNamespace = (String) otherNamespacesIterator.next();
        reallyAddOtherNamespaces.add(otherNamespace);
        final CheckBox checkBox = new CheckBox();
        checkBox.setChecked(true);
        checkBox.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            if (checkBox.isChecked() &&
                !reallyAddOtherNamespaces.contains(otherNamespace)) {             
              reallyAddOtherNamespaces.add(otherNamespace);
            }          
            else {
              if (reallyAddOtherNamespaces.contains(otherNamespace)) {
                reallyAddOtherNamespaces.remove(otherNamespace);
              }
            }
          }         
        });
       
        grid.setWidget(i, 0, checkBox);       
        grid.setText(i, 1, otherNamespace);
        i++;
      }           
      addOtherNamespacesButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          Iterator addNamespaceIterator = reallyAddOtherNamespaces.iterator();
          while (addNamespaceIterator.hasNext()) {
            String namespace = (String) addNamespaceIterator.next();           
            Analyzer.application.addNamespace(
                new NamespaceAttribute(null, namespace));
          }
          WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
          Tree wadlTree = wadlTreeRoot.buildTree(Analyzer.application);
          WadlPanel.wadlArea.clear();
          WadlPanel.wadlArea.setWidget(wadlTree);
View Full Code Here

TOP

Related Classes of com.google.code.apis.rest.client.Wadl.NamespaceAttribute

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.