本文整理了Java中com.vaadin.ui.Button.addClickListener()
方法的一些代码示例,展示了Button.addClickListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.addClickListener()
方法的具体详情如下:
包路径:com.vaadin.ui.Button
类名称:Button
方法名:addClickListener
[英]Adds the button click listener.
[中]添加按钮单击侦听器。
代码示例来源:origin: com.vaadin/vaadin-server
/**
* Creates a new push button with a click listener.
*
* @param caption
* the Button caption.
* @param listener
* the Button click listener.
*/
public Button(String caption, ClickListener listener) {
this(caption);
addClickListener(listener);
}
代码示例来源:origin: com.vaadin/vaadin-server
/**
* Creates a new push button with a click listener.
*
* @param icon
* the Button icon.
* @param listener
* the Button click listener.
* @since 8.2
*/
public Button(Resource icon, ClickListener listener) {
this(icon);
addClickListener(listener);
}
代码示例来源:origin: com.vaadin/vaadin-server
resize.addClickListener(this::resizeButtonClick);
resize.setData(false);
resize.setWidth("100%");
ok.addClickListener(this::okButtonClick);
cancel.addClickListener(this::cancelButtonClick);
代码示例来源:origin: com.haulmont.cuba/cuba-web
protected void initButtonOkListener() {
okBtn.addClickListener(event ->
commit()
);
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private Button createCancelButton(final String cancelLabel) {
final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_BUTTON, cancelLabel, "",
null, false, null, SPUIButtonStyleTiny.class);
button.addClickListener(this);
button.setClickShortcut(KeyCode.ESCAPE);
return button;
}
代码示例来源:origin: eclipse/hawkbit
private Button createOkButton(final String okLabel) {
final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.OK_BUTTON, okLabel, "",
ValoTheme.BUTTON_PRIMARY, false, null, SPUIButtonStyleTiny.class);
button.addClickListener(this);
button.setClickShortcut(KeyCode.ENTER);
return button;
}
代码示例来源:origin: OpenNMS/opennms
public Object generateCell(Table source, final Object itemId, Object columnId) {
Button button = new Button("Edit");
button.setDescription("Edit this Ops Board configuration");
button.setStyleName("small");
button.addClickListener(new Button.ClickListener() {
public void buttonClick(Button.ClickEvent clickEvent) {
m_wallboardConfigView.openWallboardEditor((Wallboard) itemId);
}
});
return button;
}
});
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private Button getPinButton(final Object itemId) {
final Button pinBtn = createPinBtn(itemId);
saveDistributionPinnedBtn(pinBtn);
pinBtn.addClickListener(this::addPinClickListener);
rePinDistribution(pinBtn, (Long) itemId);
return pinBtn;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private Button createBulkUploadIcon() {
final Button button = SPUIComponentProvider.getButton(getBulkUploadIconId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_BULK_UPLOAD), null, false, FontAwesome.UPLOAD,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::bulkUpload);
return button;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private Button createSaveButton() {
saveButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON,
UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, i18n.getMessage(UIMessageIdProvider.TOOLTIP_SAVE), null,
false, FontAwesome.SAVE, SPUIButtonStyleNoBorder.class);
saveButton.addClickListener(this);
saveButton.setEnabled(false);
return saveButton;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private Button getCloseButton() {
final Button closeBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.BULK_UPLOAD_CLOSE_BUTTON_ID, "",
"", "", true, FontAwesome.TIMES, SPUIButtonStyleNoBorder.class);
closeBtn.addStyleName(ValoTheme.BUTTON_BORDERLESS);
closeBtn.addClickListener(event -> closePopup());
return closeBtn;
}
代码示例来源:origin: eclipse/hawkbit
private Button createCloseButton() {
final Button button = SPUIComponentProvider.getButton(getCloseButtonId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_CLOSE), null, false, FontAwesome.TIMES,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::onClose);
return button;
}
代码示例来源:origin: OpenNMS/opennms
public Object generateCell(Table source, final Object itemId, Object columnId) {
Button button = new Button("Preview");
button.setDescription("Preview this Surveillance View configuration");
button.setStyleName("small");
button.addClickListener(new PreviewClickListener(m_surveillanceViewService, SurveillanceViewsConfigList.this, (View) itemId));
return button;
}
}
代码示例来源:origin: OpenNMS/opennms
public static Button createButton(
final String buttonCaption,
final String buttonDescription,
final Resource icon,
final ClickListener clickListener) {
Button button = new Button();
button.setCaption(buttonCaption);
button.setIcon(icon);
if (buttonDescription != null) button.setDescription(buttonDescription);
if (clickListener != null) button.addClickListener(clickListener);
return button;
}
代码示例来源:origin: OpenNMS/opennms
public Object generateCell(Table source, final Object itemId, Object columnId) {
Button button = new Button("Preview");
button.setDescription("Preview this Ops Board configuration");
button.setStyleName("small");
button.addClickListener(new PreviewClickListener(WallboardOverview.this, (Wallboard) itemId));
return button;
}
});
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
private void initialize() {
Button addButton = new Button(this.i18n.translate("buttons.add"));
addButton.addClickListener(e -> addSubForm(layout, null));
layout.addComponent(addButton);
}
代码示例来源:origin: eclipse/hawkbit
private Button customMetadataDetailButton(final String metadataKey) {
final Button viewIcon = SPUIComponentProvider.getButton(getDetailLinkId(metadataKey), metadataKey,
"View " + metadataKey + " Metadata details", null, false, null, SPUIButtonStyleNoBorder.class);
viewIcon.setData(metadataKey);
viewIcon.addStyleName(ValoTheme.BUTTON_TINY + " " + ValoTheme.BUTTON_LINK + " " + "on-focus-no-border link"
+ " " + "text-style");
viewIcon.addClickListener(event -> showMetadataDetails(metadataKey));
return viewIcon;
}
代码示例来源:origin: eclipse/hawkbit
private void createComponents() {
uploadProgressButton = SPUIComponentProvider.getButton(UIComponentIdProvider.UPLOAD_STATUS_BUTTON, "", "", "",
false, null, SPUIButtonStyleNoBorder.class);
uploadProgressButton.addStyleName(SPUIStyleDefinitions.UPLOAD_PROGRESS_INDICATOR_STYLE);
uploadProgressButton.setIcon(null);
uploadProgressButton.setHtmlContentAllowed(true);
uploadProgressButton.addClickListener(event -> onClickOfUploadProgressButton());
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private Button getDeleteButton(final Long itemId) {
final Item row = getItem(itemId);
final String tfName = (String) row.getItemProperty(SPUILabelDefinitions.NAME).getValue();
final Button deleteIcon = SPUIComponentProvider.getButton(getDeleteIconId(tfName), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE_CUSTOM_FILTER),
ValoTheme.BUTTON_TINY + " " + "blueicon", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class);
deleteIcon.setData(itemId);
deleteIcon.addClickListener(this::onDelete);
return deleteIcon;
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private Button customFilterDetailButton(final Long itemId) {
final Item row1 = getItem(itemId);
final String tfName = (String) row1.getItemProperty(SPUILabelDefinitions.NAME).getValue();
final Button updateIcon = SPUIComponentProvider.getButton(getDetailLinkId(tfName), tfName,
i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE_CUSTOM_FILTER), null, false, null,
SPUIButtonStyleNoBorder.class);
updateIcon.setData(tfName);
updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
updateIcon.addClickListener(this::onClickOfDetailButton);
return updateIcon;
}
内容来源于网络,如有侵权,请联系作者删除!