Package org.damour.base.client.ui.buttons

Examples of org.damour.base.client.ui.buttons.Button


    this.permissibleObject = permissibleObject;

    final User user = AuthenticationHandler.getInstance().getUser();

    setText("E-mail to Friends");
    Button ok = new Button("OK");
    ok.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        // build a map of addresses/names from table
        String toAddresses = "";
        for (int i = 0; i < NUM_ADDRESSES; i++) {
          String address = ((TextBox) emailAddressTable.getWidget(i, 0)).getText();
          if (!StringUtils.isEmpty(address)) {
            String name = ((TextBox) emailAddressTable.getWidget(i, 1)).getText();
            if (StringUtils.isEmpty(name)) {
              name = address;
            }
            toAddresses += address + ";" + name + ";";
          }
        }
        String fromAddress = null;
        String fromName = null;
        if (user == null) {
          fromAddress = userEmailTextBox.getText();
          fromName = userTextBox.getText();
        } else {
          fromAddress = user.getEmail();
          fromName = user.getFirstname();
        }
        if (StringUtils.isEmpty(fromName)) {
          fromName = fromAddress;
        }
        if (StringUtils.isEmpty(fromAddress)) {
          MessageDialogBox messageDialog = new MessageDialogBox("Error", "You must enter your email address.", false, false, true);
          messageDialog.center();
          return;
        }
        sendEmail(permissibleObject, subject, message, fromAddress, fromName, toAddresses);
        hide();
      }
    });
    Button cancel = new Button("Cancel");
    cancel.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        hide();
      }
    });
    final HorizontalPanel dialogButtonPanel = new HorizontalPanel();
View Full Code Here


    usersList.addChangeHandler(this);
    usersList.addItem("Loading...");
    setHeight("100%");
    setWidth("100%");

    Button refreshButton = new Button("Refresh");
    refreshButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        usersList.clear();
        usersList.addItem("Loading...");
        setWidget(0, 1, new Label());
        fetchUsers();
View Full Code Here

    generatedPasswordTextBox.addFocusHandler(new FocusHandler() {
      public void onFocus(FocusEvent event) {
        generatedPasswordTextBox.selectAll();
      }
    });
    Button generatePasswordButton = new Button("Generate!");
    generatePasswordButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        generatedPasswordTextBox.setText(generatePassword());
      }
View Full Code Here

    usersList.addItem("Loading...");
    setHeight("100%");
    setWidth("100%");

    VerticalPanel buttonPanel = new VerticalPanel();
    buttonPanel.add(new Button("New..."));
    buttonPanel.add(new Button("Delete"));

    Button refreshButton = new Button("Refresh");
    refreshButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        usersList.clear();
        usersList.addItem("Loading...");
        setWidget(0, 1, new Label());
        fetchUsers();
View Full Code Here

    });

    lengthCombo.addItem("160-bit WPA Key (minimum security)", "20");
    lengthCombo.addItem("504-bit WPA Key (maximum security)", "63");

    Button generateButton = new Button("Generate Key");
    generateButton.addClickHandler(new ClickHandler() {
     
      public void onClick(ClickEvent event) {
        int length = Integer.parseInt(lengthCombo.getValue(lengthCombo.getSelectedIndex()));
        String ascii = "";
        String hex = "";
        for (int i = 0; i < length; i++) {
          char character = PasswordConst.WEPCharacters[Random.nextInt(PasswordConst.WEPCharacters.length)];
          ascii += character;
          hex += Integer.toHexString(character);
        }
        asciiText.setText(ascii);
        hexText.setText(hex);
      }
    });

    Button generateCustomKeyButton = new Button("Use as Custom Phrase");
    generateCustomKeyButton.addClickHandler(new ClickHandler() {
     
      public void onClick(ClickEvent event) {
        String ascii = asciiText.getText();
        String hex = "";
        for (int i = 0; i < ascii.length(); i++) {
View Full Code Here

    HorizontalPanel buttonPanelWrapper = new HorizontalPanel();
    buttonPanelWrapper.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    buttonPanelWrapper.setWidth("500px");
    HorizontalPanel buttonPanel = new HorizontalPanel();
    // create buttons
    final Button submitButton = new Button("Submit");
    submitButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        String commentStr = commentTextArea.getText();
        if (commentStr == null || "".equals(commentStr.trim())) {
          return;
        }
        Comment comment = new Comment();
        comment.setGlobalRead(true);
        comment.setOwner(permissibleObject.getOwner());
        comment.setAuthor(AuthenticationHandler.getInstance().getUser());
        comment.setComment(commentStr);
        comment.setParent(permissibleObject);
        comment.setEmail(emailTextField.getText());
        submitButton.setEnabled(false);
        submitComment(comment);
      }
    });
    final Button clearButton = new Button("Clear");
    clearButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        commentTextArea.setText("");
        submitButton.setEnabled(true);
      }
    });
View Full Code Here

    lengthCombo.addItem("40-bit WEP Key (5 characters: 64-bits)", "5");
    lengthCombo.addItem("104-bit WEP Key (13 characters: 128-bits)", "13");
    lengthCombo.addItem("128-bit WEP Key (16 characters: 152-bits)", "16");
    lengthCombo.addItem("232-bit WEP Key (29 characters: 256-bits)", "29");

    Button generateButton = new Button("Generate Key");
    generateButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        int length = Integer.parseInt(lengthCombo.getValue(lengthCombo.getSelectedIndex()));
        String ascii = "";
        String hex = "";
        for (int i = 0; i < length; i++) {
          char character = PasswordConst.WEPCharacters[Random.nextInt(PasswordConst.WEPCharacters.length)];
          ascii += character;
          hex += Integer.toHexString(character);
        }
        asciiText.setText(ascii);
        hexText.setText(hex);
      }
    });

    Button generateCustomKeyButton = new Button("Use as Custom Phrase");
    generateCustomKeyButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        String ascii = asciiText.getText();
        String hex = "";
        for (int i = 0; i < ascii.length(); i++) {
View Full Code Here

  private void initUI() {
    statsTable.setText(0, 0, "Loading...");
    statsTable.setBorderWidth(1);
    statsTable.setCellSpacing(5);
    add(statsTable);
    Button refreshButton = new Button("Refresh");
    refreshButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        fetchHibernateStats();
      }
    });
    Button resetButton = new Button("Reset");
    resetButton.setTitle("Reset Hibernate");
    resetButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        resetHibernate();
      }
    });
View Full Code Here

    statsTable.getCellFormatter().setHorizontalAlignment(row, 7, HasHorizontalAlignment.ALIGN_RIGHT);
    statsTable.getCellFormatter().setHorizontalAlignment(row, 8, HasHorizontalAlignment.ALIGN_RIGHT);

    row++;
    for (final HibernateStat stat : stats) {
      Button evictButton = new Button("X");
      evictButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          evictClassFromCache(stat.getRegionName());
        }
      });
View Full Code Here

    String[] columnWidths = new String[] { "600px", "400px", "60px" };

    final ScrollTable table = new ScrollTable(columnWidths, false);
    clear();
    add(table);
    Button refreshButton = new Button("Refresh");
    refreshButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        fetchReferrals(table);
      }
    });
View Full Code Here

TOP

Related Classes of org.damour.base.client.ui.buttons.Button

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.