List of usage examples for com.vaadin.ui Alignment MIDDLE_LEFT
Alignment MIDDLE_LEFT
To view the source code for com.vaadin.ui Alignment MIDDLE_LEFT.
Click Source Link
From source file:com.purebred.core.view.CrudResults.java
License:Open Source License
@PostConstruct @Override/*from w ww. jav a 2 s .com*/ public void postConstruct() { super.postConstruct(); getResultsTable().setMultiSelect(true); HorizontalLayout crudButtons = new HorizontalLayout(); crudButtons.setMargin(false); crudButtons.setSpacing(true); newButton = new Button(uiMessageSource.getMessage("entityResults.new"), this, "create"); newButton.setDescription(uiMessageSource.getMessage("entityResults.new.description")); newButton.setIcon(new ThemeResource("icons/16/add.png")); newButton.addStyleName("small default"); crudButtons.addComponent(newButton); viewButton = new Button(uiMessageSource.getMessage("entityResults.view"), this, "view"); viewButton.setDescription(uiMessageSource.getMessage("entityResults.view.description")); viewButton.setIcon(new ThemeResource("icons/16/view.png")); viewButton.setEnabled(false); viewButton.addStyleName("small default"); crudButtons.addComponent(viewButton); editButton = new Button(uiMessageSource.getMessage("entityResults.edit"), this, "edit"); editButton.setDescription(uiMessageSource.getMessage("entityResults.edit.description")); editButton.setIcon(new ThemeResource("icons/16/edit.png")); editButton.setEnabled(false); editButton.addStyleName("small default"); crudButtons.addComponent(editButton); deleteButton = new Button(uiMessageSource.getMessage("entityResults.delete"), this, "delete"); deleteButton.setDescription(uiMessageSource.getMessage("entityResults.delete.description")); deleteButton.setIcon(new ThemeResource("icons/16/delete.png")); deleteButton.setEnabled(false); deleteButton.addStyleName("small default"); crudButtons.addComponent(deleteButton); getResultsTable().addListener(Property.ValueChangeEvent.class, this, "selectionChanged"); // addSelectionChangedListener(this, "selectionChanged"); actionContextMenu.addAction("entityResults.view", this, "view"); actionContextMenu.addAction("entityResults.edit", this, "edit"); actionContextMenu.addAction("entityResults.delete", this, "delete"); applySecurityToCRUDButtons(); getCrudButtons().addComponent(crudButtons, 0); getCrudButtons().setComponentAlignment(crudButtons, Alignment.MIDDLE_LEFT); getResultsTable().addListener(new DoubleClickListener()); getEntityForm().addCancelListener(this, "search"); getEntityForm().addCloseListener(this, "search"); }
From source file:com.purebred.core.view.entityselect.EntitySelectResults.java
License:Open Source License
@PostConstruct @Override//from w w w .j a va 2 s .co m public void postConstruct() { super.postConstruct(); addSelectionChangedListener(this, "selectionChanged"); HorizontalLayout crudButtons = new HorizontalLayout(); crudButtons.setMargin(false); crudButtons.setSpacing(true); selectButton = new Button(uiMessageSource.getMessage("entityResults.select")); selectButton.setDescription(uiMessageSource.getMessage("entityResults.select.description")); selectButton.setEnabled(false); selectButton.addStyleName("small default"); crudButtons.addComponent(selectButton); getCrudButtons().addComponent(crudButtons, 0); getCrudButtons().setComponentAlignment(crudButtons, Alignment.MIDDLE_LEFT); }
From source file:com.purebred.core.view.tomanyrelationship.ToManyRelationshipResults.java
License:Open Source License
@PostConstruct @Override/* w w w . ja v a2 s. c om*/ public void postConstruct() { super.postConstruct(); crudButtons = new HorizontalLayout(); crudButtons.setMargin(false); crudButtons.setSpacing(true); addButton = new Button(uiMessageSource.getMessage("entityResults.add"), this, "add"); addButton.setDescription(uiMessageSource.getMessage("entityResults.add.description")); addButton.setIcon(new ThemeResource("icons/16/add.png")); addButton.addStyleName("small default"); crudButtons.addComponent(addButton); removeButton = new Button(uiMessageSource.getMessage("entityResults.remove"), this, "remove"); removeButton.setDescription(uiMessageSource.getMessage("entityResults.remove.description")); removeButton.setIcon(new ThemeResource("icons/16/delete.png")); removeButton.setEnabled(false); removeButton.addStyleName("small default"); crudButtons.addComponent(removeButton); getCrudButtons().addComponent(crudButtons, 0); getCrudButtons().setComponentAlignment(crudButtons, Alignment.MIDDLE_LEFT); getResultsTable().setMultiSelect(true); actionContextMenu.addAction("entityResults.remove", this, "remove"); actionContextMenu.setActionEnabled("entityResults.remove", true); addSelectionChangedListener(this, "selectionChanged"); }
From source file:com.save.area.AreaUI.java
ComponentContainer getHlayoutWithBtn() { VerticalLayout buttonsLayout = new VerticalLayout(); buttonsLayout.setMargin(new MarginInfo(true, false, false, false)); Button addBtn = new AreaButton("ADD LOCATION TO AREA"); buttonsLayout.addComponent(addBtn);/* w ww.j a v a 2 s. com*/ addBtn.addClickListener(actionBtnListener); buttonsLayout.setComponentAlignment(addBtn, Alignment.MIDDLE_LEFT); Button createBtn = new AreaButton("CREATE NEW AREA"); buttonsLayout.addComponent(createBtn); createBtn.addClickListener(actionBtnListener); buttonsLayout.setComponentAlignment(createBtn, Alignment.MIDDLE_LEFT); Button editBtn = new AreaButton("EDIT AREA"); buttonsLayout.addComponent(editBtn); editBtn.addClickListener(actionBtnListener); buttonsLayout.setComponentAlignment(editBtn, Alignment.MIDDLE_LEFT); Button deleteBtn = new AreaButton("DELETE AREA"); buttonsLayout.addComponent(deleteBtn); deleteBtn.addClickListener(actionBtnListener); buttonsLayout.setComponentAlignment(deleteBtn, Alignment.MIDDLE_LEFT); Button addProvinceBtn = new AreaButton("ADD PROVINCE"); buttonsLayout.addComponent(addProvinceBtn); addProvinceBtn.addClickListener(actionBtnListener); buttonsLayout.setComponentAlignment(addProvinceBtn, Alignment.MIDDLE_LEFT); Button addCityBtn = new AreaButton("ADD CITY"); buttonsLayout.addComponent(addCityBtn); addCityBtn.addClickListener(actionBtnListener); buttonsLayout.setComponentAlignment(addCityBtn, Alignment.MIDDLE_LEFT); return buttonsLayout; }
From source file:com.save.client.ClientInformationForm.java
FormLayout clientInformationForm() { form.setMargin(false);//ww w . jav a 2 s .c o m form.setWidth("100%"); form.addStyleName("light"); form.setReadOnly(readOnly); form.setImmediate(true); editClientBtn = new Button(EDIT_BUTTON_CAPTION, editBtnListener); editClientBtn.setEnabled(false); cancelBtn = new Button(CANCEL_BUTTON_CAPTION, cancelBtnListener); cancelBtn.setEnabled(false); newClientBtn = new Button(NEW_BUTTON_CAPTION, newBtnListener); client = new TextField("Name: "); client.setWidth("50%"); client.setRequired(true); client.setRequiredError("Required Name!"); form.addComponent(client); province.setInputPrompt("Select Province.."); province.setRequired(true); province.setRequiredError("Required Province!"); city.setInputPrompt("Select City.."); city.setRequired(true); city.setRequiredError("Required City/Town!"); province.addValueChangeListener(new ProvincePropertyChangeListener(city)); province.setWidth("100%"); form.addComponent(province); city.setWidth("100%"); form.addComponent(city); address = new TextField("Street/Brgy: "); address.setWidth("50%"); address.setRequired(true); address.setRequiredError("Required Street/Brgy!"); form.addComponent(address); landline = new TextField("Landline No: "); landline.setWidth("50%"); landline.setRequired(true); landline.setRequiredError("Required Contact No!"); form.addComponent(landline); mobile = new TextField("Mobile No: "); mobile.setWidth("50%"); mobile.setRequired(true); mobile.setRequiredError("Required Contact No!"); form.addComponent(mobile); setAsDistributor = new OptionGroup("Distributor"); setAsDistributor.addItems("Yes", "No"); setAsDistributor.addStyleName("horizontal"); setAsDistributor.setRequired(readOnly); setAsDistributor.setRequiredError("Set option(Y/N) As Distrbutor!"); setAsDistributor.addValueChangeListener(distributorCheckboxListener); form.addComponent(setAsDistributor); clientType.setWidth("90%"); clientType.setRequired(true); clientType.setRequiredError("Required Client Type!"); clientType.setVisible(false); form.addComponent(clientType); if (getClientId() != 0) { editClientBtn.setEnabled(true); Client c = clientService.getClientDataById(getClientId()); client.setValue(c.getClientName().toUpperCase()); province.setValue(c.getProvince().getProvinceId()); city.setValue(c.getCityId()); address.setValue(c.getStreet()); landline.setValue(c.getLandline()); mobile.setValue(c.getMobile()); if (c.getAsDistributor() == 0) { setAsDistributor.setValue("No"); clientType.setVisible(true); clientType.setValue(c.getClientType()); } else { setAsDistributor.setValue("Yes"); clientType.setVisible(false); clientType.setValue("distributor"); } } form.setReadOnly(true); HorizontalLayout footer = new HorizontalLayout(); footer.setMargin(new MarginInfo(true, true, true, false)); footer.setSpacing(true); footer.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); form.addComponent(footer); footer.addComponent(editClientBtn); footer.addComponent(cancelBtn); footer.addComponent(newClientBtn); removeBtn = new Button("Remove Account"); removeBtn.addClickListener(removeBtnListener); form.addComponent(removeBtn); disableFields(false); return form; }
From source file:com.save.employee.EmploymentInformationForm.java
public EmploymentInformationForm(HorizontalSplitPanel hsplit, int employeeId) { this.hsplit = hsplit; this.employeeId = employeeId; setMargin(new MarginInfo(true, true, false, false)); setWidth("80%"); addStyleName("light"); setReadOnly(readOnly);/*from w ww .j a v a2s . c om*/ setImmediate(true); editBtn = new Button(EDIT_BUTTON_CAPTION); editBtn.addClickListener(editBtnListener); editBtn.setImmediate(true); cancelBtn = new Button(CANCEL_BTN_CAPTION, cancelBtnListener); cancelBtn.setImmediate(true); cancelBtn.setEnabled(false); // addBtn = new Button(ADD_BUTTON_CAPTION, addBtnListener); // addBtn.setImmediate(true); // Label section = new Label("Employment Info"); // section.addStyleName("h1"); // section.addStyleName("colored"); // addComponent(section); position = new PositionComboBox(); addComponent(position); department = new DepartmentComboBox(); addComponent(department); employmentStatus = CommonComboBox.employmentStatus("Status: "); addComponent(employmentStatus); remarks = new TextArea("Remarks: "); remarks.setWidth("100%"); remarks.setRequired(true); remarks.setRequiredError("Required Remarks"); addComponent(remarks); if (getEmployeeId() != 0) { EmployeePositionHistory eph = es.getEmployeesEmploymentDataById(getEmployeeId()); position.setValue(eph.getPosition()); department.setValue(eph.getDepartment()); employmentStatus.setValue(eph.getEmploymentStatus()); remarks.setValue(eph.getRemarks()); } footer = new HorizontalLayout(); footer.setMargin(new MarginInfo(true, true, true, false)); footer.setSpacing(true); footer.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); addComponent(footer); footer.addComponent(editBtn); footer.addComponent(cancelBtn); // footer.addComponent(addBtn); // Label lastModified = new Label("Last modified by you a minute ago"); // lastModified.addStyleName("light"); // footer.addComponent(lastModified); disableFields(false); }
From source file:com.save.employee.PersonalInformationForm.java
public PersonalInformationForm(HorizontalSplitPanel hsplit, int employeeId, Grid grid, Object itemId) { this.hsplit = hsplit; this.employeeId = employeeId; this.grid = grid; this.itemId = itemId; setMargin(new MarginInfo(true, true, false, false)); setWidth("80%"); addStyleName("light"); editBtn = new Button(BUTTON_CAPTION, editBtnListener); editBtn.setEnabled(false);/*from w w w .j a v a2 s.c o m*/ cancelBtn = new Button("CANCEL"); cancelBtn.setEnabled(false); newEntryBtn = new Button("NEW ACCOUNT"); employeeNoField = new TextField("Employee ID: "); employeeNoField.setWidth("50%"); employeeNoField.setRequired(true); employeeNoField.setRequiredError("Required Employee ID!"); addComponent(employeeNoField); firstname = new TextField("Firstname: "); firstname.setWidth("50%"); firstname.setRequired(true); firstname.setRequiredError("Required Firstname!"); addComponent(firstname); middlename = new TextField("Middlename: "); middlename.setWidth("50%"); middlename.setRequired(true); middlename.setRequiredError("Required Middlename!"); addComponent(middlename); lastname = new TextField("Lastname: "); lastname.setWidth("50%"); lastname.setRequired(true); lastname.setRequiredError("Required Lastname!"); addComponent(lastname); gender = new OptionGroup("Gender: "); gender.addItem("Female"); gender.addItem("Male"); gender.addStyleName("horizontal"); addComponent(gender); status = new ComboBox("Status: "); status.setNullSelectionAllowed(false); status.addItem("Single"); status.addItem("Married"); status.addItem("Widow"); status.addItem("Separated"); addComponent(status); birthday = new DateField("Birthday"); birthday.setValue(new Date()); addComponent(birthday); if (getEmployeeId() != 0) { Employee e = es.getEmployeesPersonalDataById(getEmployeeId()); employeeNoField.setValue(e.getEmployeeNo()); firstname.setValue(e.getFirstname()); middlename.setValue(e.getMiddlename()); lastname.setValue(e.getLastname()); gender.setValue(CommonUtilities.capitalizeFirstLetter(e.getGender())); status.setValue(e.getPersonalStatus()); birthday.setValue((e.getDob() == null) ? new Date() : e.getDob()); editBtn.setEnabled(true); cancelBtn.setEnabled(true); } setReadOnly(true); HorizontalLayout footer = new HorizontalLayout(); footer.setMargin(new MarginInfo(true, false, true, false)); footer.setSpacing(true); footer.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); addComponent(footer); footer.addComponent(editBtn); footer.addComponent(cancelBtn); footer.addComponent(newEntryBtn); removeBtn = new Button("REMOVE ACCOUNT"); removeBtn.addClickListener(removeBtnListener); addComponent(removeBtn); cancelBtn.addClickListener((Button.ClickEvent event) -> { setReadOnly(false); addStyleName("light"); editBtn.setCaption(BUTTON_CAPTION); editBtn.removeStyleName("primary"); setReadOnly(true); disableFields(false); newEntryBtn.setEnabled(true); }); newEntryBtn.addClickListener((Button.ClickEvent event) -> { setReadOnly(true); addStyleName("light"); editBtn.setCaption(BUTTON_CAPTION); editBtn.removeStyleName("primary"); Window sub = new CreateNewAccountWindow(getHsplit()); UI.getCurrent().addWindow(sub); }); disableFields(false); }
From source file:com.save.employee.request.ViewRLWindow.java
FormLayout buildFormLayout() { FormLayout f = new FormLayout(); f.setWidth("100%"); f.setMargin(true);//w w w . ja v a 2 s .co m LiquidationForm lf = rls.getRLById(getRequestId()); controlNo = new TextField("Control No."); controlNo.setWidth("100%"); controlNo.addStyleName(ValoTheme.TEXTFIELD_SMALL); controlNo.setValue(String.valueOf(lf.getControlNo())); controlNo.setEnabled(false); f.addComponent(controlNo); dateOfActivity = new DateField("Date of Activity: "); dateOfActivity.setWidth("100%"); dateOfActivity.addStyleName(ValoTheme.DATEFIELD_SMALL); dateOfActivity.setValue(lf.getDateOfActivity()); dateOfActivity.setEnabled(false); f.addComponent(dateOfActivity); area = CommonComboBox.areas(); area.setWidth("100%"); area.setValue(lf.getAreaId()); area.setEnabled(false); f.addComponent(area); activity = new TextField("Activity: "); activity.setWidth("100%"); activity.addStyleName(ValoTheme.TEXTFIELD_SMALL); activity.setValue(lf.getActivity()); activity.setEnabled(false); f.addComponent(activity); venue = new TextField("Venue: "); venue.setWidth("100%"); venue.addStyleName(ValoTheme.TEXTFIELD_SMALL); venue.setValue(lf.getVenue()); venue.setEnabled(false); f.addComponent(venue); requirements = new TextArea("Requirements: "); requirements.setWidth("100%"); requirements.addStyleName(ValoTheme.TEXTAREA_SMALL); requirements.setValue(lf.getRequirements()); requirements.setEnabled(false); f.addComponent(requirements); HorizontalLayout h1 = new HorizontalLayout(); h1.setWidth("100%"); h1.setCaption("Request Lodging"); h1.addStyleName("light"); // h1.setReadOnly(true); requestLodgingPax = new TextField(); requestLodgingPax.setWidth("100%"); requestLodgingPax.addStyleName(ValoTheme.TEXTFIELD_SMALL); requestLodgingPax.addStyleName("align-right"); requestLodgingPax.setValue("Pax: " + String.valueOf(lf.getLodgingPax())); requestLodgingPax.setEnabled(false); h1.addComponent(requestLodgingPax); requestLodgingBudget = new TextField(); requestLodgingBudget.setWidth("100%"); requestLodgingBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL); requestLodgingBudget.addStyleName("align-right"); requestLodgingBudget.setValue("Budget: " + String.valueOf(lf.getLodgingBudget())); requestLodgingBudget.setEnabled(false); h1.addComponent(requestLodgingBudget); requestLodgingAmount = new TextField(); requestLodgingAmount.setWidth("100%"); requestLodgingAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL); requestLodgingAmount.addStyleName("align-right"); requestLodgingAmount.setValue("Amount: " + String.valueOf(lf.getLodgingAmount())); requestLodgingAmount.setEnabled(false); h1.addComponent(requestLodgingAmount); f.addComponent(h1); f.setComponentAlignment(h1, Alignment.MIDDLE_LEFT); HorizontalLayout h2 = new HorizontalLayout(); h2.setWidth("100%"); h2.setCaption("Request Meals"); // h2.setReadOnly(true); requestMealsPax = new TextField(); requestMealsPax.setWidth("100%"); requestMealsPax.addStyleName(ValoTheme.TEXTFIELD_SMALL); requestMealsPax.addStyleName("align-right"); requestMealsPax.setValue("Pax: " + String.valueOf(lf.getMealsPax())); requestMealsPax.setEnabled(false); h2.addComponent(requestMealsPax); requestMealsBudget = new TextField(); requestMealsBudget.setWidth("100%"); requestMealsBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL); requestMealsBudget.addStyleName("align-right"); requestMealsBudget.setValue("Budget: " + String.valueOf(lf.getMealsBudget())); requestMealsBudget.setEnabled(false); h2.addComponent(requestMealsBudget); requestMealsAmount = new TextField(); requestMealsAmount.setWidth("100%"); requestMealsAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL); requestMealsAmount.addStyleName("align-right"); requestMealsAmount.setValue("Amount: " + String.valueOf(lf.getMealsAmount())); requestMealsAmount.setEnabled(false); h2.addComponent(requestMealsAmount); f.addComponent(h2); f.setComponentAlignment(h2, Alignment.MIDDLE_LEFT); HorizontalLayout h3 = new HorizontalLayout(); h3.setWidth("100%"); h3.setCaption("Liquidated Lodging"); // h3.setReadOnly(true); liquidateLodgingPax = new TextField(); liquidateLodgingPax.setWidth("100%"); liquidateLodgingPax.addStyleName(ValoTheme.TEXTFIELD_SMALL); liquidateLodgingPax.addStyleName("align-right"); liquidateLodgingPax.setValue("Pax: " + String.valueOf(lf.getLiquidationLodgingPax())); liquidateLodgingPax.setEnabled(false); h3.addComponent(liquidateLodgingPax); liquidateLodgingBudget = new TextField(); liquidateLodgingBudget.setWidth("100%"); liquidateLodgingBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL); liquidateLodgingBudget.addStyleName("align-right"); liquidateLodgingBudget.setValue("Budget: " + String.valueOf(lf.getLiquidationLodgingBudget())); liquidateLodgingBudget.setEnabled(false); h3.addComponent(liquidateLodgingBudget); liquidateLodgingAmount = new TextField(); liquidateLodgingAmount.setWidth("100%"); liquidateLodgingAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL); liquidateLodgingAmount.addStyleName("align-right"); liquidateLodgingAmount.setValue("Amount: " + String.valueOf(lf.getLiquidationLodgingAmount())); liquidateLodgingAmount.setEnabled(false); h3.addComponent(liquidateLodgingAmount); f.addComponent(h3); f.setComponentAlignment(h3, Alignment.MIDDLE_LEFT); HorizontalLayout h4 = new HorizontalLayout(); h4.setWidth("100%"); h4.setCaption("Liquidated Meals"); h4.setReadOnly(true); liquidateMealsPax = new TextField(); liquidateMealsPax.setWidth("100%"); liquidateMealsPax.addStyleName(ValoTheme.TEXTFIELD_SMALL); liquidateMealsPax.addStyleName("align-right"); liquidateMealsPax.setValue("Pax: " + String.valueOf(lf.getLiquidationMealsPax())); liquidateMealsPax.setEnabled(false); h4.addComponent(liquidateMealsPax); liquidateMealsBudget = new TextField(); liquidateMealsBudget.setWidth("100%"); liquidateMealsBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL); liquidateMealsBudget.addStyleName("align-right"); liquidateMealsBudget.setValue("Budget: " + String.valueOf(lf.getLiquidationMealsBudget())); liquidateMealsBudget.setEnabled(false); h4.addComponent(liquidateMealsBudget); liquidateMealsAmount = new TextField(); liquidateMealsAmount.setWidth("100%"); liquidateMealsAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL); liquidateMealsAmount.addStyleName("align-right"); liquidateMealsAmount.setValue("Amount: " + String.valueOf(lf.getLiquidationMealsAmount())); liquidateMealsAmount.setEnabled(false); h4.addComponent(liquidateMealsAmount); f.addComponent(h4); f.setComponentAlignment(h4, Alignment.MIDDLE_LEFT); reimbursement = new TextField("Reimbursement: "); reimbursement.setWidth("50%"); reimbursement.addStyleName(ValoTheme.TEXTFIELD_SMALL); reimbursement.setValue(String.valueOf(lf.getReimbursedAmount())); reimbursement.setEnabled(false); f.addComponent(reimbursement); f.addStyleName("light"); f.setReadOnly(true); return f; }
From source file:com.selzlein.lojavirtual.vaadin.core.NavigationMenu.java
License:Open Source License
private void buildTopMenu() { final HorizontalLayout top = new HorizontalLayout(); top.setWidth("100%"); top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); top.addStyleName("valo-menu-title"); final Label title = new Label("<h3>LSPS <strong>ProcessApplication</strong></h3>", ContentMode.HTML); title.setSizeUndefined();// w ww.j a v a 2 s .co m top.addComponent(title); top.setExpandRatio(title, 1); this.addComponent(top); final NavigationMenu menuWrapp = this; final Button showMenu = new Button("Menu", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { if (menuWrapp.getStyleName().contains("valo-menu-visible")) { menuWrapp.removeStyleName("valo-menu-visible"); } else { menuWrapp.addStyleName("valo-menu-visible"); } } }); showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY); showMenu.addStyleName(ValoTheme.BUTTON_SMALL); showMenu.addStyleName("valo-menu-toggle"); showMenu.setIcon(FontAwesome.LIST); this.addComponent(showMenu); }
From source file:com.skysql.manager.ui.CalendarDialog.java
License:Open Source License
/** * Inits the layout content.// w ww . j av a 2 s. c om */ private void initLayoutContent() { initNavigationButtons(); initAddNewEventButton(); initHideWeekEndButton(); //initAllScheduleButton(); HorizontalLayout hl = new HorizontalLayout(); hl.setWidth("100%"); hl.setSpacing(true); hl.setMargin(new MarginInfo(false, false, true, false)); hl.addComponent(prevButton); hl.addComponent(captionLabel); hl.addComponent(monthButton); hl.addComponent(weekButton); hl.addComponent(nextButton); hl.setComponentAlignment(prevButton, Alignment.MIDDLE_LEFT); hl.setComponentAlignment(captionLabel, Alignment.MIDDLE_CENTER); hl.setComponentAlignment(monthButton, Alignment.MIDDLE_CENTER); hl.setComponentAlignment(weekButton, Alignment.MIDDLE_CENTER); hl.setComponentAlignment(nextButton, Alignment.MIDDLE_RIGHT); monthButton.setVisible(viewMode == Mode.WEEK); weekButton.setVisible(viewMode == Mode.DAY); HorizontalLayout controlPanel = new HorizontalLayout(); controlPanel.setSpacing(true); controlPanel.setMargin(new MarginInfo(false, false, true, false)); controlPanel.setWidth("100%"); //controlPanel.addComponent(localeSelect); //controlPanel.setComponentAlignment(localeSelect, Alignment.MIDDLE_LEFT); controlPanel.addComponent(timeZoneSelect); controlPanel.setComponentAlignment(timeZoneSelect, Alignment.MIDDLE_LEFT); //controlPanel.addComponent(formatSelect); //controlPanel.setComponentAlignment(formatSelect, Alignment.MIDDLE_LEFT); controlPanel.addComponent(addNewEvent); controlPanel.setComponentAlignment(addNewEvent, Alignment.BOTTOM_LEFT); controlPanel.addComponent(hideWeekendsButton); controlPanel.setComponentAlignment(hideWeekendsButton, Alignment.BOTTOM_LEFT); //controlPanel.addComponent(allScheduleButton); //controlPanel.setComponentAlignment(allScheduleButton, Alignment.MIDDLE_LEFT); VerticalLayout layout = (VerticalLayout) dialogWindow.getContent(); layout.addComponent(controlPanel); layout.addComponent(hl); layout.addComponent(calendarComponent); layout.setExpandRatio(calendarComponent, 1); }