com.vaadin.ui.Layout Java Examples

The following examples show how to use com.vaadin.ui.Layout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PartyVoteHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, VOTE_HISTORY);

	getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent,
			ViewRiksdagenVoteDataBallotPartySummary.class,
			viewRiksdagenVoteDataBallotPartySummaryChartDataManager.findByValue(pageId), BALLOTS, NESTED_PROPERTIES,
			COLUMN_ORDER, HIDE_COLUMNS, LISTENER, EMBEDDED_ID_BALLOT_ID, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example #2
Source File: PartyCoalitionsAgainstAnnualSummaryChartPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, TITLE);
	chartDataManager.createPartyChart(panelContent,pageId);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example #3
Source File: PartySupportAnnualSummaryChartPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, TITLE);
	chartDataManager.createPartyChart(panelContent,pageId);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example #4
Source File: PoliticianDocumentActivityPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);
	final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters);
	getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, PoliticianPageMode.DOCUMENTACTIVITY.toString());

	documentChartDataManager.createPersonDocumentHistoryChart(panelContent, viewRiksdagenPolitician.getPersonId());

	pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
	return panelContent;

}
 
Example #5
Source File: MainTabSheetActionHandler.java    From cuba with Apache License 2.0 6 votes vote down vote up
protected void analyzeLayout(Object target) {
    Window window = findWindow((Layout) target);
    if (window != null) {
        LayoutAnalyzer analyzer = new LayoutAnalyzer();
        List<LayoutTip> tipsList = analyzer.analyze(window);

        if (tipsList.isEmpty()) {
            Notifications notifications = ComponentsHelper.getScreenContext(window).getNotifications();

            notifications.create(NotificationType.HUMANIZED)
                    .withCaption("No layout problems found")
                    .show();
        } else {
            WindowManager wm = (WindowManager) ComponentsHelper.getScreenContext(window).getScreens();
            WindowInfo windowInfo = AppBeans.get(WindowConfig.class).getWindowInfo("layoutAnalyzer");

            wm.openWindow(windowInfo, WindowManager.OpenType.DIALOG, ParamsMap.of("tipsList", tipsList));
        }
    }
}
 
Example #6
Source File: PartyMemberHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, MEMBER_HISTORY);

	final DataContainer<ViewRiksdagenPolitician, String> politicianDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPolitician.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPolitician.class,
			politicianDataContainer.getAllBy(ViewRiksdagenPolitician_.party, viewRiksdagenParty.getPartyId()),
			POLITICIANS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example #7
Source File: DocumentPageVisitHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);
	getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

	createPageVisitHistory(NAME, pageId, panelContent);

	panel.setContent(panelContent);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);

	return panelContent;

}
 
Example #8
Source File: PartyCurrentLeadersPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);
	final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, CURRENT_LEADERS);

	final DataContainer<ViewRiksdagenPartyRoleMember, String> partyRoleMemberDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPartyRoleMember.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPartyRoleMember.class,
			partyRoleMemberDataContainer.findListByProperty(
					new Object[] { viewRiksdagenParty.getPartyId(), Boolean.TRUE },
					ViewRiksdagenPartyRoleMember_.party, ViewRiksdagenPartyRoleMember_.active),
			CURRENT_LEADERS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example #9
Source File: PoliticianDocumentHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters);

	getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, PoliticianPageMode.DOCUMENTHISTORY.toString());

	final DataContainer<ViewRiksdagenPoliticianDocument, String> politicianDocumentDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPoliticianDocument.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class,
			politicianDocumentDataContainer.findOrderedListByProperty(
					ViewRiksdagenPoliticianDocument_.personReferenceId, viewRiksdagenPolitician.getPersonId(),
					ViewRiksdagenPoliticianDocument_.madePublicDate),
			DOCUMENTS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
	return panelContent;

}
 
Example #10
Source File: PartyGovernmentRolesPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, GOVERNMENT_ROLES);

	final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenGovermentRoleMember.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenGovermentRoleMember.class,
			govermentRoleMemberDataContainer.findListByProperty(
					new Object[] { viewRiksdagenParty.getPartyId(), Boolean.TRUE },
					ViewRiksdagenGovermentRoleMember_.party, ViewRiksdagenGovermentRoleMember_.active),
			GOVERNMENT_ROLES, COLUMN_ORDER, HIDE_COLUMNS,
			new PageItemPropertyClickListener(UserViews.POLITICIAN_VIEW_NAME, PERSON_ID), null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example #11
