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

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


    public Widget getColumn2() {
        final TextBox tb = new TextBox();
        tb.setEnabled(isEnabled());
        tb.setText(state[ANSWER]);
        tb.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                reactToChange(tb.getText());
            }
        });
        tb.addKeyboardListener(new DelayedKeyboardListener(new TimerListener() {
View Full Code Here


    public Widget getColumn2() {
        final TextArea ta =  new TextArea();
        ta.setEnabled(isEnabled());
        ta.setText(state[ANSWER]);
        ta.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                reactToChange(ta.getText());
            }
        });
        ta.addKeyboardListener(new DelayedKeyboardListener(new TimerListener() {
View Full Code Here

        for (int i = FIRST_CHOICE; i < state.length; i += 2) {           
            ids.add(state[i]);
            listBox.addItem(state[i + 1]);
        }
        listBox.setSelectedIndex(ids.indexOf(state[ANSWER]));
        listBox.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                reactToChange((String) ids.get(listBox.getSelectedIndex()));
            }
        });
        return listBox;
View Full Code Here

                    showStartButton();
                }
            }
        });

        listBox_Program.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                updateListBox();
            }

            private void updateListBox() {
                // TODO: do same easy get for others...
                String program = Utils.getListBoxItemText(listBox_Program);
                ArrayList<String> typeList = Classification.getTypeList(program);
                listBox_Type.clear();
                for (String item : typeList) {
                    listBox_Type.addItem(item);
                }
                listBox_Type.setItemSelected(0, true);
                listBox_Type.setEnabled(typeList.size() > 1);
                listBox_Type.onBrowserEvent(Event.getCurrentEvent());
            }
        });

        listBox_Type.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                updateListBox();
            }

            private void updateListBox() {
                int idx = listBox_Program.getSelectedIndex();
                if (idx < 0) {
                    GenClient.showError("Failed to get program");
                    return;
                }
                String program = listBox_Program.getValue(idx);
                idx = listBox_Type.getSelectedIndex();
                if (idx < 0) {
                    GenClient.showError("Failed to get type");
                    return;
                }
                String type = listBox_Type.getValue(idx);
                ArrayList<String> subTypeList = Classification.getSubTypeList(program, type);
                listBox_Subtype.clear();
                for (String item : subTypeList) {
                    listBox_Subtype.addItem(item);
                }
                listBox_Subtype.setItemSelected(0, true);
                listBox_Subtype.setEnabled(subTypeList.size() > 1);
                listBox_Subtype.onBrowserEvent(Event.getCurrentEvent());
            }
        });

        listBox_Subtype.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                updateListBox();
            }

            private void updateListBox() {
                int idx = listBox_Program.getSelectedIndex();
                if (idx < 0) {
                    GenClient.showError("Failed to get program");
                    return;
                }
                String program = listBox_Program.getValue(idx);
                idx = listBox_Type.getSelectedIndex();
                if (idx < 0) {
                    GenClient.showError("Failed to get type");
                    return;
                }
                String type = listBox_Type.getValue(idx);
                idx = listBox_Subtype.getSelectedIndex();
                if (idx < 0) {
                    GenClient.showError("Failed to get subType");
                    return;
                }
                String subType = listBox_Subtype.getValue(idx);
                ArrayList<String> otherList = Classification.getOtherList(program, type, subType);
                listBox_Other.clear();
                for (String item : otherList) {
                    listBox_Other.addItem(item);
                }
                listBox_Other.setItemSelected(0, true);
                listBox_Other.setEnabled(otherList.size() > 1);
                listBox_Other.onBrowserEvent(Event.getCurrentEvent()); // No need to propagate
            }
        });

        listBox_Other.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                updateListBox();
            }

            private void updateListBox() {
View Full Code Here

        if (idx < 0) {
            idx = 1; // en is default
        }
        listBoxLocale.setSelectedIndex(idx);

        listBoxLocale.addChangeListener(new ChangeListener() {
            public void onChange(Widget sender) {
                String localeName = listBoxLocale.getValue(listBoxLocale.getSelectedIndex());

                // original method.
                // Window.open(UtilsJS.getHostPageLocation() + "?locale="
View Full Code Here

    textbox.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        showPopup(null);
      }
    });
    textbox.addChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        sendChangeEvent();
      }
    });
    // Disable autocomplete on our custom combobox, since autocomplete interferes with our use of the cursor keys!
