Example usage for com.google.gwt.user.client.ui DecoratedPopupPanel DecoratedPopupPanel

List of usage examples for com.google.gwt.user.client.ui DecoratedPopupPanel DecoratedPopupPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DecoratedPopupPanel DecoratedPopupPanel.

Prototype

public DecoratedPopupPanel(boolean autoHide, boolean modal) 

Source Link

Document

Creates an empty decorated popup panel, specifying its "auto-hide" and "modal" properties.

Usage

From source file:com.google.gwt.sample.mobilewebapp.client.desktop.DesktopTaskEditView.java

License:Apache License

/**
 * Show or hide the glass panel used to lock the UI will the task loads.
 * /*  ww w  .  j a v a 2 s. c  o  m*/
 * @param visible true to show, false to hide
 */
private static void setGlassPanelVisible(boolean visible) {
    // Initialize the panel.
    if (glassPanel == null) {
        glassPanel = new DecoratedPopupPanel(false, true);
        glassPanel.setWidget(new Label("Loading..."));
    }

    if (visible) {
        // Show the loading panel.
        glassPanel.center();
    } else {
        // Hide the loading panel.
        glassPanel.hide();
    }
}

From source file:com.google.gwt.sample.mobilewebapp.client.tablet.TabletTaskEditView.java

License:Apache License

/**
 * Show or hide the glass panel used to lock the UI will the task loads.
 * /*from   ww w . ja  v  a2  s .  co m*/
 * @param visible true to show, false to hide
 */
private static void setGlassPanelVisible(boolean visible) {
    // Initialize the panel.
    if (glassPanel == null) {
        glassPanel = new DecoratedPopupPanel(false, true);
        glassPanel.setGlassEnabled(true);
        glassPanel.setWidget(new Label("Loading..."));
    }

    if (visible) {
        // Show the loading panel.
        glassPanel.center();
    } else {
        // Hide the loading panel.
        glassPanel.hide();
    }
}

From source file:org.bonitasoft.console.client.view.identity.GroupViewer.java

License:Open Source License

private void initContent() {
    final DecoratedPopupPanel theIDCardPopup = new DecoratedPopupPanel(true, false);
    theIDCardPopup.addStyleName("bos_item_viewer_identity_popup");

    myIDCardPopupPanel.setHTML(0, 0, constants.groupLabelLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(0, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(1, 0, constants.groupNameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(1, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(2, 0, constants.groupDescription());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(2, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(3, 0, constants.groupPath());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(3, 0, "identity_form_label");

    theIDCardPopup.setWidget(myIDCardPopupPanel);
    myItemDescriptionLabel.addMouseOverHandler(new MouseOverHandler() {

        public void onMouseOver(MouseOverEvent aEvent) {
            if (myCurrentItem != null) {
                theIDCardPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = myItemDescriptionLabel.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = myItemDescriptionLabel.getAbsoluteTop()
                                + myItemDescriptionLabel.getOffsetHeight() + 7;
                        theIDCardPopup.setPopupPosition(left, top);
                    }//from w  w w.j a  v a 2  s.  co m
                });
            }
        }

    });
    myItemDescriptionLabel.addMouseOutHandler(new MouseOutHandler() {

        public void onMouseOut(MouseOutEvent aEvent) {
            theIDCardPopup.hide();
        }
    });

    myOuterPanel.add(myItemDescriptionLabel);
    if (isEditable) {
        CustomMenuBar theUserSearchButton = new CustomMenuBar();
        theUserSearchButton.addItem(constants.search(), new Command() {

            public void execute() {
                if (myItemSearchPopup == null) {
                    myItemSearchPopup = buildItemSearchPopup();
                }
                myItemSearchPopup.center();
            }
        });

        myClearIcon = new Image(PICTURE_PLACE_HOLDER);
        myClearIcon.setStylePrimaryName(CSSClassManager.CLEAR_ICON);
        myClearIcon.setTitle(constants.remove());
        myClearIcon.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent aEvent) {
                Group theOldValue = myCurrentItem;
                myCurrentItemUUID = null;
                myCurrentItem = null;
                update();
                myChanges.fireModelChange(GROUP_PROPERTY, theOldValue, myCurrentItem);
            }
        });

        myOuterPanel.add(theUserSearchButton);
        myOuterPanel.add(myClearIcon);
    }

}