Source File: CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters);
	getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, DECISION_TYPE_DAILY_SUMMARY);

	chartDataManager.createDecisionTypeChart(panelContent, viewRiksdagenCommittee.getEmbeddedId().getOrgCode());

	panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);
	return panelContent;

}
 
Example #12
Source File: PartyLeaderHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);
	final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, LEADER_HISTORY);

	final DataContainer<ViewRiksdagenPartyRoleMember, String> partyRoleMemberDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPartyRoleMember.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPartyRoleMember.class,
			partyRoleMemberDataContainer.getAllBy(ViewRiksdagenPartyRoleMember_.party,
					viewRiksdagenParty.getPartyId()),
			LEADER_HISTORY2, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example #13
Source File: DocumentDetailsPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

	final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager()
			.getDataContainer(DocumentStatusContainer.class);

	final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer
			.findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document,
					DocumentData.class, DocumentData_.id, pageId);

	LabelFactory.createHeader2Label(panelContent, DOCUMENT_DETAILS);

	if (documentStatusContainer != null && documentStatusContainer.getDocumentDetailContainer() != null
			&& documentStatusContainer.getDocumentDetailContainer().getDocumentDetailList() != null) {

		getGridFactory().createBasicBeanItemGrid(panelContent, DocumentDetailData.class,
				documentStatusContainer.getDocumentDetailContainer().getDocumentDetailList(), DOCUMENT_DETAILS2,
				COLUMN_ORDER, HIDE_COLUMNS, null, null, null);
	}

	panel.setContent(panelContent);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);
	return panelContent;

}
 
Example #14
Source File: MainTabSheetActionHandler.java    From cuba with Apache License 2.0 5 votes vote down vote up
protected com.haulmont.cuba.gui.components.Window findWindow(Layout layout) {
    for (Object component : layout) {
        if (component instanceof WindowBreadCrumbs) {
            WindowBreadCrumbs breadCrumbs = (WindowBreadCrumbs) component;
            if (breadCrumbs.getCurrentWindow() != null) {
                return breadCrumbs.getCurrentWindow();
            }
        }
    }
    return null;
}
 
Example #15
Source File: GovernmentBodyIncomePageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);
	
	final List<GovernmentBodyAnnualSummary> list = getItem(parameters);
	
	if (list != null && !list.isEmpty()) {
		final Optional<GovernmentBodyAnnualSummary> governmentBodyAnnualSummary = list.stream().findFirst();
		
		if (governmentBodyAnnualSummary.isPresent()) {			
			getGovernmentBodyMenuItemFactory().createGovernmentBodyMenuBar(menuBar, pageId);
			LabelFactory.createHeader2Label(panelContent,GOVERNMENT_BODIES);
			governmentBodyChartDataManager.createGovernmentBodyIncomeSummaryChart(panelContent, governmentBodyAnnualSummary.get().getName());
			panel.setCaption(NAME + "::" + GOVERNMENT_BODY + governmentBodyAnnualSummary.get().getName());
		}
		
		getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_VIEW, ApplicationEventGroup.USER, NAME,
				parameters, pageId);

	}

	return panelContent;

}
 
Example #16
Source File: DocumentAttachementsPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

	final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager()
			.getDataContainer(DocumentStatusContainer.class);

	final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer
			.findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document,
					DocumentData.class, DocumentData_.id, pageId);

	LabelFactory.createHeader2Label(panelContent, DOCUMENT_ATTACHMENTS);

	if (documentStatusContainer != null && documentStatusContainer.getDocumentAttachmentContainer() != null
			&& documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList() != null) {

		getGridFactory().createBasicBeanItemGrid(panelContent, DocumentAttachment.class,
				documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList(),
				DOCUMENT_ATTACHMENTS, COLUMN_ORDER, HIDE_COLUMNS, null, null, null);

		displayDocumentAttachements(panelContent,
				documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList());
	}

	panel.setContent(panelContent);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);
	return panelContent;

}
 
