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

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


 
  private Widget _createWidgetForValue(final GuiInfo gui, String value) {
    int visLines = readOnly ? Math.min(gui.numLines, _countLines(value)) : gui.numLines;
    TextBoxBase tb;
    if ( visLines == 1 ) {
      tb = new TextBox();
    }
    else {
      TextArea ta = new TextArea();
      ta.setVisibleLines(visLines);
      tb = ta;
View Full Code Here


    LDCLabel = new Label("Light-duty commercial (LDC)");
    HDCLabel = new Label("Heavy-duty commercial (HDC)");
    MDBLabel = new Label("Medium-duty minibuses (MDB)");
    HDBLabel = new Label("Heavy-duty buses (HDB)")
   
    date = new TextBox();
   
    // force them to use the calendar widget
    // otherwise the startTime/endTime functions don't work
    date.setReadOnly(true);
    date.setStyleName(style.textBoxSmall());
   
    dayType = new ListBox();
    dayType.addItem("Weekday", TrafficCountRecord.DAYTYPE_WEEKDAY);
    dayType.addItem("Saturday", TrafficCountRecord.DAYTYPE_SATURDAY);
    dayType.addItem("Sunday/Holiday", TrafficCountRecord.DAYTYPE_SUNDAY_HOLIDAY);
   
    startTime = new TextBox();
    startTime.setStyleName(style.textBoxSmall());
   
    endTime = new TextBox();
    endTime.setStyleName(style.textBoxSmall());
   
    tag = new SuggestBox(tagSuggestions);
   
    W2 = new TextBox();
    W2.setStyleName(style.textBoxSmall());
   
    W3 = new TextBox();
    W3.setStyleName(style.textBoxSmall());
   
    PC = new TextBox();
    PC.setStyleName(style.textBoxSmall());
   
    TX = new TextBox();
    TX.setStyleName(style.textBoxSmall());
   
    LDV = new TextBox();
    LDV.setStyleName(style.textBoxSmall());
   
    LDC = new TextBox();
    LDC.setStyleName(style.textBoxSmall());
   
    HDC = new TextBox();
    HDC.setStyleName(style.textBoxSmall());
   
    MDB = new TextBox();
    MDB.setStyleName(style.textBoxSmall());
   
    HDB = new TextBox()
    HDB.setStyleName(style.textBoxSmall());
  }
View Full Code Here

//        RegisteredOntologyInfo ontologyInfo = suggestions.get(suggestion);
//        mainPanel.notifyWorkingOntologyAdded(OntologySelection.this, ontologyInfo, popup);
//      }
//    });
   
    final TextBox textBox = createTextBox(suggestions, listBox, popup);
    textBox.setWidth(width);
    hp.add(textBox);
   
//    // we use the star (*) to show the whole list of vocabs. If the user enters something
//    // different, then remove the star:
//    box.addKeyboardListener(new KeyboardListener() {
//      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
//        // FIXME: if the user wants to use the down arrow to pick a suggestion after
//        // entering *, it cannot do it!
//        if ( keyCode != '*' && box.getText().trim().equals("*") ) {
//          box.setText("");
//        }
//      }
//      public void onKeyDown(Widget sender, char keyCode, int modifiers) {}
//     
//      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
//        if ( keyCode == KeyboardListener.KEY_ENTER ) {
//          String selectedUri = box.getText().trim();
//          Orr.log("addVocabulary: ENTER: '" + selectedUri + "'");
//          if (selectedUri.length() > 0) {
//            if ( VineMain.containsWorkingUri(selectedUri) ) {
//              // ignore the Enter
//              return;
//            }
//            BaseOntologyInfo ontologyInfo = VineMain.getOntologyInfo(selectedUri);
//            if (ontologyInfo instanceof RegisteredOntologyInfo) {
//              // It is a registered ontology -- load it as a working one:
//              RegisteredOntologyInfo roi = (RegisteredOntologyInfo) ontologyInfo;
//              mainPanel.notifyWorkingOntologyAdded(OntologySelection.this, roi, popup);
//            }
//            else {
//              // try as an external ontology:
//              OntologySelection.this.mainPanel.addExternalOntology(selectedUri, popup);
//            }
//          }
//        }       
//      }
//    });

    popup.setText("Select an ontology");
//    hp.add(new HTML("Elements are displayed as you type. Enter * to see the full list."));

    listBox.setWidth(width);
    listBox.setVisibleItemCount(Math.min(listBox.getItemCount() + 2, 12));
    hp.add(listBox);

//    listBox.addChangeListener(new ChangeListener () {
//      public void onChange(Widget sender) {
//        String value = listBox.getValue(listBox.getSelectedIndex());
//        RegisteredOntologyInfo ontologyInfo = suggestions.get(value);
//        mainPanel.notifyWorkingOntologyAdded(OntologySelection.this, ontologyInfo, popup);
//      }
//    });

   
   
    // use a timer to request for focus in the suggest-box:
    new Timer() {
      public void run() {
//        box.setFocus(true);
        textBox.setFocus(true);
      }
    }.schedule(500);
       
   
    popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
View Full Code Here

    });
  }
 
 
  private TextBox createTextBox(final Map<String,RegisteredOntologyInfo> suggestions, final ListBox listBox, final MyDialog popup) {
    final TextBox textBox = new TextBox();
    KeyboardListener kb = new KeyboardListenerAdapter() {
      String[] lastEntered = {""};
      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
        String enteredText = textBox.getText().trim();
        if ( keyCode == KeyboardListener.KEY_ENTER ) {
          Orr.log("ENTER: '" + enteredText + "'");
          if (listBox.getItemCount() > 0) {
            // it means there are items in the listBox that match the entered text.
            // Take the selected item:
            enteredText = listBox.getValue(listBox.getSelectedIndex());
          }
         
          handleEnteredText(enteredText, popup);
       
        else if ( sender == textBox && listBox.getItemCount() > 0 &&
            (keyCode == KeyboardListener.KEY_UP || keyCode == KeyboardListener.KEY_DOWN) ) {
         
          if ( keyCode == KeyboardListener.KEY_UP) {
            if (listBox.getSelectedIndex() > 0) {
              listBox.setSelectedIndex(listBox.getSelectedIndex() - 1);
            }
          }
          else if ( keyCode == KeyboardListener.KEY_DOWN) {
            if (listBox.getSelectedIndex() < listBox.getItemCount() - 1) {
              listBox.setSelectedIndex(listBox.getSelectedIndex() + 1);
            }
          }
        }
        else if (! enteredText.equalsIgnoreCase(lastEntered[0])) {
          lastEntered[0] = enteredText;
          updateListBox(suggestions, listBox, enteredText);
        }
      }
     
    };
   
    textBox.addKeyboardListener(kb);
    listBox.addKeyboardListener(kb);
   
    listBox.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        if (listBox.getSelectedIndex() > 0) {
View Full Code Here

        if ( rb0.isChecked() ) {
          uploadContainer.add(upload);
        }
        else {
          if ( chooseLabel == null ) {
            chooseLabel = new TextBox();
            chooseLabel.setText("");
            chooseLabel.setEnabled(false);
          }
          uploadContainer.add(chooseLabel);
        }
View Full Code Here

        if ( rb0.isChecked() ) {
          uploadContainer.add(upload);
        }
        else {
          if ( chooseLabel == null ) {
            chooseLabel = new TextBox();
            chooseLabel.setText("");
            chooseLabel.setEnabled(false);
          }
          uploadContainer.add(chooseLabel);
        }
View Full Code Here

  private boolean accountJustCreated;
 
 
  private void _addTb(String name, String label) {
    TextBox tb = new TextBox();
    tb.setWidth("200px");
    tbs.put(name, new Entry(label, tb));
  }
View Full Code Here

    TextBox tb = new TextBox();
    tb.setWidth("200px");
    tbs.put(name, new Entry(label, tb));
  }
  private void _addPwTb(String name, String label) {
    TextBox tb = new PasswordTextBox();
    tb.setWidth("200px");
    tbs.put(name, new Entry(label, tb));
  }
View Full Code Here

    }
    else {
      nameToFocus = "username";
      dispatchCreate();
    }
    final TextBox tb2Focus = tbs.get(nameToFocus).tb;
   
    // use a timer to make the userPanel focused (there must be a better way)
    new Timer() {
      public void run() {
        tb2Focus.setFocus(true);
        tb2Focus.selectAll();
      }
    }.schedule(700);

  }
View Full Code Here

   
    HTML tipForPassword = null;
   
    for ( String name : tbs.keySet() ) {
      Entry entry = tbs.get(name);
      TextBox tb = entry.tb;
     
      if ( (tb instanceof PasswordTextBox) && userLoggedIn != null && tipForPassword == null ) {
        tipForPassword = new HTML("<font color=\"gray\"><i>Fill in the following if you want to change your password:</i></font>");
        panel.getFlexCellFormatter().setColSpan(row, 0, 3);
        panel.setWidget(row, 0, tipForPassword);
View Full Code Here

TOP

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

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.