Example #1
0
  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();
 }
Example #3
0
  public void showPopup(boolean show) {
    if (popup.isShowing() == show) return;

    if (show) {
      popup.center();
    } else popup.hide();
  }
Example #4
0
 @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);
  }
Example #7
0
 @Override
 public void onBrowserEvent(Event event) {
   if (DOM.eventGetType(event) == Event.ONMOUSEDOWN && enabled) {
     setupPopup();
     popup.setPopupPosition(event.getClientX(), event.getClientY());
     popup.show();
   }
 }
Example #8
0
 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();
 }
Example #10
0
  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);
  }
Example #11
0
 @Override
 public void onClick(ClickEvent event) {
   if (!popup.isShowing()) {
     if (relativeTo == null) popup.showRelativeTo((Widget) event.getSource());
     else popup.showRelativeTo(relativeTo);
   } else {
     popup.hide();
   }
 }
Example #12
0
 public void setWaitVisible(boolean visible) {
   if (visible) {
     wait.setPopupPosition(bodyContainer.getAbsoluteLeft(), bodyContainer.getAbsoluteTop());
     wait.setPixelSize(bodyContainer.getOffsetWidth(), bodyContainer.getOffsetHeight());
     wait.show();
   } else {
     wait.hide();
   }
 }
Example #13
0
 private void handleQuickReferenceClick() {
   if (isQuickReferenceShowing()) {
     quickReferencePopup.hide();
     quickReferenceLink.setText(SHOW_QUICK_REFERENCE);
   } else {
     quickReferencePopup.setPopupPositionAndShow(this);
     quickReferenceLink.setText(HIDE_QUICK_REFERENCE);
   }
 }
Example #14
0
 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);
 }
Example #15
0
  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();
    }
  }
Example #16
0
 /** 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();
   }
 }
Example #17
0
  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);
 }
Example #19
0
 /** 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);
 }
Example #20
0
  /** 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);
   }
 }
Example #23
0
 /** 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);
  }
Example #25
0
 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;
       }
   });*/
 }
Example #27
0
  /** 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);
  }
Example #29
0
 /** 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);
 }
Example #30
0
 private void closeParent() {
   for (Widget w = getParent(); w != null; w = w.getParent()) {
     if (w instanceof PopupPanel) {
       ((PopupPanel) w).hide(true);
       break;
     }
   }
 }