@SuppressWarnings("serial") private HorizontalLayout createHeader(String title) { HorizontalLayout header = ViewUtil.createSubHeader(title, getSubViewHelpGuid()); Button refresh = new Button(); refresh.setStyleName(Reindeer.BUTTON_LINK); refresh.setDescription("Refresh"); refresh.setIcon(new ThemeResource("img/Refresh.png")); refresh.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { populateTable(); } }); header.addComponent(refresh); return header; }
public AlfrescoProcessInstanceTableItem(final ProcessInstance processInstance) { addItemProperty(PROPERTY_ID, new ObjectProperty<String>(processInstance.getId(), String.class)); if (processInstance.getBusinessKey() != null) { addItemProperty(PROPERTY_BUSINESSKEY, new ObjectProperty<String>(processInstance.getBusinessKey(), String.class)); } Button viewProcessInstanceButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_ACTION_VIEW)); viewProcessInstanceButton.addStyleName(Reindeer.BUTTON_LINK); viewProcessInstanceButton.addListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { ExplorerApp.get().getViewManager().showProcessInstancePage(processInstance.getId()); } }); viewProcessInstanceButton.setIcon(Images.MAGNIFIER_16); addItemProperty(PROPERTY_ACTIONS, new ObjectProperty<Component>(viewProcessInstanceButton, Component.class)); }
protected void initUi() { removeAllComponents(); addStyleName(Reindeer.PANEL_LIGHT); addStyleName(ExplorerLayout.STYLE_PROFILE_LAYOUT); setSizeFull(); // Profile page is a horizontal layout: left we have a panel with the picture, // and one the right there is another panel the about, contact, etc information this.profilePanelLayout = new HorizontalLayout(); profilePanelLayout.setSizeFull(); setContent(profilePanelLayout); // init both panels initImagePanel(); Label emptySpace = new Label(" ", Label.CONTENT_XHTML); emptySpace.setWidth(50, UNITS_PIXELS); profilePanelLayout.addComponent(emptySpace); initInformationPanel(); }
protected void initInformationPanel() { Panel infoPanel = new Panel(); infoPanel.addStyleName(Reindeer.PANEL_LIGHT); infoPanel.setSizeFull(); profilePanelLayout.addComponent(infoPanel); profilePanelLayout.setExpandRatio(infoPanel, 1.0f); // info panel should take all the remaining width available // All the information sections are put under each other in a vertical layout this.infoPanelLayout = new VerticalLayout(); infoPanel.setContent(infoPanelLayout); initAboutSection(); initContactSection(); }
public ChangePasswordPopupWindow() { this.identityService = ProcessEngines.getDefaultProcessEngine().getIdentityService(); this.currentUser = ExplorerApp.get().getLoggedInUser(); this.i18nManager = ExplorerApp.get().getI18nManager(); setCaption(i18nManager.getMessage(Messages.PASSWORD_CHANGE)); setModal(true); center(); addStyleName(Reindeer.WINDOW_LIGHT); setWidth(350, UNITS_PIXELS); setHeight(205, UNITS_PIXELS); initLayout(); initPasswordFields(); initChangePasswordButton(); initEnterKeyListener(); }
protected void initChangePasswordButton() { errorLabel = new Label(" ", Label.CONTENT_XHTML); errorLabel.addStyleName(Reindeer.LABEL_SMALL); errorLabel.addStyleName(ExplorerLayout.STYLE_LABEL_RED); layout.addComponent(errorLabel); Button changePasswordButton = new Button(i18nManager.getMessage(Messages.PASSWORD_CHANGE)); layout.addComponent(changePasswordButton); layout.setComponentAlignment(changePasswordButton, Alignment.MIDDLE_CENTER); changePasswordButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { handlePasswordChange(); } }); }
public DetailPanel() { setSizeFull(); addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL); setMargin(true); CssLayout cssLayout = new CssLayout(); // Needed for rounded corners cssLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL); cssLayout.setSizeFull(); super.addComponent(cssLayout); mainPanel = new Panel(); mainPanel.addStyleName(Reindeer.PANEL_LIGHT); mainPanel.setSizeFull(); cssLayout.addComponent(mainPanel); // Use default layout VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setWidth(100, UNITS_PERCENTAGE); verticalLayout.setMargin(true); mainPanel.setContent(verticalLayout); }
public ConfirmationDialogPopupWindow(String title, String description) { setWidth(400, UNITS_PIXELS); setModal(true); setResizable(false); addStyleName(Reindeer.PANEL_LIGHT); layout = new GridLayout(2,2); layout.setMargin(true); layout.setSpacing(true); layout.setSizeFull(); setContent(layout); I18nManager i18nManager = ExplorerApp.get().getI18nManager(); if(title != null) { setCaption(title); } else { setCaption(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_DEFAULT_TITLE)); } initLabel(description); initButtons(i18nManager); }
public TaskListHeader() { this.i18nManager = ExplorerApp.get().getI18nManager(); this.taskService = ProcessEngines.getDefaultProcessEngine().getTaskService(); addStyleName(Reindeer.PANEL_LIGHT); addStyleName(ExplorerLayout.STYLE_SEARCHBOX); layout = new HorizontalLayout(); layout.setHeight(36, UNITS_PIXELS); layout.setWidth(99, UNITS_PERCENTAGE); // 99, otherwise the Panel will display scrollbars layout.setSpacing(true); layout.setMargin(false, true, false, true); setContent(layout); initInputField(); initKeyboardListener(); // initSortMenu(); }
protected void initUi() { setCaption(title); setModal(true); addStyleName(Reindeer.WINDOW_LIGHT); center(); windowLayout = (VerticalLayout) getContent(); windowLayout.setSpacing(true); if (multiSelect && showRoles) { setWidth(820, UNITS_PIXELS); } else if (multiSelect && !showRoles) { setWidth(685, UNITS_PIXELS); } else { setWidth(340, UNITS_PIXELS); } setHeight(350, UNITS_PIXELS); initSearchField(); initUserSelection(); initDoneButton(); }
public AttachmentDetailPopupWindow(Attachment attachment) { super(attachment.getName()); addStyleName(Reindeer.PANEL_LIGHT); center(); setModal(true); setResizable(false); AttachmentRenderer renderer = ExplorerApp.get().getAttachmentRendererManager().getRenderer(attachment.getType()); Component detail = renderer.getDetailComponent(attachment); if(detail instanceof ComponentContainer) { setContent((ComponentContainer) detail); } else { addComponent(detail); } getContent().setSizeUndefined(); }
public Component getOverviewComponent(final Attachment attachment, final RelatedContentComponent parent) { // If the attachment has no description, overview link is link to actual page // instead of showing popup with details. if(attachment.getDescription() != null && !"".equals(attachment.getDescription())) { Button attachmentLink = new Button(attachment.getName()); attachmentLink.addStyleName(Reindeer.BUTTON_LINK); attachmentLink.addListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { parent.showAttachmentDetail(attachment); } }); return attachmentLink; } else { return new Link(attachment.getName(), new ExternalResource(attachment.getUrl())); } }
protected void addTableName() { HorizontalLayout header = new HorizontalLayout(); header.setWidth(100, UNITS_PERCENTAGE); header.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK); header.setSpacing(true); // TODO: use right image Embedded image = new Embedded(null, Images.DATABASE_50); header.addComponent(image); header.setComponentAlignment(image, Alignment.MIDDLE_LEFT); header.setMargin(false, false, true, false); Label name = new Label(tableName); name.addStyleName(Reindeer.LABEL_H2); header.addComponent(name); header.setExpandRatio(name, 1.0f); header.setComponentAlignment(name, Alignment.MIDDLE_LEFT); addDetailComponent(header); Label spacer = new Label(); spacer.setWidth(100, UNITS_PERCENTAGE); spacer.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); addDetailComponent(spacer); }
public GroupItem(final Group group) { Button idButton = new Button(group.getId()); idButton.addStyleName(Reindeer.BUTTON_LINK); idButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { ExplorerApp.get().getViewManager().showGroupPage(group.getId()); } }); addItemProperty("id", new ObjectProperty<Button>(idButton, Button.class)); if (group.getName() != null) { addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class)); } if (group.getType() != null) { addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class)); } Embedded deleteIcon = new Embedded(null, Images.DELETE); deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE); deleteIcon.addListener(new DeleteMembershipListener(identityService, userId, group.getId(), userDetailPanel)); addItemProperty("actions", new ObjectProperty<Embedded>(deleteIcon, Embedded.class)); }
protected void initPageTitle() { HorizontalLayout layout = new HorizontalLayout(); layout.setWidth(100, UNITS_PERCENTAGE); layout.setSpacing(true); layout.setMargin(false, false, true, false); layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK); addDetailComponent(layout); Embedded userImage = new Embedded(null, Images.USER_50); layout.addComponent(userImage); Label userName = new Label(user.getFirstName() + " " + user.getLastName()); userName.setSizeUndefined(); userName.addStyleName(Reindeer.LABEL_H2); layout.addComponent(userName); layout.setComponentAlignment(userName, Alignment.MIDDLE_LEFT); layout.setExpandRatio(userName, 1.0f); }
protected void initPageTitle() { HorizontalLayout layout = new HorizontalLayout(); layout.setWidth(100, UNITS_PERCENTAGE); layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK); layout.setSpacing(true); layout.setMargin(false, false, true, false); addDetailComponent(layout); Embedded groupImage = new Embedded(null, Images.GROUP_50); layout.addComponent(groupImage); Label groupName = new Label(getGroupName(group)); groupName.setSizeUndefined(); groupName.addStyleName(Reindeer.LABEL_H2); layout.addComponent(groupName); layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT); layout.setExpandRatio(groupName, 1.0f); }
public GroupSelectionPopupWindow(IdentityService identityService, String userId) { this.identityService = identityService; this.i18nManager = ExplorerApp.get().getI18nManager(); this.userId = userId; setCaption(i18nManager.getMessage(Messages.USER_SELECT_GROUPS_POPUP, userId)); setModal(true); center(); setWidth(500, UNITS_PIXELS); setHeight(400, UNITS_PIXELS); addStyleName(Reindeer.WINDOW_LIGHT); ((VerticalLayout) getContent()).setSpacing(true); initGroupTable(); initSelectButton(); }
protected void initUi() { setSizeFull(); addStyleName(Reindeer.LAYOUT_WHITE); detailPanelLayout = new VerticalLayout(); detailPanelLayout.setWidth(100, UNITS_PERCENTAGE); detailPanelLayout.setMargin(true); setDetailContainer(detailPanelLayout); // All details about the process definition initHeader(); detailContainer = new HorizontalLayout(); detailContainer.addStyleName(Reindeer.PANEL_LIGHT); detailPanelLayout.addComponent(detailContainer); detailContainer.setSizeFull(); initActions(); initProcessDefinitionInfo(); }
public NewCasePopupWindow() { this.taskService = ProcessEngines.getDefaultProcessEngine().getTaskService(); this.i18nManager = ExplorerApp.get().getI18nManager(); setModal(true); center(); setResizable(false); setCaption(i18nManager.getMessage(Messages.TASK_NEW)); addStyleName(Reindeer.WINDOW_LIGHT); setWidth(430, UNITS_PIXELS); setHeight(320, UNITS_PIXELS); initForm(); initCreateTaskButton(); initEnterKeyListener(); }
protected void initAddButton() { addSubTaskButton = new Button(); addSubTaskButton.addStyleName(ExplorerLayout.STYLE_ADD); addSubTaskPanel.addComponent(addSubTaskButton); addSubTaskButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { // Remove button addSubTaskPanel.removeAllComponents(); // And add textfield Label createSubTaskLabel = new Label("Create new subtask:"); createSubTaskLabel.addStyleName(Reindeer.LABEL_SMALL); addSubTaskPanel.addComponent(createSubTaskLabel); newTaskTextField = new TextField(); newTaskTextField.focus(); addSubTaskPanel.addComponent(newTaskTextField); } }); }
protected void initParentTaskLink() { if (historicTask.getParentTaskId() != null) { final HistoricTaskInstance parentTask = historyService.createHistoricTaskInstanceQuery() .taskId(historicTask.getParentTaskId()) .singleResult(); Button showParentTaskButton = new Button(i18nManager.getMessage( Messages.TASK_SUBTASK_OF_PARENT_TASK, parentTask.getName())); showParentTaskButton.addStyleName(Reindeer.BUTTON_LINK); showParentTaskButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { viewManager.showTaskPage(parentTask.getId()); } }); centralLayout.addComponent(showParentTaskButton); } }
protected void populateSubTasks(List<HistoricTaskInstance> subTasks) { for (final HistoricTaskInstance subTask : subTasks) { // icon Embedded icon = new Embedded(null, Images.TASK_22); icon.setWidth(22, UNITS_PIXELS); icon.setWidth(22, UNITS_PIXELS); subTaskGrid.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()); } }); subTaskGrid.addComponent(subTaskLink); subTaskGrid.setComponentAlignment(subTaskLink, Alignment.MIDDLE_LEFT); } }
protected void init() { setSizeFull(); addStyleName(Reindeer.LAYOUT_WHITE); // Central panel: all task data this.centralLayout = new VerticalLayout(); centralLayout.setMargin(true); setDetailContainer(centralLayout); initHeader(); initDescriptionAndClaimButton(); initProcessLink(); initParentTaskLink(); initPeopleDetails(); initSubTasks(); initRelatedContent(); initTaskForm(); }
protected void initProcessLink() { if(task.getProcessInstanceId() != null) { ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() .processDefinitionId(task.getProcessDefinitionId()) .singleResult(); Button showProcessInstanceButton = new Button(i18nManager.getMessage( Messages.TASK_PART_OF_PROCESS, getProcessDisplayName(processDefinition))); showProcessInstanceButton.addStyleName(Reindeer.BUTTON_LINK); showProcessInstanceButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { viewManager.showMyProcessInstancesPage(task.getProcessInstanceId()); } }); centralLayout.addComponent(showProcessInstanceButton); addEmptySpace(centralLayout); } }
protected void initParentTaskLink() { if (task.getParentTaskId() != null) { final Task parentTask = taskService.createTaskQuery() .taskId(task.getParentTaskId()).singleResult(); Button showParentTaskButton = new Button(i18nManager.getMessage( Messages.TASK_SUBTASK_OF_PARENT_TASK, parentTask.getName())); showParentTaskButton.addStyleName(Reindeer.BUTTON_LINK); showParentTaskButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { viewManager.showTaskPage(parentTask.getId()); } }); centralLayout.addComponent(showParentTaskButton); addEmptySpace(centralLayout); } }
public void refreshTaskAttachments() { table.removeAllItems(); if (noContentLabel != null) { contentLayout.removeComponent(noContentLabel); } List<Attachment> attachments = null; if (task.getProcessInstanceId() != null){ attachments = (taskService.getProcessInstanceAttachments(task.getProcessInstanceId())); } else { attachments = taskService.getTaskAttachments(task.getId()); } if(attachments.size() > 0) { addAttachmentsToTable(attachments); } else { table.setVisible(false); noContentLabel = new Label(i18nManager.getMessage(Messages.TASK_NO_RELATED_CONTENT)); noContentLabel.addStyleName(Reindeer.LABEL_SMALL); contentLayout.addComponent(noContentLabel); } }
@Override protected VerticalLayout createVaadinComponent(UserTask userTask, UIApplication<IUnoVaadinApplication> application) { EntityInfo info = extractEntity(userTask); Panel panel = createPanel("Entities"); StringBuilder captionBuilder = new StringBuilder(); captionBuilder.append(info.classDefinition.getSingularEntityName()); captionBuilder.append(": "); captionBuilder.append(info.classDefinition.getStringRepresentation(info.entity)); Button button = new Button(captionBuilder.toString()); button.setStyleName(Reindeer.BUTTON_LINK); panel.addComponent(button); VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setMargin(false); mainLayout.setSpacing(true); mainLayout.setWidth("100%"); mainLayout.addComponent(panel); return mainLayout; }