當前位置: 首頁>>代碼示例>>Java>>正文


Java ClickListener類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:23,代碼來源:MainUI.java

示例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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:20,代碼來源:EmailLayout.java

示例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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:19,代碼來源:NetworkLayout.java

示例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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:19,代碼來源:NetworkLayout.java

示例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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:26,代碼來源:ViewUtil.java

示例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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:CRUDBaseSubView.java

示例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();

        }
    });
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:AdvancedSettingsWindow.java

示例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);
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:26,代碼來源:DeleteWindowUtil.java

示例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);
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:27,代碼來源:DeleteWindowUtil.java

示例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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:UpdateDistributedApplianceWindow.java

示例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;
}
 
開發者ID:imotSpot,項目名稱:imotSpot,代碼行數:18,代碼來源:DashboardView.java

示例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;
}
 
開發者ID:imotSpot,項目名稱:imotSpot,代碼行數:20,代碼來源:ReportsView.java

示例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;
}
 
開發者ID:imotSpot,項目名稱:imotSpot,代碼行數:18,代碼來源:DashboardMenu.java

示例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());
        }
    });

}
 
開發者ID:imotSpot,項目名稱:imotSpot,代碼行數:17,代碼來源:DashboardMenu.java

示例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;
}
 
開發者ID:imotSpot,項目名稱:imotSpot,代碼行數:19,代碼來源:MovieDetailsWindow.java


注:本文中的com.vaadin.ui.Button.ClickListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。