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

Examples of com.google.gwt.user.client.ui.ChangeListener


    listBox.addItem(c.Detail(),"4");   
    listBox.addItem(c.Debug(),"5"); // give up extra space between 4 and 9 for coding convenience here.

    listBox.setVisibleItemCount(1);
//    flexTable.setWidget(0, 1, listBox);
    listBox.addChangeListener(new ChangeListener() {
      public void onChange(final Widget sender) {
        GenClient.setVerbosity(Integer.parseInt( listBox.getValue( listBox.getSelectedIndex() )));
        GenClient.showOutput("verbosity now: " + GenClient.getVerbosity() );       
        icingShadow.setVerbosityToDebug(GenClient.isVerbosityDebug());
        GenClient.showOutput("visibilityStatusArea: " + GenClient.isVerbosityDebug());
View Full Code Here


   * @param mainPanel
   *          the widget to use
   */
  public void setWidget(RichTextWidget mainPanel) {
    this.rtw = mainPanel;
    rtw.addNameChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        String newName = rtw.getName();
        if (noteData.containsKey(newName)) {
          Note n = noteData.get(newName);
          if (!rtw.getHTML().equals(n.getText())) {
View Full Code Here

    options = new ListBox();
    controls.add(tb);
    options.addItem("default");
    options.setSelectedIndex(0);
    options.addChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        String newName = options.getItemText(options.getSelectedIndex());
        name.setText(newName);
        notifyNameListeners();
      }
View Full Code Here

   
    if (method.getHref() == null) {
      // name listbox
      final ListBox nameListBox = new ListBox();
      addNames(nameListBox);         
      nameListBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          method.updateName(method.getName(), nameListBox.getItemText(nameListBox.getSelectedIndex()));
          requestString = method.getApplication().getAnalyzer().getRequestString();
          updateHttpMethod(method.getName());
          method.getApplication().getAnalyzer().setRequestString(requestString);
        }     
      });    
     
      // remove method link
      Hyperlink removeMethodLink = new Hyperlink(GuiFactory.strings.remove(), true, "");
      removeMethodLink.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {           
          if (parentNode instanceof ResourceNode) {
            ((ResourceNode) parentNode).removeMethod(method);             
            listMethods(parentNode,  parentTreeItem, requestString);
          }
          else if (parentNode instanceof ApplicationNode) {
            ((ApplicationNode) parentNode).removeMethod(method);             
            listMethods(parentNode, parentTreeItem, requestString);
          }
          else if (parentNode instanceof ResourceTypeNode) {
            ((ResourceTypeNode) parentNode).removeMethod(method);
            listMethods(parentNode, parentTreeItem, requestString);
          }
        }
      });
     
      // need more than one line
      if (method.getId() != null) {
        VerticalPanel methodPanel = new VerticalPanel();
       
        methodPanel.add(new HTML(SyntaxHighlighter.highlight("<" + WadlXml.methodNode + " ")));
        HorizontalPanel containerPanel = new HorizontalPanel();
        methodPanel.add(containerPanel);
        VerticalPanel methodPanelLeft = new VerticalPanel()
        methodPanelLeft.setWidth("1em");
        methodPanelLeft.add(new HTML("&nbsp;"));
        VerticalPanel methodPanelRight = new VerticalPanel()
        containerPanel.add(methodPanelLeft);       
        containerPanel.add(methodPanelRight);
        HorizontalPanel namePanel = new HorizontalPanel();
        methodPanelRight.add(namePanel);
        namePanel.add(new HTML(SyntaxHighlighter.highlight(WadlXml.method_name + "=\"")));
        namePanel.add(nameListBox);
        namePanel.add(new HTML(SyntaxHighlighter.highlight("\"")));
       
        HorizontalPanel methodIdPanel = new HorizontalPanel();
        methodPanelRight.add(methodIdPanel);
        methodIdPanel.add(new HTML(SyntaxHighlighter.highlight(WadlXml.method_id + "=\"")));
        final TextBox idTextBox = new TextBox();
        idTextBox.addChangeListener(new ChangeListener() {
          public void onChange(Widget sender) {
            method.updateId(method.getId(), idTextBox.getText());
          }
        });   
        idTextBox.setText(method.getId());
View Full Code Here

     
      if (fault.getId() != null) {
        HorizontalPanel faultPanel0 = new HorizontalPanel();
        faultPanel0.add(new HTML(SyntaxHighlighter.highlight(WadlXml.fault_id + "=\"")));
        final TextBox idTextBox = new TextBox();
        idTextBox.addChangeListener(new ChangeListener() {
          public void onChange(Widget sender) {
            fault.updateId(fault.getId(), idTextBox.getText());
          }
        });   
        idTextBox.setText(fault.getId());
        faultPanel0.add(idTextBox);
        faultPanel0.add(new HTML(SyntaxHighlighter.highlight("\"")));
        faultPanelRight.add(faultPanel0);
      }
     
      HorizontalPanel faultPanel4 = new HorizontalPanel();
      faultPanel4.add(new HTML(SyntaxHighlighter.highlight(WadlXml.fault_status + "=\"")));
      final TextBox statusTextBox = new TextBox();
      statusTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          fault.updateStatus(fault.getStatus(), statusTextBox.getText());
        }
      });   
      statusTextBox.setText(fault.getStatus() + "");
      faultPanel4.add(statusTextBox);
      faultPanel4.add(new HTML(SyntaxHighlighter.highlight("\"")));
      faultPanelRight.add(faultPanel4);
     
      HorizontalPanel faultPanel1 = new HorizontalPanel();
      faultPanel1.add(new HTML(SyntaxHighlighter.highlight(WadlXml.fault_mediaType + "=\"")));
      final TextBox mediaTypeTextBox = new TextBox();
      mediaTypeTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          fault.updateMediaType(fault.getMediaType(), mediaTypeTextBox.getText());
        }
      });   
      mediaTypeTextBox.setText(fault.getMediaType());
      faultPanel1.add(mediaTypeTextBox);
      faultPanel1.add(new HTML(SyntaxHighlighter.highlight("\"")));
      faultPanelRight.add(faultPanel1);
     
      final VerticalPanel detailsPanel = new VerticalPanel();
      detailsPanel.setVisible(false);
      faultPanel1.add(new HTML("<img align=\"absmiddle\" src=\"./images/details.png\" style=\"margin-left:8em;\" hspace=\"2\" />"));
      final Hyperlink showDetails = new Hyperlink(GuiFactory.strings.showDetails(), "");
      showDetails.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          if (detailsPanel.isVisible()) {
            detailsPanel.setVisible(false);
            showDetails.setText(GuiFactory.strings.showDetails());
          }
          else {
            detailsPanel.setVisible(true);
            showDetails.setText(GuiFactory.strings.hideDetails());         
          }
        }
      });
      faultPanel1.add(showDetails);   
 
      HorizontalPanel faultPanel2 = new HorizontalPanel();
      faultPanel2.add(new HTML(SyntaxHighlighter.highlight(WadlXml.fault_element + "=\"")));
      final TextBox elementTextBox = new TextBox();
      elementTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          fault.updateElement(fault.getElement(), elementTextBox.getText());
        }
      });   
      elementTextBox.setText(fault.getElement());
      faultPanel2.add(elementTextBox);
      faultPanel2.add(new HTML(SyntaxHighlighter.highlight("\"")));
      detailsPanel.add(faultPanel2);
     
      HorizontalPanel faultPanel3 = new HorizontalPanel();
      faultPanel3.add(new HTML(SyntaxHighlighter.highlight(WadlXml.fault_profile + "=\"")));
      final TextBox profileTextBox = new TextBox();
      profileTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          fault.updateProfile(fault.getProfile(), profileTextBox.getText());
        }
      });   
      profileTextBox.setText(fault.getProfile());
