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

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


            setStyleName(VDateField.CLASSNAME + "-time");
            buildTime();
        }

        private ListBox createListBox() {
            ListBox lb = new ListBox();
            lb.setStyleName(VNativeSelect.CLASSNAME);
            lb.addChangeHandler(this);
            lb.addBlurHandler(VCalendarPanel.this);
            lb.addFocusHandler(VCalendarPanel.this);
            return lb;
        }
View Full Code Here


            }

            // Update times
            updateTimes();

            ListBox lastDropDown = getLastDropDown();
            lastDropDown.addKeyDownHandler(new KeyDownHandler() {
                @Override
                public void onKeyDown(KeyDownEvent event) {
                    boolean shiftKey = event.getNativeEvent().getShiftKey();
                    if (shiftKey) {
                        return;
View Full Code Here

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

    final String width = "700px";
   
    // #194: Can't access all ontologies from VINE drop-down
    // ListBox added as a fix to this issue.
    final ListBox listBox = new ListBox();
   
//    MultiWordSuggestOracle oracle = new MultiWordSuggestOracle("/ :");
   
    // A map from a suggestion to its corresponding RegisteredOntologyInfo:
    final Map<String,RegisteredOntologyInfo> suggestions = new HashMap<String,RegisteredOntologyInfo>();
   
    List<BaseOntologyInfo> allUris = VineMain.getAllUris();
   
    for ( int index = 0, count = allUris.size(); index < count; index++ ) {
      BaseOntologyInfo ontologyInfo = allUris.get(index);
      if ( VineMain.containsWorkingUri(ontologyInfo.getUri()) ) {
        // do not add any suggestion for an entry that is already in the workingUris
        continue;
      }
     
      if ( ! (ontologyInfo instanceof RegisteredOntologyInfo)) {
        // only add suggestions for registered ontologies
        continue;
      }
     
      RegisteredOntologyInfo registeredOntologyInfo = (RegisteredOntologyInfo) ontologyInfo;
     
      String lab = ontologyInfo.getDisplayLabel();
      String uri = ontologyInfo.getUri();
     
//      // include a star as a convenience to see the whole list if the user types in a star:
//      String suggestion = "* " +uri+ " : " +lab;
      String suggestion = uri;
     
      listBox.addItem(uri+ " : " +lab, suggestion);
      suggestions.put(suggestion, registeredOntologyInfo);
//      oracle.add(suggestion);
    }

//    final SuggestBox box = new SuggestBox(oracle);
//    box.setWidth(width);
   
   
    CellPanel hp = new VerticalPanel();
    final MyDialog popup = new MyDialog(hp) {
      public boolean onKeyUpPreview(char key, int modifiers) {
        if ( key == KeyboardListener.KEY_ESCAPE ) {
          hide();
          return false;
        }
          return true;
        }
    };
    hp.add(new TLabel("Ontology URI:",
        "Select or enter the URL of the ontology you want to include in the list of working ontologies. " +
        "<br/>" +
        "As you type, URIs are displayed according to matching components in the " +
        "URI or the associated title."
    ));
   
//    hp.add(box);
//    box.addEventHandler(new SuggestionHandler() {
//      public void onSuggestionSelected(SuggestionEvent event) {
//        String suggestion = event.getSelectedSuggestion().getReplacementString();
//        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());
View Full Code Here

     
      if ( elem.widget instanceof TextBoxBase ) {
        value = ((TextBoxBase) elem.widget).getText();
      }
      else if ( elem.widget instanceof ListBox ) {
        ListBox lb = (ListBox) elem.widget;
        value = lb.getValue(lb.getSelectedIndex());
      }
      else if ( elem.widget instanceof FieldWithChoose ) {
        value = ((FieldWithChoose) elem.widget).getTextBox().getText();
      }
     
View Full Code Here

     
      if ( elem.widget instanceof TextBoxBase ) {
        ((TextBoxBase) elem.widget).setText(value);
      }
      else if ( elem.widget instanceof ListBox ) {
        ListBox lb = (ListBox) elem.widget;
        int idx = 0;
        for ( int i = 0; i < lb.getItemCount(); i++ ) {
          if ( value.equals(lb.getValue(i)) ) {
            idx = i;
            break;
          }
        }
        lb.setSelectedIndex(idx);
      }
      else if ( elem.widget instanceof FieldWithChoose ) {
        ((FieldWithChoose) elem.widget).setValue(value);
      }
    }
View Full Code Here

    for ( Elem elem : elems ) {
      if ( elem.widget instanceof TextBoxBase ) {
        ((TextBoxBase) elem.widget).setText(value);
      }
      else if ( elem.widget instanceof ListBox ) {
        ListBox lb = (ListBox) elem.widget;
        int idx = 0;
        lb.setSelectedIndex(idx);
      }
      else if ( elem.widget instanceof FieldWithChoose ) {
        ((FieldWithChoose) elem.widget).setValue(value);
      }
    }
View Full Code Here

      refreshPrimaryList(item.getLabel(), item.getValue(), !item.isSelected());
        }
    });
    scroll.add(tree);
    rightPanel.add(scroll);
    primary = new ListBox();
    primary.setWidth("400px");
    primary.addItem("Current Document", "");
    addNamedField(primary, "Primary Resource: ");
    ok = new Button("OK", new ClickHandler(){
      public void onClick(ClickEvent event) {
View Full Code Here

     * Builds the Insert LaTeX Header form.
     */
  @Override
  protected void buildForm() {
    content.setWidth("500px");
      level = new ListBox();
    level.addItem("Part");
    level.addItem("Chapter");
    level.addItem("Section");
    level.addItem("Sub-Section");
    level.addItem("Sub-Sub-Section");
View Full Code Here

   
   
    // Auswaehlen
    selectPanel = new Grid(2,2);
    selectPanel.setWidget(0, 0, new HTML("Name"));
    selectBox = new ListBox();
    selectPanel.setWidget(0, 1, selectBox);
    Button selectButton = new Button("Auswählen");
    selectButton.addClickHandler(new ClickHandler() {
     
      @Override
      public void onClick(ClickEvent event) {
        String wikiPageName = selectBox.getItemText(selectBox.getSelectedIndex());
        for (WikiPageBoxHandler listener: selectHandler)
          listener.onWikiPage(wikiPageName);
      }
    });
    selectPanel.setWidget(1, 1, selectButton);
    selectPanel.setVisible(false);
    panel.add(selectPanel);
   
   
    // delete panel
    deletePanel = new Grid(2,2);
    deletePanel.setWidget(0, 0, new HTML("Name"));
    deleteBox = new ListBox();
    deletePanel.setWidget(0, 1, deleteBox);
    Button deleteButton = new Button("Löschen");
    deleteButton.addClickHandler(new ClickHandler() {
     
      @Override
View Full Code Here

TOP

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

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.