View Full Code Here

    }
  }

  public void addAction(String label, Action action) {
    if(actions.size() == 0) {
      this.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          final String value = getValue();
          if(actions.containsKey(value)) {
            Action action = (Action)actions.get(value);
            action.perform(new AsyncCallback<Void>() {
View Full Code Here

        slider.setNumLabels(5);
        slider.setSize("300px", "50px");
        drawCircleFromRadius(marker.getLatLng(),
            slider.getCurrentValue() * 1000, 30);

        slider.addChangeListener(new ChangeListener() {

          @Override
          public void onChange(Widget sender) {
            SliderBar sb = (SliderBar) sender;
            if (oldCircle != null) {
View Full Code Here

      dropBox.setStyleName("bpm-operation-ui");
      dropBox.addItem("All");
      dropBox.addItem("Active");
      dropBox.addItem("Retired");

      dropBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          switch (dropBox.getSelectedIndex())
          {
            case 0:
              currentFilter = FILTER_NONE;
View Full Code Here

    DefaultListItem retainPermissionsListItem = new DefaultListItem( Messages.getString( "retainPermissions" ) );
    retainPermissionsListItem.setValue( "true" );
    filePermissionsDropDown.addItem( retainPermissionsListItem ); // If selected set "overwriteAclPermissions" to
    // true.

    final ChangeListener filePermissionsHandler = new ChangeListener() {
      @Override
      public void onChange( Widget sender ) {
        String value = filePermissionsDropDown.getSelectedItem().getValue().toString();

        applyAclPermissions.setValue( Boolean.valueOf( value ) );
        applyAclPermissions.setFormValue( value );
        overwriteAclPermissions.setFormValue( value );
        overwriteAclPermissions.setValue( Boolean.valueOf( value ) );
        setRetainOwnershipState();
      }
    };
    filePermissionsDropDown.addChangeListener( filePermissionsHandler );
    filePermissionsDropDown.setVisibleRowCount( 1 );
    disclosureContent.add( filePermissionsDropDown );

    spacer = new VerticalPanel();
    spacer.setHeight( "4px" );
    disclosureContent.add( spacer );

    HTML fileOwnershipLabel = new HTML( Messages.getString( "fileOwnership" ) );
    fileOwnershipLabel.setStyleName( "gwt-Label" );
    disclosureContent.add( fileOwnershipLabel );

    retainOwnershipDropDown.addChangeListener( new ChangeListener() {
      @Override
      public void onChange( Widget sender ) {
        String value = retainOwnershipDropDown.getSelectedItem().getValue().toString();
        retainOwnership.setValue( value );
      }
    } );
    DefaultListItem keepOwnershipListItem = new DefaultListItem( Messages.getString( "keepOwnership" ) );
    keepOwnershipListItem.setValue( "true" );
    retainOwnershipDropDown.addItem( keepOwnershipListItem );
    DefaultListItem assignOwnershipListItem = new DefaultListItem( Messages.getString( "assignOwnership" ) );
    assignOwnershipListItem.setValue( "false" );
    retainOwnershipDropDown.addItem( assignOwnershipListItem );

    retainOwnershipDropDown.setVisibleRowCount( 1 );
    disclosureContent.add( retainOwnershipDropDown );

    spacer = new VerticalPanel();
    spacer.setHeight( "4px" );
    disclosureContent.add( spacer );

    ChangeListener overwriteFileHandler = new ChangeListener() {
      @Override
      public void onChange( Widget sender ) {
        String value = overwriteFileDropDown.getSelectedItem().getValue().toString();
        overwriteFile.setValue( value );
      }
    };
    overwriteFileDropDown.addChangeListener( overwriteFileHandler );

    HTML loggingLabel = new HTML( Messages.getString( "logging" ) );
    loggingLabel.setStyleName( "gwt-Label" );
    disclosureContent.add( loggingLabel );

    final CustomListBox loggingDropDown = new CustomListBox();
    loggingDropDown.addChangeListener( new ChangeListener() {
      public void onChange( Widget sender ) {
        String value = loggingDropDown.getSelectedItem().getValue().toString();
        logLevel.setValue( value );
      }
    } );
View Full Code Here

TOP

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

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.