Пример #1
0
  /**
   * 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("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);
  }
Пример #4
0
  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();
  }
  @UiHandler("MesAdresses")
  void onMesAdressesClick(ClickEvent event) {

    RootPanel.get().clear();
    PageMesAdresses p_a = new PageMesAdresses();
    RootPanel.get().add(p_a);
  }
Пример #6
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);
  }
Пример #7
0
  /** Log a user off */
  public void logout() {
    loginButton.setText("Login");
    RootPanel.get().clear();
    RootPanel.get().add(this);

    // Window.alert("( o ) ( o )  HONEY T**S!!!");
  }
Пример #8
0
  public RenderSpace getAllocatedSpace(Widget child) {
    Size popupExtra = calculatePopupExtra();

    return new RenderSpace(
        RootPanel.get().getOffsetWidth() - popupExtra.getWidth(),
        RootPanel.get().getOffsetHeight() - popupExtra.getHeight());
  }
Пример #9
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);
 }
Пример #10
0
  public void open() {
    RootPanel.get("slideInWindowsBackDiv").addStyleName("dim");
    int windowZIndex = getZIndex();
    RootPanel.get("slideInWindowsBackDiv").getElement().getStyle().setZIndex(windowZIndex - 1);

    animateShow(AnimationEffect.FLY);
  }
Пример #11
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();
  }
Пример #12
0
  private void initOutputLocation() {
    // currently, the save location is populated deterministically by the combination of
    // the users's input

    final RootPanel outputPanel = RootPanel.get("output");
    output = new TextBox();
    output.setVisibleLength(150);
    output.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(final ChangeEvent event) {
            outputPathUserSpecified = true;
            updateOutputLocation();
          }
        });
    outputPanel.add(output);

    final RootPanel outputWarning = RootPanel.get("outputWarning");
    outputValidationPanel = new ValidationPanel(2);

    outputWarning.add(outputValidationPanel);

    connectOutputLocationAndFileTable();
    // Fire userChanged to get the output location updated
    userChanged();
    updateOutputLocation();
  }
  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);
  }
Пример #14
0
 private void openView(String token) {
   RootPanel.get().clear();
   if ("admin".equals(token)) {
     RootPanel.get().add(new AdminView());
   } else {
     RootPanel.get().add(new LoginView());
   }
 }
Пример #15
0
 public void startEngine() {
   if (!running) {
     RootPanel.get().add(new CheckBox("A Checkbox"));
     RootPanel.get().add(new DatePicker());
     RootPanel.get().add(new RichTextArea());
     running = true;
   }
 }
Пример #16
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());
  }
Пример #17
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"));
  }
  /** 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);
  }
Пример #20
0
  private void initUI() {
    RootPanel.get().setSize("100%", "100%");
    // Add augmented reality panel
    this.arPanel = new ARPanel();
    this.arPanel.setSize("100%", "100%");
    RootPanel.get().add(this.arPanel);

    this.cameraOrientationLabel = new Label();
    RootPanel.get().add(this.cameraOrientationLabel);

    this.deviceOrientationLabel = new Label();
    RootPanel.get().add(this.deviceOrientationLabel);
  }
Пример #21
0
  /**
   * Sets the body of the website to a certain view
   *
   * @param body enum corresponding to view in <code>allViews HashMap</code>
   */
  public void setBody(ViewEnum body) {
    View view;
    try {
      view = allViews.get(body);
      view.updateView();
      view.updateStatus();
    } catch (RuntimeException r) {
      throw new RuntimeException("Unknown view TODO: " + body.toString());
    }

    RootPanel.get("body").clear();
    RootPanel.get("body").add(view);
  }
Пример #22
0
  @Override
  public void close() {
    RootPanel.get("slideInWindowsBackDiv").removeStyleName("dim");
    RootPanel.get("slideInWindowsBackDiv").getElement().getStyle().setZIndex(-80000);

    GHAUiHelper.removeGHAResizeHandler(this);
    hide(
        new AnimationCallback() {

          @Override
          public void execute(boolean earlyFinish) {
            destroy();
          }
        });
  }
  /**
   * This method is called when GWT loads the Notes application (as defined in the Notes.gwt.xml).
   */
  public void onModuleLoad() {

    final HorizontalPanel mainpanel = new HorizontalPanel();

    final HTML displayTitle = new HTML("Existing Notes");
    displayTitle.setStyleName("displayTitle");
    final HTML entryTitle = new HTML("Create A Note");
    entryTitle.setStyleName("entryTitle");

    final VerticalPanel displayPanel = new VerticalPanel();
    displayPanel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    displayPanel.setStyleName("displayPanel");
    displayPanel.add(displayTitle);

    final VerticalPanel entryPanel = new VerticalPanel();
    entryPanel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    entryPanel.setStyleName("entryPanel");
    entryPanel.add(entryTitle);

    displayPanel.add(notesPanel);

    final VerticalPanel form = createForm();
    entryPanel.add(form);

    mainpanel.add(displayPanel);
    mainpanel.add(entryPanel);

    RootPanel.get("notes").add(mainpanel);

    getNotes();
  }
