private void resizeHeightSuggestor() {
   if (suggestor != null) {
     RootPanel rp = RootPanel.get();
     int h = rp.getOffsetHeight() - 200;
     suggestor.setHeightTo(h);
   }
 }
  public void createSuggestor(int x, int y, String query) {

    /*
     * Register coordinates
     */
    this.x = x;
    this.y = y;

    /*
     * Remove suggestor from root panel
     */
    RootPanel rp = RootPanel.get();

    if (suggestor != null) {
      rp.remove(suggestor);

      suggestor.destroy();
      suggestor = null;
    }

    /*
     * Build requestor
     */
    // buildSuggestorAsync(query);
    buildSuggestorSync(query);
  }
Exemple #3
0
 public void onModuleLoad() {
   RootPanel root = RootPanel.get();
   root.add(view);
   root.addDomHandler(view, KeyDownEvent.getType());
   controller.initAndStartWith(clock);
   view.initAndRender();
 }
Exemple #4
0
  @SuppressWarnings("deprecation")
  private void intAuthorizedUserGUI() {
    final ClientFactory clientFactory = GWT.create(ClientFactory.class);
    SiteHeader header = clientFactory.getHeader();
    // user.setAdmin(true);
    if (user.getAdmin()) {
      header.setVisibleAdminButtons();
      header.setVisibleOperatorButtons();
    } else {
      header.setVisibleOperatorButtons(user.getRoles());
    }
    header.setVisibleFooterAndHeader();
    RootPanel rootLayoutPanel = RootPanel.get("container");
    rootLayoutPanel.add(contentPanel);
    contentPanel.setStyleName("content-container");

    ActivityMapper activityMapper = new CustomActivityMapper(clientFactory);
    ActivityManager activityManager =
        new ActivityManager(activityMapper, clientFactory.getEventBus());
    activityManager.setDisplay(contentPanel);

    PlaceHistoryHandler historyHandler =
        new PlaceHistoryHandler((PlaceHistoryMapper) GWT.create(CustomPlaceHistoryMapper.class));
    historyHandlerRegistration =
        historyHandler.register(
            clientFactory.getPlaceController(), clientFactory.getEventBus(), new AboutPagePlace());
    historyHandler.handleCurrentHistory();
    setWaitingBlockVisible(false);
  }
Exemple #5
0
  public void init(String rootPanelId, ApplicationConnection applicationConnection) {
    DOM.sinkEvents(getWidget().getElement(), Event.ONKEYDOWN | Event.ONSCROLL);

    // iview is focused when created so element needs tabIndex
    // 1 due 0 is at the end of natural tabbing order
    DOM.setElementProperty(getWidget().getElement(), "tabIndex", "1");

    RootPanel root = RootPanel.get(rootPanelId);

    // Remove the v-app-loading or any splash screen added inside the div by
    // the user
    root.getElement().setInnerHTML("");

    String themeName = applicationConnection.getConfiguration().getThemeName();
    // Remove chars that are not suitable for style names
    themeName = themeName.replaceAll("[^a-zA-Z0-9]", "");
    root.addStyleName(themeName);

    root.add(getWidget());

    if (applicationConnection.getConfiguration().isStandalone()) {
      // set focus to iview element by default to listen possible keyboard
      // shortcuts. For embedded applications this is unacceptable as we
      // don't want to steal focus from the main page nor we don't want
      // side-effects from focusing (scrollIntoView).
      getWidget().getElement().focus();
    }
  }
  // PostData page contains a list of Posts
  //  Created when user clicks "View Posts"
  public void viewPostData(List<PostData> posts) {
    if (posts == null) return;

    RootPanel rootPanel = RootPanel.get();
    rootPanel.clear();
    makeMenuBar(rootPanel);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    rootPanel.add(horizontalPanel, 10, 79);

    makeSideBar(horizontalPanel);

    VerticalPanel dataListPanel = new VerticalPanel();
    horizontalPanel.add(dataListPanel);

    FlowPanel flowPanel = new FlowPanel();
    dataListPanel.add(flowPanel);

    Label programTitlebar = new Label("GusList");
    programTitlebar.addStyleName("appTitleBar");
    programTitlebar.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    flowPanel.add(programTitlebar);

    makePostTable(posts, flowPanel, dataListPanel);
  }
  /** This is the entry point method. */
  @Override
  public void onModuleLoad() {

    FormUtil.setupUncaughtExceptionHandler();

    FormUtil.retrieveUserDivParameters();

    Context.startup();

    // FormDesignerWidget designer = new FormDesignerWidget(true,true,true);

    // Hook the window resize event, so that we can adjust the UI.
    Window.addResizeHandler(this);

    // Get rid of scrollbars, and clear out the window's built-in margin,
    // because we want to take advantage of the entire client area.
    Window.enableScrolling(false);
    Window.setMargin("0px");

    // Different themes use different background colors for the body
    // element, but IE only changes the background of the visible content
    // on the page instead of changing the background color of the entire
    // page. By changing the display style on the body element, we force
    // IE to redraw the background correctly.
    RootPanel.getBodyElement().getStyle().setProperty("display", "none");
    RootPanel.getBodyElement().getStyle().setProperty("display", "");

    // Finally, add the designer widget to the RootPanel, so that it will be
    // displayed.
    RootPanel.get().add(loginView);

    FormUtil.dlg
        .hide(); // Temporary fix This comes from the form designer where it loads and never closes
  }
  @UiHandler("Deconnexion")
  void onDeconnexionClick(ClickEvent event) {

    RootPanel.get().clear();
    page_connexion p_a = new page_connexion();
    RootPanel.get().add(p_a);
  }
  @UiHandler("ModifierInfos")
  void onModifierInfosClick(ClickEvent event) {

    RootPanel.get().clear();
    ModifierMesInfos p_a = new ModifierMesInfos();
    RootPanel.get().add(p_a);
  }