From source file:org.bonitasoft.console.client.view.identity.RoleViewer.java

License:Open Source License

private void initContent() {
    final DecoratedPopupPanel theIDCardPopup = new DecoratedPopupPanel(true, false);
    theIDCardPopup.addStyleName("bos_item_viewer_identity_popup");

    myIDCardPopupPanel.setHTML(0, 0, constants.roleLabelLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(0, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(1, 0, constants.roleNameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(1, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(2, 0, constants.roleDescription());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(2, 0, "identity_form_label");

    theIDCardPopup.setWidget(myIDCardPopupPanel);
    myItemDescriptionLabel.addMouseOverHandler(new MouseOverHandler() {

        public void onMouseOver(MouseOverEvent aEvent) {
            if (myCurrentItem != null) {
                theIDCardPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = myItemDescriptionLabel.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = myItemDescriptionLabel.getAbsoluteTop()
                                + myItemDescriptionLabel.getOffsetHeight() + 7;
                        theIDCardPopup.setPopupPosition(left, top);
                    }/*from   ww  w  .j a v  a 2 s . co  m*/
                });
            }
        }

    });
    myItemDescriptionLabel.addMouseOutHandler(new MouseOutHandler() {

        public void onMouseOut(MouseOutEvent aEvent) {
            theIDCardPopup.hide();
        }
    });

    myOuterPanel.add(myItemDescriptionLabel);
    if (isEditable) {
        CustomMenuBar theUserSearchButton = new CustomMenuBar();
        theUserSearchButton.addItem(constants.search(), new Command() {

            public void execute() {
                if (myItemSearchPopup == null) {
                    myItemSearchPopup = buildUserSearchPopup();
                }
                myItemSearchPopup.center();
            }
        });

        myClearIcon = new Image(PICTURE_PLACE_HOLDER);
        myClearIcon.setStylePrimaryName(CSSClassManager.CLEAR_ICON);
        myClearIcon.setTitle(constants.remove());
        myClearIcon.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent aEvent) {
                final Role theOldValue = myCurrentItem;
                myCurrentItemUUID = null;
                myCurrentItem = null;
                update();
                myChanges.fireModelChange(ROLE_PROPERTY, theOldValue, myCurrentItem);
            }
        });

        myOuterPanel.add(theUserSearchButton);
        myOuterPanel.add(myClearIcon);
    }

}

From source file:org.bonitasoft.console.client.view.identity.UserViewer.java

License:Open Source License

