Examples of TextBox


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

    }

    private static TextBox editableTextBox(final ValueChanged changed,
                                           String fieldName,
                                           String initialValue) {
        final TextBox tb = new TextBox();
        tb.setText( initialValue );
        String m = ((Constants) GWT.create( Constants.class )).ValueFor0( fieldName );
        tb.setTitle( m );
        tb.addChangeHandler( new ChangeHandler() {

            public void onChange(ChangeEvent event) {
                changed.valueChanged( tb.getText() );
            }
        } );

        return tb;
    }
View Full Code Here

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

        mainPanel.setStylePrimaryName("ProConPanel");
        mainPanel.addStyleDependentName(string);

        HorizontalPanel addP = new HorizontalPanel();
        addTextBox = new TextBox();
        Button addB = new Button("Add");
        addB.addClickListener(this);
        addP.add(addTextBox);
        addP.add(addB);
        mainPanel.add(addP);
View Full Code Here

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

  /**
   * Setup the cell editors on the scroll table.
   */
  private void setupCellEditors(PagingScrollTable<Serializable> table) {
    // Integer only cell editor for age
    TextBox intOnlyTextBox = new TextBox();
    intOnlyTextBox.setWidth("4em");
    intOnlyTextBox.addKeyboardListener(new KeyboardListenerAdapter() {
      @Override
      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
        if ((!Character.isDigit(keyCode)) && (keyCode != (char) KEY_TAB)
            && (keyCode != (char) KEY_BACKSPACE)
            && (keyCode != (char) KEY_DELETE) && (keyCode != (char) KEY_ENTER)
View Full Code Here

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

  /**
   * Constructor.
   */
  public TextCellEditor() {
    this(new TextBox());
  }
View Full Code Here

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

    // Align options in a grid
    Grid grid = new Grid(5, 3);

    // Set video ID option
    final TextBox videoIDBox = new TextBox();
    videoIDBox.setText("iuywmPePYKQ");
    grid.setHTML(0, 0, "<B>Video ID:</B>");
    grid.setWidget(0, 1, videoIDBox);
    grid.setWidget(0, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setMovieID(videoIDBox.getText());
      }
    }));

    // Set player width
    final TextBox widthBox = new TextBox();
    widthBox.setText("443px");
    grid.setHTML(1, 0, "<B>Width:</B>");
    grid.setWidget(1, 1, widthBox);
    grid.setWidget(1, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setWidth(widthBox.getText());
      }
    }));

    // Set player height
    final TextBox heightBox = new TextBox();
    heightBox.setText("369px");
    grid.setHTML(2, 0, "<B>Height:</B>");
    grid.setWidget(2, 1, heightBox);
    grid.setWidget(2, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setHeight(heightBox.getText());
      }
    }));

    // Plugins page
    final TextBox pluginsBox = new TextBox();
    pluginsBox.setText("http://www.google.com");
    grid.setHTML(3, 0, "<B>Plugins Page:</B>");
    grid.setWidget(3, 1, pluginsBox);
    grid.setWidget(3, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        EmbeddedObjectInfo info = mainViewer.getInfo();
        info.setPluginsPage(pluginsBox.getText());
        mainViewer.setInfo(info);
      }
    }));

    // Enabled/disable autoplay
View Full Code Here

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

            final CreatePostDialog createPostDialog, final User author,
            String selection) {

        VerticalPanel mainP = new VerticalPanel();

        titleBox = new TextBox();

        textArea = new RichTextArea();

        textArea.setSize("35em", "15em");
        RichTextToolbar toolbar = new RichTextToolbar(textArea);
View Full Code Here

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

    });

   
    final Label aNaiveTextLabel = new Label("A Naive Text Widget:");
    rootPanel.add(aNaiveTextLabel, 50, 180);
    final TextBox textBox = new TextBox();
    rootPanel.add(textBox, 50, 204);
  }
