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

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


    levelButtons = new Button[levels.length];
    for (int i = 0; i < levels.length; i++) {
      final int level = levels[i];
      levelButtons[i] = new Button(LogUtil.levelToString(level));
      buttonPanel.add(levelButtons[i]);
      levelButtons[i].addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          ((Button) sender).setFocus(false);
          Log.setCurrentLogLevel(level);
        }
      });
    }

    Button clearButton = new Button("Clear");
    clearButton.addStyleName("log-clear-button");
    DOM.setStyleAttribute(clearButton.getElement(), "color", "#00c");
    clearButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        ((Button) sender).setFocus(false);
        Log.clear();
      }
    });
    buttonPanel.add(clearButton);

    Button aboutButton = new Button("About");
    aboutButton.addStyleName("log-clear-about");
    aboutButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        ((Button) sender).setFocus(false);

        // TODO Add GWT.getVersion() after 1.5
        Log.diagnostic("\n" //
View Full Code Here


   
    int row = listTable.getRowCount();
    Hyperlink link = new Hyperlink( client.getName(), client.getName() );
    listTable.getRowFormatter().setVerticalAlign(row,HasVerticalAlignment.ALIGN_TOP);
    final Image icon = new Image("icon_user.gif");
    icon.addClickListener(new ClickListener(){
      public void onClick( Widget sender ){
        try{
        RequestBuilder requestBuilder = new RequestBuilder( RequestBuilder.GET, GWT.getModuleBaseURL()+"/"+client.getName()+".html" );
        requestBuilder.sendRequest( null, new RequestCallback(){
          public void onError(Request request, Throwable exception){ /*ignored*/ }
View Full Code Here

           {
               if(keyCode == KEY_ENTER )
                 signIn();
           }});

    signInButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender)
      {
        signIn();
      }});
  }
View Full Code Here

      while (errorIterator.hasNext()) {       
        final String error = (String) errorIterator.next();
        reallyAddFaults.add(error);
        final CheckBox checkBox = new CheckBox();
        checkBox.setChecked(true);
        checkBox.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            if (checkBox.isChecked() &&
                !reallyAddFaults.contains(error)) {             
              reallyAddFaults.add(error);
            }          
            else {
              if (reallyAddFaults.contains(error)) {
                reallyAddFaults.remove(error);
              }
            }
          }         
        });
       
        grid.setWidget(i, 0, checkBox);       
        grid.setText(i, 1, error);      
        i++;
      }     
      addErrorsButton.setEnabled(false);
      addErrorsButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          // TODO         
        }
       
      });
      containerPanel.add(addErrorsButton);
    }
   
    // schema locations
    final Button addSchemaButton = new Button(GuiFactory.strings.addSchema());
    if (!schemaLocations.isEmpty()) {
      final Vector reallyAddSchemaLocations = new Vector();
      containerPanel.add(new HTML("<br />" + GuiFactory.strings.schemaLocations()));
      ScrollPanel schemaLocationContainerPanel = new ScrollPanel();
      schemaLocationContainerPanel.setStyleName("restDescribe-wadlArea");
      schemaLocationContainerPanel.setHeight(panelHeight);
      VerticalPanel schemaLocationPanel = new VerticalPanel();
      schemaLocationContainerPanel.add(schemaLocationPanel);
      containerPanel.add(schemaLocationContainerPanel);
     
      Iterator schemaLocationIterator = schemaLocations.iterator();
      int i = 0;
      HorizontalPanel horizontalSchemaPanel = new HorizontalPanel();
      schemaLocationPanel.add(horizontalSchemaPanel);
      Grid grid = new Grid(schemaLocations.size(), 2);
      horizontalSchemaPanel.add(grid);
      while (schemaLocationIterator.hasNext()) {       
        final String schemaLocation = (String) schemaLocationIterator.next();
        reallyAddSchemaLocations.add(schemaLocation);
        final CheckBox checkBox = new CheckBox();
        checkBox.setChecked(true);
        checkBox.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            if (checkBox.isChecked() &&
                !reallyAddSchemaLocations.contains(schemaLocation)) {             
              reallyAddSchemaLocations.add(schemaLocation);
            }          
            else {
              if (reallyAddSchemaLocations.contains(schemaLocation)) {
                reallyAddSchemaLocations.remove(schemaLocation);
              }
            }
          }         
        });
       
        grid.setWidget(i, 0, checkBox);       
        grid.setText(i, 1, schemaLocation);
        i++;
      }           
      addSchemaButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {                   
          Iterator addSchemaIterator = reallyAddSchemaLocations.iterator();
          while (addSchemaIterator.hasNext()) {
            String include = (String) addSchemaIterator.next();
            if (Analyzer.application.getGrammars() == null) {
              Analyzer.application.addGrammars(new GrammarsNode(Analyzer.application));
            }
            Analyzer.application.grammars.addInclude(include);
          }
          WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
          Tree wadlTree = wadlTreeRoot.buildTree(Analyzer.application);
          WadlPanel.wadlArea.clear();
          WadlPanel.wadlArea.setWidget(wadlTree);
        }         
      });
      containerPanel.add(addSchemaButton);
    }

    // default namespace
    final Button addNamespaceButton = new Button(GuiFactory.strings.addNamespace());
    if (!defaultNamespace.isEmpty()) {
      final Vector reallyAddDefaultNamespace = new Vector();
      containerPanel.add(new HTML("<br />" + GuiFactory.strings.defaultNamespaces()));
      ScrollPanel defaultNamespaceContainerPanel = new ScrollPanel();
      defaultNamespaceContainerPanel.setStyleName("restDescribe-wadlArea");
      defaultNamespaceContainerPanel.setHeight(panelHeight);
      VerticalPanel defaultNamespacePanel = new VerticalPanel();
      defaultNamespaceContainerPanel.add(defaultNamespacePanel);
      containerPanel.add(defaultNamespaceContainerPanel);
     
      Iterator defaultNamespaceIterator = defaultNamespace.iterator();
      int i = 0;
      HorizontalPanel horizontalNamespacePanel = new HorizontalPanel();
      defaultNamespacePanel.add(horizontalNamespacePanel);
      Grid grid = new Grid(defaultNamespace.size(), 2);
      horizontalNamespacePanel.add(grid);
      while (defaultNamespaceIterator.hasNext()) {       
        final String defaultNamespace = (String) defaultNamespaceIterator.next();
        reallyAddDefaultNamespace.add(defaultNamespace);
        final CheckBox checkBox = new CheckBox();
        checkBox.setChecked(true);
        checkBox.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            if (checkBox.isChecked() &&
                !reallyAddDefaultNamespace.contains(defaultNamespace)) {             
              reallyAddDefaultNamespace.add(defaultNamespace);
            }          
            else {
              if (reallyAddDefaultNamespace.contains(defaultNamespace)) {
                reallyAddDefaultNamespace.remove(defaultNamespace);
              }
            }
          }         
        });
       
        grid.setWidget(i, 0, checkBox);       
        grid.setText(i, 1, defaultNamespace);
        i++;
      }           
      addNamespaceButton.addClickListener(new ClickListener() {
        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);
        }         
      });
      containerPanel.add(addOtherNamespacesButton);
    }
   
    Button closeButton = new Button(GuiFactory.strings.ok());
    closeButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        if (!otherNamespaces.isEmpty()) {
          addOtherNamespacesButton.click();
        }
        if (!defaultNamespace.isEmpty()) {
          addNamespaceButton.click();
        }
        if (!errorStatuses.isEmpty()) {
          addErrorsButton.click();
        }
        if (!schemaLocations.isEmpty()) {
          addSchemaButton.click();
        }       
        dialog.hide();
        GuiFactory.blockScreen(false);
      }
    });
   
    Button cancelButton = new Button(GuiFactory.strings.cancel());
    cancelButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialog.hide();
        GuiFactory.blockScreen(false);
      }
    });