View Full Code Here

    if (resource.getHref() == null) {
      resourcePanel.add(new HTML(SyntaxHighlighter.highlight("<" + WadlXml.resourceNode + " " + WadlXml.resource_path + "=\"")));
     
      final TextBox input = new TextBox();
      input.setText(resource.getPath());
      input.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          resource.updatePath(resource.getPath(), input.getText());
        }
      });
      resourcePanel.add(input);
View Full Code Here

    HorizontalPanel resourcesPanel = new HorizontalPanel();
    resourcesPanel.add(new HTML(SyntaxHighlighter.highlight("<" + WadlXml.resourcesNode + " " + WadlXml.resources_base + "=\"")));
       
    final TextBox input = new TextBox();
    input.setText(resources.getBase());
    input.addChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        resources.updateBase(resources.getBase(), input.getText());
      }   
    });
    resourcesPanel.add(input);
View Full Code Here

     
      if (representation.getId() != null) {
        HorizontalPanel representationPanel0 = new HorizontalPanel();
        representationPanel0.add(new HTML(SyntaxHighlighter.highlight(WadlXml.representation_id + "=\"")));
        final TextBox idTextBox = new TextBox();
        idTextBox.addChangeListener(new ChangeListener() {
          public void onChange(Widget sender) {
            representation.updateId(representation.getId(), idTextBox.getText());
          }
        });   
        idTextBox.setText(representation.getId());
        representationPanel0.add(idTextBox);
        representationPanel0.add(new HTML(SyntaxHighlighter.highlight("\"")));
        representationPanelRight.add(representationPanel0);
      }
     
      HorizontalPanel representationPanel2 = new HorizontalPanel();
      representationPanel2.add(new HTML(SyntaxHighlighter.highlight(WadlXml.representation_element + "=\"")));
      final TextBox elementTextBox = new TextBox();
      elementTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          representation.updateElement(representation.getElement(), elementTextBox.getText());
        }
      });   
      elementTextBox.setText(representation.getElement());
      representationPanel2.add(elementTextBox);
      representationPanel2.add(new HTML(SyntaxHighlighter.highlight("\"")));
      representationPanelRight.add(representationPanel2);
     
      HorizontalPanel representationPanel1 = new HorizontalPanel();
      representationPanel1.add(new HTML(SyntaxHighlighter.highlight(WadlXml.representation_mediaType + "=\"")));
      final TextBox mediaTypeTextBox = new TextBox();
      mediaTypeTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          representation.updateMediaType(representation.getMediaType(), mediaTypeTextBox.getText());
        }
      });   
      mediaTypeTextBox.setText(representation.getMediaType());
      representationPanel1.add(mediaTypeTextBox);
      representationPanel1.add(new HTML(SyntaxHighlighter.highlight("\"")));
      representationPanelRight.add(representationPanel1);
         
      final VerticalPanel detailsPanel = new VerticalPanel();
      detailsPanel.setVisible(false);
      representationPanel1.add(new HTML("<img align=\"absmiddle\" src=\"./images/details.png\" style=\"margin-left:8em;\" hspace=\"2\" />"));
      final Hyperlink showDetails = new Hyperlink(GuiFactory.strings.showDetails(), "");
      showDetails.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          if (detailsPanel.isVisible()) {
            detailsPanel.setVisible(false);
            showDetails.setText(GuiFactory.strings.showDetails());
          }
          else {
            detailsPanel.setVisible(true);
            showDetails.setText(GuiFactory.strings.hideDetails());         
          }
        }
      });
      representationPanel1.add(showDetails);   
 
      HorizontalPanel representationPanel3 = new HorizontalPanel();
      representationPanel3.add(new HTML(SyntaxHighlighter.highlight(WadlXml.representation_profile + "=\"")));
      final TextBox profileTextBox = new TextBox();
      profileTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          representation.updateProfile(representation.getProfile(), profileTextBox.getText());
        }
      });   
      profileTextBox.setText(representation.getProfile());
      representationPanel3.add(profileTextBox);
      representationPanel3.add(new HTML(SyntaxHighlighter.highlight("\"")));
      detailsPanel.add(representationPanel3);
     
      HorizontalPanel representationPanel4 = new HorizontalPanel();
      representationPanel4.add(new HTML(SyntaxHighlighter.highlight(WadlXml.representation_status + "=\"")));
      final TextBox statusTextBox = new TextBox();
      statusTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          representation.updateStatus(representation.getStatus(), statusTextBox.getText());
        }
      });   
      statusTextBox.setText(representation.getStatus());