Example #17
Source File: CommitteeDocumentHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters);

	getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, DOCUMENT_HISTORY);

	final DataContainer<ViewRiksdagenPoliticianDocument, String> politicianDocumentDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPoliticianDocument.class);

	getGridFactory()
			.createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class,
					politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.org,
							viewRiksdagenCommittee.getEmbeddedId().getOrgCode().replace(" ", "").replace("_", "")
									.trim(),
							ViewRiksdagenPoliticianDocument_.madePublicDate),
					DOCUMENTS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);
	return panelContent;

}
 
Example #18
Source File: ProjectMemberInviteViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private Layout createButtonControls() {
    MButton inviteBtn = new MButton(UserUIContext.getMessage(ProjectMemberI18nEnum.BUTTON_NEW_INVITEE), clickEvent -> {
        SimpleProjectRole role = roleComboBox.getValue();
        ProjectMemberInviteViewImpl.this.fireEvent(new ViewEvent<>(ProjectMemberInviteViewImpl.this,
                new InviteMembers(inviteUserTokenField.getInviteEmails(), role.getId(), role.getRolename(), messageArea.getValue())));
    }).withIcon(VaadinIcons.PAPERPLANE).withStyleName(WebThemes.BUTTON_ACTION);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL),
            clickEvent -> EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoList(this, CurrentProjectVariables.getProjectId())))
            .withStyleName(WebThemes.BUTTON_OPTION);
    return new MHorizontalLayout(cancelBtn, inviteBtn);
}
 
Example #19
Source File: WebWindow.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public boolean getSpacing() {
    if (getContainer() instanceof Layout.SpacingHandler) {
        return ((Layout.SpacingHandler) getContainer()).isSpacing();
    }
    return false;
}
 
Example #20
Source File: CommitteeMemberHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters);

	getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, MEMBER_HISTORY);

	final DataContainer<ViewRiksdagenCommitteeRoleMember, String> committeeRoleMemberDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenCommitteeRoleMember.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenCommitteeRoleMember.class,
			committeeRoleMemberDataContainer.getAllBy(ViewRiksdagenCommitteeRoleMember_.detail,
					viewRiksdagenCommittee.getEmbeddedId().getDetail()),
			MEMBER_HISTORY, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);
	return panelContent;

}
 
Example #21
Source File: MainTabSheetActionHandler.java    From cuba with Apache License 2.0 5 votes vote down vote up
protected void showInfo(Object target) {
    AbstractEditor editor = (AbstractEditor) findEditor((Layout) target);
    Entity entity = editor.getItem();

    Metadata metadata = AppBeans.get(Metadata.NAME);
    MetaClass metaClass = metadata.getSession().getClass(entity.getClass());

    new ShowInfoAction().showInfo(entity, metaClass, editor);
}
 
Example #22
Source File: DocumentPersonReferencesPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);
	getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

	final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager()
			.getDataContainer(DocumentStatusContainer.class);

	final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer
			.findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document,
					DocumentData.class, DocumentData_.id, pageId);

	LabelFactory.createHeader2Label(panelContent, PERSON_REFERENCES);

	if (documentStatusContainer != null && documentStatusContainer.getDocumentPersonReferenceContainer() != null
			&& documentStatusContainer.getDocumentPersonReferenceContainer()
					.getDocumentPersonReferenceList() != null) {

		getGridFactory().createBasicBeanItemGrid(panelContent, DocumentPersonReferenceData.class,
				documentStatusContainer.getDocumentPersonReferenceContainer().getDocumentPersonReferenceList(),
				DOCUMENT_PERSON_REFERENCES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	}

	panel.setContent(panelContent);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);

	return panelContent;

}
 
Example #23
Source File: DocumentActivityPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

	final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager()
			.getDataContainer(DocumentStatusContainer.class);

	final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer
			.findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document,
					DocumentData.class, DocumentData_.id, pageId);

	LabelFactory.createHeader2Label(panelContent, DOCUMENT_ACTIVITY);

	if (documentStatusContainer != null && documentStatusContainer.getDocumentActivityContainer() != null
			&& documentStatusContainer.getDocumentActivityContainer().getDocumentActivities() != null) {

		getGridFactory().createBasicBeanItemGrid(panelContent, DocumentActivityData.class,
				documentStatusContainer.getDocumentActivityContainer().getDocumentActivities(), DOCUMENT_ACTIVITIES,
				COLUMN_ORDER, HIDE_COLUMNS, null, null, null);

	}

	panel.setContent(panelContent);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);
	return panelContent;

}
 
