List of usage examples for com.vaadin.ui Label setSizeUndefined
@Override public void setSizeUndefined()
From source file:com.klwork.explorer.ui.content.GenericAttachmentRenderer.java
License:Apache License
public Component getDetailComponent(Attachment attachment) { VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSizeUndefined();// w ww . j av a 2 s.c o m verticalLayout.setSpacing(true); verticalLayout.setMargin(true); Label description = new Label(attachment.getDescription()); description.setSizeUndefined(); verticalLayout.addComponent(description); HorizontalLayout linkLayout = new HorizontalLayout(); linkLayout.setSpacing(true); verticalLayout.addComponent(linkLayout); // Image linkLayout.addComponent(new Embedded(null, getImage(attachment))); // Link Link link = null; if (attachment.getUrl() != null) { link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl())); } else { TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService(); Resource res = new StreamResource( new InputStreamStreamSource(taskService.getAttachmentContent(attachment.getId())), attachment.getName() + extractExtention(attachment.getType())); link = new Link(attachment.getName(), res); } // Set generic image and external window link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK); linkLayout.addComponent(link); return verticalLayout; }
From source file:com.klwork.explorer.ui.custom.UploadComponent.java
License:Apache License
protected void addOrLabel() { Label orLabel = new Label("or"); orLabel.setSizeUndefined(); orLabel.addStyleName(Reindeer.LABEL_SMALL); addComponent(orLabel);// w w w .j a v a 2 s.co m setComponentAlignment(orLabel, Alignment.MIDDLE_CENTER); }
From source file:com.klwork.explorer.ui.custom.UploadComponent.java
License:Apache License
protected void addDropPanel() { Panel dropPanel = new Panel(); dropPanel.setContent(new VerticalLayout()); DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(dropPanel); //WW_TODO ?//from w ww . j av a 2s.c o m dragAndDropWrapper.setDropHandler(this); dragAndDropWrapper.setWidth("80%"); addComponent(dragAndDropWrapper); setComponentAlignment(dragAndDropWrapper, Alignment.MIDDLE_CENTER); // Label dropLabel = new Label(i18nManager.getMessage(Messages.UPLOAD_DROP)); dropLabel.setSizeUndefined(); ((VerticalLayout) dropPanel.getContent()).addComponent(dropLabel); ((VerticalLayout) dropPanel.getContent()).setComponentAlignment(dropLabel, Alignment.MIDDLE_CENTER); }
From source file:com.klwork.explorer.ui.task.HistoricTaskDetailPanel.java
License:Apache License
protected void initHeader() { GridLayout taskDetails = new GridLayout(5, 2); taskDetails.setWidth(100, UNITS_PERCENTAGE); taskDetails.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK); taskDetails.setSpacing(true);//from w w w . ja va 2 s . co m taskDetails.setMargin(new MarginInfo(false, false, true, false)); // Add image Embedded image = new Embedded(null, Images.TASK_50); taskDetails.addComponent(image, 0, 0, 0, 1); // Add task name Label nameLabel = new Label(historicTask.getName()); nameLabel.addStyleName(Reindeer.LABEL_H2); taskDetails.addComponent(nameLabel, 1, 0, 4, 0); // Add due date PrettyTimeLabel dueDateLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.TASK_DUEDATE_SHORT), historicTask.getDueDate(), i18nManager.getMessage(Messages.TASK_DUEDATE_UNKNOWN), false); dueDateLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_DUEDATE); taskDetails.addComponent(dueDateLabel, 1, 1); // Add priority Integer lowMedHighPriority = convertPriority(historicTask.getPriority()); Label priorityLabel = new Label(); switch (lowMedHighPriority) { case 1: priorityLabel.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_LOW)); priorityLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_LOW); break; case 2: priorityLabel.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_MEDIUM)); priorityLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_MEDIUM); break; case 3: default: priorityLabel.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_HIGH)); priorityLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_HIGH); } taskDetails.addComponent(priorityLabel, 2, 1); // Add create date PrettyTimeLabel createLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.TASK_CREATED_SHORT), historicTask.getStartTime(), "", true); createLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_CREATE_TIME); taskDetails.addComponent(createLabel, 3, 1); // Add label to fill excess space Label spacer = new Label(); spacer.setContentMode(Label.CONTENT_XHTML); spacer.setValue(" "); spacer.setSizeUndefined(); taskDetails.addComponent(spacer); taskDetails.setColumnExpandRatio(1, 1.0f); taskDetails.setColumnExpandRatio(2, 1.0f); taskDetails.setColumnExpandRatio(3, 1.0f); taskDetails.setColumnExpandRatio(4, 1.0f); centralLayout.addComponent(taskDetails); }
From source file:com.klwork.explorer.ui.task.ProcessInstanceEventsPanel.java
License:Apache License
protected void addTaskEventText(final Comment taskEvent, final GridLayout eventGrid) { VerticalLayout layout = new VerticalLayout(); layout.addStyleName(ExplorerLayout.STYLE_TASK_EVENT); layout.setWidth("100%"); eventGrid.addComponent(layout);/*from www .ja va 2 s .com*/ // Actual text Label text = taskEventTextResolver.resolveText(taskEvent); text.setWidth("100%"); layout.addComponent(text); // Time String human = new HumanTime(i18nManager).format(taskEvent.getTime()); Label time = new Label(human + "(" + ")"); time.setSizeUndefined(); time.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_TIME); layout.addComponent(time); }
From source file:com.klwork.explorer.ui.task.SubTaskComponent.java
License:Apache License
protected void populateSubTasks(List<HistoricTaskInstance> subTasks) { if (subTasks.size() > 0) { for (final HistoricTaskInstance subTask : subTasks) { // icon Embedded icon = null;// www . j a v a2s .c o m if (subTask.getEndTime() != null) {//? icon = new Embedded(null, Images.TASK_FINISHED_22); } else { icon = new Embedded(null, Images.TASK_22); } icon.setWidth(22, UNITS_PIXELS); icon.setWidth(22, UNITS_PIXELS); subTaskLayout.addComponent(icon); // Link to subtask Button subTaskLink = new Button(subTask.getName()); subTaskLink.addStyleName(Reindeer.BUTTON_LINK); subTaskLink.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { //ExplorerApp.get().getViewManager().showTaskPage(subTask.getId()); } }); subTaskLayout.addComponent(subTaskLink); subTaskLayout.setComponentAlignment(subTaskLink, Alignment.MIDDLE_LEFT); if (subTask.getEndTime() == null) { // Delete icon only appears when task is not finished yet Embedded deleteIcon = new Embedded(null, Images.DELETE); deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE); deleteIcon.addListener(new DeleteSubTaskClickListener(subTask, this)); subTaskLayout.addComponent(deleteIcon); subTaskLayout.setComponentAlignment(deleteIcon, Alignment.MIDDLE_RIGHT); } else { // Next line of grid subTaskLayout.newLine(); } } } else { Label noSubTasksLabel = new Label(i18nManager.getMessage(Messages.TASK_NO_SUBTASKS)); noSubTasksLabel.setSizeUndefined(); noSubTasksLabel.addStyleName(Reindeer.LABEL_SMALL); subTaskLayout.addComponent(noSubTasksLabel); } }
From source file:com.klwork.explorer.ui.task.TaskDetailPanel.java
License:Apache License
protected void addEmptySpace(ComponentContainer container) { Label emptySpace = new Label(" ", ContentMode.HTML); emptySpace.setSizeUndefined(); container.addComponent(emptySpace);/*w w w . j a v a2 s.c o m*/ }
From source file:com.klwork.explorer.ui.task.TaskEventsPanel.java
License:Apache License
protected void addTaskEventText(final org.activiti.engine.task.Event taskEvent, final GridLayout eventGrid) { VerticalLayout layout = new VerticalLayout(); layout.addStyleName(ExplorerLayout.STYLE_TASK_EVENT); layout.setWidth("100%"); eventGrid.addComponent(layout);/* w w w. ja v a 2 s . com*/ // Actual text Label text = taskEventTextResolver.resolveText(taskEvent); text.setWidth("100%"); layout.addComponent(text); // Time Label time = new Label(new HumanTime(i18nManager).format(taskEvent.getTime())); time.setSizeUndefined(); time.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_TIME); layout.addComponent(time); }
From source file:com.klwork.explorer.ui.user.ProfilePanel.java
License:Apache License
protected void initContactSection() { Label header = createProfileHeader(i18nManager.getMessage(Messages.PROFILE_CONTACT)); header.addStyleName(ExplorerLayout.STYLE_H3); header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); infoPanelLayout.addComponent(header); GridLayout contactLayout = createInfoSectionLayout(2, 4); // Email/*from www. j a v a 2 s. co m*/ if (!editable && isDefined(user.getEmail())) { addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), user.getEmail()); } else if (editable) { emailField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), emailField, user.getEmail()); } // Phone if (!editable && isDefined(phone)) { addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phone); } else if (editable) { phoneField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phoneField, phone); } // Twitter if (!editable && isDefined(twitterName)) { Link twitterLink = new Link(twitterName, new ExternalResource("http://www.twitter.com/" + twitterName)); addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterLink); } else if (editable) { twitterField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterField, twitterName); } // Skype if (!editable && isDefined(skypeId)) { // The skype entry shows the name + skype icon, laid out in a small grid GridLayout skypeLayout = new GridLayout(2, 1); skypeLayout.setSpacing(true); skypeLayout.setSizeUndefined(); Label skypeIdLabel = new Label(skypeId); skypeIdLabel.setSizeUndefined(); skypeLayout.addComponent(skypeIdLabel); addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeLayout); } else if (editable) { skypeField = new TextField(); addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeField, skypeId); } }
From source file:com.klwork.explorer.ui.user.ProfilePanel.java
License:Apache License
protected void addProfileInputField(GridLayout layout, String name, AbstractField inputField, String inputFieldValue) { Label label = new Label(name + ": "); label.addStyleName(ExplorerLayout.STYLE_PROFILE_FIELD); label.setSizeUndefined(); layout.addComponent(label);//ww w.j a v a 2 s .c om layout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); if (inputFieldValue != null) { inputField.setValue(inputFieldValue); } layout.addComponent(inputField); layout.setComponentAlignment(inputField, Alignment.MIDDLE_LEFT); }