當前位置: 首頁>>代碼示例>>Java>>正文


Java ChangeHandler類代碼示例

本文整理匯總了Java中com.google.gwt.event.dom.client.ChangeHandler的典型用法代碼示例。如果您正苦於以下問題:Java ChangeHandler類的具體用法?Java ChangeHandler怎麽用?Java ChangeHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ChangeHandler類屬於com.google.gwt.event.dom.client包,在下文中一共展示了ChangeHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FileInputButton

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
public FileInputButton() {
    wrapper = new Span();
    wrapper.addStyleName(Styles.BTN);
    upload = new FileUpload();

    upload.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            fireChanged();
        }
    });

    wrapper.add(upload);
    wrapper.addStyleName("btn-file");
    initWidget(wrapper);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:FileInputButton.java

示例2: initializeListBox

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
/**
 * Initializes the list box that allows to select styles
 * @param listBox the list box to initialize
 * @param dataToName the mapping from the style ID to the human readable name of the style
 * @param dataToStyleName the mapping from the style ID to the CSS style name
 * @param defaultValue the default style ID that should be set as selected
 */
public void initializeListBox( final ListBox listBox, final Map<Integer, String> dataToName,
							   final Map<Integer, String> dataToStyleName, final int defaultValue) {
	//Initialize the list box with data
	Iterator< Entry<Integer,String> > entrySetIter = dataToName.entrySet().iterator();
	while( entrySetIter.hasNext() ) {
		Entry<Integer, String> entry = entrySetIter.next();
		listBox.addItem( entry.getValue(), dataToStyleName.get( entry.getKey() ) );
	}
	listBox.setVisibleItemCount( 1 );
	
	//Set the default value as being selected
	setListBoxStyleID( listBox, defaultValue, dataToStyleName );
	
	//Add the change listener
	listBox.addChangeHandler(new ChangeHandler() {
		public void onChange(ChangeEvent e) {
			//Update the sample view
			updateSampleViewStyles();
		}
	});
}
 
開發者ID:ivan-zapreev,項目名稱:x-cure-chat,代碼行數:29,代碼來源:FontSelectorPanelUI.java

