List of usage examples for com.google.gwt.user.client.ui DecoratedPopupPanel setWidget
@Override
public void setWidget(Widget w)
From source file:com.google.gwt.sample.showcase.client.content.popups.CwBasicPopup.java
License:Apache License
/** * Initialize this example./*ww w.jav a2s .c o m*/ */ @ShowcaseSource @Override public Widget onInitialize() { // Create a basic popup widget final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); simplePopup.ensureDebugId("cwBasicPopup-simplePopup"); simplePopup.setWidth("150px"); simplePopup.setWidget(new HTML(constants.cwBasicPopupClickOutsideInstructions())); // Create a button to show the popup Button openButton = new Button(constants.cwBasicPopupShowButton(), new ClickHandler() { public void onClick(ClickEvent event) { // Reposition the popup relative to the button Widget source = (Widget) event.getSource(); int left = source.getAbsoluteLeft() + 10; int top = source.getAbsoluteTop() + 10; simplePopup.setPopupPosition(left, top); // Show the popup simplePopup.show(); } }); // Create a popup to show the full size image Image jimmyFull = new Image(Showcase.images.jimmy()); final PopupPanel imagePopup = new PopupPanel(true); imagePopup.setAnimationEnabled(true); imagePopup.ensureDebugId("cwBasicPopup-imagePopup"); imagePopup.setWidget(jimmyFull); jimmyFull.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { imagePopup.hide(); } }); // Add an image thumbnail Image jimmyThumb = new Image(Showcase.images.jimmyThumb()); jimmyThumb.ensureDebugId("cwBasicPopup-thumb"); jimmyThumb.addStyleName("cw-BasicPopup-thumb"); jimmyThumb.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { imagePopup.center(); } }); // Add the widgets to a panel VerticalPanel vPanel = new VerticalPanel(); vPanel.setSpacing(5); vPanel.add(openButton); vPanel.add(new HTML("<br><br><br>" + constants.cwBasicPopupInstructions())); vPanel.add(jimmyThumb); // Return the panel return vPanel; }
From source file:com.thinqq.qsports.client.userprofile.UserProfileViewImpl.java
License:Open Source License
@Override public void showFatalError() { final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); simplePopup.ensureDebugId("cwBasicPopup-simplePopup"); simplePopup.setWidth("150px"); simplePopup.setWidget(new HTML("FATAL ERROR")); simplePopup.show();/*from ww w . java 2s . com*/ }
From source file:es.deusto.weblab.client.lab.ui.themes.es.deusto.weblab.defaultmobile.LoginWindow.java
License:Open Source License
private void setupWidgets(final Widget wid) { this.logoImage.setUrl(GWT.getModuleBaseURL() + this.configurationManager.getProperty(DefaultTheme.Configuration.HOST_ENTITY_MOBILE_IMAGE, "")); final String hostEntityLink = this.configurationManager .getProperty(DefaultTheme.Configuration.HOST_ENTITY_LINK, ""); this.institutionLink.setHref(hostEntityLink); // If ENTER is pressed, login as if the button had been clicked. final KeyDownHandler keyboardHandler = new KeyDownHandler() { @Override//w w w . ja va 2 s.c o m public void onKeyDown(KeyDownEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) LoginWindow.this.onLoginButtonClicked(null); } }; this.usernameTextbox.addKeyDownHandler(keyboardHandler); this.passwordTextbox.addKeyDownHandler(keyboardHandler); final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); final VerticalPanel languageList = new VerticalPanel(); for (int i = 0; i < IWebLabI18N.LANGUAGES.length; ++i) { final String curLanguage = IWebLabI18N.LANGUAGES[i]; final String curLanguageCode = IWebLabI18N.LANGUAGE_CODES[i]; final Anchor languageButton = new Anchor(curLanguage); languageButton.addClickHandler(new LanguageButtonClickHandler(curLanguageCode)); languageList.add(languageButton); } languageList.setSpacing(15); simplePopup.setWidget(languageList); this.languages.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final Widget source = (Widget) event.getSource(); final int left = source.getAbsoluteLeft() + 10; final int top = source.getAbsoluteTop() + 10; simplePopup.setPopupPosition(left, top); simplePopup.setModal(true); simplePopup.show(); } }); this.mainPanel.add(wid); final boolean demoAvailable = this.configurationManager .getBoolProperty(WebLabClientLab.DEMO_AVAILABLE_PROPERTY, WebLabClientLab.DEFAULT_DEMO_AVAILABLE); this.guestPanel.setVisible(demoAvailable); }
From source file:net.s17fabu.vip.gwt.showcase.client.content.popups.CwBasicPopup.java
License:Apache License
/** * Initialize this example.//from w w w . j a v a 2 s. co m */ @Override public Widget onInitialize() { // Create a basic popup widget final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); simplePopup.ensureDebugId("cwBasicPopup-simplePopup"); simplePopup.setWidth("150px"); simplePopup.setWidget(new HTML(constants.cwBasicPopupClickOutsideInstructions())); // Create a button to show the popup Button openButton = new Button(constants.cwBasicPopupShowButton(), new ClickHandler() { public void onClick(ClickEvent event) { // Reposition the popup relative to the button Widget source = (Widget) event.getSource(); int left = source.getAbsoluteLeft() + 10; int top = source.getAbsoluteTop() + 10; simplePopup.setPopupPosition(left, top); // Show the popup simplePopup.show(); } }); // Create a popup to show the full size image Image jimmyFull = Showcase.images.jimmy().createImage(); final PopupPanel imagePopup = new PopupPanel(true); imagePopup.setAnimationEnabled(true); imagePopup.ensureDebugId("cwBasicPopup-imagePopup"); imagePopup.setWidget(jimmyFull); jimmyFull.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { imagePopup.hide(); } }); // Add an image thumbnail Image jimmyThumb = Showcase.images.jimmyThumb().createImage(); jimmyThumb.ensureDebugId("cwBasicPopup-thumb"); jimmyThumb.addStyleName("cw-BasicPopup-thumb"); jimmyThumb.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { imagePopup.center(); } }); // Add the widgets to a panel VerticalPanel vPanel = new VerticalPanel(); vPanel.setSpacing(5); vPanel.add(openButton); vPanel.add(new HTML("<br><br><br>" + constants.cwBasicPopupInstructions())); vPanel.add(jimmyThumb); // Return the panel return vPanel; }
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); }/* w w w. j a v a2s . c o 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 w w w . 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 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;//from w w w . j a v a 2s. c om 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); }/*from ww w . ja v a 2 s . c om*/ }); } }); 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); 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); }//from w ww.ja v a 2 s . c o m }); } }); 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); }//from w ww. jav a 2 s. c om }); } } }); 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); } }