Java Code Examples for com.vaadin.ui.Button#ClickEvent

The following examples show how to use com.vaadin.ui.Button#ClickEvent . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServerButtonsBottom.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
private void deleteButtonClick(Button.ClickEvent event) {
    final InstanceDto instance = (InstanceDto) sender.serverPanel.serverTable.getValue();

    // 確認ダイアログを表示
    String message = ViewMessages.getMessage("IUI-000015", instance.getInstance().getInstanceName());
    DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message,
            Buttons.OKCancel);
    dialog.setCallback(new DialogConfirm.Callback() {
        @Override
        public void onDialogResult(Result result) {
            if (result != Result.OK) {
                return;
            }

            delete(instance.getInstance().getInstanceNo());
        }
    });
    getApplication().getMainWindow().addWindow(dialog);
}
 
Example 2
Source File: ServiceButtonsBottom.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
private void deleteButtonClick(Button.ClickEvent event) {
    final ComponentDto component = (ComponentDto) sender.servicePanel.serviceTable.getValue();

    // 確認ダイアログを表示
    String message = ViewMessages.getMessage("IUI-000018", component.getComponent().getComponentName());
    DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message,
            Buttons.OKCancel);
    dialog.setCallback(new DialogConfirm.Callback() {
        @Override
        public void onDialogResult(Result result) {
            if (result != Result.OK) {
                return;
            }

            delete(component.getComponent().getComponentNo());
        }
    });

    getApplication().getMainWindow().addWindow(dialog);
}
 
Example 3
Source File: ServerButtonsBottom.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
private void stopMonitoringButtonClick(Button.ClickEvent event) {
    final InstanceDto instance = (InstanceDto) sender.serverPanel.serverTable.getValue();

    // 確認ダイアログを表示
    String message = ViewMessages.getMessage("IUI-000122", instance.getInstance().getInstanceName());
    DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message,
            Buttons.OKCancel);
    dialog.setCallback(new DialogConfirm.Callback() {
        @Override
        public void onDialogResult(Result result) {
            if (result != Result.OK) {
                return;
            }

            stopMonitoring(instance);
        }
    });

    getApplication().getMainWindow().addWindow(dialog);
}
 
Example 4
Source File: LoadBalancerDescBasic.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void editButtonClick(Button.ClickEvent event) {
    LoadBalancerListener listener = (LoadBalancerListener) event.getButton().getData();

    WinLoadBalancerConfigListener win = new WinLoadBalancerConfigListener(listener.getLoadBalancerNo(),
            listener.getLoadBalancerPort());
    win.addListener(new Window.CloseListener() {
        @Override
        public void windowClose(Window.CloseEvent e) {
            refreshTable();
        }
    });

    getWindow().addWindow(win);
}
 
Example 5
Source File: MTableWithTraditionalPaging.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Override
public void buttonClick(Button.ClickEvent event) {
    if (event.getButton() == first) {
        currentPage = 0;
    } else if (event.getButton() == last) {
        currentPage = pages - 1;
    } else if (event.getButton() == next) {
        currentPage++;
    } else if (event.getButton() == previous) {
        currentPage--;
    }
    updateState();
    listener.pageRequested(currentPage);
}
 
Example 6
Source File: ServerButtonsBottom.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void editButtonClick(Button.ClickEvent event) {
    InstanceDto instance = (InstanceDto) sender.serverPanel.serverTable.getValue();

    WinServerEdit winServerEdit = new WinServerEdit(instance.getInstance().getInstanceNo());
    winServerEdit.addListener(new Window.CloseListener() {
        @Override
        public void windowClose(CloseEvent e) {
            refreshTable();
        }
    });

    getWindow().addWindow(winServerEdit);
}
 
Example 7
Source File: ServiceButtonsBottom.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void editButtonClick(Button.ClickEvent event) {
    ComponentDto component = (ComponentDto) sender.servicePanel.serviceTable.getValue();

    WinServiceEdit winServiceEdit = new WinServiceEdit(component.getComponent().getComponentNo());
    winServiceEdit.addListener(new Window.CloseListener() {
        @Override
        public void windowClose(CloseEvent e) {
            refreshTable();
        }
    });

    getWindow().addWindow(winServiceEdit);
}
 
Example 8
Source File: LoadBalancerDescBasic.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void addButtonClick(Button.ClickEvent event) {
    WinLoadBalancerConfigListener win = new WinLoadBalancerConfigListener(
            loadBalancer.getLoadBalancer().getLoadBalancerNo(), null);
    win.addListener(new Window.CloseListener() {
        @Override
        public void windowClose(Window.CloseEvent e) {
            refreshTable();
        }
    });

    getWindow().addWindow(win);
}
 
