Package org.jboss.ballroom.client.widgets.icons

Examples of org.jboss.ballroom.client.widgets.icons.FontIcon


        HTML titleText = new HTML(title);
        headerId = "h_" + DOM.createUniqueId();
        titleText.getElement().setId(headerId);
        titleText.setStyleName("default-window-title");

        FontIcon closeIcon = new FontIcon("icon-remove", FontIcon.Size.SMALL);
        closeIcon.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent clickEvent) {
                callback.hide();
            }
        });

        FontIcon maximizeIcon = new FontIcon("icon-resize-full", FontIcon.Size.SMALL);
        maximizeIcon.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent clickEvent) {

                int width = origWidth;
                int height = origHeight;


                if(origWidth==-1)
                {
                    origWidth = getOffsetWidth();
                    origHeight = (int) ( origWidth / 1.618 ) +50;// TODO: this fails "getOffsetHeight()";
                    origLeft = getAbsoluteLeft();
                    origTop = getAbsoluteTop();

                    width = Window.getClientWidth() - 50;
                    height = Window.getClientHeight() - 50;

                    callback.hide();

                    callback.setPopupPosition(25, 25);
                    callback.setWidth(width+"px");
                    callback.setHeight(height+"px");

                    callback.show();
                }
                else
                {

                    // reset to previous size & position
                    // see above ...

                    callback.hide();

                    callback.setWidth(width+"px");
                    callback.setHeight(height+"px");

                    callback.center();

                    // clear
                    origWidth = -1;
                    origHeight = -1;
                    origLeft = -1;
                    origTop = -1;

                }

            }
        });

        header.add(titleText);
        header.add(maximizeIcon);
        header.add(closeIcon);

        initWidget(header);

        titleText.getElement().getParentElement().setAttribute("width", "100%");

        maximizeIcon.getElement().getParentElement().setAttribute("width", "16px");
        maximizeIcon.getElement().getParentElement().setAttribute("style", "padding-right:10px");

        closeIcon.getElement().getParentElement().setAttribute("width", "16px");
        closeIcon.getElement().getParentElement().setAttribute("style", "padding-right:10px");

    }
View Full Code Here


        HTML titleText = new HTML(title);
        headerId = "h_" + DOM.createUniqueId();
        titleText.getElement().setId(headerId);
        titleText.setStyleName("default-window-title");

        FontIcon closeIcon = new FontIcon(" icon-remove", FontIcon.Size.MEDIUM);
        closeIcon.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent clickEvent) {
                callback.hide();
            }
        });

        FontIcon maximizeIcon = new FontIcon("icon-resize-full", FontIcon.Size.MEDIUM);
        maximizeIcon.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent clickEvent) {

                int width = origWidth;
                int height = origHeight;

                int top = origTop;
                int left = origLeft;

                if(origWidth==-1)
                {
                    origWidth = getOffsetWidth();
                    origHeight = (int) ( origWidth / 1.618 ) +50;// TODO: this fails "getOffsetHeight()";
                    origLeft = getAbsoluteLeft();
                    origTop = getAbsoluteTop();

                    width = Window.getClientWidth() - 50;
                    height = Window.getClientHeight() - 50;

                    top = 25;
                    left = 25;
                }
                else
                {
                    origWidth = -1;
                    origHeight = -1;
                    origLeft = -1;
                    origTop = -1;

                }

                callback.hide();

                callback.setPopupPosition(top, left);
                callback.setWidth(width+"px");
                callback.setHeight(height+"px");

                callback.show();

            }
        });

        header.add(titleText);
        header.add(maximizeIcon);
        header.add(closeIcon);

        initWidget(header);

        titleText.getElement().getParentElement().setAttribute("width", "100%");

        maximizeIcon.getElement().getParentElement().setAttribute("width", "16px");
        maximizeIcon.getElement().getParentElement().setAttribute("style", "color:#ffffff;padding-right:10px");

        closeIcon.getElement().getParentElement().setAttribute("width", "16px");
        closeIcon.getElement().getParentElement().setAttribute("style", "color:#ffffff;padding-right:10px");

    }
View Full Code Here

TOP

Related Classes of org.jboss.ballroom.client.widgets.icons.FontIcon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.