Search in sources :

Example 1 with VerticalPanel

use of com.extjs.gxt.ui.client.widget.VerticalPanel in project activityinfo by bedatadriven.

the class SearchResultItem method setChilds.

public void setChilds(List<Axis> childList) {
    for (Axis axis : childList) {
        VerticalPanel panelAll = new VerticalPanel();
        HorizontalPanel panelChild = new HorizontalPanel();
        HorizontalPanel spacer = new HorizontalPanel();
        spacer.setWidth(20);
        panelChild.add(spacer);
        Image image = IconImageBundle.ICONS.activity().createImage();
        panelChild.add(image);
        panelAll.add(panelChild);
        EntityCategory activity = (EntityCategory) axis.getCategory();
        Hyperlink link = new Hyperlink(axis.getLabel(), PageStateSerializer.serialize(new DataEntryPlace(Filter.filter().onActivity(activity.getId()))));
        link.setStylePrimaryName("link");
        panelChild.add(link);
        for (Axis childAxis : axis.getChildren()) {
            HorizontalPanel panelIndicator = new HorizontalPanel();
            HorizontalPanel spacerIndicator = new HorizontalPanel();
            spacerIndicator.setWidth(40);
            panelIndicator.add(spacerIndicator);
            panelIndicator.add(IconImageBundle.ICONS.indicator().createImage());
            // Hyperlink linkIndicator = new Hyperlink(childAxis.getLabel(),
            // "site-grid/" +
            // ((EntityCategory)childAxis.getCategory()).getId());
            // linkIndicator.setStylePrimaryName("link");
            // panelIndicator.add(linkIndicator);
            LabelField labelIndicator = new LabelField(childAxis.getLabel());
            panelIndicator.add(labelIndicator);
            panelAll.add(panelIndicator);
            indicatorCount++;
        }
        activityCount++;
        childPanel.add(panelAll);
    }
}
Also used : VerticalPanel(com.extjs.gxt.ui.client.widget.VerticalPanel) DataEntryPlace(org.activityinfo.client.page.entry.place.DataEntryPlace) HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel) Image(com.google.gwt.user.client.ui.Image) EntityCategory(org.activityinfo.shared.report.content.EntityCategory) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField) Axis(org.activityinfo.shared.report.content.PivotTableData.Axis) Hyperlink(com.google.gwt.user.client.ui.Hyperlink)

Example 2 with VerticalPanel

use of com.extjs.gxt.ui.client.widget.VerticalPanel in project activityinfo by bedatadriven.

the class SearchResultsPage method showSearchResults.

private void showSearchResults() {
    searchResultsPanel.removeAll();
    clearErrorsIfShowing();
    int activities = 0;
    int databases = 0;
    int indicators = 0;
    LabelField labelResults = new LabelField();
    searchResultsPanel.add(labelResults);
    if (pivotContent != null) {
        VerticalPanel panelSpacer = new VerticalPanel();
        panelSpacer.setHeight(16);
        searchResultsPanel.add(panelSpacer);
        searchResultsPanel.setStylePrimaryName("searchResults");
        for (Axis axis : pivotContent.getData().getRootRow().getChildren()) {
            SearchResultItem itemWidget = new SearchResultItem();
            itemWidget.setDabaseName(axis.getLabel());
            itemWidget.setChilds(axis.getChildList());
            searchResultsPanel.add(itemWidget);
            databases++;
            activities += itemWidget.getActivityCount();
            indicators += itemWidget.getIndicatorCount();
        }
    }
    labelResults.setText(I18N.MESSAGES.searchResultsFound(searchQuery, Integer.toString(databases), Integer.toString(activities), Integer.toString(indicators)));
    layout();
}
Also used : VerticalPanel(com.extjs.gxt.ui.client.widget.VerticalPanel) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField) Axis(org.activityinfo.shared.report.content.PivotTableData.Axis)

Example 3 with VerticalPanel

use of com.extjs.gxt.ui.client.widget.VerticalPanel in project activityinfo by bedatadriven.

the class SearchResultsPage method createSearchResultsPanel.

private void createSearchResultsPanel() {
    searchResultsPanel = new VerticalPanel();
    searchResultsPanel.setScrollMode(Scroll.AUTO);
    containerFilterAndResult.add(searchResultsPanel);
}
Also used : VerticalPanel(com.extjs.gxt.ui.client.widget.VerticalPanel)

Aggregations

VerticalPanel (com.extjs.gxt.ui.client.widget.VerticalPanel)3 LabelField (com.extjs.gxt.ui.client.widget.form.LabelField)2 Axis (org.activityinfo.shared.report.content.PivotTableData.Axis)2 HorizontalPanel (com.extjs.gxt.ui.client.widget.HorizontalPanel)1 Hyperlink (com.google.gwt.user.client.ui.Hyperlink)1 Image (com.google.gwt.user.client.ui.Image)1 DataEntryPlace (org.activityinfo.client.page.entry.place.DataEntryPlace)1 EntityCategory (org.activityinfo.shared.report.content.EntityCategory)1