Example 9
Source File: LoginView.java    From gazpachoquest with GNU General Public License v3.0 5 votes vote down vote up
protected Button.ClickListener createLoginButtonListener() {
    return new Button.ClickListener() {
        private static final long serialVersionUID = 3424514570135131495L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            loginEvent.fire(new LoginEvent(RespondentAccount.USER_NAME, invitation.getValue()));
        }
    };
}
 
Example 10
Source File: GroupsView.java    From jpa-addressbook with The Unlicense 4 votes vote down vote up
private void addNew(Button.ClickEvent e) {
    entryList.asSingleSelect().setValue(null);
    editEntry(new PhoneBookGroup());
}
 
Example 11
Source File: AbstractForm.java    From viritin with Apache License 2.0 4 votes vote down vote up
protected void delete(Button.ClickEvent e) {
    deleteHandler.onDelete(getEntity());
}
 
Example 12
Source File: AbstractForm.java    From viritin with Apache License 2.0 4 votes vote down vote up
protected void reset(Button.ClickEvent e) {
    resetHandler.onReset(getEntity());
    hasChanges = false;
    adjustSaveButtonState();
    adjustResetButtonState();
}
 
Example 13
Source File: WinLoadBalancerConfigListener.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
private void addButtonClick(Button.ClickEvent event) {
    // 入力値を取得
    String loadBalancerPortString = (String) basicForm.loadBalancerPortField.getValue();
    String servicePortString = (String) basicForm.servicePortField.getValue();
    String protocol = (String) basicForm.protocolSelect.getValue();
    Long sslKeyNo = (Long) basicForm.sslKeySelect.getValue();

    // 入力チェック
    basicForm.loadBalancerPortField.validate();
    basicForm.servicePortField.validate();
    basicForm.protocolSelect.validate();
    if (basicForm.sslKeySelect.isEnabled()) {
        basicForm.sslKeySelect.validate();
    }

    LoadBalancerService loadBalancerService = BeanContext.getBean(LoadBalancerService.class);
    Integer loadBalancerPort = Integer.valueOf(loadBalancerPortString);
    Integer servicePort = Integer.valueOf(servicePortString);

    // 追加時
    if (isAddMode()) {
        // オペレーションログ
        OperationLogger.writeLoadBalancer("LOAD_BALANCER", "Attach LB_Listener", loadBalancerNo,
                loadBalancerPortString);

        // リスナーの追加
        loadBalancerService.createListener(loadBalancerNo, loadBalancerPort, servicePort, protocol, sslKeyNo);
    }
    // 編集時
    else {
        // オペレーションログ
        OperationLogger.writeLoadBalancer("LOAD_BALANCER", "Edit LB_Listener", loadBalancerNo,
                loadBalancerPortString);

        // リスナーの更新
        loadBalancerService.updateListener(loadBalancerNo, this.loadBalancerPort, loadBalancerPort, servicePort,
                protocol, sslKeyNo);
    }

    // 画面を閉じる
    close();
}
 
Example 14
Source File: ElementCollectionWithPopupEditor.java    From viritin with Apache License 2.0 4 votes vote down vote up
@Override
public void buttonClick(Button.ClickEvent event) {
    Address a = new Address();
    addresses.addElement(a);
    addresses.editInPopup(a);
}
 
Example 15
Source File: WindowBreadCrumbs.java    From cuba with Apache License 2.0 4 votes vote down vote up
protected void navigationButtonClicked(Button.ClickEvent event) {
    Window win = ((NavigationButton) event.getButton()).getWindow();
    if (win != null) {
        fireListeners(win);
    }
}
 
Example 16
Source File: ElementCollectionTable.java    From viritin with Apache License 2.0 4 votes vote down vote up
@Override
public void buttonClick(Button.ClickEvent event) {
    addElement(createInstance());
}
 
Example 17
Source File: AbstractTableDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Click listener for edit button.
 * 
 * @param event
 */
protected abstract void onEdit(Button.ClickEvent event);
 
Example 18
Source File: AbstractFilterButtonClickBehaviour.java    From hawkbit with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * @param event
 */
protected abstract void processFilterButtonClick(Button.ClickEvent event);
 
Example 19
Source File: AbstractTableHeader.java    From hawkbit with Eclipse Public License 1.0 votes vote down vote up
protected abstract void addNewItem(final Button.ClickEvent event); 
Example 20
Source File: AbstractTableDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 votes vote down vote up
protected abstract void showMetadata(Button.ClickEvent event);