View Full Code Here

        HorizontalPanel parameterPanel0 = new HorizontalPanel();   
        parameterPanel0.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_id + "=\"")));
        String id = param.getId();
        final TextBox parameterId = new TextBox();
        parameterId.setText(id);
        parameterId.addChangeListener(new ChangeListener() {
          public void onChange(Widget sender) {
            param.updateId(param.getId(), parameterId.getText());        
          }
        });        
        parameterPanel0.add(parameterId);
        parameterPanel0.add(new HTML(SyntaxHighlighter.highlight("\"")));  
        parameterPanelRight.add(parameterPanel0);
      }
     
      HorizontalPanel parameterPanel1 = new HorizontalPanel();   
      parameterPanel1.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_name + "=\"")));
      String name = param.getName();
      final TextBox parameterName = new TextBox();
      parameterName.setText(name);
      parameterName.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          requestString = param.getApplication().getAnalyzer().getRequestString();
          updateParamName(parameterName.getText());
          param.getApplication().getAnalyzer().setRequestString(requestString);
        }
      });   
      parameterName.addKeyboardListener(new KeyboardListener() {
        public void onKeyDown(Widget sender, char keyCode, int modifiers) {              
        }
 
        public void onKeyPress(Widget sender, char keyCode, int modifiers) {              
        }
 
        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
          requestString = param.getApplication().getAnalyzer().getRequestString();
          updateParamName(parameterName.getText());
          param.getApplication().getAnalyzer().setRequestString(requestString);
        }     
      });   
      parameterPanel1.add(parameterName);
      parameterPanel1.add(new HTML(SyntaxHighlighter.highlight("\"")));  
      parameterPanelRight.add(parameterPanel1);
 
      HorizontalPanel parameterPanel2 = new HorizontalPanel();
      parameterPanel2.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_type + "=\"")));
      final ListBox parameterType = new ListBox();
      parameterType.setVisibleItemCount(1);
      addTypes(parameterType);       
      String supposedType = param.getType();  
      parameterType.setSelectedIndex(indexOfValue(supposedType));   
      parameterPanel2.add(parameterType);   
      parameterPanel2.add(new HTML(SyntaxHighlighter.highlight("\"")));   
    
      if (param.getEstimateQuality().equals(TypeEstimator.sure)) {
        estimationQualityHtml = sureHtml;
      }
      else if (param.getEstimateQuality().equals(TypeEstimator.supposed)) {
        estimationQualityHtml = believedHtml;
      }
      else if (param.getEstimateQuality().equals(TypeEstimator.unsure)) {
        estimationQualityHtml = unsureHtml;
      }
      else if (param.getEstimateQuality().equals(TypeEstimator.manual)) {
        estimationQualityHtml = manualHtml;
      }
      else {
        estimationQualityHtml = new HTML();
      }
      parameterPanel2.add(estimationQualityHtml);
      parameterType.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          String selectedType = parameterType.getItemText(parameterType.getSelectedIndex());
          if (selectedType.equals(GuiFactory.strings.newCustomType())) {
            CustomTypesDialog.show(parameterType, param, (GenericNode) parentNode, parentTreeItem, paramCounter, estimationQualityHtml);                  
          }
          else {
            updateParam(selectedType);
          }
        }   
      });
 
      parameterPanelRight.add(parameterPanel2);
     
      HorizontalPanel parameterPanel4 = new HorizontalPanel();
      parameterPanel4.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_style + "=\"")));
      final ListBox parameterStyle = new ListBox();
      parameterStyle.setVisibleItemCount(1);     
      if (parentNode instanceof ResourceTypeNode) {      
        addResourceTypeStyles(parameterStyle);
      }
      else if (parentNode instanceof ResourceNode) {      
        addResourceStyles(parameterStyle);
      }
      else if (parentNode instanceof RequestNode) {      
        addRequestStyles(parameterStyle);
      }
      else if (parentNode instanceof ResponseNode) {      
        addResponseStyles(parameterStyle);
      }
      else if (parentNode instanceof RepresentationNode) {      
        addRepresentationStyles(parameterStyle);
      }
      else if (parentNode instanceof FaultNode) {      
        addFaultStyles(parameterStyle);
      }
      else {
        addStyles(parameterStyle);
      }
     
      parameterStyle.setSelectedIndex(indexOfStyle(param.getStyle(), parameterStyle));
      parameterStyle.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          param.updateStyle(param.getStyle(), parameterStyle.getItemText(parameterStyle.getSelectedIndex()));
        }
      });
      parameterPanel4.add(parameterStyle);
      parameterPanel4.add(new HTML(SyntaxHighlighter.highlight("\"")));
      parameterPanelRight.add(parameterPanel4);
     
      final VerticalPanel detailsPanel = new VerticalPanel();
      detailsPanel.setVisible(SettingsDialog.alwaysShowDetails);
     
      parameterPanel4.add(new HTML("<img align=\"absmiddle\" src=\"./images/details.png\" style=\"margin-left:10em;\" hspace=\"2\" />"));
      final Hyperlink showDetails;
      if (SettingsDialog.alwaysShowDetails) {
        showDetails = new Hyperlink(GuiFactory.strings.hideDetails(), true, "");
      }
      else {
        showDetails = new Hyperlink(GuiFactory.strings.showDetails(), true, "");
      }
      showDetails.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          if (detailsPanel.isVisible()) {
            detailsPanel.setVisible(false);
            showDetails.setText(GuiFactory.strings.showDetails());
          }
          else {
            detailsPanel.setVisible(true);
            showDetails.setText(GuiFactory.strings.hideDetails());         
          }
        }
      });
      parameterPanel4.add(showDetails);   
     
      HorizontalPanel parameterPanel5 = new HorizontalPanel();   
      parameterPanel5.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_default + "=\"")));
      final TextBox parameterDefault = new TextBox();
      parameterDefault.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          param.updateDefaultValue(param.getDefaultValue(), parameterDefault.getText());
        }
      });
      parameterDefault.setText(param.getDefaultValue());
      parameterPanel5.add(parameterDefault);
      parameterPanel5.add(new HTML(SyntaxHighlighter.highlight("\"")));   
      detailsPanel.add(parameterPanel5);
     
      HorizontalPanel parameterPanel9 = new HorizontalPanel();   
      parameterPanel9.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_path + "=\"")));
      final TextBox parameterPath = new TextBox();
      parameterPath.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          param.updatePath(param.getPath(), parameterPath.getText());
        }
      });
      parameterPath.setText(param.getPath());
      parameterPanel9.add(parameterPath);
      parameterPanel9.add(new HTML(SyntaxHighlighter.highlight("\"")));   
      detailsPanel.add(parameterPanel9);
     
      HorizontalPanel parameterPanel6 = new HorizontalPanel();
      parameterPanel6.add(new HTML((SyntaxHighlighter.highlight(WadlXml.param_fixed + "=\""))));
      final TextBox parameterFixed = new TextBox();
      parameterFixed.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          param.updateFixedValue(param.getFixedValue(), parameterFixed.getText());
        }
      });
      parameterFixed.setText(param.getFixedValue());
      parameterPanel6.add(parameterFixed);
      parameterPanel6.add(new HTML(SyntaxHighlighter.highlight("\"")));
      detailsPanel.add(parameterPanel6);
     
      HorizontalPanel parameterPanel7 = new HorizontalPanel();   
      parameterPanel7.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_required + "=\"")));
      final ListBox parameterRequired = new ListBox();
      parameterRequired.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          boolean newIsRequired = false;
          if (parameterRequired.getItemText(parameterRequired.getSelectedIndex()).equals("true")) {
            newIsRequired = true;
          }
          param.updateIsRequired(param.getIsRequired(), newIsRequired);
        }
      });
      parameterRequired.setVisibleItemCount(1);
      parameterRequired.addItem("true");
      parameterRequired.addItem("false");
      if (param.getIsRequired()) {
        parameterRequired.setSelectedIndex(0);
      }
      else {
        parameterRequired.setSelectedIndex(1);
      }
      parameterPanel7.add(parameterRequired);
      parameterPanel7.add(new HTML(SyntaxHighlighter.highlight("\"")));
      detailsPanel.add(parameterPanel7);
 
      HorizontalPanel parameterPanel8 = new HorizontalPanel();
      parameterPanel8.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_repeating + "=\"")));
      final ListBox parameterRepeating = new ListBox();
      parameterRepeating.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          boolean newIsRepeating = false;
          if (parameterRepeating.getItemText(parameterRepeating.getSelectedIndex()).equals("true")) {
            newIsRepeating = true;
          }
View Full Code Here

    HorizontalPanel resourceTypePanel = new HorizontalPanel();
    resourceTypePanel.add(new HTML(SyntaxHighlighter.highlight("<" + WadlXml.resourceTypeNode + " " + WadlXml.resource_type_id + "=\"")));
       
    final TextBox input = new TextBox();
    input.setText(resourceType.getId());
    input.addChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        resourceType.updateId(resourceType.getId(), input.getText());
      }   
    });
    resourceTypePanel.add(input);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.ChangeListener

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.