private void initContent() {
    final DecoratedPopupPanel theIDCardPopup = new DecoratedPopupPanel(true, false);
    theIDCardPopup.addStyleName("bos_item_viewer_identity_popup");

    myIDCardPopupPanel.setHTML(0, 0, constants.titleLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(0, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(1, 0, constants.firstNameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(1, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(2, 0, constants.lastNameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(2, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(3, 0, constants.jobTitleLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(3, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(4, 0, constants.usernameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(4, 0, "identity_form_label");

    theIDCardPopup.setWidget(myIDCardPopupPanel);
    myUserIdentityLabel.addMouseOverHandler(new MouseOverHandler() {

        public void onMouseOver(MouseOverEvent aEvent) {
            if (myCurrentUser != null) {
                theIDCardPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = myUserIdentityLabel.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = myUserIdentityLabel.getAbsoluteTop() + myUserIdentityLabel.getOffsetHeight()
                                + 7;/*  w ww  .jav  a2 s. com*/
                        theIDCardPopup.setPopupPosition(left, top);
                    }
                });
            }
        }

    });
    myUserIdentityLabel.addMouseOutHandler(new MouseOutHandler() {

        public void onMouseOut(MouseOutEvent aEvent) {
            theIDCardPopup.hide();
        }
    });

    myOuterPanel.add(myUserIdentityLabel);
    if (isEditable) {
        CustomMenuBar theUserSearchButton = new CustomMenuBar();
        theUserSearchButton.addItem(constants.search(), new Command() {

            public void execute() {
                if (myUserSearchPopup == null) {
                    myUserSearchPopup = buildUserSearchPopup();
                }
                myUserSearchPopup.center();
            }
        });

        myClearIcon = new Image(PICTURE_PLACE_HOLDER);
        myClearIcon.setStylePrimaryName(CSSClassManager.CLEAR_ICON);
        myClearIcon.setTitle(constants.remove());
        myClearIcon.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent aEvent) {
                User theOldValue = myCurrentUser;
                myCurrentUserUUID = null;
                myCurrentUser = null;
                update();
                myChanges.fireModelChange(USER_PROPERTY, theOldValue, myCurrentUser);
            }
        });

        myOuterPanel.add(theUserSearchButton);
        myOuterPanel.add(myClearIcon);
    }

}

From source file:org.bonitasoft.console.client.view.ItemFilterEditor.java

License:Open Source License

protected SimplePanel createNaturalSearchElement(HTML aSearchScopeExplanations) {
    DecoratorPanel theNaturalSearchPanel = new DecoratorPanel();
    theNaturalSearchPanel.setStylePrimaryName(ROUNDED_STYLE);
    final SuggestBox theSearchSB = new SuggestBox(mySearchOracle);

    HorizontalPanel theNaturalSearch = new HorizontalPanel();
    final Image theMagnifyIcon = new Image(PICTURE_PLACE_HOLDER);
    theMagnifyIcon.setStylePrimaryName(CSSClassManager.SEARCH_ICON);
    if (aSearchScopeExplanations != null) {
        final DecoratedPopupPanel theExplanationsPopup = new DecoratedPopupPanel(true, false);
        theExplanationsPopup.setWidget(aSearchScopeExplanations);
        theMagnifyIcon.addMouseOverHandler(new MouseOverHandler() {

            public void onMouseOver(MouseOverEvent aEvent) {
                theExplanationsPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = theMagnifyIcon.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = theMagnifyIcon.getAbsoluteTop() + theMagnifyIcon.getHeight() + 7;
                        theExplanationsPopup.setPopupPosition(left, top);
                    }/*w  ww .j av  a2  s  .  c  o m*/
                });
            }

        });
        theMagnifyIcon.addMouseOutHandler(new MouseOutHandler() {

            public void onMouseOut(MouseOutEvent aEvent) {
                theExplanationsPopup.hide();
            }
        });
    }
    final Image theActionIcon = new Image(PICTURE_PLACE_HOLDER);
    theActionIcon.setStylePrimaryName(CSSClassManager.SEARCH_CLEAR_ICON);
    theActionIcon.setVisible(false);
    theActionIcon.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent aEvent) {
            theSearchSB.setValue(null);
            theActionIcon.setVisible(false);
            clearFilterPatternAndNotify();
        }
    });
    final DecoratedPopupPanel theClearTooltip = new DecoratedPopupPanel(true, false);
    theClearTooltip.setWidget(new HTML(constants.clearFilter()));
    theActionIcon.addMouseOverHandler(new MouseOverHandler() {

        public void onMouseOver(MouseOverEvent aEvent) {
            theClearTooltip.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                    int left = theActionIcon.getAbsoluteLeft() - (anOffsetWidth / 2);
                    int top = theActionIcon.getAbsoluteTop() + theActionIcon.getHeight() + 7;
                    theClearTooltip.setPopupPosition(left, top);
                }
            });
        }

    });
    // theActionIcon.addMouseMoveHandler(new MouseMoveHandler() {
    //
    // public void onMouseMove(MouseMoveEvent aEvent) {
    // theClearTooltip.setPopupPositionAndShow(new PopupPanel.PositionCallback()
    // {
    // public void setPosition(int anOffsetWidth, int anOffsetHeight) {
    // int left = theActionIcon.getAbsoluteLeft() - (anOffsetWidth / 2);
    // int top = theActionIcon.getAbsoluteTop() + theActionIcon.getHeight() + 7;
    // theClearTooltip.setPopupPosition(left, top);
    // }
    // });
    // }
    //
    // });

    theActionIcon.addMouseOutHandler(new MouseOutHandler() {

        public void onMouseOut(MouseOutEvent aEvent) {
            theClearTooltip.hide();
        }
    });

    theSearchSB.getTextBox().addKeyDownHandler(new KeyDownHandler() {

        public void onKeyDown(KeyDownEvent anEvent) {
            int theKey = anEvent.getNativeKeyCode();
            if (KeyCodes.KEY_ENTER == theKey) {
                if (performNaturalSearch(theSearchSB)) {
                    theActionIcon.setVisible(true);
                } else {
                    theActionIcon.setVisible(false);
                }
            }
        }
    });

    theSearchSB.getTextBox().addBlurHandler(new BlurHandler() {

        public void onBlur(BlurEvent aEvent) {
            theSearchSB.setValue(myFilter.getSearchPattern());
            if (theSearchSB.getValue() == null || theSearchSB.getValue().length() == 0) {
                theActionIcon.setVisible(false);
            } else {
                theActionIcon.setVisible(true);
            }
        }
    });

    theNaturalSearch.add(theMagnifyIcon);
    theNaturalSearch.add(theSearchSB);
    theNaturalSearch.add(theActionIcon);
    theNaturalSearchPanel.add(theNaturalSearch);

    return theNaturalSearchPanel;
}