示例3: addIntervalChangeHandler

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
private final void addIntervalChangeHandler() {
	intervalListBox.addChangeHandler(new ChangeHandler() {

		@Override
		public void onChange(ChangeEvent event) {
			String divisor = intervalListBox.getValue(intervalListBox.getSelectedIndex());
			String headerName = getSelectedRadioValue();
			if (!(headerName.equalsIgnoreCase(ReportingConstants.MODULE) || headerName.equalsIgnoreCase(ReportingConstants.PLUGIN))) {
				headerName = ReportingConstants.MODULE;
			}
			List<Record> recordList = createTableData(reportList, Integer.parseInt(divisor));
			reportingListView.updateHeaders(headerName, intervalListBox.getItemText(intervalListBox.getSelectedIndex()));
			reportingListView.listView.updateRecords(recordList, presenter.getStartIndex(), presenter.getTotalCount());
		}
	});
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:17,代碼來源:ReportingView.java

示例4: FolderSelectionWidget

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
public FolderSelectionWidget(final Map<String, String> batchClassesNameMap, final HandlerManager eventBus) {
	super();
	initWidget(BINDER.createAndBindUi(this));
	mainPanel.addStyleName(FolderManagementConstants.OPTIONS_BOX);
	batchClassSelectionListBox.setWidth(_150PX);
	batchClassSelectionListBox.addStyleName(FolderManagementConstants.CUSTOM_LIST_BOX);
	if (null != batchClassesNameMap && !batchClassesNameMap.isEmpty()) {
		Set<Entry<String, String>> entrySet = batchClassesNameMap.entrySet();
		for (Entry<String, String> entry : entrySet) {
			batchClassSelectionListBox.addItem(entry.getKey());
		}
		fireEventForFolderSelection(batchClassesNameMap, eventBus);
		batchClassSelectionListBox.addChangeHandler(new ChangeHandler() {

			@Override
			public void onChange(ChangeEvent event) {
				fireEventForFolderSelection(batchClassesNameMap, eventBus);
			}
		});
	} else {
		eventBus.fireEvent(new BatchClassChangeEvent());
	}
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:24,代碼來源:FolderSelectionWidget.java

示例5: postConstruct

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
/**
 * Called after construction.
 */
@PostConstruct
protected void postConstruct() {
	sourceTablesTable.clear();
	
    // Change Listener for Available sources ListBox
    listboxSources.addChangeHandler(new ChangeHandler()
    {
    	// Changing the updates status
    	public void onChange(ChangeEvent event)
    	{
    		sourceTablesTable.clear();
			String srcName = getSelectedSource();
			if (srcName != null) {
				doGetTablesAndProcs(srcName);
			}
    	}
    });
    
    sourceTablesTable.setOwner(this.getClass().getName());
    sourceTablesTable.setShowHeader(false);
}
 
開發者ID:Teiid-Designer,項目名稱:teiid-webui,代碼行數:25,代碼來源:TableSelectorWidget.java

示例6: addValueChangeHandler

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler)
{
	// Initialization code
	if (!valueChangeHandlerInitialized)
	{
		valueChangeHandlerInitialized = true;
		super.addChangeHandler(new ChangeHandler()
		{
			public void onChange(ChangeEvent event)
			{
				ValueChangeEvent.fire(EnumListBox.this, getValue());
			}
		});
	}
	return addHandler(handler, ValueChangeEvent.getType());
}
 
開發者ID:turbomanage,項目名稱:listmaker,代碼行數:18,代碼來源:EnumListBox.java

示例7: addValueChangeHandler

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler)
{
	// Initialization code
	if (!valueChangeHandlerInitialized)
	{
		valueChangeHandlerInitialized = true;
		super.addChangeHandler(new ChangeHandler()
		{
			public void onChange(ChangeEvent event)
			{
				ValueChangeEvent.fire(SelectOneListBox.this, getValue());
			}
		});
	}
	return addHandler(handler, ValueChangeEvent.getType());
}
 
開發者ID:turbomanage,項目名稱:listmaker,代碼行數:18,代碼來源:SelectOneListBox.java

示例8: ShiftsLimitTextBox

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
public ShiftsLimitTextBox(final RiaContext ctx, final EmployeePreferences employeePreferences) {
	shiftLimit=employeePreferences.getShiftsLimit();
	
	setStyleName("s2-preferencesJobsTextBox");
	setTitle(ctx.getI18n().job());
	setText(""+shiftLimit);

	addChangeHandler(new ChangeHandler() {
		@Override
		public void onChange(ChangeEvent event) {
			try {
				shiftLimit=(Integer.parseInt(getText()));
				ctx.getStatusLine().showInfo("Shift limit set to "+getText()); // TODO i18n
			} catch(Exception e) {
				ctx.getStatusLine().showError(getText()+" is not valid shift limit number"); // TODO i18n
			}
		}
	});
}
 
開發者ID:dvorka,項目名稱:shifts-solver,代碼行數:20,代碼來源:ShiftsLimitTextBox.java

示例9: addChangeHandler

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addChangeHandler(final ChangeHandler handler) {
  if (!changeHandlerAdded) {
    changeHandlerAdded = true;
    final OrionTextViewOverlay textView = this.editorOverlay.getTextView();
    textView.addEventListener(
        OrionEventConstants.MODEL_CHANGED_EVENT,
        new OrionTextViewOverlay.EventHandlerNoParameter() {

          @Override
          public void onEvent() {
            fireChangeEvent();
          }
        });
  }
  return addHandler(handler, ChangeEvent.getType());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:18,代碼來源:OrionEditorWidget.java

示例10: createListBox

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
private ListBox createListBox() {
    List<EnumFieldDef.Item> listItems = new ArrayList<EnumFieldDef.Item>();
    listItems.add(new EnumFieldDef.Item("short", "Short Form"));
    listItems.add(new EnumFieldDef.Item("long", "Long Form"));
    EnumFieldDef list = new EnumFieldDef("Lists");
    list.addItems(listItems);
    list.setNullAllow(false);
    list.setErrMsg("This field is required. Select one from list");
    lists = GwtUtil.createComboBox(list);
    lists.addChangeHandler((new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            formToSelect = lists.getValue(lists.getSelectedIndex());
            changePanel(formToSelect);
        }
    }));


    return lists;
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:20,代碼來源:CatddPanel.java

