本文整理匯總了Java中com.vaadin.ui.Button.ClickEvent類的典型用法代碼示例。如果您正苦於以下問題:Java ClickEvent類的具體用法?Java ClickEvent怎麽用?Java ClickEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ClickEvent類屬於com.vaadin.ui.Button包,在下文中一共展示了ClickEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildSubmenu
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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: buttonClicked
import com.vaadin.ui.Button.ClickEvent; //導入依賴的package包/類
@Override
public void buttonClicked(ClickEvent event) throws Exception {
if (event.getButton().getId().equals(ToolbarButtons.ADD.getId())) {
log.debug("Redirecting to Add Manager Connector Window");
ViewUtil.addWindow(new AddManagerConnectorWindow(this, this.addManagerConnectorService, this.pluginService, this.validator, this.trustManager, this.server));
}
if (event.getButton().getId().equals(ToolbarButtons.EDIT.getId())) {
log.debug("Redirecting to Update Manager Connector Window");
ViewUtil.addWindow(new UpdateManagerConnectorWindow(this, this.updateManagerConnectorService, this.pluginService, this.validator, this.trustManager, this.server));
}
if (event.getButton().getId().equals(ToolbarButtons.DELETE.getId())) {
log.debug("Redirecting to Delete Manager Connector Window");
ViewUtil.addWindow(new DeleteManagerConnectorWindow(this, this.deleteManagerConnectorService, this.server));
}
if (event.getButton().getId().equals(ToolbarButtons.CONFORM.getId())) {
conformManagerConnector(getParentItemId());
}
}
示例3: buttonClicked
import com.vaadin.ui.Button.ClickEvent; //導入依賴的package包/類
@Override
public void buttonClicked(ClickEvent event) throws Exception {
if (event.getButton().getId().equals(ToolbarButtons.ADD.getId())) {
log.debug("Redirecting to Add Security Group interface Window");
ViewUtil.addWindow(new AddSecurityGroupInterfaceWindow(getDtoInContext().getId(), this.addSecurityGroupInterfaceService, this.listVirtualSystemPolicyService));
}
if (event.getButton().getId().equals(ToolbarButtons.EDIT.getId())) {
log.debug("Redirecting to Update Security Group interface Window");
ViewUtil.addWindow(new UpdateSecurityGroupInterfaceWindow(getSelectedItem().getBean(),
this.listVirtualSystemPolicyService, this.updateSecurityGroupInterfaceService));
}
if (event.getButton().getId().equals(ToolbarButtons.DELETE.getId())) {
log.debug("Redirecting to Delete Security Group interface Window");
DeleteWindowUtil.deleteSecurityGroupInterface(getSelectedItem().getBean(), this.deleteSecurityGroupInterfaceService);
}
if (event.getButton().getId().equals(ToolbarButtons.BACK.getId())) {
// removing object from the sub view map so it can be garbage collected
this.currentView.childSubViewMap.put(this.currentView.getKeyforChildSubView(2), null);
this.currentView.viewSplitter.removeComponent(this.currentView.viewSplitter.getSecondComponent());
this.currentView.viewSplitter.addComponent(this.currentView.childContainerLayout);
}
}
示例4: setupOkClickedListener
import com.vaadin.ui.Button.ClickEvent; //導入依賴的package包/類
@SuppressWarnings("serial")
private void setupOkClickedListener(final VmidcWindow<OkCancelButtonModel> alertWindow) {
alertWindow.getComponentModel().setOkClickedListener(new Button.ClickListener(){
@Override
public void buttonClick(ClickEvent event) {
try {
InternalCertReplacementUploader.this.x509TrustManager
.replaceInternalCertificate(InternalCertReplacementUploader.this.file, true);
} catch (Exception e) {
ViewUtil.iscNotification(e.getMessage(), Notification.Type.ERROR_MESSAGE);
} finally {
alertWindow.close();
removeUploadedFile();
}
}});
}
示例5: createEditButton
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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;
}
示例6: createIPSettingsEditButton
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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;
}
示例7: createNATEditButton
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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;
}
示例8: buttonClicked
import com.vaadin.ui.Button.ClickEvent; //導入依賴的package包/類
@Override
public void buttonClicked(ClickEvent event) throws Exception {
if (event.getButton().getId().equals(ToolbarButtons.ADD.getId())) {
log.debug("Redirecting to Add Alarm Window");
ViewUtil.addWindow(new AddAlarmWindow(this, this.addAlarmService,
this.getEmailSettingsService));
}
if (event.getButton().getId().equals(ToolbarButtons.EDIT.getId())) {
log.debug("Redirecting to Update Alarm Window");
ViewUtil.addWindow(new UpdateAlarmWindow(this, this.updateAlarmService,
this.getEmailSettingsService));
}
if (event.getButton().getId().equals(ToolbarButtons.DELETE.getId())) {
log.debug("Redirecting to Delete Alarm Window");
DeleteWindowUtil.deleteAlarm(this.deleteAlarmService, getParentItem().getBean());
}
}
示例9: createHeader
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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;
}
示例10: AdvancedSettingsWindow
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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();
}
});
}
示例11: deleteVirtualSystem
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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);
}
示例12: deleteAlert
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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);
}
示例13: getUpgradeAlertWindow
import com.vaadin.ui.Button.ClickEvent; //導入依賴的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;
}
示例14: testButton
import com.vaadin.ui.Button.ClickEvent; //導入依賴的package包/類
@Test
public void testButton() {
FButton button = new FButton().withCaption("My button")
.withIcon(VaadinIcons.ARROW_BACKWARD)
.withIconAlternateText("backward")
.withClickListener(click -> System.out.println("clicked"))
.withClickShortcut(ShortcutAction.KeyCode.ENTER, null)
.withBlurListener(blur -> System.out.println("lost focus"))
.withFocusListener(focus -> System.out.println("gain focus"))
.withTabIndex(5)
.withDisableOnClick(true);
assertEquals("My button", button.getCaption());
assertEquals(VaadinIcons.ARROW_BACKWARD, button.getIcon());
assertEquals("backward", button.getIconAlternateText());
assertEquals(5, button.getTabIndex());
assertEquals(1, button.getListeners(ClickEvent.class).size());
assertEquals(1, button.getListeners(FocusEvent.class).size());
assertEquals(1, button.getListeners(BlurEvent.class).size());
assertTrue(button.getClickShortcut() != null);
assertTrue(button.isDisableOnClick());
}
示例15: testNativeButton
import com.vaadin.ui.Button.ClickEvent; //導入依賴的package包/類
@Test
public void testNativeButton() {
FNativeButton button = new FNativeButton().withCaption("My button")
.withIcon(VaadinIcons.ARROW_BACKWARD)
.withIconAlternateText("backward")
.withClickListener(click -> System.out.println("clicked"))
.withClickShortcut(ShortcutAction.KeyCode.ENTER, null)
.withBlurListener(blur -> System.out.println("lost focus"))
.withFocusListener(focus -> System.out.println("gain focus"))
.withTabIndex(5)
.withDisableOnClick(true);
assertEquals("My button", button.getCaption());
assertEquals(VaadinIcons.ARROW_BACKWARD, button.getIcon());
assertEquals("backward", button.getIconAlternateText());
assertEquals(5, button.getTabIndex());
assertEquals(1, button.getListeners(ClickEvent.class).size());
assertEquals(1, button.getListeners(FocusEvent.class).size());
assertEquals(1, button.getListeners(BlurEvent.class).size());
assertTrue(button.isDisableOnClick());
}