From source file:org.bonitasoft.console.client.view.ListBoxEditor.java

License:Open Source License

protected void buildTooltipPopup() {
    final DecoratedPopupPanel thePopup = new DecoratedPopupPanel(true, false);
    thePopup.addStyleName("bos_field_editor_popup");
    HTML theInnerPanel = new HTML(constants.editIcon());

    thePopup.setWidget(theInnerPanel);// w w w . j  a v  a 2  s. c  om

    if (allowHtml) {
        myMouseOverHandlerRegistration = myHtmlView.addMouseOverHandler(new MouseOverHandler() {

            public void onMouseOver(MouseOverEvent aEvent) {
                thePopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = myHtmlView.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = myHtmlView.getAbsoluteTop() + myHtmlView.getOffsetHeight() + 7;
                        thePopup.setPopupPosition(left, top);
                    }
                });
            }

        });
        myMouseOutHandlerRegistration = myHtmlView.addMouseOutHandler(new MouseOutHandler() {

            public void onMouseOut(MouseOutEvent aEvent) {
                thePopup.hide();
            }
        });
    } else {
        myMouseOverHandlerRegistration = myTextView.addMouseOverHandler(new MouseOverHandler() {

            public void onMouseOver(MouseOverEvent aEvent) {
                thePopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = myTextView.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = myTextView.getAbsoluteTop() + myTextView.getOffsetHeight() + 7;
                        thePopup.setPopupPosition(left, top);
                    }
                });
            }

        });
        myMouseOutHandlerRegistration = myTextView.addMouseOutHandler(new MouseOutHandler() {

            public void onMouseOut(MouseOutEvent aEvent) {
                thePopup.hide();
            }
        });
    }
}

From source file:org.bonitasoft.console.client.view.processes.ProcessViewer.java

License:Open Source License

