List of usage examples for com.vaadin.ui CheckBox getValue
@Override
public Boolean getValue()
From source file:com.esofthead.mycollab.mobile.module.user.view.LoginViewImpl.java
License:Open Source License
private void initUI() { this.setStyleName("login-view"); this.setSizeFull(); VerticalLayout contentLayout = new VerticalLayout(); contentLayout.setStyleName("content-wrapper"); contentLayout.setDefaultComponentAlignment(Alignment.TOP_CENTER); contentLayout.setMargin(true);/* w w w . j ava2s . c o m*/ contentLayout.setSpacing(true); contentLayout.setWidth("320px"); Image mainLogo = new Image(null, new ThemeResource("icons/logo_m.png")); contentLayout.addComponent(mainLogo); Label introText = new Label( "MyCollab helps you do all your office jobs on the computers, phones and tablets you use"); introText.setStyleName("intro-text"); contentLayout.addComponent(introText); CssLayout welcomeTextWrapper = new CssLayout(); welcomeTextWrapper.setStyleName("welcometext-wrapper"); welcomeTextWrapper.setWidth("100%"); welcomeTextWrapper.setHeight("15px"); Label welcomeText = new Label("Welcome Back!"); welcomeText.setWidth("150px"); welcomeTextWrapper.addComponent(welcomeText); contentLayout.addComponent(welcomeTextWrapper); final EmailField emailField = new EmailField(); emailField.setWidth("100%"); emailField.setInputPrompt("E-mail Address"); emailField.setStyleName("email-input"); contentLayout.addComponent(emailField); final PasswordField pwdField = new PasswordField(); pwdField.setWidth("100%"); pwdField.setInputPrompt("Password"); pwdField.setStyleName("password-input"); contentLayout.addComponent(pwdField); final CheckBox rememberPassword = new CheckBox(); rememberPassword.setWidth("100%"); rememberPassword.setCaption("Remember password"); rememberPassword.setValue(true); contentLayout.addComponent(rememberPassword); Button signInBtn = new Button("Sign In"); signInBtn.setWidth("100%"); signInBtn.addStyleName(UIConstants.BUTTON_BIG); signInBtn.addStyleName(UIConstants.COLOR_BLUE); signInBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(Button.ClickEvent event) { ShellController.doLogin(emailField.getValue(), pwdField.getValue(), rememberPassword.getValue()); } }); contentLayout.addComponent(signInBtn); Button createAccountBtn = new Button("Create Account"); createAccountBtn.setWidth("100%"); createAccountBtn.addStyleName(UIConstants.BUTTON_BIG); createAccountBtn.addStyleName(UIConstants.COLOR_GRAY); contentLayout.addComponent(createAccountBtn); this.addComponent(contentLayout); }
From source file:com.esofthead.mycollab.module.crm.view.lead.LeadConvertInfoWindow.java
License:Open Source License
private ComponentContainer createBody() { final CssLayout layout = new CssLayout(); layout.setSizeFull();/*from w w w .j a v a2s . c o m*/ Label shortDescription = new Label( "<p> By clicking the \"Convert\" button, the following tasks will be done:</p>", ContentMode.HTML); layout.addComponent(shortDescription); VerticalLayout infoLayout = new VerticalLayout(); infoLayout.setMargin(new MarginInfo(false, true, true, true)); infoLayout.setSpacing(true); String createAccountTxt = "Create Account: <span class='" + UIConstants.TEXT_BLUE + "'>" + lead.getAccountname() + "</span>"; Label createAccountLbl = new Label(createAccountTxt, ContentMode.HTML); createAccountLbl.addStyleName(UIConstants.LABEL_CHECKED); infoLayout.addComponent(createAccountLbl); String createContactTxt = "Create Contact: <span class='" + UIConstants.TEXT_BLUE + "'>" + lead.getLastname() + (lead.getFirstname() != null ? " " + lead.getFirstname() : "") + "</span>"; Label createContactLbl = new Label(createContactTxt, ContentMode.HTML); createContactLbl.addStyleName(UIConstants.LABEL_CHECKED); infoLayout.addComponent(createContactLbl); final CheckBox isCreateOpportunityChk = new CheckBox("Create a new opportunity for this account"); isCreateOpportunityChk.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { Boolean isSelected = isCreateOpportunityChk.getValue(); if (isSelected) { opportunityForm = new LeadOpportunityForm(); Opportunity opportunity = new Opportunity(); // this is a trick to pass validation opportunity.setAccountid(0); opportunityForm.setBean(opportunity); layout.addComponent(opportunityForm); } else { layout.removeComponent(opportunityForm); } } }); infoLayout.addComponent(isCreateOpportunityChk); layout.addComponent(infoLayout); return layout; }
From source file:com.esofthead.mycollab.module.project.ui.components.ProjectSubscribersComp.java
License:Open Source License
@Override protected Component initContent() { ProjectMemberService projectMemberService = ApplicationContextUtil .getSpringBean(ProjectMemberService.class); List<SimpleUser> members = projectMemberService.getActiveUsersInProject(projectId, AppContext.getAccountId());// w w w.j ava 2s . c o m CssLayout container = new CssLayout(); container.setStyleName("followers-container"); final CheckBox selectAllCheckbox = new CheckBox("All", defaultSelectAll); selectAllCheckbox.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { boolean val = selectAllCheckbox.getValue(); for (FollowerCheckbox followerCheckbox : memberSelections) { followerCheckbox.setValue(val); } } }); container.addComponent(selectAllCheckbox); for (SimpleUser user : members) { final FollowerCheckbox memberCheckbox = new FollowerCheckbox(user); memberCheckbox.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { if (!memberCheckbox.getValue()) { selectAllCheckbox.setValue(false); } } }); if (defaultSelectAll || selectedUsers.contains(user.getUsername())) { memberCheckbox.setValue(true); } memberSelections.add(memberCheckbox); container.addComponent(memberCheckbox); } return container; }
From source file:com.esofthead.mycollab.module.project.view.bug.BugSimpleSearchPanel.java
License:Open Source License
private void createBasicSearchLayout() { layoutSearchPane = new GridLayout(5, 3); layoutSearchPane.setSpacing(true);//from w ww . j a v a 2s . c o m addTextFieldSearch(); final CheckBox chkIsOpenBug = new CheckBox("Only Open Bugs"); layoutSearchPane.addComponent(chkIsOpenBug, 2, 0); layoutSearchPane.setComponentAlignment(chkIsOpenBug, Alignment.MIDDLE_CENTER); Button searchBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SEARCH)); searchBtn.setStyleName(UIConstants.THEME_GREEN_LINK); searchBtn.setIcon(FontAwesome.SEARCH); searchBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { searchCriteria = new BugSearchCriteria(); searchCriteria.setProjectId( new NumberSearchField(SearchField.AND, CurrentProjectVariables.getProject().getId())); searchCriteria.setSummary(new StringSearchField(textValueField.getValue().trim())); if (chkIsOpenBug.getValue()) { searchCriteria.setStatuses(new SetSearchField<>(SearchField.AND, new String[] { BugStatus.InProgress.name(), BugStatus.Open.name(), BugStatus.ReOpened.name() })); } BugSimpleSearchPanel.this.notifySearchHandler(searchCriteria); } }); layoutSearchPane.addComponent(searchBtn, 3, 0); layoutSearchPane.setComponentAlignment(searchBtn, Alignment.MIDDLE_CENTER); Button clearBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CLEAR)); clearBtn.setStyleName(UIConstants.THEME_GRAY_LINK); clearBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { textValueField.setValue(""); } }); layoutSearchPane.addComponent(clearBtn, 4, 0); layoutSearchPane.setComponentAlignment(clearBtn, Alignment.MIDDLE_CENTER); this.setCompositionRoot(layoutSearchPane); }
From source file:com.esofthead.mycollab.module.project.view.kanban.AddNewColumnWindow.java
License:Open Source License
public AddNewColumnWindow(final IKanbanView kanbanView, final String type, final String fieldGroup) { super(AppContext.getMessage(TaskI18nEnum.ACTION_NEW_COLUMN)); this.setWidth("800px"); this.setModal(true); this.setResizable(false); this.center(); MVerticalLayout layout = new MVerticalLayout().withMargin(new MarginInfo(false, false, true, false)); GridFormLayoutHelper gridFormLayoutHelper = GridFormLayoutHelper.defaultFormLayoutHelper(1, 4); this.setContent(layout); final TextField stageField = new TextField(); final CheckBox defaultProject = new CheckBox(); defaultProject.setEnabled(AppContext.canBeYes(RolePermissionCollections.GLOBAL_PROJECT_SETTINGS)); final ColorPicker colorPicker = new ColorPicker("", new com.vaadin.shared.ui.colorpicker.Color( DEFAULT_COLOR.getRed(), DEFAULT_COLOR.getGreen(), DEFAULT_COLOR.getBlue())); final TextArea description = new TextArea(); gridFormLayoutHelper.addComponent(stageField, AppContext.getMessage(GenericI18Enum.FORM_NAME), 0, 0); gridFormLayoutHelper.addComponent(defaultProject, AppContext.getMessage(TaskI18nEnum.FORM_COLUMN_DEFAULT_FOR_NEW_PROJECT), 0, 1); gridFormLayoutHelper.addComponent(colorPicker, AppContext.getMessage(TaskI18nEnum.FORM_COLUMN_COLOR), 0, 2); gridFormLayoutHelper.addComponent(description, AppContext.getMessage(GenericI18Enum.FORM_DESCRIPTION), 0, 3);//from www . j a va 2s .c o m Button saveBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SAVE), new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { OptionVal optionVal = new OptionVal(); optionVal.setCreatedtime(new GregorianCalendar().getTime()); optionVal.setCreateduser(AppContext.getUsername()); optionVal.setDescription(description.getValue()); com.vaadin.shared.ui.colorpicker.Color color = colorPicker.getColor(); String cssColor = color.getCSS(); if (cssColor.startsWith("#")) { cssColor = cssColor.substring(1); } optionVal.setColor(cssColor); if (defaultProject.getValue()) { optionVal.setIsdefault(true); } else { optionVal.setIsdefault(false); optionVal.setExtraid(CurrentProjectVariables.getProjectId()); } optionVal.setSaccountid(AppContext.getAccountId()); optionVal.setType(type); optionVal.setTypeval(stageField.getValue()); optionVal.setFieldgroup(fieldGroup); OptionValService optionService = AppContextUtil.getSpringBean(OptionValService.class); int optionValId = optionService.saveWithSession(optionVal, AppContext.getUsername()); if (optionVal.getIsdefault()) { optionVal.setId(null); optionVal.setIsdefault(false); optionVal.setRefoption(optionValId); optionVal.setExtraid(CurrentProjectVariables.getProjectId()); optionService.saveWithSession(optionVal, AppContext.getUsername()); } kanbanView.addColumn(optionVal); close(); } }); saveBtn.setIcon(FontAwesome.SAVE); saveBtn.setStyleName(UIConstants.BUTTON_ACTION); Button cancelBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CANCEL), new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { close(); } }); cancelBtn.setStyleName(UIConstants.BUTTON_OPTION); MHorizontalLayout controls = new MHorizontalLayout().with(cancelBtn, saveBtn) .withMargin(new MarginInfo(false, true, false, false)); layout.with(gridFormLayoutHelper.getLayout(), controls).withAlign(controls, Alignment.BOTTOM_RIGHT); }
From source file:com.esofthead.mycollab.module.project.view.milestone.AllMilestoneTimelineWidget.java
License:Open Source License
public void display() { this.withMargin(new MarginInfo(true, false, true, false)); this.setWidth("100%"); this.addStyleName("tm-container"); MHorizontalLayout headerLayout = new MHorizontalLayout() .withMargin(new MarginInfo(false, true, false, true)); ELabel titleLbl = ELabel.h2("Phase Timeline"); final CheckBox includeNoDateSet = new CheckBox("No date set"); includeNoDateSet.setValue(false);/*from w ww. ja v a 2 s . c om*/ final CheckBox includeClosedMilestone = new CheckBox("Closed phase"); includeClosedMilestone.setValue(false); includeNoDateSet.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { displayTimelines(includeNoDateSet.getValue(), includeClosedMilestone.getValue()); } }); includeClosedMilestone.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { displayTimelines(includeNoDateSet.getValue(), includeClosedMilestone.getValue()); } }); headerLayout.with(titleLbl, includeNoDateSet, includeClosedMilestone).expand(titleLbl) .withAlign(includeNoDateSet, Alignment.MIDDLE_RIGHT) .withAlign(includeClosedMilestone, Alignment.MIDDLE_RIGHT); MilestoneSearchCriteria searchCriteria = new MilestoneSearchCriteria(); UserDashboardView userDashboardView = UIUtils.getRoot(this, UserDashboardView.class); searchCriteria.setProjectIds(new SetSearchField<>(userDashboardView.getInvolvedProjectKeys())); searchCriteria.setOrderFields( Collections.singletonList(new SearchCriteria.OrderField(Milestone.Field.enddate.name(), "ASC"))); MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.class); milestones = milestoneService .findPagableListByCriteria(new BasicSearchRequest<>(searchCriteria, 0, Integer.MAX_VALUE)); this.addComponent(headerLayout); timelineContainer = new CssLayout(); timelineContainer.setWidth("100%"); this.addComponent(timelineContainer); timelineContainer.addStyleName("tm-wrapper"); displayTimelines(false, false); }
From source file:com.esofthead.mycollab.module.project.view.milestone.MilestoneRoadmapViewImpl.java
License:Open Source License
@Override protected void displayView() { initUI();/*from w ww.ja va 2 s .c o m*/ createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)); baseCriteria = new MilestoneSearchCriteria(); baseCriteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId())); baseCriteria.setOrderFields(Arrays.asList(new SearchCriteria.OrderField("startdate", SearchCriteria.DESC), new SearchCriteria.OrderField("enddate", SearchCriteria.DESC))); displayMilestones(); final MilestoneSearchCriteria tmpCriteria = BeanUtility.deepClone(baseCriteria); tmpCriteria.setStatuses(new SetSearchField<>(OptionI18nEnum.MilestoneStatus.Closed.name())); int totalCloseCount = milestoneService.getTotalCount(tmpCriteria); final CheckBox closeMilestoneSelection = new CheckBox( AppContext.getMessage(MilestoneI18nEnum.WIDGET_CLOSED_PHASE_TITLE) + " (" + totalCloseCount + ")", true); closeMilestoneSelection.setIcon(FontAwesome.MINUS_CIRCLE); filterPanel.addComponent(closeMilestoneSelection); tmpCriteria.setStatuses(new SetSearchField<>(OptionI18nEnum.MilestoneStatus.InProgress.name())); int totalInProgressCount = milestoneService.getTotalCount(tmpCriteria); final CheckBox inProgressMilestoneSelection = new CheckBox( AppContext.getMessage(MilestoneI18nEnum.WIDGET_INPROGRESS_PHASE_TITLE) + " (" + totalInProgressCount + ")", true); inProgressMilestoneSelection.setIcon(FontAwesome.SPINNER); filterPanel.addComponent(inProgressMilestoneSelection); tmpCriteria.setStatuses(new SetSearchField<>(OptionI18nEnum.MilestoneStatus.Future.name())); int totalFutureCount = milestoneService.getTotalCount(tmpCriteria); final CheckBox futureMilestoneSelection = new CheckBox( AppContext.getMessage(MilestoneI18nEnum.WIDGET_FUTURE_PHASE_TITLE) + " (" + totalFutureCount + ")", true); closeMilestoneSelection.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { displayMilestones(tmpCriteria, closeMilestoneSelection.getValue(), inProgressMilestoneSelection.getValue(), futureMilestoneSelection.getValue()); } }); inProgressMilestoneSelection.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { displayMilestones(tmpCriteria, closeMilestoneSelection.getValue(), inProgressMilestoneSelection.getValue(), futureMilestoneSelection.getValue()); } }); futureMilestoneSelection.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { displayMilestones(tmpCriteria, closeMilestoneSelection.getValue(), inProgressMilestoneSelection.getValue(), futureMilestoneSelection.getValue()); } }); futureMilestoneSelection.setIcon(FontAwesome.CLOCK_O); filterPanel.addComponent(futureMilestoneSelection); }
From source file:com.esofthead.mycollab.module.project.view.milestone.MilestoneTimelineWidget.java
License:Open Source License
public void display() { this.setWidth("100%"); this.addStyleName("tm-container"); MHorizontalLayout headerLayout = new MHorizontalLayout(); ELabel titleLbl = ELabel.h2("Phase Timeline"); final CheckBox noDateSetMilestone = new CheckBox("No date set"); noDateSetMilestone.setValue(false);//from w ww . j av a 2 s . c om final CheckBox includeClosedMilestone = new CheckBox("Closed phase"); includeClosedMilestone.setValue(false); noDateSetMilestone.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { displayTimelines(noDateSetMilestone.getValue(), includeClosedMilestone.getValue()); } }); includeClosedMilestone.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { displayTimelines(noDateSetMilestone.getValue(), includeClosedMilestone.getValue()); } }); headerLayout.with(titleLbl, noDateSetMilestone, includeClosedMilestone).expand(titleLbl) .withAlign(noDateSetMilestone, Alignment.MIDDLE_RIGHT) .withAlign(includeClosedMilestone, Alignment.MIDDLE_RIGHT); MilestoneSearchCriteria searchCriteria = new MilestoneSearchCriteria(); searchCriteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId())); searchCriteria.setOrderFields( Collections.singletonList(new SearchCriteria.OrderField(Milestone.Field.enddate.name(), "ASC"))); MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.class); milestones = milestoneService .findPagableListByCriteria(new BasicSearchRequest<>(searchCriteria, 0, Integer.MAX_VALUE)); this.addComponent(headerLayout); timelineContainer = new CssLayout(); timelineContainer.setWidth("100%"); this.addComponent(timelineContainer); timelineContainer.addStyleName("tm-wrapper"); displayTimelines(false, false); }
From source file:com.esofthead.mycollab.module.project.view.user.ProjectAssignmentsWidget.java
License:Open Source License
public ProjectAssignmentsWidget() { withSpacing(false).withMargin(false); titleLbl = new Label(AppContext.getMessage(ProjectCommonI18nEnum.WIDGET_OPEN_ASSIGNMENTS_TITLE, 0)); final CheckBox overdueSelection = new CheckBox("Overdue"); overdueSelection.addValueChangeListener(new Property.ValueChangeListener() { @Override// www .ja v a 2s .co m public void valueChange(Property.ValueChangeEvent valueChangeEvent) { boolean isOverdueOption = overdueSelection.getValue(); if (isOverdueOption) { searchCriteria.setDueDate( new DateSearchField(DateSearchField.AND, DateTimeUtils.getCurrentDateWithoutMS())); } else { searchCriteria.setDueDate(null); } updateSearchResult(); } }); final CheckBox myItemsSelection = new CheckBox("My Items"); myItemsSelection.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { boolean isMyItemsOption = myItemsSelection.getValue(); if (isMyItemsOption) { searchCriteria.setAssignUser(new StringSearchField(AppContext.getUsername())); } else { searchCriteria.setAssignUser(null); } updateSearchResult(); } }); MHorizontalLayout header = new MHorizontalLayout().withMargin(new MarginInfo(false, true, false, true)) .withHeight("34px").with(titleLbl, overdueSelection, myItemsSelection) .withAlign(titleLbl, Alignment.MIDDLE_LEFT).withAlign(overdueSelection, Alignment.MIDDLE_RIGHT) .withAlign(myItemsSelection, Alignment.MIDDLE_RIGHT).expand(titleLbl); header.addStyleName("panel-header"); taskList = new DefaultBeanPagedList<>(ApplicationContextUtil.getSpringBean(ProjectGenericTaskService.class), new TaskRowDisplayHandler(), 10); this.with(header, taskList); }
From source file:com.esofthead.mycollab.module.project.view.user.ProjectOverdueAssignmentsWidget.java
License:Open Source License
public ProjectOverdueAssignmentsWidget() { super(AppContext.getMessage(ProjectCommonI18nEnum.WIDGET_OVERDUE_ASSIGNMENTS_TITLE, 0), new CssLayout()); this.setWidth("100%"); final CheckBox myItemsSelection = new CheckBox(AppContext.getMessage(GenericI18Enum.OPT_MY_ITEMS)); myItemsSelection.addValueChangeListener(new Property.ValueChangeListener() { @Override//from ww w. j a va 2s .c om public void valueChange(Property.ValueChangeEvent valueChangeEvent) { boolean isMyItemsOption = myItemsSelection.getValue(); if (isMyItemsOption) { searchCriteria.setAssignUser(StringSearchField.and(AppContext.getUsername())); } else { searchCriteria.setAssignUser(null); } updateSearchResult(); } }); taskList = new DefaultBeanPagedList(AppContextUtil.getSpringBean(ProjectGenericTaskService.class), new GenericTaskRowDisplayHandler(), 10) { @Override protected String stringWhenEmptyList() { return AppContext.getMessage(ProjectI18nEnum.OPT_NO_OVERDUE_ASSIGNMENT); } }; this.addHeaderElement(myItemsSelection); bodyContent.addComponent(taskList); }