Exemple #10
0
  public RenderSpace getAllocatedSpace(Widget child) {
    Size popupExtra = calculatePopupExtra();

    return new RenderSpace(
        RootPanel.get().getOffsetWidth() - popupExtra.getWidth(),
        RootPanel.get().getOffsetHeight() - popupExtra.getHeight());
  }
Exemple #11
0
 private void finalizeFileTableInit() {
   files = new FileTable();
   final RootPanel filePanel = RootPanel.get("fileTable");
   filePanel.add(files);
   connectOutputLocationAndFileTable();
   connectTitleAndFileTable();
 }
  private static void init() {
    showProfileSearches();

    searchInfos = RootPanel.get("profileSearches_searchInfos");
    clearSearches = RootPanel.get("profileSearches_clearSearches");
    clearSearches.addDomHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "wait");

            if (clearSearches.getElement().getClassName().contains("disabled")) {
              return;
            }
            userService.clearSavedSearches(
                GWTClient.getCurrentUser().getId(),
                new AsyncCallback<Void>() {
                  @Override
                  public void onFailure(Throwable caught) {
                    DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "default");
                    Window.alert("There was an error while clearing your cart.");
                  }

                  @Override
                  public void onSuccess(Void result) {
                    DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "default");
                    refreshSearches();
                  }
                });
          }
        },
        ClickEvent.getType());
    setSearchInfos();
  }
Exemple #13
0
  public void initialize() {
    customSqlBox.setSize("50em", "5em");
    quickReferenceLink.addClickListener(this);
    showHideControlsLink.addClickListener(this);

    filterList = new WidgetList<TestFilterWidget>(filterFactory);
    Panel titlePanel = new HorizontalPanel();
    titlePanel.add(getFieldLabel("Test attributes:"));
    titlePanel.add(
        new HTML(
            "&nbsp;<a href=\""
                + WIKI_URL
                + "#attribute_filtering\" "
                + "target=\"_blank\">[?]</a>"));
    Panel attributeFilters = new VerticalPanel();
    attributeFilters.setStyleName("box");
    attributeFilters.add(titlePanel);
    attributeFilters.add(filterList);

    Panel commonFilterPanel = new VerticalPanel();
    commonFilterPanel.add(customSqlBox);
    commonFilterPanel.add(attributeFilters);
    commonFilterPanel.add(showInvalid);
    RootPanel.get("common_filters").add(commonFilterPanel);
    RootPanel.get("common_quick_reference").add(quickReferenceLink);
    RootPanel.get("common_show_hide_controls").add(showHideControlsLink);
    generateQuickReferencePopup();
  }
  /** Log a user off */
  public void logout() {
    loginButton.setText("Login");
    RootPanel.get().clear();
    RootPanel.get().add(this);

    // Window.alert("( o ) ( o )  HONEY T**S!!!");
  }
  @Override
  public void onModuleLoad() {

    // Add the chat widget
    RootPanel panel = RootPanel.get("ChatWidget");
    panel.add(new ChatWidget());
  }
