List of usage examples for com.vaadin.ui HorizontalLayout setWidth
@Override public void setWidth(float width, Unit unit)
From source file:com.github.daytron.twaattin.ui.TimelineScreen.java
License:Open Source License
public TimelineScreen() { setMargin(true);//w w w.j a v a 2 s . c o m Label label = new Label(VaadinSession.getCurrent().getAttribute(Principal.class).getName()); Button logoutButton = new Button("Logout"); logoutButton.addClickListener(new LogoutBehaviour()); HorizontalLayout menuBar = new HorizontalLayout(label, logoutButton); menuBar.setWidth(100, Unit.PERCENTAGE); menuBar.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT); addComponent(menuBar); addComponentAttachListener(new TweetRefresherBehaviour()); Table table = new Table(); addComponent(table); table.addGeneratedColumn("source", new SourceColumnDecorator()); table.addGeneratedColumn("screenName", new ScreenNameColumnGenerator()); table.addGeneratedColumn("name", new NameColumnGenerator()); table.addGeneratedColumn("profileImage", new ProfileImageColumnGenerator()); table.addGeneratedColumn("text", new TweetColumnDecorator()); table.setColumnHeader("source", "via"); table.setColumnHeader("screenName", "Screen name"); table.setColumnHeader("profileImage", ""); table.setColumnHeader("text", "Tweet"); table.setVisibleColumns( new Object[] { "text", "name", "screenName", "profileImage", "createdAt", "source" }); }
From source file:com.hack23.cia.web.impl.ui.application.views.common.chartfactory.impl.AbstractChartDataManagerImpl.java
License:Apache License
/** * Adds the chart./*w ww. j av a 2 s.c o m*/ * * @param content * the content * @param caption * the caption * @param chart * the chart */ protected final void addChart(final AbstractOrderedLayout content, final String caption, final DCharts chart) { final HorizontalLayout horizontalLayout = new HorizontalLayout(); final int browserWindowWidth = Page.getCurrent().getBrowserWindowWidth() - 50; final int browserWindowHeight = Page.getCurrent().getBrowserWindowHeight() - 200; horizontalLayout.setWidth(browserWindowWidth, Unit.PIXELS); horizontalLayout.setHeight(browserWindowHeight, Unit.PIXELS); final Panel formPanel = new Panel(); formPanel.setSizeFull(); formPanel.setContent(horizontalLayout); content.addComponent(formPanel); content.setExpandRatio(formPanel, ContentRatio.LARGE); chart.setWidth(browserWindowWidth - 50, Unit.PIXELS); chart.setHeight(browserWindowHeight - 100, Unit.PIXELS); chart.setMarginRight(5); chart.setMarginLeft(5); chart.setMarginBottom(5); chart.setMarginTop(5); chart.setEnableDownload(true); chart.setChartImageFormat(ChartImageFormat.PNG); horizontalLayout.addComponent(chart); chart.setCaption(caption); }
From source file:com.hack23.cia.web.impl.ui.application.views.common.pagemode.AbstractPageModContentFactoryImpl.java
License:Apache License
/** * Creates the page visit history.//w w w. ja va 2 s . co m * * @param pageName * the page name * @param pageId * the page id * @param panelContent * the panel content */ protected final void createPageVisitHistory(final String pageName, final String pageId, final VerticalLayout panelContent) { final TabSheet tabsheet = new TabSheet(); tabsheet.setWidth(100, Unit.PERCENTAGE); tabsheet.setHeight(100, Unit.PERCENTAGE); panelContent.addComponent(tabsheet); panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE); final HorizontalLayout tabContentPageItemRankHistory = new HorizontalLayout(); tabContentPageItemRankHistory.setWidth(100, Unit.PERCENTAGE); tabContentPageItemRankHistory.setHeight(100, Unit.PERCENTAGE); final Tab tabPageItemRankHistory = tabsheet.addTab(tabContentPageItemRankHistory); tabPageItemRankHistory.setCaption(CURRENT_PAGE_VISIT_HISTORY); adminChartDataManager.createApplicationActionEventPageElementDailySummaryChart( tabContentPageItemRankHistory, pageName, pageId); final HorizontalLayout tabContentPageModeSummary = new HorizontalLayout(); tabContentPageModeSummary.setWidth(100, Unit.PERCENTAGE); tabContentPageModeSummary.setHeight(100, Unit.PERCENTAGE); final Tab tabPageModeSummary = tabsheet.addTab(tabContentPageModeSummary); tabPageModeSummary.setCaption(GENERAL_PAGE_MODE_PAGE_VISIT); adminChartDataManager.createApplicationActionEventPageModeDailySummaryChart(tabContentPageModeSummary, pageName); }
From source file:com.hack23.cia.web.impl.ui.application.views.user.ballot.pagemode.BallotChartsPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override/*from w w w.j a v a 2 s. co m*/ public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); final String pageId = getPageId(parameters); final DataContainer<ViewRiksdagenVoteDataBallotSummary, RiksdagenVoteDataBallotEmbeddedId> dataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenVoteDataBallotSummary.class); final DataContainer<ViewRiksdagenVoteDataBallotPartySummary, RiksdagenVoteDataBallotPartyEmbeddedId> dataPartyContainer = getApplicationManager() .getDataContainer(ViewRiksdagenVoteDataBallotPartySummary.class); final List<ViewRiksdagenVoteDataBallotSummary> ballots = dataContainer.findListByEmbeddedProperty( ViewRiksdagenVoteDataBallotSummary.class, ViewRiksdagenVoteDataBallotSummary_.embeddedId, RiksdagenVoteDataBallotEmbeddedId.class, RiksdagenVoteDataBallotEmbeddedId_.ballotId, pageId); final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotList = dataPartyContainer .findListByEmbeddedProperty(ViewRiksdagenVoteDataBallotPartySummary.class, ViewRiksdagenVoteDataBallotPartySummary_.embeddedId, RiksdagenVoteDataBallotPartyEmbeddedId.class, RiksdagenVoteDataBallotPartyEmbeddedId_.ballotId, pageId); if (!ballots.isEmpty()) { getBallotMenuItemFactory().createBallotMenuBar(menuBar, pageId); LabelFactory.createHeader2Label(panelContent, CHARTS); final TabSheet tabsheet = new TabSheet(); tabsheet.setWidth(100, Unit.PERCENTAGE); tabsheet.setHeight(100, Unit.PERCENTAGE); panelContent.addComponent(tabsheet); panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE); Collections.sort(ballots, (Comparator<ViewRiksdagenVoteDataBallotSummary>) (o1, o2) -> (o1.getEmbeddedId().getIssue() + o2.getEmbeddedId().getConcern()) .compareTo(o1.getEmbeddedId().getIssue() + o2.getEmbeddedId().getConcern())); for (final ViewRiksdagenVoteDataBallotSummary viewRiksdagenVoteDataBallotSummary : ballots) { final HorizontalLayout tabContent = new HorizontalLayout(); tabContent.setWidth(100, Unit.PERCENTAGE); tabContent.setHeight(100, Unit.PERCENTAGE); final Tab tab = tabsheet.addTab(tabContent); ballotChartDataManager.createChart(tab, tabContent, viewRiksdagenVoteDataBallotSummary); } final Map<String, List<ViewRiksdagenVoteDataBallotPartySummary>> concernIssuePartyBallotSummaryMap = createIssueConcernMap( partyBallotList); for (final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotSummaryList : concernIssuePartyBallotSummaryMap .values()) { final HorizontalLayout tabContent = new HorizontalLayout(); tabContent.setWidth(100, Unit.PERCENTAGE); tabContent.setHeight(100, Unit.PERCENTAGE); final Tab tab = tabsheet.addTab(tabContent); ballotChartDataManager.createChart(tab, tabContent, partyBallotSummaryList); } panel.setCaption(BALLOT + pageId); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_BALLOT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); } return panelContent; }
From source file:com.klwork.explorer.ui.form.FormPropertiesForm.java
License:Apache License
protected void initButtons() { submitFormButton = new Button(); cancelFormButton = new Button(); HorizontalLayout buttons = new HorizontalLayout(); buttons.setSpacing(true);/*from w w w .ja va2s . c om*/ buttons.setWidth(100, Unit.PERCENTAGE); buttons.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); buttons.addComponent(submitFormButton); buttons.setComponentAlignment(submitFormButton, Alignment.BOTTOM_RIGHT); buttons.addComponent(cancelFormButton); buttons.setComponentAlignment(cancelFormButton, Alignment.BOTTOM_RIGHT); Label buttonSpacer = new Label(); buttons.addComponent(buttonSpacer); buttons.setExpandRatio(buttonSpacer, 1.0f); addComponent(buttons); }
From source file:com.klwork.explorer.ui.task.NewTaskPopupWindow.java
License:Apache License
protected void initCreateTaskButton() { HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setWidth(100, UNITS_PERCENTAGE); form.getFooter().setWidth(100, UNITS_PERCENTAGE); form.getFooter().addComponent(buttonLayout); Button createButton = new Button(i18nManager.getMessage(Messages.BUTTON_CREATE)); buttonLayout.addComponent(createButton); buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT); createButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { handleFormSubmit();//w ww .j a v a 2s . c o m } }); }
From source file:com.klwork.explorer.ui.task.NewTodoToTaskPopupWindow.java
License:Apache License
protected void initCreateTaskButton() { HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setWidth(100, Unit.PERCENTAGE); form.addComponent(buttonLayout);//w w w .j a va 2 s. c o m Button createButton = new Button(i18nManager.getMessage(Messages.BUTTON_CREATE)); buttonLayout.addComponent(createButton); buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT); createButton.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { handleFormSubmit(); } }); }
From source file:com.klwork.explorer.ui.task.ProcessInstanceEventsPanel.java
License:Apache License
protected void addInputField() { HorizontalLayout hLayout = new HorizontalLayout(); hLayout.setSpacing(true);/*from ww w .j a v a 2 s . c o m*/ hLayout.setWidth(100, Unit.PERCENTAGE); pMainContent.addComponent(hLayout); // ? initAddEventInput(hLayout); Button addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT)); hLayout.addComponent(addCommentButton); hLayout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT); addCommentButton.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { addNewComment(commentInputField.getValue().toString()); } }); }
From source file:com.klwork.explorer.ui.task.SubTaskComponent.java
License:Apache License
protected void initHeader() { HorizontalLayout headerLayout = new HorizontalLayout(); headerLayout.setWidth(100, UNITS_PERCENTAGE); layout.addComponent(headerLayout);/*from w ww . j av a2s . c om*/ initTitle(headerLayout); //add initAddSubTaskPanel(headerLayout); }
From source file:com.klwork.explorer.ui.task.TaskDetailPanel.java
License:Apache License
protected void initDescriptionAndClaimButton() { HorizontalLayout layout = new HorizontalLayout(); layout.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); layout.setWidth(100, Unit.PERCENTAGE); layout.setSpacing(true);/*w ww . java2 s . com*/ centralLayout.addComponent(layout); initClaimButton(layout); initDescription(layout); }