Search in sources :

Example 1 with El

use of com.extjs.gxt.ui.client.core.El 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 2 with El

use of com.extjs.gxt.ui.client.core.El in project activityinfo by bedatadriven.

the class SectionTabStrip method onBrowserEvent.

@Override
public void onBrowserEvent(Event event) {
    El element = El.fly(Element.as(event.getEventTarget()));
    switch(DOM.eventGetType(event)) {
        case Event.ONMOUSEOVER:
            if (element.hasStyleName(style.section())) {
                unhighlight();
                highlight(element.dom);
            }
            break;
        case Event.ONMOUSEOUT:
            if (hoverElement != null && element.dom.isOrHasChild(hoverElement)) {
                unhighlight();
            }
            break;
        case Event.ONCLICK:
            if (element.hasStyleName(style.section())) {
                int index = element.getParent().getChildIndex(element.dom);
                SelectionEvent.fire(this, Section.values()[index]);
            }
            break;
    }
}
Also used : El(com.extjs.gxt.ui.client.core.El)

Example 3 with El

use of com.extjs.gxt.ui.client.core.El in project activityinfo by bedatadriven.

the class IndicatorLinkPage method addGalley.

private void addGalley() {
    linkButton = new ToggleButton("", IconImageBundle.ICONS.link());
    linkButton.disable();
    linkButton.setWidth(28);
    linkButton.setHeight(40);
    linkButton.addSelectionListener(new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            onToggleLink();
        }
    });
    linkButtonTip = new ToolTip(linkButton);
    LayoutContainer container = new LayoutContainer();
    container.setWidth(35);
    container.add(linkButton);
    container.setLayout(new BoxLayout() {

        @Override
        protected void onLayout(Container<?> container, El target) {
            super.onLayout(container, target);
            Size size = target.getStyleSize();
            innerCt.setSize(size.width, size.height, true);
            Component c = container.getItem(0);
            int ch = c.getOffsetHeight();
            setPosition(c, 5, ((int) (size.height * 0.65)) - (ch / 2));
        }
    });
    add(container);
}
Also used : ToolTip(com.extjs.gxt.ui.client.widget.tips.ToolTip) ToggleButton(com.extjs.gxt.ui.client.widget.button.ToggleButton) Size(com.extjs.gxt.ui.client.util.Size) El(com.extjs.gxt.ui.client.core.El)

Example 4 with El

use of com.extjs.gxt.ui.client.core.El in project activityinfo by bedatadriven.

the class ExportDialog method tryStartDownloadWithIframe.

private void tryStartDownloadWithIframe(String url) {
    com.google.gwt.user.client.ui.Frame frame = new com.google.gwt.user.client.ui.Frame(url);
    El el = El.fly(frame.getElement());
    el.setStyleAttribute("width", 0);
    el.setStyleAttribute("height", 0);
    el.setStyleAttribute("position", "absolute");
    el.setStyleAttribute("border", 0);
    RootPanel.get().add(frame);
}
Also used : El(com.extjs.gxt.ui.client.core.El)

Example 5 with El

use of com.extjs.gxt.ui.client.core.El in project activityinfo by bedatadriven.

the class HighlightingGridView method highlight.

public void highlight(Set<Integer> ids) {
    clearHighlight();
    if (!ids.isEmpty()) {
        for (int row = 0; row != grid.getStore().getCount(); ++row) {
            Element element = grid.getView().getRow(row);
            El el = El.fly(element);
            if (ids.contains(grid.getStore().getAt(row).get("id"))) {
                el.addStyleName(IndicatorLinkResources.INSTANCE.style().highlight());
                highlighted.add(element);
            }
        }
    }
}
Also used : Element(com.google.gwt.dom.client.Element) El(com.extjs.gxt.ui.client.core.El)

Aggregations

El (com.extjs.gxt.ui.client.core.El)5 Size (com.extjs.gxt.ui.client.util.Size)2 ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)1 Component (com.extjs.gxt.ui.client.widget.Component)1 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)1 ToggleButton (com.extjs.gxt.ui.client.widget.button.ToggleButton)1 ToolButton (com.extjs.gxt.ui.client.widget.button.ToolButton)1 AccordionLayout (com.extjs.gxt.ui.client.widget.layout.AccordionLayout)1 ToolTip (com.extjs.gxt.ui.client.widget.tips.ToolTip)1 Element (com.google.gwt.dom.client.Element)1