Пример #24
0
  /* (non-Javadoc)
   * @see com.google.gwt.core.client.EntryPoint#onModuleLoad()
   */
  @Override
  public void onModuleLoad() {
    // initialization
    defaultPlace = new HistoryPlace();
    EventBus eventBus = clientFactory.getEventBus();
    PlaceController placeController = clientFactory.getPlaceController();

    // Start ActivityManager for the main widget with our ActivityMapper
    ActivityMapper activityMapper = new HistoryActivityMapper(clientFactory);
    ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
    activityManager.setDisplay(appWidget);

    // Start PlaceHistoryHandler with our PlaceHistoryMapper
    HistoryPlaceHistoryMapper historyMapper = GWT.create(HistoryPlaceHistoryMapper.class);
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
    historyHandler.register(placeController, eventBus, defaultPlace);

    // Start the events handler
    new HistoryEventsHandler(clientFactory);

    // build UI
    RootPanel.get().add(appWidget);

    // Goes to the place represented on URL else default place
    historyHandler.handleCurrentHistory();

    // timer for player update
    eventBus.fireEvent(new RefreshHistoryEvent());
  }
Пример #25
0
  public void onModuleLoad() {
    // Make some text boxes. The password text box is identical to the text
    // box, except that the input is visually masked by the browser.
    PasswordTextBox ptb = new PasswordTextBox();
    TextBox tb = new TextBox();

    // TODO(ECC) must be tested.
    tb.addKeyPressHandler(
        new KeyPressHandler() {

          public void onKeyPress(KeyPressEvent event) {
            if (!Character.isDigit(event.getCharCode())) {
              ((TextBox) event.getSource()).cancelKey();
            }
          }
        });

    // Let's make an 80x50 text area to go along with the other two.
    TextArea ta = new TextArea();
    ta.setCharacterWidth(80);
    ta.setVisibleLines(50);

    // Add them to the root panel.
    VerticalPanel panel = new VerticalPanel();
    panel.add(tb);
    panel.add(ptb);
    panel.add(ta);
    RootPanel.get().add(panel);
  }
Пример #26
0
  @Override
  public void onModuleLoad() {

    // Add the chat widget
    RootPanel panel = RootPanel.get("ChatWidget");
    panel.add(new ChatWidget());
  }
Пример #27
0
  /**
   * Displays this menu at a specific xy position.
   *
   * @param x the x coordinate
   * @param y the y coordinate
   */
  public void showAt(int x, int y) {
    MenuEvent me = new MenuEvent(this);
    if (fireEvent(Events.BeforeShow, me)) {
      RootPanel.get().add(this);

      el().makePositionable(true);

      onShow();
      el().updateZIndex(0);

      showing = true;
      doAutoSize();

      if (constrainViewport) {
        Point p = el().adjustForConstraints(new Point(x, y));
        x = p.x;
        y = p.y;
      }
      setPagePosition(x + XDOM.getBodyScrollLeft(), y + XDOM.getBodyScrollTop());
      if (enableScrolling) {
        constrainScroll(y);
      }

      el().show();
      eventPreview.add();

      if (focusOnShow) {
        focus();
      }

      fireEvent(Events.Show, me);
    }
  }
Пример #28
0
  /**
   * Displays this menu relative to another element.
   *
   * @param elem the element to align to
   * @param pos the {@link El#alignTo} anchor position to use in aligning to the element (defaults
   *     to defaultAlign)
   * @param offsets the menu align offsets
   */
  public void show(Element elem, String pos, int[] offsets) {
    MenuEvent me = new MenuEvent(this);
    if (fireEvent(Events.BeforeShow, me)) {
      RootPanel.get().add(this);

      el().makePositionable(true);

      onShow();
      el().updateZIndex(0);

      showing = true;
      doAutoSize();

      el().alignTo(elem, pos, offsets);

      if (enableScrolling) {
        constrainScroll(el().getY());
      }
      el().show();

      eventPreview.add();

      if (focusOnShow) {
        focus();
      }

      fireEvent(Events.Show, me);
    }
  }
Пример #29
0
  @Override
  public void onModuleLoad() {

    defaultPlace = new ProfilePlace("Profile");

    ClientFactory clientFactory = GWT.create(ClientFactory.class);
    EventBus eventBus = clientFactory.getEventBus();
    PlaceController placeController = clientFactory.getPlaceController();

    // Start ActivityManager for the main widget with our ActivityMapper
    ActivityMapper activityMapper = new AppActivityMapper(clientFactory);
    ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
    activityManager.setDisplay(appWidget);

    // Start PlaceHistoryHandler with our PlaceHistoryMapper
    AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class);
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
    historyHandler.register(placeController, eventBus, defaultPlace);

    // Header
    // DockLayoutPanel dlPanel = new DockLayoutPanel(Unit.EM);
    // dlPanel.addNorth(new HeaderViewImpl(), 5);
    // dlPanel.add(appWidget);
    RootPanel.get().add(appWidget);

    // RootPanel.get().add(appWidget);

    // Goes to the place represented on URL else default place
    historyHandler.handleCurrentHistory();
  }
Пример #30
0
  @PostConstruct
  public void init() {

    button.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            String s = message.getText();
            remoteService
                .call(
                    new RemoteCallback<String>() {
                      @Override
                      public void callback(String s) {
                        responseLabel.setText("Message from Server: " + s);
                      }
                    })
                .myMethod(s);
          }
        });

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.add(message);
    horizontalPanel.add(button);
    horizontalPanel.add(responseLabel);

    RootPanel.get().add(horizontalPanel);

    System.out.println("UI Constructed!");
  }