List of usage examples for com.vaadin.ui Panel setStyleName
@Override public void setStyleName(String style)
From source file:com.esofthead.mycollab.module.project.view.task.GanttChartViewImpl.java
License:Open Source License
private Panel createControls() { Panel panel = new Panel(); panel.setWidth(100, Unit.PERCENTAGE); MHorizontalLayout controls = new MHorizontalLayout().withMargin(true); panel.setContent(controls);/*from w w w. ja va2 s . co m*/ DateFieldExt start = new DateFieldExt(AppContext.getMessage(TaskI18nEnum.FORM_START_DATE)); start.setValue(gantt.getStartDate()); start.setResolution(Resolution.DAY); start.setImmediate(true); start.addValueChangeListener(startDateValueChangeListener); DateField end = new DateFieldExt(AppContext.getMessage(TaskI18nEnum.FORM_END_DATE)); end.setValue(gantt.getEndDate()); end.setResolution(Resolution.DAY); end.setImmediate(true); end.addValueChangeListener(endDateValueChangeListener); reso = new NativeSelect("Resolution"); reso.setNullSelectionAllowed(false); reso.addItem(org.tltv.gantt.client.shared.Resolution.Hour); reso.addItem(org.tltv.gantt.client.shared.Resolution.Day); reso.addItem(org.tltv.gantt.client.shared.Resolution.Week); reso.setValue(gantt.getResolution()); reso.setImmediate(true); reso.addValueChangeListener(resolutionValueChangeListener); controls.with(start, end, reso); panel.setStyleName(UIConstants.THEME_NO_BORDER); return panel; }
From source file:com.lizardtech.expresszip.ui.FindLayersPresenter.java
License:Apache License
private void addClusteredVectorLayer() { if (clusterLayer != null) { findLayersMap.removeLayer(clusterLayer); }// ww w. jav a 2s .com clusterLayer = new VectorLayer(); clusterLayer.setSelectionMode(SelectionMode.SIMPLE); clusterLayer.addListener(new org.vaadin.vol.VectorLayer.VectorSelectedListener() { @Override public void vectorSelected(org.vaadin.vol.VectorLayer.VectorSelectedEvent event) { Vector[] vectors = event.getVectors(); if (null == vectors) return; if (null != popup) { findLayersMap.removeComponent(popup); } popup = new Popup(); findLayersMap.addPopup(popup); CssLayout cssLayout = new CssLayout(); VerticalLayout verticalLayout = new VerticalLayout(); Panel panel = new Panel(); panel.setStyleName(Runo.PANEL_LIGHT); panel.setContent(verticalLayout); int height = Math.min(400, (vectors.length + 1) * 32 + 10); panel.setHeight(height + "px"); cssLayout.addComponent(panel); popup.addComponent(cssLayout); TreeTable popupTable = findLayersView.getPopupTable(); popupTable.removeAllItems(); verticalLayout.addComponent(popupTable); List<ExpressZipLayer> layers = new ArrayList<ExpressZipLayer>(); for (Vector selected : vectors) { final ExpressZipLayer layer = (ExpressZipLayer) selected.getData(); findLayersView.addLayerItem(layer, popupTable); layers.add(layer); } Bounds b = MapModel.getBoundsForLayers(layers, MapModel.EPSG4326); popup.setLat((b.getMinLat() + b.getMaxLat()) / 2.0d); popup.setLon((b.getMaxLon() + b.getMinLon()) / 2.0d); } }); clusterLayer.addListener(new org.vaadin.vol.VectorLayer.VectorUnSelectedListener() { @Override public void vectorUnSelected(VectorUnSelectedEvent event) { if (null != popup) { findLayersMap.removeComponent(popup); popup = null; } } }); clusterLayer.setImmediate(true); findLayersMap.addLayer(clusterLayer); }
From source file:com.logicbomb.newschool.MyAppWidgetSet.core.UserDetailsWidgetOld.java
public UserDetailsWidgetOld() { setSpacing(true);//w w w. j a va 2 s .c o m Panel iPanel = new Panel(); iPanel.setWidth("50px"); iPanel.setHeight("50px"); iPanel.setStyleName("backColorWhite"); addComponent(iPanel); String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath(); // Image as a file resource FileResource resource = new FileResource(new File(basepath + "/VAADIN/themes/mytheme/img/loginPage.jpg")); // Show the image in the application Image image = new Image("", resource); image.setSizeFull(); iPanel.setContent(image); }
From source file:com.logicbomb.newschool.MyAppWidgetSet.MenuWidget.java
public MenuWidget(String Width) { Panel iPanel = new Panel(); iPanel.setWidth(Width);/*from ww w . j a va 2 s .c om*/ iPanel.setStyleName("backColorWhite"); addComponent(iPanel); VerticalLayout iVerticalLayout = new VerticalLayout(); for (int i = 1; i <= 8; i++) { Button iButton = new Button(); iButton.setWidth(Width); iButton.setHeight("50px"); iVerticalLayout.addComponent(iButton); } iPanel.setContent(iVerticalLayout); }
From source file:com.logicbomb.newschool.pages.masterpages.PrimaryMasterPage.java
public PrimaryMasterPage() { //ContextWidget c= new ContextWidget(); HorizontalLayout iHorizontalLayout = new HorizontalLayout(); //addComponent(iHorizontalLayout,"top:0px;left:0px"); iHorizontalLayout.setWidth(String.valueOf(Page.getCurrent().getBrowserWindowWidth())); iHorizontalLayout.setHeight(String.valueOf(Page.getCurrent().getBrowserWindowHeight())); iHorizontalLayout.setStyleName("backColorBlack"); //String[] captions1 = {"Logo Here", "My Cool School", "Third"}; //Layout A and its sub components Panel AP = new Panel(); iHorizontalLayout.addComponent(AP);/*from w w w . j a va 2 s. com*/ AP.setSizeFull(); AP.setStyleName("backColorBlack"); VerticalLayout A1 = new VerticalLayout(); AP.setContent(A1); //A.setSizeFull(); A1.setSpacing(true); iHorizontalLayout.setExpandRatio(AP, 1); A1.setStyleName("backColorBlack"); A1.setMargin(new MarginInfo(true, true, true, true)); Button logoImage = new Button(); logoImage.setIcon(FontAwesome.PICTURE_O); logoImage.setWidth("80px"); logoImage.setHeight(logoImage.getWidth(), Unit.PIXELS); //logoImage.setWidth("100px"); A1.addComponent(logoImage); A1.setComponentAlignment(logoImage, Alignment.TOP_CENTER); Label schoolName = new Label("The School Of Future"); schoolName.setStyleName("v-label-big"); A1.addComponent(schoolName); //A.setComponentAlignment(schoolName,Alignment.TOP_CENTER); Label schoolMinorName = new Label("Random Branch"); schoolMinorName.setStyleName("v-label-small"); A1.addComponent(schoolMinorName); VerticalLayout A2 = new VerticalLayout(); A1.addComponent(A2); MainMenuWidget iMainMenuWidget = new MainMenuWidget(); A2.addComponent(iMainMenuWidget); //A.setComponentAlignment(schoolName,Alignment.TOP_CENTER); //Layout B ContextWidgetTop c = new ContextWidgetTop(); c = ContextWidgetTop.ContextWidgetTransformer(c, new UserDetailsWidget(), SliderMode.TOP, SliderPanelStyles.COLOR_RED); VerticalLayout B = new VerticalLayout(); B.setSizeFull(); //B.setSpacing(true); iHorizontalLayout.addComponent(c); c.addComponent(B); iHorizontalLayout.setExpandRatio(c, 7); //Layout B1 and its sub Components HorizontalLayout B1 = new HorizontalLayout(); B.addComponent(B1); //B.setExpandRatio(B1, 1); //B1.setHeight("70px"); B1.setSizeFull(); //B1=ContextWidget.ContextWidgetTransformer(B1, new SliderMasterPage(),SliderMode.RIGHT,SliderPanelStyles.COLOR_RED); HorizontalLayout B11 = new HorizontalLayout(); B1.addComponent(B11); B1.setStyleName("backColorBlack"); B11.setSizeFull(); B1.setHeight("45px"); //B1.setStyleName("backColorWhite"); //B1.setMargin(new MarginInfo(false, true, false, true)); TextField iTextField = new TextField(); iTextField.setWidth("200px"); iTextField.setInputPrompt("Search!"); iTextField.setStyleName("v-text-type-search"); iTextField.focus(); B11.addComponent(iTextField); B11.setComponentAlignment(iTextField, Alignment.MIDDLE_LEFT); //Layout B2 and its Sub Components ContextWidget B2 = new ContextWidget(); B2.setSizeFull(); B.addComponent(B2); B.setExpandRatio(B2, 10); B2 = ContextWidget.ContextWidgetTransformer(B2, new SliderMasterPage(), SliderMode.RIGHT, SliderPanelStyles.COLOR_BLUE); //B2=ContextWidget.ContextWidgetTransformer(B2, new SliderMasterPage(),SliderMode.TOP,SliderPanelStyles.COLOR_RED); VerticalLayout v = new VerticalLayout(); B2.addComponent(v); Button b1111 = new Button( "Put all the inner components like this Put all the inner components like this Put all the inner components like this Put all the inner components like this"); v.addComponent(b1111); Button b1112 = new Button("Put all the inner components like this"); v.addComponent(b1112); /* Panel p = new Panel(); VerticalLayout v= new VerticalLayout(); v.addComponent(new TextField("Name")); v.addComponent(new TextField("Street address")); v.addComponent(new TextField("Postal code")); p.setContent(v); B2.addComponent(p); v.setWidth(String.valueOf(B2.getWidth()*10)+"px"); //v.setSizeFull();// <- This will cause issues. Don't do this p.setSizeFull(); */ //ContextWidget iContextPanel= new ContextWidget(p); //B2.addComponent(iContextPanel); //setPosition(p, iComponentPositionPanel); addComponent(iHorizontalLayout); }
From source file:com.ocs.dynamo.ui.composite.form.ModelBasedEditForm.java
License:Apache License
/** * Construct the layout (form and panel) for an attribute group * /* w w w . ja v a2s. co m*/ * @param parent * the parent component * @param tabs * whether to include the component in a tab sheet * @param tabSheet * the parent tab sheet (only used if the "tabs" parameter is true) * @param caption * caption of the panel or tab sheet * @param lowest * indicates whether this is the lowest level * @return */ private Layout constructAttributeGroupLayout(Layout parent, boolean tabs, TabSheet tabSheet, String caption, boolean lowest) { Layout innerLayout = null; if (lowest) { innerLayout = new FormLayout(); ((FormLayout) innerLayout).setMargin(true); if (!tabs) { ((FormLayout) innerLayout).setStyleName(DynamoConstants.CSS_CLASS_HALFSCREEN); } } else { innerLayout = new DefaultVerticalLayout(true, true); } if (tabs) { tabSheet.addTab(innerLayout, caption); } else { Panel panel = new Panel(); panel.setStyleName("attributePanel"); panel.setCaption(caption); panel.setContent(innerLayout); parent.addComponent(panel); } return innerLayout; }
From source file:com.openhris.employee.EmployeePersonalInformation.java
public ComponentContainer layout() { glayout = new GridLayout(4, 19); glayout.setSpacing(true);//from w w w . j a v a 2 s.c om glayout.setWidth("600px"); glayout.setHeight("100%"); final Panel imagePanel = new Panel(); imagePanel.setStyleName("light"); AbstractLayout panelLayout = (AbstractLayout) imagePanel.getContent(); panelLayout.setMargin(false); imagePanel.setWidth("100px"); avatar = new Embedded(null, new ThemeResource("../myTheme/img/fnc.jpg")); avatar.setImmediate(true); avatar.setWidth(90, Sizeable.UNITS_PIXELS); avatar.setHeight(90, Sizeable.UNITS_PIXELS); avatar.addStyleName("logo-img"); imagePanel.addComponent(avatar); glayout.addComponent(avatar, 0, 0, 0, 1); glayout.setComponentAlignment(imagePanel, Alignment.MIDDLE_CENTER); Button uploadPhotoBtn = new Button("Upload.."); uploadPhotoBtn.setWidth("100%"); uploadPhotoBtn.setStyleName(Reindeer.BUTTON_SMALL); uploadPhotoBtn.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (getEmployeeId() == null) { getWindow().showNotification("You did not select and Employee!", Window.Notification.TYPE_WARNING_MESSAGE); return; } Window uploadImage = new UploadImage(imagePanel, avatar, getEmployeeId()); uploadImage.setWidth("450px"); if (uploadImage.getParent() == null) { getWindow().addWindow(uploadImage); } uploadImage.setModal(true); uploadImage.center(); } }); glayout.addComponent(uploadPhotoBtn, 0, 2); glayout.setComponentAlignment(uploadPhotoBtn, Alignment.MIDDLE_CENTER); fnField = createTextField("Firstname: "); glayout.addComponent(fnField, 1, 0); glayout.setComponentAlignment(fnField, Alignment.MIDDLE_LEFT); mnField = createTextField("Middlename: "); glayout.addComponent(mnField, 2, 0); glayout.setComponentAlignment(mnField, Alignment.MIDDLE_LEFT); lnField = createTextField("Lastname: "); glayout.addComponent(lnField, 3, 0); glayout.setComponentAlignment(lnField, Alignment.MIDDLE_LEFT); companyIdField = createTextField("Employee ID: "); companyIdField.setEnabled(false); glayout.addComponent(companyIdField, 1, 1, 2, 1); glayout.setComponentAlignment(companyIdField, Alignment.MIDDLE_LEFT); dobField = new PopupDateField("Date of Birth: "); dobField.addStyleName("mydate"); dobField.setDateFormat("MM/dd/yyyy"); dobField.setWidth("100%"); dobField.setResolution(DateField.RESOLUTION_DAY); glayout.addComponent(dobField, 1, 2); glayout.setComponentAlignment(dobField, Alignment.MIDDLE_LEFT); pobField = createTextField("Birth Place: "); pobField.setValue("N/A"); glayout.addComponent(pobField, 2, 2, 3, 2); glayout.setComponentAlignment(pobField, Alignment.MIDDLE_LEFT); genderBox = dropDownComponent.populateGenderList(new ComboBox()); genderBox.setWidth("100%"); glayout.addComponent(genderBox, 1, 3); glayout.setComponentAlignment(genderBox, Alignment.MIDDLE_LEFT); civilStatusBox = dropDownComponent.populateCivilStatusList(new ComboBox()); civilStatusBox.setWidth("100%"); glayout.addComponent(civilStatusBox, 2, 3); glayout.setComponentAlignment(civilStatusBox, Alignment.MIDDLE_LEFT); citizenshipField = createTextField("Citizenship: "); citizenshipField.setValue("N/A"); glayout.addComponent(citizenshipField, 3, 3); glayout.setComponentAlignment(citizenshipField, Alignment.MIDDLE_LEFT); heightField = createTextField("Height(cm):"); heightField.setValue(0.0); glayout.addComponent(heightField, 1, 4); glayout.setComponentAlignment(heightField, Alignment.MIDDLE_LEFT); weightField = createTextField("Weight(kg): "); weightField.setValue(0.0); glayout.addComponent(weightField, 2, 4); glayout.setComponentAlignment(weightField, Alignment.MIDDLE_LEFT); religionField = createTextField("Religion: "); religionField.setValue("N/A"); glayout.addComponent(religionField, 3, 4); glayout.setComponentAlignment(religionField, Alignment.MIDDLE_LEFT); spouseNameField = createTextField("Spouse Name: "); spouseNameField.setValue("N/A"); glayout.addComponent(spouseNameField, 1, 5, 2, 5); glayout.setComponentAlignment(spouseNameField, Alignment.MIDDLE_LEFT); spouseOccupationField = createTextField("Spouse Occupation: "); spouseOccupationField.setValue("N/A"); glayout.addComponent(spouseOccupationField, 3, 5); glayout.setComponentAlignment(spouseOccupationField, Alignment.MIDDLE_LEFT); spouseOfficeAddressField = createTextField("Spouse Office Address: "); spouseOfficeAddressField.setValue("N/A"); glayout.addComponent(spouseOfficeAddressField, 1, 6, 3, 6); glayout.setComponentAlignment(spouseOfficeAddressField, Alignment.MIDDLE_LEFT); fathersNameField = createTextField("Father's Name: "); fathersNameField.setValue("N/A"); glayout.addComponent(fathersNameField, 1, 7, 2, 7); glayout.setComponentAlignment(fathersNameField, Alignment.MIDDLE_LEFT); fathersOccupationField = createTextField("Father's Occupation: "); fathersOccupationField.setValue("N/A"); glayout.addComponent(fathersOccupationField, 3, 7); glayout.setComponentAlignment(fathersOccupationField, Alignment.MIDDLE_LEFT); mothersNameField = createTextField("Mother's Maiden Name: "); mothersNameField.setValue("N/A"); glayout.addComponent(mothersNameField, 1, 8, 2, 8); glayout.setComponentAlignment(mothersNameField, Alignment.MIDDLE_LEFT); mothersOccupationField = createTextField("Mother's Occupation: "); mothersOccupationField.setValue("N/A"); glayout.addComponent(mothersOccupationField, 3, 8); glayout.setComponentAlignment(mothersOccupationField, Alignment.MIDDLE_LEFT); parentsAddressField = createTextField("Parents Address"); parentsAddressField.setValue("N/A"); glayout.addComponent(parentsAddressField, 1, 9, 3, 9); glayout.setComponentAlignment(parentsAddressField, Alignment.MIDDLE_LEFT); dialectSpeakWriteField = createTextField("Language or Dialect you can speak or write: "); dialectSpeakWriteField.setValue("N/A"); glayout.addComponent(dialectSpeakWriteField, 1, 10, 3, 10); glayout.setComponentAlignment(dialectSpeakWriteField, Alignment.MIDDLE_LEFT); contactPersonNameField = createTextField("Contact Person: "); contactPersonNameField.setValue("N/A"); glayout.addComponent(contactPersonNameField, 1, 11); glayout.setComponentAlignment(contactPersonNameField, Alignment.MIDDLE_LEFT); contactPersonAddressField = createTextField("Contact Person's Address: "); contactPersonAddressField.setValue("N/A"); glayout.addComponent(contactPersonAddressField, 2, 11, 3, 11); glayout.setComponentAlignment(contactPersonAddressField, Alignment.MIDDLE_LEFT); contactPersonNoField = createTextField("Contact Person's Tel No: "); contactPersonNoField.setValue("N/A"); glayout.addComponent(contactPersonNoField, 1, 12); glayout.setComponentAlignment(contactPersonNoField, Alignment.MIDDLE_LEFT); skillsField = createTextField("Skills: "); skillsField.setValue("N/A"); glayout.addComponent(skillsField, 2, 12); glayout.setComponentAlignment(skillsField, Alignment.MIDDLE_LEFT); hobbyField = createTextField("Hobbies"); hobbyField.setValue("N/A"); glayout.addComponent(hobbyField, 3, 12); glayout.setComponentAlignment(hobbyField, Alignment.MIDDLE_LEFT); if (employeeId != null) { personalInformation = piService.getPersonalInformationData(employeeId); final byte[] image = personalInformation.getImage(); if (image != null) { StreamResource.StreamSource imageSource = new StreamResource.StreamSource() { @Override public InputStream getStream() { return new ByteArrayInputStream(image); } }; StreamResource imageResource = new StreamResource(imageSource, personalInformation.getFirstname() + ".jpg", getThisApplication()); imageResource.setCacheTime(0); avatar.setSource(imageResource); } fnField.setValue(personalInformation.getFirstname().toUpperCase()); mnField.setValue(personalInformation.getMiddlename().toUpperCase()); lnField.setValue(personalInformation.getLastname().toUpperCase()); companyIdField.setValue(employeeId); dobField.setValue(personalInformation.getDob()); pobField.setValue(personalInformation.getPob()); if (personalInformation.getCivilStatus() != null) { Object civilStatusId = civilStatusBox.addItem(); civilStatusBox.setItemCaption(civilStatusId, personalInformation.getCivilStatus()); civilStatusBox.setValue(civilStatusId); } if (personalInformation.getGender() != null) { Object genderId = genderBox.addItem(); genderBox.setItemCaption(genderId, personalInformation.getGender()); genderBox.setValue(genderId); } citizenshipField.setValue(personalInformation.getCitizenship()); heightField.setValue(personalInformation.getHeight()); weightField.setValue(personalInformation.getWeight()); religionField.setValue(personalInformation.getReligion()); spouseNameField.setValue(personalInformation.getSpouseName()); spouseOccupationField.setValue(personalInformation.getSpouseOccupation()); spouseOfficeAddressField.setValue(personalInformation.getSpouseOfficeAddress()); fathersNameField.setValue(personalInformation.getFathersName()); fathersOccupationField.setValue(personalInformation.getFathersOccupation()); mothersNameField.setValue(personalInformation.getMothersName()); mothersOccupationField.setValue(personalInformation.getMothersOccupation()); parentsAddressField.setValue(personalInformation.getParentsAddress()); dialectSpeakWriteField.setValue(personalInformation.getDialectSpeakWrite()); contactPersonNameField.setValue(personalInformation.getContactPersonName()); contactPersonAddressField.setValue(personalInformation.getContactPersonAddress()); contactPersonNoField.setValue(personalInformation.getContactPersonNo()); skillsField.setValue(personalInformation.getSkills()); hobbyField.setValue(personalInformation.getHobby()); } Button removeBtn = new Button("REMOVE EMPLOYEE"); removeBtn.setWidth("100%"); boolean visible = false; if (GlobalVariables.getUserRole() == null) { visible = false; } else if (GlobalVariables.getUserRole().equals("hr") || GlobalVariables.getUserRole().equals("administrator")) { visible = true; } removeBtn.setVisible(visible); removeBtn.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (!GlobalVariables.getUserRole().equals("administrator")) { getWindow().showNotification("You need to an ADMINISTRATOR to perform this ACTION.", Window.Notification.TYPE_WARNING_MESSAGE); return; } Window window = getRemoveWindow(getEmployeeId()); window.setModal(true); if (window.getParent() == null) { getWindow().addWindow(window); } window.center(); } }); glayout.addComponent(removeBtn, 1, 13); Button saveButton = new Button("UPDATE EMPLOYEE's INFORMATION"); saveButton.setWidth("100%"); saveButton.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (dobField.getValue() == null || dobField.getValue().toString().isEmpty()) { getWindow().showNotification("Date of Birth Required!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (heightField.getValue() == null || heightField.getValue().toString().isEmpty()) { getWindow().showNotification("Null/Empty Value for Height is not ALLOWED!", Window.Notification.TYPE_ERROR_MESSAGE); return; } else { if (!convertionUtilities.checkInputIfDouble(heightField.getValue().toString())) { getWindow().showNotification("Enter a numeric format for Height!", Window.Notification.TYPE_ERROR_MESSAGE); return; } } if (weightField.getValue() == null || weightField.getValue().toString().isEmpty()) { getWindow().showNotification("Null/Empty Value for Weight is not ALLOWED!", Window.Notification.TYPE_ERROR_MESSAGE); return; } else { if (!convertionUtilities.checkInputIfDouble(weightField.getValue().toString())) { getWindow().showNotification("Enter a numeric format for Weight!", Window.Notification.TYPE_ERROR_MESSAGE); return; } } if (genderBox.getValue() == null || genderBox.getValue().toString().isEmpty()) { getWindow().showNotification("Select a Gender!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (civilStatusBox.getValue() == null || civilStatusBox.getValue().toString().isEmpty()) { getWindow().showNotification("Select Civil Status!", Window.Notification.TYPE_ERROR_MESSAGE); return; } PersonalInformation pi = new PersonalInformation(); pi.setFirstname(fnField.getValue().toString().toLowerCase().trim()); pi.setMiddlename(mnField.getValue().toString().toLowerCase().trim()); pi.setLastname(lnField.getValue().toString().toLowerCase().trim()); pi.setEmployeeId(employeeId); pi.setDob((Date) dobField.getValue()); pi.setPob((pobField.getValue() == null) ? "N/A" : pobField.getValue().toString().toLowerCase().trim()); pi.setHeight(convertionUtilities.convertStringToDouble(heightField.getValue().toString())); pi.setWeight(convertionUtilities.convertStringToDouble(weightField.getValue().toString())); if (convertionUtilities.checkInputIfInteger(genderBox.getValue().toString())) { pi.setGender(genderBox.getItemCaption(genderBox.getValue())); } else { pi.setGender(genderBox.getValue().toString()); } if (convertionUtilities.checkInputIfInteger(civilStatusBox.getValue().toString())) { pi.setCivilStatus(civilStatusBox.getItemCaption(civilStatusBox.getValue())); } else { pi.setCivilStatus(civilStatusBox.getValue().toString()); } pi.setCitizenship( (citizenshipField.getValue() == null) ? "N/A" : citizenshipField.getValue().toString()); pi.setReligion((religionField.getValue() == null) ? "N/A" : religionField.getValue().toString()); pi.setSpouseName( (spouseNameField.getValue() == null) ? "N/A" : spouseNameField.getValue().toString()); pi.setSpouseOccupation((spouseOccupationField.getValue() == null) ? "N/A" : spouseOccupationField.getValue().toString()); pi.setSpouseOfficeAddress((spouseOfficeAddressField.getValue() == null) ? "N/A" : spouseOfficeAddressField.getValue().toString()); pi.setFathersName( (fathersNameField.getValue() == null) ? "N/A" : fathersNameField.getValue().toString()); pi.setFathersOccupation((fathersOccupationField.getValue() == null) ? "N/A" : fathersOccupationField.getValue().toString()); pi.setMothersName( (mothersNameField.getValue() == null) ? "N/A" : mothersNameField.getValue().toString()); pi.setMothersOccupation((mothersOccupationField.getValue() == null) ? "N/A" : mothersOccupationField.getValue().toString()); pi.setParentsAddress((parentsAddressField.getValue() == null) ? "N/A" : parentsAddressField.getValue().toString()); pi.setDialectSpeakWrite((dialectSpeakWriteField.getValue() == null) ? "N/A" : dialectSpeakWriteField.getValue().toString()); pi.setContactPersonName((contactPersonNameField.getValue() == null) ? "N/A" : contactPersonNameField.getValue().toString()); pi.setContactPersonAddress((contactPersonAddressField.getValue() == null) ? "N/A" : contactPersonAddressField.getValue().toString()); pi.setContactPersonNo((contactPersonNoField.getValue() == null) ? "N/A" : contactPersonNoField.getValue().toString()); pi.setSkills((skillsField.getValue() == null) ? "N/A" : skillsField.getValue().toString()); pi.setHobby((hobbyField.getValue() == null) ? "N/A" : hobbyField.getValue().toString()); pi.setEmployeeId(getEmployeeId()); // boolean result = piService.updatePersonalInformation(pi, "UPDATE PERSONAL INFORMATION"); Window window = updatePersonalInformationConfirmation(pi); window.setModal(true); if (window.getParent() == null) { getWindow().addWindow(window); } window.center(); // if(result){ // getWindow().showNotification("Information Updated", Window.Notification.TYPE_TRAY_NOTIFICATION); // } else { // getWindow().showNotification("SQL Error", Window.Notification.TYPE_ERROR_MESSAGE); // } } }); if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) { saveButton.setEnabled(true); } else { saveButton.setEnabled(false); } glayout.addComponent(saveButton, 2, 13, 3, 13); glayout.setColumnExpandRatio(1, .10f); glayout.setColumnExpandRatio(2, .10f); glayout.setColumnExpandRatio(3, .10f); return glayout; }
From source file:com.scipionyx.butterflyeffect.frontend.configuration.ui.view.AboutView.java
License:Apache License
/** * //from w ww . j av a 2 s .co m * @param workAreaPanel */ private GridLayout createClusterInformation(String type, VerticalLayout workAreaPanel) { GridLayout layout = new GridLayout(4, 2); layout.setSizeFull(); layout.setMargin(true); layout.setSpacing(true); Label label = new Label("Cluster Information - " + type); label.setStyleName(ValoTheme.LABEL_H2); Panel panelClusterInformation = new Panel(layout); panelClusterInformation.setStyleName(ValoTheme.PANEL_WELL); workAreaPanel.addComponents(label, panelClusterInformation); return layout; }
From source file:de.catma.ui.repository.CorpusPanel.java
License:Open Source License
private Component createCorporaButtonPanel() { Panel corporaButtonsPanel = new Panel(new HorizontalLayout()); corporaButtonsPanel.setStyleName(Reindeer.PANEL_LIGHT); ((HorizontalLayout) corporaButtonsPanel.getContent()).setSpacing(true); btCreateCorpus = new Button("Create Corpus"); corporaButtonsPanel.addComponent(btCreateCorpus); MenuBar menuMoreCorpusActions = new MenuBar(); miMoreCorpusActions = menuMoreCorpusActions.addItem("More actions...", null); miMoreCorpusActions.setEnabled(repository instanceof IndexedRepository); corporaButtonsPanel.addComponent(menuMoreCorpusActions); return corporaButtonsPanel; }
From source file:de.catma.ui.repository.SourceDocumentPanel.java
License:Open Source License
private Component createDocumentButtonsPanel() { Panel documentButtonsPanel = new Panel(new HorizontalLayout()); documentButtonsPanel.setStyleName(Reindeer.PANEL_LIGHT); ((HorizontalLayout) documentButtonsPanel.getContent()).setSpacing(true); btOpenDocument = new Button("Open Document"); documentButtonsPanel.addComponent(btOpenDocument); btAddDocument = new Button("Add Document"); documentButtonsPanel.addComponent(btAddDocument); MenuBar menuMoreDocumentActions = new MenuBar(); miMoreDocumentActions = menuMoreDocumentActions.addItem("More actions...", null); documentButtonsPanel.addComponent(menuMoreDocumentActions); return documentButtonsPanel; }