本文整理汇总了Java中com.vaadin.event.FieldEvents类的典型用法代码示例。如果您正苦于以下问题:Java FieldEvents类的具体用法?Java FieldEvents怎么用?Java FieldEvents使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FieldEvents类属于com.vaadin.event包,在下文中一共展示了FieldEvents类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createZkOptionGroup
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
/**
* zk
* @return
*/
private OptionGroup createZkOptionGroup(){
zkOption = new OptionGroup();
zkOption.addItem(0);
zkOption.setItemCaption(0, "消费者");
zkOption.addItem(1);
zkOption.setItemCaption(1, "提供者");
zkOption.setStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
zkOption.select(0);
zkOption.setNullSelectionAllowed(false);
zkOption.addBlurListener((FieldEvents.BlurListener) blurEvent -> {
String selected = blurEvent.getSource().toString();
if ("0".equals(selected)) {
isSelectedConsumer = true;
reloadConsumerViewBox();
} else if ("1".equals(selected)) {
isSelectedConsumer = false;
reloadProviderViewBox();
}
});
return zkOption;
}
示例2: focus
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void focus(FieldEvents.FocusEvent event) {
if (FormGroupDefaults.BOOTSTRAP_MODE.equals(formGroup.getMode())) {
// mode is already updated, don't change it again.
return;
}
// field is focused, update the mode
formGroup.removeMode();
// field is focused, remove feedback if you are allowed to do it.
if (this.removeFeedback) {
formGroup.removeFeedback();
}
}
示例3: addTextChangeListener
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void addTextChangeListener(TextChangeListener listener) {
getEventRouter().addListener(TextChangeListener.class, listener);
if (textChangeListener == null) {
textChangeListener = (FieldEvents.TextChangeListener) e -> {
TextChangeEvent event = new TextChangeEvent(this, e.getText(), e.getCursorPosition());
getEventRouter().fireEvent(TextChangeListener.class, TextChangeListener::textChange, event);
};
component.addTextChangeListener(textChangeListener);
}
}
示例4: blur
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void blur(FieldEvents.BlurEvent event) {
SettingKey key = SettingKey.getEnumByKey(event.getComponent().getId());
for(AbstractTextField field : fields) {
if(field.getId().equals(key.getKey())) {
presenter.updateSetting(key, field.getValue());
break;
}
}
}
示例5: UsersMenu
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
public UsersMenu() {
textSearch.addStyleName(ValoTheme.TEXTFIELD_SMALL);
textSearch.setWidth(100, Unit.PERCENTAGE);
textSearch.setNullRepresentation("");
textSearch.setWidth(100, Unit.PERCENTAGE);
textSearch.setInputPrompt("type to search users");
textSearch.addTextChangeListener(new FieldEvents.TextChangeListener() {
@Override
public void textChange(FieldEvents.TextChangeEvent event) {
search(event.getText());
}
});
table.addStyleName(ValoTheme.TABLE_BORDERLESS);
table.addStyleName(ValoTheme.TABLE_NO_HEADER);
table.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
table.addStyleName(ValoTheme.TABLE_SMALL);
table.addStyleName(ValoTheme.TABLE_COMPACT);
table.addStyleName(ValoTheme.TABLE_NO_STRIPES);
table.addContainerProperty("user", User.class, null, "Username", null, Table.Align.LEFT);
table.addContainerProperty("tasks", Label.class, null, "Tasks", null, Table.Align.LEFT);
table.setColumnExpandRatio("user", 1f);
table.setVisibleColumns("user", "tasks");
table.setSizeFull();
table.setColumnExpandRatio("user", 1f);
table.setSelectable(false);
table.addGeneratedColumn("user", new UserColumnGenerator());
addComponents(textSearch, table);
setExpandRatio(table, 1f);
setHeight(100, Unit.PERCENTAGE);
setWidth(300, Unit.PIXELS);
addStyleName("users-list");
setVisible(false);
}
示例6: AdaptiveTaskEditor
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
public AdaptiveTaskEditor(DashboardTab panelView, Case case1) {
this.panelView = panelView;
this.case1 = case1;
Design.read(this);
btnSend.setIcon(FontAwesome.SEND);
btnSend.addClickListener(this);
btnProcess.addClickListener(this);
TextComplete textComplete = new TextComplete();
textComplete.extend(taskTitle,
HybridbpmUI.getAccessAPI().findUserNamesByName(null),
Arrays.asList(new String[]{"loan", "creditcard"}));
taskTitle.addTextChangeListener(new FieldEvents.TextChangeListener() {
@Override
public void textChange(FieldEvents.TextChangeEvent event) {
String text = event.getText();
String[] lines = text.split(System.getProperty("line.separator"));
if (lines != null && (lines.length > 1)) {
taskTitle.setRows(lines.length + 2);
}
}
});
btnBack.addClickListener(this);
btnBack.setStyleName(ValoTheme.BUTTON_LINK);
btnBack.addStyleName(ValoTheme.BUTTON_SMALL);
btnBack.setIcon(FontAwesome.ARROW_LEFT);
}
示例7: textChange
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void textChange(FieldEvents.TextChangeEvent event) {
applyFilterPattern(
getTargetPropertyType(),
getTargetPropertyId(),
event.getText(),
getTargetContainer());
}
示例8: initLayout
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
protected void initLayout() {
setModal(true);
setSizeUndefined();
setResizable(false);
layout.setSizeUndefined();
formLayout.setMargin(true);
loginButton.addListener(this);
panel.setVisible(false);
panel.setContent(label);
formLayout.addComponent(loginTf);
formLayout.addComponent(passwordTf);
formLayout.addComponent(loginButton);
layout.addComponent(panel);
layout.setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
layout.addComponent(formLayout);
layout.setComponentAlignment(formLayout, Alignment.MIDDLE_CENTER);
setContent(layout);
loginButton.setClickShortcut(KeyCode.ENTER);
addListener(new FieldEvents.FocusListener() {
private static final long serialVersionUID = 1L;
@Override
public void focus(FocusEvent event) {
loginTf.focus();
}
});
}
示例9: CubaSuggestionField
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
public CubaSuggestionField() {
setValidationVisible(false);
serverRpc = new CubaSuggestionFieldServerRpc() {
@Override
public void searchSuggestions(String query) {
if (searchExecutor != null) {
searchExecutor.accept(query);
}
}
@Override
public void selectSuggestion(String suggestionId) {
Object suggestion = keyMapper.get(suggestionId);
setValue(suggestion);
updateTextPresentation(getValue());
}
@Override
public void onEnterKeyPressed(String currentSearchString) {
if (enterActionHandler != null) {
enterActionHandler.accept(currentSearchString);
}
}
@Override
public void onArrowDownKeyPressed(String currentSearchString) {
if (arrowDownActionHandler != null) {
arrowDownActionHandler.accept(currentSearchString);
}
}
@Override
public void cancelSearch() {
cancelSearchHandler.run();
}
};
registerRpc(serverRpc);
focusBlurRpc = new FieldEvents.FocusAndBlurServerRpcImpl(this) {
private static final long serialVersionUID = -780524775769549747L;
@Override
protected void fireEvent(Event event) {
CubaSuggestionField.this.fireEvent(event);
}
};
registerRpc(focusBlurRpc);
}
示例10: addBlurListener
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void addBlurListener(FieldEvents.BlurListener listener) {
addListener(FieldEvents.BlurEvent.EVENT_ID, FieldEvents.BlurEvent.class, listener,
FieldEvents.BlurListener.blurMethod);
}
示例11: addListener
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
@Deprecated
public void addListener(FieldEvents.BlurListener listener) {
addBlurListener(listener);
}
示例12: removeBlurListener
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void removeBlurListener(FieldEvents.BlurListener listener) {
removeListener(FieldEvents.BlurEvent.EVENT_ID, FieldEvents.BlurEvent.class, listener);
}
示例13: removeListener
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
@Deprecated
public void removeListener(FieldEvents.BlurListener listener) {
removeBlurListener(listener);
}
示例14: addFocusListener
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void addFocusListener(FieldEvents.FocusListener listener) {
addListener(FieldEvents.FocusEvent.EVENT_ID, FieldEvents.FocusEvent.class, listener,
FieldEvents.FocusListener.focusMethod);
}
示例15: removeFocusListener
import com.vaadin.event.FieldEvents; //导入依赖的package包/类
@Override
public void removeFocusListener(FieldEvents.FocusListener listener) {
removeListener(FieldEvents.FocusEvent.EVENT_ID, FieldEvents.FocusEvent.class, listener);
}