Exemple #16
0
  public void run(final RootPanel rp, final String nick) {

    if (Cookies.getCookie(nick) == null) Cookies.setCookie(nick, "" + 0);

    cl.setPageSize(500);

    final Button sendMessage =
        new Button(
            "sendMessage",
            new ClickHandler() {

              public void onClick(ClickEvent event) {

                if (!message.getText().equals("")) {
                  new Post().postJson(SERVERURL, nick.toString(), message.getText());
                  message.setText("");
                }
              }
            });

    rp.get("mainDiv2").setVisible(true);
    message.getElement().setAttribute("placeholder", "Introduce your message");
    message.getElement().setAttribute("id", "message");

    cl.getElement().setAttribute("id", "chatBox");

    sendMessage.getElement().setAttribute("id", "sendMessage");
    sendMessage.setText("Send");

    vp.getElement().setAttribute("id", "verticalPanel");
    hp.getElement().setAttribute("id", "horizontalPanel");

    panel.getElement().setAttribute("id", "scroller");

    hp.add(message);
    hp.add(sendMessage);
    panel.add(cl);
    vp.add(panel);

    vp.add(hp);
    rp.get("mainDiv2").add(vp);

    Timer t =
        new Timer() {
          @Override
          public void run() {
            getMessages();

            if (chatList != null && Integer.parseInt(Cookies.getCookie(nick)) < chatList.size()) {
              cl.setRowCount(chatList.size() + 1, true);
              cl.setRowData(
                  Integer.parseInt(Cookies.getCookie(nick)),
                  chatList.subList(Integer.parseInt(Cookies.getCookie(nick)), chatList.size()));
              panel.setVerticalScrollPosition(panel.getMaximumVerticalScrollPosition() - 1);
              Cookies.setCookie(nick, "" + chatList.size());
            }
          }
        };
    t.scheduleRepeating(1000);
  }
Exemple #17
0
 @Override
 public void hide() {
   for (final HideableListener listener : listeners) listener.hide();
   RootPanel.get("slideInWindowsBackDiv").removeStyleName("dim");
   RootPanel.get("slideInWindowsBackDiv").getElement().getStyle().setZIndex(-80000);
   animateHide(AnimationEffect.FLY);
 }
Exemple #18
0
  public void open() {
    RootPanel.get("slideInWindowsBackDiv").addStyleName("dim");
    int windowZIndex = getZIndex();
    RootPanel.get("slideInWindowsBackDiv").getElement().getStyle().setZIndex(windowZIndex - 1);

    animateShow(AnimationEffect.FLY);
  }
  /**
   * This is the entry point method, meaning the first method called when this module is
   * initialized.
   */
  public void onModuleLoad() {
    collab = new Collaborator(collabService);

    // Make the loading display invisible and the application visible.
    RootPanel.get("application").add(collab);
    RootPanel.get("loading").setVisible(false);
  }
  @UiHandler("MesAdresses")
  void onMesAdressesClick(ClickEvent event) {

    RootPanel.get().clear();
    PageMesAdresses p_a = new PageMesAdresses();
    RootPanel.get().add(p_a);
  }
  public void goToPage2() {
    RootPanel.get("content").clear();
    RootPanel.get("content").add(page2);
    RootPanel.get("footer").clear();
    HTML footerimage = new HTML("<img src=\"images/3.jpg\">");

    RootPanel.get("footer").add(footerimage);
  }
 public void startEngine() {
   if (!running) {
     RootPanel.get().add(new CheckBox("A Checkbox"));
     RootPanel.get().add(new DatePicker());
     RootPanel.get().add(new RichTextArea());
     running = true;
   }
 }
Exemple #23
0
 private void openView(String token) {
   RootPanel.get().clear();
   if ("admin".equals(token)) {
     RootPanel.get().add(new AdminView());
   } else {
     RootPanel.get().add(new LoginView());
   }
 }
Exemple #24
0
  private void initGUI(final GUIInfo info) {
    // Prepare a value manager that will include all forms spanned in each
    // tab
    vm = new ValuesManager();

    // Create all the tabs each one for a specific setup step
    tabs = new TabSet();
    tabs.setWidth(500);
    tabs.setHeight(250);

    Tab registrationTab = setupRegistration(vm);
    Tab repositoryTab = setupRepository(vm);
    Tab databaseTab = setupDatabase(vm);
    Tab languageTab = setupLanguage(vm);
    Tab smtpTab = setupSmtp(vm);
    tabs.setTabs(registrationTab, repositoryTab, databaseTab, languageTab, smtpTab);

    // This is the button used to confirm each step
    submit = new IButton();
    submit.setTitle(I18N.message("next"));
    submit.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onSubmit(info);
          }
        });

    // Prepare the heading panel with Logo and Title
    // Prepare the logo image to be shown inside the login form
    Label header = new Label(I18N.message("setup"));
    header.setStyleName("setupHeader");
    header.setIcon(Util.brandUrl("logo.png"));
    header.setIconWidth(205);
    header.setIconHeight(40);
    header.setHeight(45);

    // Prepare a panel to layout setup components
    VLayout layout = new VLayout();
    layout.setHeight(500);
    layout.setWidth(400);
    layout.setMembersMargin(5);
    layout.addMember(header);
    layout.addMember(tabs);
    layout.addMember(submit);

    // Panel for horizontal centering
    VLayout vPanel = new VLayout();
    vPanel.setDefaultLayoutAlign(Alignment.CENTER);
    vPanel.setWidth100();
    vPanel.setHeight(300);
    vPanel.addMember(layout);

    RootPanel.get().add(vPanel);

    // Remove the loading frame
    RootPanel.getBodyElement().removeChild(RootPanel.get("loadingWrapper").getElement());
  }
  private void buildSuggestorSync(String query) {

    suggestor = new SuggestImpl(query);

    RootPanel rp = RootPanel.get();
    rp.add(suggestor);

    moveSuggestorTo(x, y);
  }
