Example usage for com.vaadin.ui Button Button

List of usage examples for com.vaadin.ui Button Button

Introduction

In this page you can find the example usage for com.vaadin.ui Button Button.

Prototype

public Button(Resource icon) 

Source Link

Document

Creates a new push button with the given icon.

Usage

From source file:com.esofthead.mycollab.module.project.view.ProjectBreadcrumb.java

License:Open Source License

public void gotoRoleList() {
    this.select(0);
    this.addLink(new Button(AppContext.getMessage(BreadcrumbI18nEnum.ROLES)));
    AppContext.addFragment("project/role/list/" + UrlEncodeDecoder.encode(project.getId()),
            AppContext.getMessage(BreadcrumbI18nEnum.FRA_ROLES));
}

From source file:com.esofthead.mycollab.module.project.view.ProjectBreadcrumb.java

License:Open Source License

public void gotoProjectEdit() {
    this.select(0);
    this.addLink(new Button(AppContext.getMessage(GenericI18Enum.BUTTON_EDIT)));
    AppContext.addFragment("project/edit/" + UrlEncodeDecoder.encode(project.getId()),
            "Edit Project: " + project.getName());
}

From source file:com.esofthead.mycollab.module.project.view.ProjectInformationComponent.java

License:Open Source License

public ProjectInformationComponent() {
    this.setStyleName(UIConstants.PROJECT_INFO);
    this.prjDisplay = new BasicProjectInformation();
    this.projectInfoHeader = new MHorizontalLayout().withMargin(true).withWidth("100%");
    this.projectInfoHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    this.projectInfoHeader.setStyleName(UIConstants.PROJECT_INFO_HEADER);
    this.addComponent(this.projectInfoHeader);
    this.addComponent(this.prjDisplay);

    MHorizontalLayout projectInfoFooter = new MHorizontalLayout().withMargin(true)
            .withStyleName(UIConstants.PROJECT_INFO_FOOTER);
    final Button toggleBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_MORE));
    toggleBtn.addClickListener(new Button.ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override/*from w  w  w .jav a 2  s .  c  o m*/
        public void buttonClick(final ClickEvent event) {
            final int replaceIndex = ProjectInformationComponent.this
                    .getComponentIndex(ProjectInformationComponent.this.prjDisplay);
            ProjectInformationComponent.this.removeComponent(ProjectInformationComponent.this.prjDisplay);
            if (ProjectInformationComponent.this.prjDisplay instanceof BasicProjectInformation) {
                ProjectInformationComponent.this.prjDisplay = new DetailProjectInformation();
                event.getButton().setCaption(AppContext.getMessage(GenericI18Enum.BUTTON_LESS));
            } else {
                ProjectInformationComponent.this.prjDisplay = new BasicProjectInformation();
                event.getButton().setCaption(AppContext.getMessage(GenericI18Enum.BUTTON_MORE));
            }
            ProjectInformationComponent.this.addComponent(ProjectInformationComponent.this.prjDisplay,
                    replaceIndex);
            ProjectInformationComponent.this.prjDisplay.show();
        }
    });
    toggleBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    projectInfoFooter.addComponent(toggleBtn);
    this.addComponent(projectInfoFooter);
}