本文整理匯總了Java中java.awt.ItemSelectable.addItemListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ItemSelectable.addItemListener方法的具體用法?Java ItemSelectable.addItemListener怎麽用?Java ItemSelectable.addItemListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.ItemSelectable
的用法示例。
在下文中一共展示了ItemSelectable.addItemListener方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: subscribeActual
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@Override
protected void subscribeActual(Observer<? super ItemEvent> observer) {
ItemSelectable w = widget;
ItemEventConsumer aec = new ItemEventConsumer(observer, w);
observer.onSubscribe(aec);
w.addItemListener(aec);
if (aec.get() == null) {
aec.onDispose(w);
}
}
示例2: bindImpl
import java.awt.ItemSelectable; //導入方法依賴的package包/類
private void bindImpl(Object target, String targetProperty,
ItemSelectable is, String itemProperty) {
is.addItemListener(
(ItemListener) EventHandler.create(
ItemListener.class,
target,
targetProperty,
"source." + itemProperty
)
);
}
示例3: addRequiredListener
import java.awt.ItemSelectable; //導入方法依賴的package包/類
protected void addRequiredListener(final String requiredField, ItemSelectable valueField) {
// logger.debug("Added required field: " + requiredField);
this.requiredFields.put(requiredField, false);
valueField.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (PropertyConfigurationStep.this.requiredFields.containsKey(requiredField)) {
boolean selected = e.getStateChange() == ItemEvent.SELECTED;
PropertyConfigurationStep.this.requiredFields.put(requiredField, selected);
PropertyConfigurationStep.this.checkComplete();
}
}
});
}
示例4: watch
import java.awt.ItemSelectable; //導入方法依賴的package包/類
public void watch(ItemSelectable c)
{
c.addItemListener(listener);
}
示例5: ItemReport
import java.awt.ItemSelectable; //導入方法依賴的package包/類
/**
* Instantiates a report and registers itself as listener to the given model,
* if it is not null.
*
* @param model the model to register as listener to
*/
public ItemReport(ItemSelectable model) {
if (model != null) {
model.addItemListener(this);
}
}