Exemple #26
0
 public void onModuleLoad() {
   final ScrollPanel contentPanel = new ScrollPanel();
   contentPanel.setStyleName("content_panel");
   RoundedPanel roundedContentPanel = new RoundedPanel(contentPanel, RoundedPanel.ALL, 5);
   roundedContentPanel.setStyleName("rounded_content_panel");
   MenuBar menuBar = createMenuBar(contentPanel);
   RoundedPanel roundedMenuBar = new RoundedPanel(menuBar, RoundedPanel.ALL, 5);
   RootPanel.get().add(roundedMenuBar);
   RootPanel.get().add(roundedContentPanel);
 }
  public void onModuleLoad() {

    addInfoMsg();

    RootPanel.get("gwtIntegrationSampleDiv").add(makeDraggable(createMenuBar(), "menu"));
    RootPanel.get("gwtIntegrationSampleDiv").add(makeDraggable(createDecoratedForm(), "form"));
    RootPanel.get("gwtIntegrationSampleDiv").add(makeDraggable(createDatePanel(), "datePicker"));
    RootPanel.get("gwtIntegrationSampleDiv").add(makeDraggable(createTabPanel(), "tabPanel"));
    RootPanel.get("gwtIntegrationSampleDiv").add(makeDraggable(createDynamicTree(), "tree"));
  }
  public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get();

    Image img = new Image("/PokerLogo.jpg");
    img.setSize("200px", "100px");
    rootPanel.add(img);

    LoginWidget login = new LoginWidget();
    login.setStyleName("LoginWidget");
    rootPanel.add(login);
  }
Exemple #29
0
  //  Welcome Page is main app page
  public void viewWelcomePage() {
    RootPanel rootPanel = RootPanel.get();
    rootPanel.clear();
    makeMenuBar(rootPanel);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    rootPanel.add(horizontalPanel, 10, 79);
    horizontalPanel.setSize("412px", "211px");

    makeSideBar(horizontalPanel);
  }
  /** This is the entry point method. */
  public void onModuleLoad() {
    sendButton = new Button("Send");
    nameField = new TextBox();
    nameField.setText("GWT User");
    errorLabel = new Label();

    // We can add style names to widgets
    sendButton.addStyleName("sendButton");

    // Add the nameField and sendButton to the RootPanel
    // Use RootPanel.get() to get the entire body element
    RootPanel.get("nameFieldContainer").add(nameField);
    RootPanel.get("sendButtonContainer").add(sendButton);
    RootPanel.get("errorLabelContainer").add(errorLabel);

    // Focus the cursor on the name field when the app loads
    nameField.setFocus(true);
    nameField.selectAll();

    // Create the popup dialog box
    dialogBox = new DialogBox();
    dialogBox.setText("Remote Procedure Call");
    dialogBox.setAnimationEnabled(true);
    closeButton = new Button("Close");
    // We can set the id of a widget by accessing its Element
    closeButton.getElement().setId("closeButton");
    textToServerLabel = new Label();
    serverResponseLabel = new HTML();
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.addStyleName("dialogVPanel");
    dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
    dialogVPanel.add(textToServerLabel);
    dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
    dialogVPanel.add(serverResponseLabel);
    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel);

    // Add a handler to close the DialogBox
    final ClickHandler buttonClickHandler =
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            dialogBox.hide();
            sendButton.setEnabled(true);
            sendButton.setFocus(true);
          }
        };
    closeButton.addClickHandler(buttonClickHandler);

    // Add a handler to send the name to the server
    ChangeEventHandler handler = new ChangeEventHandler();
    sendButton.addClickHandler(handler);
    nameField.addKeyUpHandler(handler);
  }