本文整理汇总了Java中com.vaadin.ui.Button.ClickListener类的典型用法代码示例。如果您正苦于以下问题:Java ClickListener类的具体用法?Java ClickListener怎么用?Java ClickListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClickListener类属于com.vaadin.ui.Button包,在下文中一共展示了ClickListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSubmenu
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
private void buildSubmenu(CssLayout submenu, Set<OSCViewProvider<?>> views) {
for (final OSCViewProvider<?> view : views) {
String viewName = view.getName();
NativeButton b = new NativeButton(viewName);
// selecting default menu button
if (view.getName().equals(VIEW_FRAGMENT_ALERTS)) {
b.addStyleName("selected");
}
b.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
clearMenuSelection();
event.getButton().addStyleName("selected");
if (!MainUI.this.nav.getState().equals(viewName)) {
MainUI.this.nav.navigateTo(viewName);
}
}
});
submenu.setSizeFull();
submenu.addComponent(b);
}
}
示例2: createEditButton
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
@SuppressWarnings("serial")
private Button createEditButton() {
// creating edit button
this.edit = new Button("Edit");
this.edit.setEnabled(true);
this.edit.addStyleName(StyleConstants.BUTTON_TOOLBAR);
this.edit.addStyleName(StyleConstants.EDIT_BUTTON);
this.edit.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
editClicked();
} catch (Exception e) {
ViewUtil.showError("Error editing email settings", e);
}
}
});
return this.edit;
}
示例3: createIPSettingsEditButton
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
@SuppressWarnings("serial")
private Button createIPSettingsEditButton() {
// creating edit button
this.editIPSettings = new Button("Edit");
this.editIPSettings.setEnabled(true);
this.editIPSettings.addStyleName(StyleConstants.BUTTON_TOOLBAR);
this.editIPSettings.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
editIPSettingsClicked();
} catch (Exception e) {
ViewUtil.showError("Error editing IP settings", e);
}
}
});
return this.editIPSettings;
}
示例4: createNATEditButton
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
@SuppressWarnings("serial")
private Button createNATEditButton() {
// creating edit button
this.editNATSettings = new Button("Edit");
this.editNATSettings.setEnabled(true);
this.editNATSettings.addStyleName(StyleConstants.BUTTON_TOOLBAR);
this.editNATSettings.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
editNATSettingsClicked();
} catch (Exception e) {
ViewUtil.showError("Error editing NAT settings", e);
}
}
});
return this.editNATSettings;
}
示例5: buildToolbarButton
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
/**
* @param toolbar
* HorizontalLayout which contains all the action Buttons
* @param toolbarButton
* Which Tool bar button to create (Provided using ENUM constant)
* @param listner
* Click listener called when this button is clicked
* @return
*/
public static Button buildToolbarButton(HorizontalLayout toolbar, ToolbarButtons toolbarButton,
ClickListener listner) {
Button button = new Button(toolbarButton.getText());
button.addStyleName(StyleConstants.BUTTON_TOOLBAR);
button.setDescription(toolbarButton.getTooltip());
button.setStyleName(ValoTheme.BUTTON_LINK);
if (StringUtils.isNotEmpty(toolbarButton.getImageLocation())) {
button.setIcon(new ThemeResource(toolbarButton.getImageLocation()), toolbarButton.toString());
}
button.setEnabled(false);
button.setId(toolbarButton.getId());
button.addClickListener(listner);
toolbar.addComponent(button);
return button;
}
示例6: createHeader
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
@SuppressWarnings("serial")
private HorizontalLayout createHeader(String title) {
HorizontalLayout header = ViewUtil.createSubHeader(title, getSubViewHelpGuid());
Button refresh = new Button();
refresh.setStyleName(Reindeer.BUTTON_LINK);
refresh.setDescription("Refresh");
refresh.setIcon(new ThemeResource("img/Refresh.png"));
refresh.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
populateTable();
}
});
header.addComponent(refresh);
return header;
}
示例7: AdvancedSettingsWindow
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
public AdvancedSettingsWindow(BaseVCWindow baseVCWindow) throws Exception {
this.baseVCWindow = baseVCWindow;
createWindow(ADVANCED_SETTINGS_CAPTION);
getComponentModel().setOkClickedListener(new ClickListener() {
/**
*
*/
private static final long serialVersionUID = -8326846388022657979L;
@Override
public void buttonClick(ClickEvent event) {
submitForm();
}
});
}
示例8: deleteVirtualSystem
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
@SuppressWarnings("serial")
public static void deleteVirtualSystem(final ForceDeleteVirtualSystemServiceApi forceDeleteVsService,
final VirtualSystemDto dto, ServerApi server) {
final VmidcWindow<OkCancelButtonModel> deleteWindow = WindowUtil
.createAlertWindow("Force Delete Virtual System", "Force Delete Virtual System - " + dto.getName());
deleteWindow.getComponentModel().setOkClickedListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
BaseJobResponse response = forceDeleteVsService.dispatch(new BaseDeleteRequest(dto.getId(), true));
deleteWindow.close();
if (response.getJobId() != null) {
ViewUtil.showJobNotification(response.getJobId(), server);
}
} catch (Exception e) {
ViewUtil.iscNotification(e.getMessage(), Notification.Type.ERROR_MESSAGE);
}
}
});
ViewUtil.addWindow(deleteWindow);
}
示例9: deleteAlert
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
public static void deleteAlert(final DeleteAlertServiceApi deleteAlertService, final List<AlertDto> dtoList) {
final VmidcWindow<OkCancelButtonModel> deleteWindow = WindowUtil.createAlertWindow("Delete Alert",
"Delete selected alert(s)? ");
deleteWindow.getComponentModel().setOkClickedListener(new ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
try {
AlertRequest req = new AlertRequest();
req.setDtoList(dtoList);
deleteAlertService.dispatch(req);
deleteWindow.close();
log.info("Delete Alert(s) Successful!");
} catch (Exception e) {
log.error("Failed to delete Alert(s)", e);
ViewUtil.iscNotification("Failed to delete Alert(s).", Notification.Type.WARNING_MESSAGE);
}
}
});
ViewUtil.addWindow(deleteWindow);
}
示例10: getUpgradeAlertWindow
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
private VmidcWindow<OkCancelButtonModel> getUpgradeAlertWindow() {
String fromVersion = this.currentDAObject.getApplianceModel() + "-" + this.currentDAObject.getApplianceSoftwareVersionName();
String toVersion = ((ApplianceModelSoftwareVersionDto) this.applianceDefinition.getValue()).getName();
final VmidcWindow<OkCancelButtonModel> upgradeAlert = WindowUtil.createAlertWindow(
VmidcMessages.getString(VmidcMessages_.DA_UPGRADE_WARNING_TITLE),
VmidcMessages.getString(VmidcMessages_.DA_UPGRADE_WARNING, fromVersion, toVersion));
upgradeAlert.getComponentModel().setOkClickedListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
upgradeAlert.close();
submitRequest();
}
});
return upgradeAlert;
}
示例11: buildEditButton
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
private Component buildEditButton() {
Button result = new Button();
result.setId(EDIT_ID);
result.setIcon(FontAwesome.EDIT);
result.addStyleName("icon-edit");
result.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
result.setDescription("Add Imot");
result.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
getUI().addWindow(
new AddingImot(DashboardView.this, titleLabel
.getValue()));
}
});
return result;
}
示例12: buildCreateBox
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
private Component buildCreateBox() {
VerticalLayout createBox = new VerticalLayout();
createBox.setWidth(160.0f, Unit.PIXELS);
createBox.setHeight(200.0f, Unit.PIXELS);
createBox.addStyleName("create");
Button create = new Button("Create New");
create.addStyleName(ValoTheme.BUTTON_PRIMARY);
create.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
addReport(ReportType.EMPTY, null);
}
});
createBox.addComponent(create);
createBox.setComponentAlignment(create, Alignment.MIDDLE_CENTER);
return createBox;
}
示例13: buildToggleButton
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
private Component buildToggleButton() {
Button valoMenuToggleButton = new Button("Menu", new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) {
getCompositionRoot().removeStyleName(STYLE_VISIBLE);
} else {
getCompositionRoot().addStyleName(STYLE_VISIBLE);
}
}
});
valoMenuToggleButton.setIcon(FontAwesome.LIST);
valoMenuToggleButton.addStyleName("valo-menu-toggle");
valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_SMALL);
return valoMenuToggleButton;
}
示例14: ValoMenuItemButton
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
public ValoMenuItemButton(final DashboardViewType view) {
this.view = view;
setPrimaryStyleName("valo-menu-item");
setIcon(view.getIcon());
setCaption(view.getViewName().substring(0, 1).toUpperCase()
+ view.getViewName().substring(1));
DashboardEventBus.register(this);
addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
UI.getCurrent().getNavigator()
.navigateTo(view.getViewName());
}
});
}
示例15: buildFooter
import com.vaadin.ui.Button.ClickListener; //导入依赖的package包/类
private Component buildFooter() {
HorizontalLayout footer = new HorizontalLayout();
footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
footer.setWidth(100.0f, Unit.PERCENTAGE);
Button ok = new Button("Close");
ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
ok.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
close();
}
});
ok.focus();
footer.addComponent(ok);
footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);
return footer;
}