private void initContent() {
    final DecoratedPopupPanel theIDCardPopup = new DecoratedPopupPanel(true, false);
    theIDCardPopup.addStyleName("bos_item_viewer_identity_popup");

    myIDCardPopupPanel.setHTML(0, 0, constants.processLabelLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(0, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(1, 0, constants.processNameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(1, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(2, 0, constants.processDescriptionLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(2, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(3, 0, constants.processVersionLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(3, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(4, 0, constants.processStateLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(4, 0, "identity_form_label");

    theIDCardPopup.setWidget(myIDCardPopupPanel);
    myItemDescriptionLabel.addMouseOverHandler(new MouseOverHandler() {

        public void onMouseOver(MouseOverEvent aEvent) {
            if (myCurrentItem != null) {
                theIDCardPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = myItemDescriptionLabel.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = myItemDescriptionLabel.getAbsoluteTop()
                                + myItemDescriptionLabel.getOffsetHeight() + 7;
                        theIDCardPopup.setPopupPosition(left, top);
                    }/* w  ww .j a  va  2  s .  c  o m*/
                });
            }
        }

    });
    myItemDescriptionLabel.addMouseOutHandler(new MouseOutHandler() {

        public void onMouseOut(MouseOutEvent aEvent) {
            theIDCardPopup.hide();
        }
    });

    myOuterPanel.add(myItemDescriptionLabel);
    if (isEditable) {
        CustomMenuBar theItemSearchButton = new CustomMenuBar();
        theItemSearchButton.addItem(constants.search(), new Command() {

            public void execute() {
                if (myItemSearchPopup == null) {
                    myItemSearchPopup = buildItemSearchPopup();
                }
                myItemSearchPopup.center();
            }
        });

        myClearIcon = new Image(PICTURE_PLACE_HOLDER);
        myClearIcon.setStylePrimaryName(CSSClassManager.CLEAR_ICON);
        myClearIcon.setTitle(constants.remove());
        myClearIcon.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent aEvent) {
                final BonitaProcess theOldValue = myCurrentItem;
                myCurrentBonitaProcessUUID = null;
                myCurrentItem = null;
                update();
                myChanges.fireModelChange(PROCESS_PROPERTY, theOldValue, myCurrentItem);
            }
        });

        myOuterPanel.add(theItemSearchButton);
        myOuterPanel.add(myClearIcon);
    }

}

From source file:org.bonitasoft.console.client.view.steps.StepDefinitionViewer.java

License:Open Source License

private void initContent() {
    final DecoratedPopupPanel theIDCardPopup = new DecoratedPopupPanel(true, false);
    theIDCardPopup.addStyleName("bos_item_viewer_identity_popup");

    myIDCardPopupPanel.setHTML(0, 0, constants.stepLabelLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(0, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(1, 0, constants.stepNameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(1, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(2, 0, constants.processNameLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(2, 0, "identity_form_label");

    myIDCardPopupPanel.setHTML(3, 0, constants.processVersionLabel());
    myIDCardPopupPanel.getFlexCellFormatter().setStyleName(3, 0, "identity_form_label");

    theIDCardPopup.setWidget(myIDCardPopupPanel);
    myItemDescriptionLabel.addMouseOverHandler(new MouseOverHandler() {

        public void onMouseOver(MouseOverEvent aEvent) {
            if (myCurrentItem != null) {
                theIDCardPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                    public void setPosition(int anOffsetWidth, int anOffsetHeight) {
                        int left = myItemDescriptionLabel.getAbsoluteLeft() - (anOffsetWidth / 2);
                        int top = myItemDescriptionLabel.getAbsoluteTop()
                                + myItemDescriptionLabel.getOffsetHeight() + 7;
                        theIDCardPopup.setPopupPosition(left, top);
                    }/*ww w. jav a2  s .c o m*/
                });
            }
        }

    });
    myItemDescriptionLabel.addMouseOutHandler(new MouseOutHandler() {

        public void onMouseOut(MouseOutEvent aEvent) {
            theIDCardPopup.hide();
        }
    });

    myOuterPanel.add(myItemDescriptionLabel);
    if (isEditable) {
        myStepDefinitionSearchButton = new CustomMenuBar();
        myStepDefinitionSearchButton.addItem(constants.search(), new Command() {

            public void execute() {
                if (myItemSearchPopup == null) {
                    myItemSearchPopup = buildStepDefinitionSearchPopup();
                }
                myItemSearchPopup.center();
            }
        });

        myClearIcon = new Image(PICTURE_PLACE_HOLDER);
        myClearIcon.setStylePrimaryName(CSSClassManager.CLEAR_ICON);
        myClearIcon.setTitle(constants.remove());
        myClearIcon.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent aEvent) {
                myCurrentItemUUID = null;
                myCurrentItem = null;
                update();
                myChanges.fireModelChange(STEP_PROPERTY, null, myCurrentItem);
            }
        });
    }

}