Examples of ListBox


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

    protected ListBox select;

    private int lastSelectedIndex = -1;

    public VListSelect() {
        super(new ListBox(true), CLASSNAME);
        select = getOptionsContainer();
        select.addChangeHandler(this);
        select.addClickHandler(this);
        select.setVisibleItemCount(VISIBLE_COUNT);
        setStyleName(CLASSNAME);
View Full Code Here

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

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

            }

            // 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

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

    // 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

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

    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

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

     
      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

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

     
      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

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

    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

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

      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

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

     * 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
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.