示例11: ListBoxInputField

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
public ListBoxInputField(EnumFieldDef fieldDef) {
    _fieldDef= fieldDef;
    initWidget(_listBox);

    //list box setup
    _items= ((EnumFieldDef)_fieldDef).getEnumValues();
    for(EnumFieldDef.Item item : _items) {
        _listBox.addItem(item.getTitle());
    }
    _listBox.setTitle(_fieldDef.getShortDesc());
    reset();

    _listBox.addChangeHandler(new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            _selectedIdx= _listBox.getSelectedIndex();
            ValueChangeEvent.fire(ListBoxInputField.this,_selectedIdx+"");
            updatePref();
        }
    });

   // label setup
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:23,代碼來源:ListBoxInputField.java

示例12: DownloadBox

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
DownloadBox(ChangeInfo change, String revision, PatchSet.Id psId) {
  this.change = change;
  this.revision = revision;
  this.psId = psId;
  this.commandTable = new FlexTable();
  this.scheme = new ListBox();
  this.scheme.addChangeHandler(
      new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
          renderCommands();
          if (Gerrit.isSignedIn()) {
            saveScheme();
          }
        }
      });

  setStyleName(Gerrit.RESOURCES.css().downloadBox());
  commandTable.setStyleName(Gerrit.RESOURCES.css().downloadBoxTable());
  scheme.setStyleName(Gerrit.RESOURCES.css().downloadBoxScheme());
  add(commandTable);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:23,代碼來源:DownloadBox.java

示例13: addChangeHandler

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
private void addChangeHandler(final PropertyEditorFieldInfo property,
                              final PropertyEditorComboBox listBox) {
    listBox.addChangeHandler(new ChangeHandler() {
                                 @Override
                                 public void onChange(ChangeEvent event) {
                                     int selectedIndex = listBox.getSelectedIndex();
                                     if (validate(property,
                                                  listBox.getItemText(selectedIndex))) {
                                         listBox.clearOldValidationErrors();
                                         property.setCurrentStringValue(listBox.getItemText(selectedIndex));
                                         propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
                                                                                                           listBox.getItemText(selectedIndex)));
                                     } else {
                                         listBox.setValidationError(getValidatorErrorMessage(property,
                                                                                             listBox.getItemText(selectedIndex)));
                                         listBox.setSelectItemByText(property.getCurrentStringValue());
                                     }
                                 }
                             }

    );
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:23,代碼來源:ComboField.java

示例14: setupZoomChangeHandler

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
private void setupZoomChangeHandler() {
    view.addZoomChangeHandler(new ChangeHandler() {

        private int m_currentZoom = 100;

        @Override
        public void onChange(final ChangeEvent event) {
            final int pct = view.getSelectedZoomLevel();
            if (m_currentZoom == pct) {
                return;
            }
            m_currentZoom = pct;
            view.setZoom(pct);
        }
    });
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:WiresGridsDemoPresenter.java

示例15: init

import com.google.gwt.event.dom.client.ChangeHandler; //導入依賴的package包/類
@Override
public void init(final RepositoryConfigurationPresenter presenter) {
    this.presenter = presenter;

    configureButton.setText(constants.Configure_Repository());
    sourceBranchText.setText("master");
    devBranchText.setText("dev");
    releaseBranchText.setText("release");
    currentVersionText.setReadOnly(true);
    chooseRepositoryBox.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            String value = chooseRepositoryBox.getSelectedValue();
            GWT.log(value);

            presenter.loadRepositoryStructure(value);
        }
    });
    presenter.loadRepositories();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:22,代碼來源:RepositoryConfigurationViewImpl.java


注:本文中的com.google.gwt.event.dom.client.ChangeHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。