List of usage examples for com.vaadin.ui HorizontalLayout setStyleName
@Override public void setStyleName(String style)
From source file:org.escidoc.browser.ui.view.helpers.CreateResourceLinksVH.java
License:Open Source License
public CreateResourceLinksVH(String url, ResourceProxy resourceProxy, AbstractComponentContainer componentContainer, Router router) { HorizontalLayout vl = buildInitialElements(); if (resourceProxy.getType().equals(ResourceType.ITEM)) { vl.setStyleName("permanentLinkItem"); } else {//from ww w . j ava 2 s . co m vl.setStyleName("permanentLink"); } if (!resourceProxy.getType().equals(ResourceType.CONTEXT)) { final Button btnVersionHistory = new Button(" ", new VersionHistoryClickListener(resourceProxy, router.getMainWindow(), router.getRepositories())); btnVersionHistory.setStyleName(BaseTheme.BUTTON_LINK); btnVersionHistory.setDescription("Show Version history in a Pop-up"); btnVersionHistory.addStyleName("paddingright10"); btnVersionHistory.setIcon(ICON_HISTORY); vl.addComponent(btnVersionHistory); } try { l = new Link("", new ExternalResource( url + "?id=" + resourceProxy.getId() + "&type=" + resourceProxy.getType().toString() + "&escidocurl=" + router.getServiceLocation().getEscidocUrl())); l.setDescription(ViewConstants.PERMANENT_LINK); l.setIcon(new ThemeResource("images/wpzoom/globe-1.png")); vl.addComponent(l); } catch (MalformedURLException e) { componentContainer.getWindow().showNotification(ViewConstants.COULD_NOT_RETRIEVE_APPLICATION_URL); LOG.error(ViewConstants.COULD_NOT_RETRIEVE_APPLICATION_URL + e.getLocalizedMessage()); } componentContainer.addComponent(hl); }
From source file:org.escidoc.browser.ui.view.helpers.CreateResourceLinksVH.java
License:Open Source License
public CreateResourceLinksVH(String url, UserProxy userProxy, AbstractComponentContainer componentContainer, Router router, UserAccountController controller) { buildInitialElements();/*from w ww . ja v a 2 s.c om*/ // Checking if has access on changing password here as well HorizontalLayout hl = buildInitialElements(); hl.setStyleName("permanentLink"); final Button btnVersionHistory = new Button(" ", new ChangeUserPassword(userProxy, router, controller)); btnVersionHistory.setStyleName(BaseTheme.BUTTON_LINK); btnVersionHistory.setDescription("Change user password"); btnVersionHistory.addStyleName("paddingright10"); btnVersionHistory.setIcon(ICON_KEY); hl.addComponent(btnVersionHistory); componentContainer.addComponent(hl); }
From source file:org.gpstouch.account.AccountGridView.java
public HorizontalLayout createTopBar() { TextField filter = new TextField(); filter.setStyleName("filter-textfield"); filter.setInputPrompt("Filter"); ResetButtonForTextField.extend(filter); filter.setImmediate(true);//from w w w. j a v a 2 s.c om filter.addTextChangeListener(new FieldEvents.TextChangeListener() { @Override public void textChange(FieldEvents.TextChangeEvent event) { grid.setFilter(event.getText()); } }); bnewAccount = new Button("New Account"); bnewAccount.addStyleName(ValoTheme.BUTTON_PRIMARY); bnewAccount.setIcon(FontAwesome.PLUS_CIRCLE); bnewAccount.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { viewLogic.newAccount(); } }); HorizontalLayout topLayout = new HorizontalLayout(); topLayout.setSpacing(true); topLayout.setWidth("100%"); topLayout.addComponent(filter); topLayout.addComponent(bnewAccount); topLayout.setComponentAlignment(filter, Alignment.MIDDLE_LEFT); topLayout.setExpandRatio(filter, 1); topLayout.setStyleName("top-bar"); return topLayout; }
From source file:org.hip.vif.admin.groupadmin.ui.AbstractContributionView.java
License:Open Source License
private VerticalLayout createCompletion(final Long inCompletionID, final String inCompletionText, final String inCompletionState, final CodeList inCodeList, final IPluggable inTask, final IMessages inMessages, final String inMsgKey, final String inStyle) { final VerticalLayout outLayout = new VerticalLayout(); outLayout.setStyleName("vif-completion"); //$NON-NLS-1$ // label and state final HorizontalLayout lTitleView = new HorizontalLayout(); lTitleView.setStyleName("vif-title-bar"); //$NON-NLS-1$ lTitleView.setSpacing(true);/*w w w .ja va2 s . co m*/ lTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth( new Label(String.format(VIFViewHelper.TMPL_TITLE, inStyle, inMessages.getMessage(inMsgKey)), ContentMode.HTML))); //$NON-NLS-1$ //$NON-NLS-1$ final boolean lEditable = inCompletionState == null || inCompletionState.length() == 0 || WorkflowAwareContribution.STATE_PRIVATE.equals(inCompletionState); final String lStyle = lEditable ? "vif-note-emphasized" : "vif-note"; //$NON-NLS-1$ //$NON-NLS-2$ final Label lNote = new Label(String.format(VIFViewHelper.TMPL_TITLE, lStyle, getState(inCompletionState, inCodeList, inMessages)), ContentMode.HTML); //$NON-NLS-1$ lTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth(lNote)); if (lEditable) { final Button lEdit = new Button(inMessages.getMessage("ui.discussion.completion.button.edit")); //$NON-NLS-1$ lEdit.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent inEvent) { if (inTask instanceof AdminQuestionShowTask) { ((AdminQuestionShowTask) inTask).editCompletion(inCompletionID); } } }); lTitleView.addComponent(lEdit); final AbstractDialogWindow lDialogPublish = Dialog.openQuestion( inMessages.getMessage("ui.discussion.dialog.title"), //$NON-NLS-1$ inMessages.getMessage("ui.discussion.dialog.completion.publish"), new Dialog.ICommand() { //$NON-NLS-1$ @Override public void execute() { if (inTask instanceof AdminQuestionShowTask) { if (!((AdminQuestionShowTask) inTask).publishCompletion(inCompletionID)) { Notification.show(inMessages.getMessage("errmsg.contribution.publish"), //$NON-NLS-1$ Type.WARNING_MESSAGE); } } } }); final AbstractDialogWindow lDialogDelete = Dialog.openQuestion( inMessages.getMessage("ui.discussion.dialog.title"), //$NON-NLS-1$ inMessages.getMessage("ui.discussion.dialog.completion.delete"), new Dialog.ICommand() { //$NON-NLS-1$ @Override public void execute() { if (inTask instanceof AdminQuestionShowTask) { if (!((AdminQuestionShowTask) inTask).deleteCompletion(inCompletionID)) { Notification.show(inMessages.getMessage("errmsg.contribution.delete"), //$NON-NLS-1$ Type.WARNING_MESSAGE); } } } }); final Button lPublish = new Button(inMessages.getMessage("ui.discussion.contribution.button.publish")); //$NON-NLS-1$ lPublish.addClickListener(Dialog.createClickListener(lDialogPublish, this)); lTitleView.addComponent(lPublish); final Button lDelete = new Button(inMessages.getMessage("ui.discussion.contribution.button.delete")); //$NON-NLS-1$ lDelete.addClickListener(Dialog.createClickListener(lDialogDelete, this)); lTitleView.addComponent(lDelete); } outLayout.addComponent(lTitleView); // the completion outLayout.addComponent(new Label(inCompletionText, ContentMode.HTML)); return outLayout; }
From source file:org.hip.vif.admin.groupadmin.ui.AbstractContributionView.java
License:Open Source License
private Component createBibliography(final GeneralDomainObject inBibliography, final AbstractAdminTask inTask, final IMessages inMessages) throws VException { final HorizontalLayout out = new HorizontalLayout(); out.setWidth("100%"); //$NON-NLS-1$ out.setStyleName("vif-bibliography"); //$NON-NLS-1$ final Long lBiblioID = BeanWrapperHelper.getLong(TextHome.KEY_ID, inBibliography); final Button lRemove = new Button(inMessages.getMessage("ui.bibliography.link.button.remove")); //$NON-NLS-1$ lRemove.addClickListener(new Button.ClickListener() { @Override/*from ww w .j a v a 2 s . c om*/ public void buttonClick(final ClickEvent inEvent) { if (!inTask.unlinkBibliography(lBiblioID)) { Notification.show(inMessages.getMessage("errmsg.biblio.remove"), Type.WARNING_MESSAGE); //$NON-NLS-1$ } } }); out.addComponent(lRemove); final Button lLink = LinkButtonHelper.createLinkButton( BeanWrapperHelper.getString(TextHome.KEY_REFERENCE, inBibliography), LinkButtonHelper.LookupType.BIBLIOGRAPHY, lBiblioID, inTask); lLink.setStyleName(BaseTheme.BUTTON_LINK); out.addComponent(lLink); final BibliographyFormatter lFormatter = new BibliographyFormatter( new BibliographyAdapter(inBibliography, TextHome.KEY_BIBLIO_TYPE)); final Label lLabel = new Label(lFormatter.renderHtml(), ContentMode.HTML); lLabel.setWidth("100%"); //$NON-NLS-1$ out.addComponent(lLabel); out.setExpandRatio(lLabel, 1.0f); return out; }
From source file:org.hip.vif.admin.groupadmin.ui.AbstractQuestionView.java
License:Open Source License
/** * Renders the display of the whole question context. * //w w w .j a va 2s . c om * @param inQuestion * {@link Question} * @param inTitle * String * @param inCodeList * {@link CodeList} * @param inAuthors * {@link QueryResult} * @param inReviewers * {@link QueryResult} * @param inMessages * {@link IMessages} * @param inIsGuest * boolean * @param inTask * {@link IPluggableWithLookup} * @return {@link Component} the view component with the rendered question * @throws VException * @throws SQLException */ protected Component createQuestion(final Question inQuestion, final String inTitle, final CodeList inCodeList, final QueryResult inAuthors, final QueryResult inReviewers, final IMessages inMessages, final IPluggableWithLookup inTask) throws VException, SQLException { final VerticalLayout outLayout = new VerticalLayout(); // question title and state final HorizontalLayout lTitleView = new HorizontalLayout(); lTitleView.setStyleName("vif-title-bar"); //$NON-NLS-1$ lTitleView.setSpacing(true); lTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth( new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-title", inTitle), ContentMode.HTML))); //$NON-NLS-1$ final String lState = getState(BeanWrapperHelper.getString(QuestionHome.KEY_STATE, inQuestion), inCodeList, inMessages); final Label lNote = new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-note", lState), //$NON-NLS-1$ ContentMode.HTML); lTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth(lNote)); lTitleView.setComponentAlignment(lNote, Alignment.BOTTOM_RIGHT); outLayout.addComponent(lTitleView); addProperQuestion(inQuestion, inMessages, outLayout); // author/reviewer final AuthorReviewerRenderer lRenderer = AuthorReviewerRenderHelper.createRenderer(inAuthors, inReviewers, inTask); outLayout.addComponent(lRenderer.render(inMessages.getMessage("ui.discussion.question.view.label.author"), //$NON-NLS-1$ inMessages.getMessage("ui.discussion.question.view.label.reviewer"), //$NON-NLS-1$ BeanWrapperHelper.getFormattedDate(QuestionHome.KEY_MUTATION, inQuestion))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return outLayout; }
From source file:org.hip.vif.admin.member.ui.MemberView.java
License:Open Source License
private Component createZipCityLabels(final Member inMember) { final HorizontalLayout outLayout = new HorizontalLayout(); outLayout.setStyleName("vif-value"); //$NON-NLS-1$ outLayout.addComponent(RiplaViewHelper .makeUndefinedWidth(new Label(BeanWrapperHelper.getString(MemberHome.KEY_ZIP, inMember)))); outLayout.addComponent(RiplaViewHelper.makeUndefinedWidth(new Label(" ", ContentMode.HTML))); //$NON-NLS-1$ outLayout.addComponent(RiplaViewHelper .makeUndefinedWidth(new Label(BeanWrapperHelper.getString(MemberHome.KEY_CITY, inMember)))); return outLayout; }
From source file:org.hip.vif.forum.groups.ui.AbstractContributionView.java
License:Open Source License
private VerticalLayout createCompletion(final String inCompletionText, final String inCompletionState, final CodeList inCodeList, final IMessages inMessages, final String inMsgKey, final String inStyle) { final VerticalLayout outLayout = new VerticalLayout(); outLayout.setStyleName("vif-completion"); //$NON-NLS-1$ // label and state final HorizontalLayout lTitleView = new HorizontalLayout(); lTitleView.setStyleName("vif-title-bar"); //$NON-NLS-1$ lTitleView.setSpacing(true);//from ww w. ja va2 s . co m lTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth( new Label(String.format(VIFViewHelper.TMPL_TITLE, inStyle, inMessages.getMessage(inMsgKey)), ContentMode.HTML))); //$NON-NLS-1$ //$NON-NLS-1$ if (WorkflowAwareContribution.isUnpublished(inCompletionState)) { final Label lNote = new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-note", //$NON-NLS-1$ getState(inCompletionState, inCodeList, inMessages)), ContentMode.HTML); lTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth(lNote)); } outLayout.addComponent(lTitleView); // the completion outLayout.addComponent(new Label(inCompletionText, ContentMode.HTML)); return outLayout; }
From source file:org.hip.vif.forum.groups.ui.AbstractQuestionView.java
License:Open Source License
private VerticalLayout createQuestionLayout(final Question inQuestion, final String inTitle, final HorizontalLayout inTitleView, final CodeList inCodeList, final IMessages inMessages) { final VerticalLayout outLayout = new VerticalLayout(); outLayout.setWidth("100%"); //$NON-NLS-1$ // question title and state inTitleView.setStyleName("vif-title-bar"); //$NON-NLS-1$ final Label lLabel = new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-title", inTitle), //$NON-NLS-1$ ContentMode.HTML);/*from w w w.j a v a 2 s. com*/ inTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth(lLabel)); //$NON-NLS-1$ final String lState = getState(BeanWrapperHelper.getString(QuestionHome.KEY_STATE, inQuestion), inCodeList, inMessages); final Label lNote = new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-note", lState), //$NON-NLS-1$ ContentMode.HTML); lNote.setWidth("100%"); //$NON-NLS-1$ inTitleView.addComponent(RiplaViewHelper.makeUndefinedWidth(lNote)); inTitleView.setComponentAlignment(lNote, Alignment.BOTTOM_LEFT); inTitleView.setExpandRatio(lLabel, 1); inTitleView.setExpandRatio(lNote, 6); outLayout.addComponent(inTitleView); addProperQuestion(inQuestion, inMessages, outLayout); return outLayout; }
From source file:org.hip.vif.forum.groups.ui.AbstractQuestionView.java
License:Open Source License
private HorizontalLayout createBiblioLayout() { final HorizontalLayout out = new HorizontalLayout(); out.setWidth("100%"); //$NON-NLS-1$ out.setStyleName("vif-bibliography"); //$NON-NLS-1$ return out;// ww w. j av a 2 s. com }