Search in sources :

Example 1 with ContentPanel

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

the class LayersWidget method createLayersPanel.

private void createLayersPanel() {
    layersPanel = new ContentPanel();
    layersPanel.setCollapsible(false);
    layersPanel.setFrame(true);
    layersPanel.setHeadingText(I18N.CONSTANTS.layers());
    layersPanel.setBodyBorder(false);
    layersPanel.setHeaderVisible(true);
    layersPanel.setIcon(AbstractImagePrototype.create(MapResources.INSTANCE.layers()));
    AnchorData layoutData = new AnchorData();
    layoutData.setAnchorSpec("100% none");
    add(layersPanel, layoutData);
}
Also used : AnchorData(com.extjs.gxt.ui.client.widget.layout.AnchorData) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Example 2 with ContentPanel

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

the class LayerOptionsPanel method initializeComponent.

private void initializeComponent() {
    setWidth(WIDTH);
    setHeight(HEIGHT);
    layout = new AccordionLayout() {

        @Override
        protected void renderComponent(Component component, int index, El target) {
            super.renderComponent(component, index, target);
            // keep the default style of rounded corners on the content
            // panels
            El.fly(((ContentPanel) component).getElement("header")).removeStyleName("x-accordion-hd");
        }

        @Override
        protected void setItemSize(Component item, Size size) {
            // don't set the height of the panels
            ContentPanel cp = (ContentPanel) item;
            cp.setWidth(size.width);
        }
    };
    layout.setHideCollapseTool(true);
    setLayout(layout);
    // setFieldsetHeadingToLayerName();
    stylePanel = new ContentPanel();
    stylePanel.setHeadingText(I18N.CONSTANTS.style());
    stylePanel.setIcon(AbstractImagePrototype.create(MapResources.INSTANCE.styleIcon()));
    stylePanel.setCollapsible(true);
    stylePanel.setHideCollapseTool(true);
    stylePanel.setAnimCollapse(true);
    ToolButton closeBtn = new ToolButton("x-tool-close");
    closeBtn.addListener(Events.Select, new Listener<ComponentEvent>() {

        @Override
        public void handleEvent(ComponentEvent ce) {
            fadeOut();
        }
    });
    stylePanel.getHeader().addTool(closeBtn);
    add(stylePanel);
    clusteringPanel = new ContentPanel();
    clusteringPanel.setIcon(AbstractImagePrototype.create(MapResources.INSTANCE.clusterIcon()));
    clusteringPanel.setHeadingText(I18N.CONSTANTS.clustering());
    clusteringPanel.setCollapsible(true);
    clusteringPanel.setHideCollapseTool(true);
    clusteringPanel.setAnimCollapse(true);
    add(clusteringPanel);
}
Also used : AccordionLayout(com.extjs.gxt.ui.client.widget.layout.AccordionLayout) ToolButton(com.extjs.gxt.ui.client.widget.button.ToolButton) Size(com.extjs.gxt.ui.client.util.Size) El(com.extjs.gxt.ui.client.core.El) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent) Component(com.extjs.gxt.ui.client.widget.Component) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Example 3 with ContentPanel

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

the class IconLayerOptions method populateWithIcons.

private void populateWithIcons() {
    boolean isFirst = true;
    for (Icon mapIcon : Icon.values()) {
        ContentPanel iconPanel = new ContentPanel();
        iconPanel.setHeaderVisible(false);
        iconPanel.setLayout(new RowLayout(Orientation.VERTICAL));
        iconPanel.setAutoWidth(true);
        Radio radiobuttonIcon = new Radio();
        iconPanel.add(radiobuttonIcon);
        iconPanel.add(new Image(MapIcon.fromEnum(mapIcon)));
        radioIcons.put(radiobuttonIcon, mapIcon);
        iconRadios.put(mapIcon, radiobuttonIcon);
        radioGroup.add(radiobuttonIcon);
        contentPanel.add(iconPanel);
        if (isFirst) {
            radiobuttonIcon.setValue(true);
            isFirst = false;
        }
    }
}
Also used : RowLayout(com.extjs.gxt.ui.client.widget.layout.RowLayout) Radio(com.extjs.gxt.ui.client.widget.form.Radio) Icon(org.activityinfo.legacy.shared.reports.model.MapIcon.Icon) MapIcon(org.activityinfo.legacy.shared.reports.model.MapIcon) Image(com.google.gwt.user.client.ui.Image) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Example 4 with ContentPanel

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

the class ReportViewRetrier method createRetryPanel.

private static ContentPanel createRetryPanel(final Throwable caught, final ClickHandler retryCallback) {
    Button retryButton = new Button(I18N.CONSTANTS.retry());
    retryButton.addSelectionListener(new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            if (retryCallback != null) {
                retryCallback.onClick(null);
            }
        }
    });
    Text label = new Text(ExceptionOracle.getExplanation(caught));
    label.setWidth("50%");
    VBoxLayout layout = new VBoxLayout(VBoxLayout.VBoxLayoutAlign.CENTER);
    ContentPanel panel = new ContentPanel();
    panel.setHeaderVisible(false);
    panel.setLayout(layout);
    panel.add(label, new RowData(1, -1, new Margins(4)));
    panel.add(retryButton, new RowData(-1, -1, new Margins(4)));
    return panel;
}
Also used : VBoxLayout(com.extjs.gxt.ui.client.widget.layout.VBoxLayout) RowData(com.extjs.gxt.ui.client.widget.layout.RowData) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) Margins(com.extjs.gxt.ui.client.util.Margins) Text(com.extjs.gxt.ui.client.widget.Text) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Example 5 with ContentPanel

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

the class DbTargetGrid method createTargetValueContainer.

@Override
public void createTargetValueContainer(Widget w) {
    targetValueContainer = new ContentPanel();
    targetValueContainer.setHeaderVisible(false);
    targetValueContainer.setBorders(false);
    targetValueContainer.setFrame(false);
    targetValueContainer.setLayout(new FitLayout());
    BorderLayoutData layout = new BorderLayoutData(Style.LayoutRegion.SOUTH);
    layout.setSplit(true);
    layout.setCollapsible(true);
    layout.setSize(250);
    layout.setMargins(new Margins(5, 0, 0, 0));
    targetValueContainer.add(w);
    add(targetValueContainer, layout);
}
Also used : BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Margins(com.extjs.gxt.ui.client.util.Margins) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Aggregations

ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)6 Margins (com.extjs.gxt.ui.client.util.Margins)2 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)2 El (com.extjs.gxt.ui.client.core.El)1 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)1 ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)1 Size (com.extjs.gxt.ui.client.util.Size)1 Component (com.extjs.gxt.ui.client.widget.Component)1 Text (com.extjs.gxt.ui.client.widget.Text)1 Button (com.extjs.gxt.ui.client.widget.button.Button)1 ToolButton (com.extjs.gxt.ui.client.widget.button.ToolButton)1 Radio (com.extjs.gxt.ui.client.widget.form.Radio)1 AccordionLayout (com.extjs.gxt.ui.client.widget.layout.AccordionLayout)1 AnchorData (com.extjs.gxt.ui.client.widget.layout.AnchorData)1 BorderLayout (com.extjs.gxt.ui.client.widget.layout.BorderLayout)1 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)1 RowData (com.extjs.gxt.ui.client.widget.layout.RowData)1 RowLayout (com.extjs.gxt.ui.client.widget.layout.RowLayout)1 VBoxLayout (com.extjs.gxt.ui.client.widget.layout.VBoxLayout)1 Image (com.google.gwt.user.client.ui.Image)1