View Full Code Here

    topPanel.setWidth("100%");   
    
    // user links in the upper right corner
    String separator = "&nbsp;|&nbsp;";   
    Hyperlink settingsLink = new Hyperlink(GuiFactory.strings.settingsLink(), "settings");
    settingsLink.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        SettingsDialog.show();
      }
    });
    userLinks.add(settingsLink);
    userLinks.setStyleName("restDescribe-userLinks");
    userLinks.add(new HTML(separator));
    Hyperlink helpLink = new Hyperlink("<nobr><img src=\"./images/new_window.png\" style=\"vertical-align:middle;margin-right:0.2em;\" />" + GuiFactory.strings.helpLink() + "</nobr>", true, "help");
    helpLink.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        HelpDialog.show();
      }
    });
    userLinks.add(new HTML(GuiFactory.strings.newFeature()));
View Full Code Here

        }     
      });    
     
      // 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);
          }
View Full Code Here

    if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.methodNode)) {     
      // add method button     
      HorizontalPanel addMethodPanel = new HorizontalPanel();
           
      Button addMethodButton = new Button(GuiFactory.strings.addMethod());
      addMethodButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          if (parentNode instanceof ResourceNode) {
            ((ResourceNode) parentNode).directlyAddMethod(new MethodNode(GuiFactory.strings.newMethod(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));
            listMethods(parentNode, parentTreeItem, requestString);
          }
View Full Code Here

  public GrammarsItem(final GrammarsNode grammars, final TreeItem applicationTreeItem) {
    HorizontalPanel grammarsPanel = new HorizontalPanel();
    grammarsPanel.add(new HTML(SyntaxHighlighter.highlight("<" + WadlXml.grammarsNode + ">")));
    // remove resources hyperlink
    Hyperlink removeGrammarsLink = new Hyperlink(GuiFactory.strings.remove(), true, "");
    removeGrammarsLink.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {       
        grammars.getApplication().removeGrammars();       
        listGrammars(grammars.getApplication(), applicationTreeItem);
      }
    });     
View Full Code Here

      if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.grammarsNode)) {     
        // add grammars button     
        HorizontalPanel addGrammarsPanel = new HorizontalPanel();
             
        Button addGrammarsButton = new Button(GuiFactory.strings.addGrammars());
        addGrammarsButton.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {         
            application.addGrammars(new GrammarsNode(application));
            application.getGrammars().addInclude(GuiFactory.strings.newInclude());
            listGrammars(application, applicationTreeItem);                   
          }
View Full Code Here

     
      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());
      faultPanel3.add(profileTextBox);
      faultPanel3.add(new HTML(SyntaxHighlighter.highlight("\"")));
      detailsPanel.add(faultPanel3);
         
      faultPanelRight.add(detailsPanel);   
     
      HorizontalPanel faultEndPanel = new HorizontalPanel();
      faultEndPanel.add(new HTML(SyntaxHighlighter.highlight("/>")));
      Hyperlink removeFaultLink = new Hyperlink(GuiFactory.strings.remove(), true, "");
      removeFaultLink.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          if (parentNode instanceof ApplicationNode) {
            ((ApplicationNode) parentNode).removeFault(fault);
          }
          else if (parentNode instanceof ResponseNode) {
View Full Code Here

TOP

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

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.