Java Code Examples for com.vaadin.server.FontAwesome#CLOSE

The following examples show how to use com.vaadin.server.FontAwesome#CLOSE . 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: ZookeeperConsumerManageUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperConsumerRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example 2
Source File: ZookeeperAppManageUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if(item != null){
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperAppRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example 3
Source File: ZookeeperProviderManageUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperProviderRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example 4
Source File: ZookeeperConsumerManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperConsumerRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example 5
Source File: ZookeeperAppManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if(item != null){
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperAppRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example 6
Source File: ZookeeperProviderManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperProviderRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}