Search in sources :

Example 1 with ToolButton

use of com.extjs.gxt.ui.client.widget.button.ToolButton 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 ToolButton

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

the class ReportPortlet method addOptionsMenu.

private void addOptionsMenu() {
    final Menu optionsMenu = new Menu();
    optionsMenu.add(new MenuItem(I18N.CONSTANTS.edit(), IconImageBundle.ICONS.edit(), new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            edit();
        }
    }));
    optionsMenu.add(new MenuItem(I18N.CONSTANTS.removeFromDashboard(), IconImageBundle.ICONS.remove(), new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            removeFromDashboard();
        }
    }));
    final ToolButton gear = new ToolButton("x-tool-gear", new SelectionListener<IconButtonEvent>() {

        @Override
        public void componentSelected(IconButtonEvent ce) {
            optionsMenu.show(ce.getComponent());
        }
    });
    getHeader().addTool(gear);
}
Also used : ToolButton(com.extjs.gxt.ui.client.widget.button.ToolButton) MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem) Menu(com.extjs.gxt.ui.client.widget.menu.Menu)

Example 3 with ToolButton

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

the class ReportPortlet method addCloseButton.

private void addCloseButton() {
    getHeader().addTool(new ToolButton("x-tool-close", new SelectionListener<IconButtonEvent>() {

        @Override
        public void componentSelected(IconButtonEvent ce) {
            removeFromDashboard();
        }
    }));
    getHeader().addTool(new ToolButton("x-tool-maximize", new SelectionListener<IconButtonEvent>() {

        @Override
        public void componentSelected(IconButtonEvent ce) {
            edit();
        }
    }));
}
Also used : ToolButton(com.extjs.gxt.ui.client.widget.button.ToolButton)

Aggregations

ToolButton (com.extjs.gxt.ui.client.widget.button.ToolButton)3 El (com.extjs.gxt.ui.client.core.El)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 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)1 AccordionLayout (com.extjs.gxt.ui.client.widget.layout.AccordionLayout)1 Menu (com.extjs.gxt.ui.client.widget.menu.Menu)1 MenuItem (com.extjs.gxt.ui.client.widget.menu.MenuItem)1