Example #24
Source File: RoleFormLayoutFactory.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public AbstractComponent getLayout() {
    ReadViewLayout userAddLayout = new DefaultReadViewLayout(this.title);

    wrappedLayoutFactory = new RoleInformationLayout();
    wrappedLayoutFactory.getLayout().setWidth("100%");
    userAddLayout.addBody(wrappedLayoutFactory.getLayout());

    Layout bottomPanel = this.createBottomPanel();
    if (bottomPanel != null) {
        userAddLayout.addBottomControls(bottomPanel);
    }

    return userAddLayout;
}
 
Example #25
Source File: AbstractGridComponentLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Layouts header, grid and optional footer.
 */
protected void buildLayout() {
    setSizeFull();
    setSpacing(true);
    setMargin(false);
    setStyleName("group");
    final VerticalLayout gridHeaderLayout = new VerticalLayout();
    gridHeaderLayout.setSizeFull();
    gridHeaderLayout.setSpacing(false);
    gridHeaderLayout.setMargin(false);

    gridHeaderLayout.setStyleName("table-layout");
    gridHeaderLayout.addComponent(gridHeader);

    gridHeaderLayout.setComponentAlignment(gridHeader, Alignment.TOP_CENTER);
    gridHeaderLayout.addComponent(grid);
    gridHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
    gridHeaderLayout.setExpandRatio(grid, 1.0F);

    addComponent(gridHeaderLayout);
    setComponentAlignment(gridHeaderLayout, Alignment.TOP_CENTER);
    setExpandRatio(gridHeaderLayout, 1.0F);
    if (hasFooterSupport()) {
        final Layout footerLayout = getFooterSupport().createFooterMessageComponent();
        addComponent(footerLayout);
        setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
    }

}
 
Example #26
Source File: AgentOperationsOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();

	getMenuItemFactory().createMainPageMenuBar(menuBar);

	LabelFactory.createHeader2Label(content,ADMIN_AGENT_OPERATION);
			
	final VerticalLayout overviewLayout = new VerticalLayout();
	overviewLayout.setSizeFull();
	content.addComponent(overviewLayout);
	content.setExpandRatio(overviewLayout, ContentRatio.LARGE);

	final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout);

	for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) {
		final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget) , VaadinIcons.BULLSEYE);
		importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT));
		importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget));
		RowUtil.createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE);
	}
	
	final String pageId = getPageId(parameters);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN,
			NAME, null, pageId);


	return content;
}
 
Example #27
Source File: CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters);
	getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, CURRENT_MEMBERS);

	final DataContainer<ViewRiksdagenCommitteeRoleMember, String> committeeRoleMemberDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenCommitteeRoleMember.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenCommitteeRoleMember.class,
			committeeRoleMemberDataContainer.findListByProperty(
					new Object[] { viewRiksdagenCommittee.getEmbeddedId().getDetail(), Boolean.TRUE },
					ViewRiksdagenCommitteeRoleMember_.detail, ViewRiksdagenCommitteeRoleMember_.active),
			CURRENT_MEMBERS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);
	return panelContent;

}
 
Example #28
Source File: MultiFileUpload.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
protected Layout getprogressBarsLayout() {
    if (progressBars == null) {
        final VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setMargin(false);
        verticalLayout.setSpacing(false);
        progressBars = verticalLayout;
    }
    return progressBars;
}
 
Example #29
Source File: PartyRankingDataGridPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar);

	final String pageId = getPageId(parameters);


	final DataContainer<ViewRiksdagenPartySummary, String> dataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPartySummary.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPartySummary.class, dataContainer.getAllOrderBy(ViewRiksdagenPartySummary_.currentAssignments),
			PARTIES,
			COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);


	panel.setCaption(NAME + "::" + DATAGRID);

	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARTY_RANKING_VIEW, ApplicationEventGroup.USER,
			NAME, parameters, pageId);

	return panelContent;

}
 
Example #30
Source File: ElementCollectionTable.java    From viritin with Apache License 2.0 4 votes vote down vote up
@Override
public Layout getLayout() {
    return layout;
}