View Full Code Here

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

    Grid grid = new Grid(7, 3);
    grid.setBorderWidth(1);
    grid.setCellPadding(3);

    // Set the current progress
    final TextBox curBox = new TextBox();
    curBox.setText("0.0");
    grid.setWidget(0, 1, curBox);
    grid.setHTML(0, 2, "The current progress.");
    grid.setWidget(0, 0, new Button("Set Progress", new ClickListener() {
      public void onClick(Widget sender) {
        simulationTimer.cancel();
        mainProgressBar.setProgress(new Float(curBox.getText()).floatValue());
      }
    }));

    // Set the minimum progress
    final TextBox minBox = new TextBox();
    minBox.setText(mainProgressBar.getMinProgress() + "");
    grid.setWidget(1, 1, minBox);
    grid.setHTML(1, 2, "The minimum progress progress.");
    grid.setWidget(1, 0, new Button("Set Min Progress", new ClickListener() {
      public void onClick(Widget sender) {
        simulationTimer.cancel();
        mainProgressBar.setMinProgress(new Float(minBox.getText()).floatValue());
      }
    }));

    // Set the maximum progress
    final TextBox maxBox = new TextBox();
    maxBox.setText(mainProgressBar.getMaxProgress() + "");
    grid.setWidget(2, 1, maxBox);
    grid.setHTML(2, 2, "The maximum progress.");
    grid.setWidget(2, 0, new Button("Set Max Progress", new ClickListener() {
      public void onClick(Widget sender) {
        simulationTimer.cancel();
        mainProgressBar.setMaxProgress(new Float(maxBox.getText()).floatValue());
      }
    }));

    // Show or hide the text
    final HTML textVisibleLabel = new HTML("visible");
    grid.setWidget(3, 1, textVisibleLabel);
    grid.setHTML(3, 2, "Show or hide the text in the progress bar.");
    grid.setWidget(3, 0, new Button("Toggle Text", new ClickListener() {
      public void onClick(Widget sender) {
        if (mainProgressBar.isTextVisible()) {
          textVisibleLabel.setHTML("hidden");
          mainProgressBar.setTextVisible(false);
        } else {
          textVisibleLabel.setHTML("visible");
          mainProgressBar.setTextVisible(true);
        }
      }
    }));

    // Add the default text option
    final HTML defaultTextLabel = new HTML("custom");
    grid.setWidget(4, 1, defaultTextLabel);
    grid.setHTML(4, 2, "Override the format of the text with a custom"
        + "format.");
    grid.setWidget(4, 0, new Button("Toggle Custom Text", new ClickListener() {
      public void onClick(Widget sender) {
        if (useCustomText) {
          defaultTextLabel.setHTML("default");
          useCustomText = false;
          mainProgressBar.setProgress(mainProgressBar.getProgress());
        } else {
          defaultTextLabel.setHTML("custom");
          useCustomText = true;
          mainProgressBar.setProgress(mainProgressBar.getProgress());
        }
      }
    }));

    // Add static resize timer methods
    final HTML resizeCheckLabel = new HTML("enabled");
    grid.setWidget(5, 1, resizeCheckLabel);
    grid.setHTML(5, 2, "When resize checking is enabled, a Timer will "
        + "periodically check if the Widget's dimensions have changed.  If "
        + "they change, the widget will be redrawn.");
    grid.setWidget(5, 0, new Button("Toggle Resize Checking",
        new ClickListener() {
          public void onClick(Widget sender) {
            if (ResizableWidgetCollection.get().isResizeCheckingEnabled()) {
              ResizableWidgetCollection.get().setResizeCheckingEnabled(false);
              resizeCheckLabel.setHTML("disabled");

            } else {
              ResizableWidgetCollection.get().setResizeCheckingEnabled(true);
              resizeCheckLabel.setHTML("enabled");
            }
          }
        }));

    // Create a form to set width of element
    final TextBox widthBox = new TextBox();
    widthBox.setText("50%");
    grid.setWidget(6, 1, widthBox);
    grid.setHTML(6, 2, "Set the width of the widget.  Use this to see how "
        + "resize checking detects the new dimensions and redraws the widget.");
    grid.setWidget(6, 0, new Button("Set Width", new ClickListener() {
      public void onClick(Widget sender) {
        mainProgressBar.setWidth(widthBox.getText());
      }
    }));

    // Add all components to the page
    RootPanel.get().add(mainProgressBar);
View Full Code Here

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

  }

  private Widget treeWithVarietyWidgets() {
    FastTree t = new FastTree();
    FastTreeItem item = t.addItem("Text");
    item.addItem(new TextBox());
    ListBox lb = new ListBox();
    for (int i = 0; i < 100; i++) {
      lb.addItem(i + "");
    }
    item.addItem(lb);
View Full Code Here

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

    return sp;
  }

  private Widget zoomingTree() {
    VerticalPanel p = new VerticalPanel();
    final TextBox b = new TextBox();

    p.add(b);
    final FastTree tree = new FastTree();
    final HashMap<String, FastTreeItem> treeItems = new HashMap<String, FastTreeItem>();

    b.addKeyboardListener(new KeyboardListener() {

      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        if (keyCode == KEY_ENTER) {
          String value = b.getText().trim();
          FastTreeItem chosen = treeItems.get(value);
          if (chosen == null) {
            Window.alert("No such tree item exists");
          }
          tree.setSelectedItem(chosen);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.