public CreateGroupWidget(UserGroup parent) { initComponents(); this.parent = parent; int row = 0; createTable.setWidget(row, 0, closeLink); createTable.getFlexCellFormatter().setColSpan(row, 0, 2); row += 1; createTable.setHTML(row, 0, "<b>Name</b>"); createTable.setWidget(row, 1, groupName); row += 1; createTable.setHTML(row, 0, "<b>Description</b>"); createTable.setWidget(row, 1, groupDescription); row += 1; createTable.setWidget(row, 0, table); createTable.getFlexCellFormatter().setColSpan(row, 0, 2); row += 1; createTable.setWidget(row, 0, createButton); createTable.getFlexCellFormatter().setHorizontalAlignment(row, 0, HasAlignment.ALIGN_RIGHT); createTable.setWidget(row, 1, cancelButton); popup.setWidget(createTable); popup.setGlassEnabled(true); popup.setGlassStyleName("dialog_box_glass"); closeLink.addClickHandler(new CloseWidgetHandler()); cancelButton.addClickHandler(new CloseWidgetHandler()); }
private void showMessagePopup() { Label validationMessageLabel = new Label(); validationMessageLabel.setStyleName("validation-textbox-message-label"); // $NON-NLS-1$ validationMessageLabel.setText(getValidationMessage()); VerticalPanel messagePanel = new VerticalPanel(); messagePanel.add(validationMessageLabel); HorizontalPanel bottomPanel = new HorizontalPanel(); SimplePanel hSpacer = new SimplePanel(); hSpacer.setStylePrimaryName("validation-textbox-left-image-buffer"); // $NON-NLS-1$ bottomPanel.add(hSpacer); SimplePanel tailImagePanel = new SimplePanel(); image = new Image(GWT.getModuleBaseURL() + "images/spacer.gif"); // $NON-NLS-1$ image.setStylePrimaryName("validation-textbox-tail-image"); // $NON-NLS-1$ tailImagePanel.add(image); bottomPanel.add(tailImagePanel); messagePanel.add(bottomPanel); popupPanel = new PopupPanel(true, false); popupPanel.setWidget(messagePanel); popupPanel.setPopupPositionAndShow( new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { int absLeft = -1; int absTop = -1; absLeft = textBox.getAbsoluteLeft(); absTop = textBox.getAbsoluteTop(); Rectangle popupSize = ElementUtils.getSize(popupPanel.getElement()); popupPanel.setPopupPosition( absLeft, absTop - popupSize.height >= 0 ? absTop - popupSize.height : absTop); } }); popupPanel.show(); }
public void showPopup(boolean show) { if (popup.isShowing() == show) return; if (show) { popup.center(); } else popup.hide(); }
@Inject public DisplayHelpPopup(EventBus eventBus) { super(eventBus); widget = binder.createAndBindUi(this); widget.setWidth("600px"); widget.setHeight("400px"); }
public void createRefreshToggleButton(final Button refreshIntervalSelector) { refreshIntervalSelector.setToggle(true); refreshIntervalSelector.setIcon(IconType.COG); refreshIntervalSelector.setTitle(Constants.INSTANCE.AutoRefresh()); refreshIntervalSelector.setSize(ButtonSize.MINI); popup.getElement().getStyle().setZIndex(Integer.MAX_VALUE); popup.addAutoHidePartner(refreshIntervalSelector.getElement()); popup.addCloseHandler( new CloseHandler<PopupPanel>() { public void onClose(CloseEvent<PopupPanel> popupPanelCloseEvent) { if (popupPanelCloseEvent.isAutoClosed()) { refreshIntervalSelector.setActive(false); } } }); refreshIntervalSelector.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { if (!refreshIntervalSelector.isActive()) { showSelectRefreshIntervalPopup( refreshIntervalSelector.getAbsoluteLeft() + refreshIntervalSelector.getOffsetWidth(), refreshIntervalSelector.getAbsoluteTop() + refreshIntervalSelector.getOffsetHeight(), refreshIntervalSelector); } else { popup.hide(false); } } }); }
public InlineMultiSelect() { popup.setAutoHideEnabled(true); popup.addAutoHidePartner(textbox.getElement()); multiSelect.addValueChangeHandler( new ValueChangeHandler<List<String>>() { @Override public void onValueChange(ValueChangeEvent<List<String>> event) { int size = event.getValue().size(); textbox.setText(size + " selected"); } }); popup.add(multiSelect); textbox.setText("Make a selection"); textbox.setReadOnly(true); panel.add(textbox); panel.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { popup.showRelativeTo(panel); } }); initWidget(panel); }
@Override public void onBrowserEvent(Event event) { if (DOM.eventGetType(event) == Event.ONMOUSEDOWN && enabled) { setupPopup(); popup.setPopupPosition(event.getClientX(), event.getClientY()); popup.show(); } }
private PopupPanel createPopup() { PopupPanel p = new PopupPanel(true, false); p.setWidget(suggestionMenu); p.setStyleName(STYLE_NAME_POPUP_PANEL); p.setPreviewingAllNativeEvents(true); p.addAutoHidePartner(getTextBox().getElement()); return p; }
@Override public void show(int x, int y, Element parent, Date value) { currentValue = value; createMenu(value); popupPanel.setPopupPosition(x, y); popupPanel.show(); menu.focus(); }
public static void tip(String message, UIObject target) { HTML messageLabel = new HTML(message); messageLabel.addStyleName("content"); PopupPanel tip = new DecoratedPopupPanel(true); tip.addStyleName("tip-box"); tip.setWidget(messageLabel); tip.showRelativeTo(target); }
@Override public void onClick(ClickEvent event) { if (!popup.isShowing()) { if (relativeTo == null) popup.showRelativeTo((Widget) event.getSource()); else popup.showRelativeTo(relativeTo); } else { popup.hide(); } }
public void setWaitVisible(boolean visible) { if (visible) { wait.setPopupPosition(bodyContainer.getAbsoluteLeft(), bodyContainer.getAbsoluteTop()); wait.setPixelSize(bodyContainer.getOffsetWidth(), bodyContainer.getOffsetHeight()); wait.show(); } else { wait.hide(); } }
private void handleQuickReferenceClick() { if (isQuickReferenceShowing()) { quickReferencePopup.hide(); quickReferenceLink.setText(SHOW_QUICK_REFERENCE); } else { quickReferencePopup.setPopupPositionAndShow(this); quickReferenceLink.setText(HIDE_QUICK_REFERENCE); } }
public static void init() { panel.setSize("300px", "80px"); panel.add(label); panel.add(fileUpload); popup.setGlassEnabled(true); popup.setAutoHideEnabled(true); popup.center(); popup.add(panel); }
private void openPanel() { if (isEnabled) { popup.setWidth((header.getOffsetWidth() - 10) + "px"); popup.setHeight((cellList.getRowCount() * 25) + "px"); popup.setPopupPosition(header.getAbsoluteLeft(), header.getAbsoluteTop() + 22); popup.show(); } }
/** Popup menu listener */ public void onClick(ClickEvent event) { int x = event.getX(); int y = event.getY(); if (screen[x][y] != 0) { currentPerson = getPersonById(screen[x][y]); popup.showRelativeTo(currentPerson); popup.show(); } else { popup.hide(); } }
private void setupSavedSearches() { savedSearchesPanel.add(savedSearchesGrid); savedSearchesPanel.setStyleName("savedSearchesPanel"); savedSearchesGrid.addStyleName("savedSearchesPanel"); // panel position will be re-calculated on down-arrow click savedSearchesPanel.show(); savedSearchesPanel.hide(); SavedSearchesEventHandler handler = new SavedSearchesEventHandler(); savedSearchesPanel.addCloseHandler(handler); savedSearchesGrid.setSavedSearchSelectionHandler(handler); }
/** * On right click. * * @param value the value * @param event the event * @param element the element */ public void onRightClick(CellTreeNode value, Event event, Element element) { clearMessages(); selectedNode = value; selectionModel.setSelected(selectedNode, true); int x = element.getAbsoluteRight() - 10; int y = element.getAbsoluteBottom() + 5; popupPanel.setPopupPosition(x, y); popupPanel.setAnimationEnabled(true); // popupPanel.setSize("175px", "75px"); popupPanel.show(); popupPanel.setStyleName("popup"); clauseWorkspaceContextMenu.displayMenuItems(popupPanel); }
/** Hide lightbox */ public void hide() { /** @author Luis Faria check if png is null before removing from parent */ if (GWT.isScript()) { if (png != null) { png.removeFromParent(); } png = null; } showSelects(); child.hide(); background.hide(); Window.removeWindowResizeListener(windowResizeListener); }
/** Creates the conditions group operator popup. */ private void setupPopup() { popup = new PopupPanel(true, true); MenuBar menuBar = new MenuBar(true); menuBar.addItem( CONDITIONS_OPERATOR_TEXT_ALL, true, new Command() { public void execute() { popup.hide(); setText(CONDITIONS_OPERATOR_TEXT_ALL); } }); menuBar.addSeparator(); menuBar.addItem( CONDITIONS_OPERATOR_TEXT_ANY, true, new Command() { public void execute() { popup.hide(); setText(CONDITIONS_OPERATOR_TEXT_ANY); } }); // menuBar.addSeparator(); // menuBar.addItem(CONDITIONS_OPERATOR_TEXT_NONE,true,new Command(){ // public void execute() {popup.hide(); setText(CONDITIONS_OPERATOR_TEXT_NONE);}}); // // menuBar.addSeparator(); // menuBar.addItem(CONDITIONS_OPERATOR_TEXT_NOT_ALL,true, new Command(){ // public void execute() {popup.hide(); setText(CONDITIONS_OPERATOR_TEXT_NOT_ALL);}}); popup.setWidget(menuBar); }
public void setPopupPosition(int x, int y, boolean store) { super.setPopupPosition(x, y); if (store) { xCoord = x; yCoord = y; } }
private void showWaitPanelIfRequired(RequestContext context) { if (getServicePropertyBoolean(context.getMethodName(), "showWaitPanel", false)) { GwtUtils.log(getClass(), "showWaitPanelIfRequired", "showWaitPanel = true"); if (waitPanel == null) { waitPanel = new PopupPanel(); GwtUtils.setStyleAttribute(waitPanel, "border", "none"); GwtUtils.setStyleAttribute(waitPanel, "background", "transparent"); waitPanel.setGlassEnabled(false); waitPanel.setAnimationEnabled(true); Image waitingImg = new Image(UriUtils.fromTrustedString("/images/commons/transp-loading.gif")); waitPanel.setWidget(waitingImg); } GwtUtils.showWait(waitPanel); } }
/** Refreshing satus */ public void refresh() { if (flag_getChilds) { int left = ((Main.get().findFolderSelectPopup.getOffsetWidth() - 200) / 2) + Main.get().findFolderSelectPopup.getAbsoluteLeft(); int top = ((Main.get().findFolderSelectPopup.getOffsetHeight() - 40) / 2) + Main.get().findFolderSelectPopup.getAbsoluteTop(); setPopupPosition(left, top); Main.get().findFolderSelectPopup.scrollFolderPanel.addStyleName("okm-PanelRefreshing"); super.show(); } else { super.hide(); Main.get().findFolderSelectPopup.scrollFolderPanel.removeStyleName("okm-PanelRefreshing"); } }
/** * Creates an empty dialog box specifying its "auto-hide" property. It should not be shown until * its child widget has been added using {@link #add(Widget)}. * * @param autoHide <code>true</code> if the dialog should be automatically hidden when the user * clicks outside of it * @param modal <code>true</code> if keyboard and mouse events for widgets not contained by the * dialog should be ignored */ public MyDialogBox(boolean autoHide, boolean modal) { super(autoHide, modal); dock = new HorizontalPanel(); dock.add(caption); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(0); dock.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT); listener = new DialogListener(this); minimiseBtn.addClickListener(listener); maximiseBtn.addClickListener(listener); closeBtn.addClickListener(listener); hp.add(minimiseBtn); hp.add(maximiseBtn); hp.add(closeBtn); dock.add(hp); panel.add(dock); panel.setHeight("100%"); panel.setSpacing(0); sp = new ScrollPanel(); panel.add(sp); super.setWidget(panel); setStyleName("gwt-DialogBox"); dock.setStyleName("Caption"); caption.addMouseListener(this); }
public AppointmentFormPage() { popupPanel = new PopupPanel(true); popupPanel.add(uiBinder.createAndBindUi(this)); close.addClickHandler(closeHandler()); cancel.addClickHandler(closeHandler()); submit.addClickHandler(createSaveHandler()); }
private void createMenu(Date value) { popupPanel = new ContextMenuPopupPanel(grid); menu = new MenuBar(true); menu.setAutoOpen(false); menu.addStyleName(ContextMenuPopupPanel.RESOURCES.style().bCellContextMenu()); menu.addItem(CONSTANTS.lastYr(), lastYearCommand); menu.addItem(CONSTANTS.thisYr(), thisYearCommand); menu.addItem(CONSTANTS.lastQr(), lastQrCommand); menu.addItem(CONSTANTS.thisQr(), thisQrCommand); if (value != null) { menu.addSeparator(); menu.addItem(CONSTANTS.inYr(DateUtils.getYear(value)), inYearCommand); menu.addItem( CONSTANTS.inQrYr(QUARTERS[DateUtils.getMonth(value) / 3], DateUtils.getYear(value)), inQrYrCommand); menu.addItem( CONSTANTS.inMnYr( Integer.toString(DateUtils.getMonth(value) + 1), DateUtils.getYear(value)), inMnYrCommand); menu.addItem(CONSTANTS.date(DateUtils.dateToString(value)), inDayCommand); } popupPanel.add(menu); /* popupPanel.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { if (!event.isAutoClosed()) { if (lastParent != null) { lastParent.focus(); } } lastParent = null; } });*/ }
/** Creates a new context menu. */ public ContextMenu() { popupPanel = new PopupPanel(true); // autoHide menuBar = new MenuBar(true); menuBar.setStylePrimaryName("ode-ContextMenu"); popupPanel.add(menuBar); }
private void showSelectRefreshIntervalPopup( final int left, final int top, final Button refreshIntervalSelector) { VerticalPanel popupContent = new VerticalPanel(); // int configuredSeconds = presenter.getAutoRefreshSeconds(); int configuredSeconds = view.getRefreshValue(); if (configuredSeconds > 0) { updateRefreshInterval(true, configuredSeconds); } else { updateRefreshInterval(false, 0); } RadioButton oneMinuteRadioButton = createTimeSelectorRadioButton( 60, "1 Minute", configuredSeconds, refreshIntervalSelector, popupContent); RadioButton fiveMinuteRadioButton = createTimeSelectorRadioButton( 300, "5 Minutes", configuredSeconds, refreshIntervalSelector, popupContent); RadioButton tenMinuteRadioButton = createTimeSelectorRadioButton( 600, "10 Minutes", configuredSeconds, refreshIntervalSelector, popupContent); popupContent.add(oneMinuteRadioButton); popupContent.add(fiveMinuteRadioButton); popupContent.add(tenMinuteRadioButton); Button resetButton = new Button("Disable Autorefresh"); resetButton.setSize(ButtonSize.MINI); resetButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { updateRefreshInterval(false, 0); view.saveRefreshValue(0); refreshIntervalSelector.setActive(false); popup.hide(); } }); popupContent.add(resetButton); popup.setWidget(popupContent); popup.show(); int finalLeft = left - popup.getOffsetWidth(); popup.setPopupPosition(finalLeft, top); }
/** Parses the current date box's value and shows that date. */ public void showDatePicker() { Date current = parseDate(false); if (current == null) { current = new Date(); } picker.setCurrentMonth(current); popup.showRelativeTo(this); }
private void closeParent() { for (Widget w = getParent(); w != null; w = w.getParent()) { if (w instanceof PopupPanel) { ((PopupPanel) w).hide(true); break; } } }