/** 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
  }
Exemple #2
0
  /**
   * This method constructs the application user interface by instantiating controls and hooking up
   * event handler.
   */
  public void init() {
    // Inject global styles.
    GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected();

    // Create the UI defined in Mail.ui.xml.
    DockLayoutPanel outer = binder.createAndBindUi(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");

    // Special-case stuff to make topPanel overhang a bit.
    Element topElem = outer.getWidgetContainerElement(topPanel);
    topElem.getStyle().setZIndex(2);
    topElem.getStyle().setOverflow(Overflow.VISIBLE);

    // Listen for item selection, displaying the currently-selected item in
    // the detail area.
    //    mailList.setListener(new MailList.Listener() {
    //      public void onItemSelected(MailItem item) {
    //        mailDetail.setItem(item);
    //      }
    //    });

    // Add the outer panel to the RootLayoutPanel, so that it will be
    // displayed.

    // MenuMain PRINCIPAL
    RootLayoutPanel.get().add(outer);
  }
Exemple #3
0
 private void style() {
   // TODO Auto-generated method stub
   Window.setMargin("0px");
   /*
    * int height = Window.getClientHeight(); container.setHeight((height -
    * 42) + "px");
    */
   // main.getElement().getStyle().setBackgroundColor("#d3d6db");
 }
  @Test
  public void margin() {
    // Arrange
    Document.get().getBody().setAttribute("style", "");

    // Act
    Window.setMargin("13px");

    // Assert
    assertEquals("13px", Document.get().getBody().getStyle().getMargin());
    assertEquals("margin: 13px; ", Document.get().getBody().getAttribute("style"));
  }
  public void onModuleLoad() {
    DockLayoutPanel outer = binder.createAndBindUi(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");

    mainRotor.setRotor(myRotor);

    // Add the outer panel to the RootLayoutPanel, so that it will be
    // displayed.
    RootLayoutPanel root = RootLayoutPanel.get();

    root.add(outer);
    root.forceLayout();
    mainRotor.moveBlades();
  }
Exemple #6
0
  @Override
  public void onModuleLoad() {
    // Setup the language for localization
    RequestInfo loc = WindowUtils.getRequestInfo();

    // Tries to capture locale parameter
    String lang;
    if (loc.getParameter(Constants.LOCALE) != null
        && !loc.getParameter(Constants.LOCALE).equals("")) {
      lang = loc.getParameter(Constants.LOCALE);
    } else {
      // First we initialize language values
      lang = Util.getBrowserLanguage();
    }
    I18N.setLocale(lang);

    // Get grid 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");

    infoService.getInfo(
        I18N.getLocale(),
        new AsyncCallback<GUIInfo>() {
          @Override
          public void onFailure(Throwable error) {
            SC.warn(error.getMessage());
          }

          @Override
          public void onSuccess(GUIInfo info) {
            I18N.init(info);

            WindowUtils.setTitle(
                info.getProductName()
                    + " "
                    + info.getRelease()
                    + (info.getLicensee() != null
                        ? " - " + I18N.message("licensedto") + ": " + info.getLicensee()
                        : ""));
            initGUI(info);
          }
        });
  }
Exemple #7
0
  @Override
  public void onModuleLoad() {
    // Initialize the singleton before calling the constructors of the
    // various widgets that might call GSS.get().
    singleton = this;
    parseUserCredentials();

    topPanel = new TopPanel(GSS.images);
    topPanel.setWidth("100%");

    messagePanel.setWidth("100%");
    messagePanel.setVisible(false);

    search = new Search(images);
    searchStatus.add(search, DockPanel.WEST);
    searchStatus.add(userDetailsPanel, DockPanel.EAST);
    searchStatus.setCellHorizontalAlignment(userDetailsPanel, HasHorizontalAlignment.ALIGN_RIGHT);
    searchStatus.setCellVerticalAlignment(search, HasVerticalAlignment.ALIGN_MIDDLE);
    searchStatus.setCellVerticalAlignment(userDetailsPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    searchStatus.setWidth("100%");

    fileList = new FileList(images);

    searchResults = new SearchResults(images);

    // Inner contains the various lists.
    inner.sinkEvents(Event.ONCONTEXTMENU);
    inner.setAnimationEnabled(true);
    inner.getTabBar().addStyleName("gss-MainTabBar");
    inner.getDeckPanel().addStyleName("gss-MainTabPanelBottom");
    inner.add(
        fileList, createHeaderHTML(AbstractImagePrototype.create(images.folders()), "Files"), true);

    inner.add(
        groups, createHeaderHTML(AbstractImagePrototype.create(images.groups()), "Groups"), true);
    inner.add(
        searchResults,
        createHeaderHTML(AbstractImagePrototype.create(images.search()), "Search Results"),
        true);
    // inner.add(new CellTreeView(images),
    // createHeaderHTML(AbstractImagePrototype.create(images.search()), "Cell tree sample"), true);
    inner.setWidth("100%");
    inner.selectTab(0);

    inner.addSelectionHandler(
        new SelectionHandler<Integer>() {

          @Override
          public void onSelection(SelectionEvent<Integer> event) {
            int tabIndex = event.getSelectedItem();
            //				TreeItem treeItem = GSS.get().getFolders().getCurrent();
            switch (tabIndex) {
              case 0:
                //						Files tab selected
                // fileList.clearSelectedRows();
                fileList.updateCurrentlyShowingStats();
                break;
              case 1:
                //						Groups tab selected
                groups.updateCurrentlyShowingStats();
                updateHistory("Groups");
                break;
              case 2:
                //						Search tab selected
                searchResults.clearSelectedRows();
                searchResults.updateCurrentlyShowingStats();
                updateHistory("Search");
                break;
            }
          }
        });
    //		If the application starts with no history token, redirect to a new "Files" state
    String initToken = History.getToken();
    if (initToken.length() == 0) History.newItem("Files");
    //		   Add history listener to handle any history events
    History.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(ValueChangeEvent<String> event) {
            String tokenInput = event.getValue();
            String historyToken = handleSpecialFolderNames(tokenInput);
            try {
              if (historyToken.equals("Search")) inner.selectTab(2);
              else if (historyToken.equals("Groups")) inner.selectTab(1);
              else if (historyToken.equals("Files") || historyToken.length() == 0)
                inner.selectTab(0);
              else {
                /*TODO: CELLTREE
                PopupTree popupTree = GSS.get().getFolders().getPopupTree();
                TreeItem treeObj = GSS.get().getFolders().getPopupTree().getTreeItem(historyToken);
                SelectionEvent.fire(popupTree, treeObj);
                */
              }
            } catch (IndexOutOfBoundsException e) {
              inner.selectTab(0);
            }
          }
        });

    // Add the left and right panels to the split panel.
    splitPanel.setLeftWidget(treeView);
    splitPanel.setRightWidget(inner);
    splitPanel.setSplitPosition("25%");
    splitPanel.setSize("100%", "100%");
    splitPanel.addStyleName("gss-splitPanel");

    // Create a dock panel that will contain the menu bar at the top,
    // the shortcuts to the left, the status bar at the bottom and the
    // right panel taking the rest.
    VerticalPanel outer = new VerticalPanel();
    outer.add(topPanel);
    outer.add(searchStatus);
    outer.add(messagePanel);
    outer.add(splitPanel);
    outer.add(statusPanel);
    outer.setWidth("100%");
    outer.setCellHorizontalAlignment(messagePanel, HasHorizontalAlignment.ALIGN_CENTER);

    outer.setSpacing(4);

    // Hook the window resize event, so that we can adjust the UI.
    Window.addResizeHandler(this);
    // Clear out the window's built-in margin, because we want to take
    // advantage of the entire client area.
    Window.setMargin("0px");
    // Finally, add the outer panel to the RootPanel, so that it will be
    // displayed.
    RootPanel.get().add(outer);
    // Call the window resized handler to get the initial sizes setup. Doing
    // this in a deferred command causes it to occur after all widgets'
    // sizes have been computed by the browser.
    DeferredCommand.addCommand(
        new Command() {

          @Override
          public void execute() {
            onWindowResized(Window.getClientHeight());
          }
        });
  }