Esempio n. 1
0
  /**
   * Sets content widget.
   *
   * @param widget content widget
   */
  public final void setContentWidget(Widget widget) {
    container.add(widget);
    for (FocusWidget focusWidget : UIUtil.getFocusableChildren(widget)) {
      focusWidget.addBlurHandler(blurHandler);
    }

    focusView();
  }
Esempio n. 2
0
  /** Redraws app for GUI (with menu) */
  public static void redrawGuiWithMenu() {

    bodySplitter.clear();
    bodySplitter.addSouth(ft, 23);
    bodySplitter.addWest(leftMenu, 280);
    bodySplitter.add(contentPanel);
    leftMenu.setHeight("100%");
    contentPanel.setHeight("100%");
  }
Esempio n. 3
0
  private void addQAPanel() {
    DockLayoutPanel qaDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    QATree qaTreeItem = new QATree();
    ScrollPanel qaTreeItemPanel = new ScrollPanel(qaTreeItem);

    qaDockLayoutPanel.add(qaTreeItemPanel);

    add(qaDockLayoutPanel, qaTreeItem.getHeaderHTML(), 2);
  }
Esempio n. 4
0
  private void addAdminPanel() {
    DockLayoutPanel adminDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    AdministrationTree deploymentTreeItem = new AdministrationTree();
    ScrollPanel adminTreeItemPanel = new ScrollPanel(deploymentTreeItem);

    adminDockLayoutPanel.add(adminTreeItemPanel);

    add(adminDockLayoutPanel, deploymentTreeItem.getHeaderHTML(), 2);
  }
Esempio n. 5
0
  private void addAdminPanel() {
    DockLayoutPanel browseDockLayoutPanel = new DockLayoutPanel(Unit.EM);

    AdminTree tree = new AdminTree();
    tree.setStyleName("lhs-Tree");
    ScrollPanel treePanel = new ScrollPanel(tree);
    browseDockLayoutPanel.add(treePanel);

    layout.add(browseDockLayoutPanel, Util.getHeaderHTML(images.config(), constants.admin()), 2);
  }
  protected void initDockLayoutPanel() {
    if (dockLayoutPanel != null) return;
    if (leftPanel == null) leftPanel = new LeftPanel(this, businessService);

    RootPanel.get().clear();
    dockLayoutPanel = new DockLayoutPanel(Unit.PX);

    dockLayoutPanel.addNorth(new TopBar(this), 25);
    dockLayoutPanel.addWest(leftPanel, 225);
    mainPanel = new MainPanel(this);
    dockLayoutPanel.add(mainPanel);
  }
Esempio n. 7
0
  private void addCategoriesPanel() {
    DockLayoutPanel browseDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    BrowseTree categoriesTreeItem = new BrowseTree();
    ScrollPanel categoriesTreeItemPanel = new ScrollPanel(categoriesTreeItem);

    if (CapabilitiesManager.getInstance().shouldShow(Capabilities.SHOW_CREATE_NEW_ASSET)) {
      browseDockLayoutPanel.addNorth(RulesNewMenu.getMenu(categoriesTreeItem), 2);
    }
    browseDockLayoutPanel.add(categoriesTreeItemPanel);

    add(browseDockLayoutPanel, categoriesTreeItem.getHeaderHTML(), 2);
  }
Esempio n. 8
0
  public ShellView() {
    shell = new DockLayoutPanel(Style.Unit.PX);

    header = new SimpleLayoutPanel();
    navigation = new SimpleLayoutPanel();
    content = new SimpleLayoutPanel();

    shell.addNorth(header, 75);
    shell.addWest(navigation, 275);
    shell.add(content);

    initWidget(shell);
  }
Esempio n. 9
0
  private void addDeploymentPanel() {
    DockLayoutPanel deploymentDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    DeploymentTree deploymentTreeItem = new DeploymentTree();
    ScrollPanel deploymentTreeItemPanel = new ScrollPanel(deploymentTreeItem);

    if (CapabilitiesManager.getInstance().shouldShow(Capabilities.SHOW_CREATE_NEW_ASSET)) {
      deploymentDockLayoutPanel.addNorth(DeploymentNewMenu.getMenu(deploymentTreeItem), 2);
    }

    deploymentDockLayoutPanel.add(deploymentTreeItemPanel);

    add(deploymentDockLayoutPanel, deploymentTreeItem.getHeaderHTML(), 2);
  }
    @Override
    protected void finalizeObject(DockLayoutPanel widget) {

      if (northWidget != null) {
        widget.addNorth(northWidget, northSize);
      }
      if (southWidget != null) {
        widget.addSouth(southWidget, southSize);
      }
      if (eastWidget != null) {
        widget.addEast(eastWidget, eastSize);
      }
      if (westWidget != null) {
        widget.addWest(westWidget, westSize);
      }
      for (Widget centerWidget : centerWidgets) {
        widget.add(centerWidget);
      }
    }
Esempio n. 11
0
    public UI() {
      DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);

      LayoutPanel northPanel = new LayoutPanel();

      this.topLabel = new Label();
      topLabel.setStyleName("cc-problemName", true);
      northPanel.add(topLabel);
      northPanel.setWidgetTopHeight(topLabel, 0.0, Unit.PX, 22.0, Unit.PX);
      northPanel.setWidgetLeftRight(topLabel, 0.0, Unit.PX, PageNavPanel.WIDTH_PX, Unit.PX);

      this.pageNavPanel = new PageNavPanel();
      northPanel.add(pageNavPanel);
      northPanel.setWidgetTopHeight(pageNavPanel, 0.0, Unit.PX, PageNavPanel.HEIGHT_PX, Unit.PX);
      northPanel.setWidgetRightWidth(pageNavPanel, 0.0, Unit.PX, PageNavPanel.WIDTH_PX, Unit.PX);

      dockLayoutPanel.addNorth(northPanel, PageNavPanel.HEIGHT_PX);

      LayoutPanel southPanel = new LayoutPanel();

      this.statusMessageView = new StatusMessageView();
      southPanel.add(statusMessageView);
      southPanel.setWidgetTopBottom(statusMessageView, 0.0, Unit.PX, 0.0, Unit.PX);
      southPanel.setWidgetLeftRight(statusMessageView, 0.0, Unit.PX, 0.0, Unit.PX);

      dockLayoutPanel.addSouth(southPanel, StatusMessageView.HEIGHT_PX);

      this.userProgressView = new UserProgressView();
      userProgressView.setViewSubmissionsCallback(
          new ICallback<Problem>() {
            @Override
            public void call(Problem value) {
              // Set the Problem. (The UserSelection should already be in the session.)
              getSession().add(value);

              // Switch to UserProblemSubmissionsPage
              getSession().get(PageStack.class).push(PageId.USER_PROBLEM_SUBMISSIONS);
            }
          });
      dockLayoutPanel.add(userProgressView);

      initWidget(dockLayoutPanel);
    }
Esempio n. 12
0
  private void addPackagesPanel() {
    DockLayoutPanel packageDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    final PackagesTree packagesTreeItem = new PackagesTree();
    ScrollPanel packagesTreeItemPanel = new ScrollPanel(packagesTreeItem);

    if (CapabilitiesManager.getInstance().shouldShow(Capabilities.SHOW_CREATE_NEW_ASSET)) {
      packageDockLayoutPanel.addNorth(PackagesNewMenu.getMenu(packagesTreeItem), 2);
    }
    packageDockLayoutPanel.add(packagesTreeItemPanel);

    add(packageDockLayoutPanel, packagesTreeItem.getHeaderHTML(), 2);

    // lazy loaded to easy startup wait time.
    DeferredCommand.addCommand(
        new Command() {
          public void execute() {
            packagesTreeItem.loadPackageList();
          }
        });
  }
Esempio n. 13
0
  public Widget asWidget() {

    DockLayoutPanel wrapper = new DockLayoutPanel(Style.Unit.PX);

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("window-content");

    final Form<PropertyRecord> form = new Form<PropertyRecord>(PropertyRecord.class);

    TextBoxItem nameItem = new TextBoxItem("key", "Name");
    TextBoxItem valueItem = new TextBoxItem("value", "Value");
    CheckBoxItem bootItem = new CheckBoxItem("bootTime", "Boot-Time");

    if (Console.MODULES.getBootstrapContext().isStandalone() || !includeBootTime)
      form.setFields(nameItem, valueItem);
    else form.setFields(nameItem, valueItem, bootItem);

    DialogueOptions options =
        new DialogueOptions(
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                // save
                PropertyRecord property = form.getUpdatedEntity();
                presenter.onCreateProperty(reference, property);
              }
            },
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                // cancel
                presenter.closePropertyDialoge();
              }
            });

    panel.add(form.asWidget());

    wrapper.addSouth(options, 35);
    wrapper.add(panel);
    return wrapper;
  }
  public com.google.gwt.user.client.ui.Widget createAndBindUi(
      final PolyakovGWT.client.view.MailboxViewImpl owner) {

    PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
            (PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle)
                GWT.create(PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle.class);
    PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenCss_style style =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style();
    PolyakovGWT.client.view.widgets.CurrentPathWidget currentPathWidget =
        (PolyakovGWT.client.view.widgets.CurrentPathWidget)
            GWT.create(PolyakovGWT.client.view.widgets.CurrentPathWidget.class);
    PolyakovGWT.client.view.widgets.toolbar.ButtonsHolderWidget buttonsWidget = owner.buttonsWidget;
    com.google.gwt.user.client.ui.VerticalPanel f_VerticalPanel2 =
        (com.google.gwt.user.client.ui.VerticalPanel)
            GWT.create(com.google.gwt.user.client.ui.VerticalPanel.class);
    PolyakovGWT.client.view.widgets.FolderTreeWidget folderTree = owner.folderTree;
    com.google.gwt.user.client.ui.SimpleLayoutPanel containerPanel =
        (com.google.gwt.user.client.ui.SimpleLayoutPanel)
            GWT.create(com.google.gwt.user.client.ui.SimpleLayoutPanel.class);
    com.google.gwt.user.client.ui.SplitLayoutPanel f_SplitLayoutPanel3 =
        (com.google.gwt.user.client.ui.SplitLayoutPanel)
            GWT.create(com.google.gwt.user.client.ui.SplitLayoutPanel.class);
    com.google.gwt.user.client.ui.DockLayoutPanel f_DockLayoutPanel1 =
        new com.google.gwt.user.client.ui.DockLayoutPanel(com.google.gwt.dom.client.Style.Unit.PX);

    f_VerticalPanel2.add(currentPathWidget);
    f_VerticalPanel2.add(buttonsWidget);
    f_DockLayoutPanel1.addNorth(f_VerticalPanel2, 85);
    f_SplitLayoutPanel3.addWest(folderTree, 135);
    containerPanel.addStyleName("" + style.container() + "");
    f_SplitLayoutPanel3.add(containerPanel);
    f_SplitLayoutPanel3.addStyleName("" + style.data_container() + "");
    f_DockLayoutPanel1.add(f_SplitLayoutPanel3);

    owner.containerPanel = containerPanel;
    owner.currentPathWidget = currentPathWidget;
    clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected();

    return f_DockLayoutPanel1;
  }
  public void onModuleLoad() {
    mainPanel = new DockLayoutPanel(Unit.EM);
    mainCenterPanel = new FlowPanel();
    headerPanel = new EmontoHeaderPanel();
    headerPanel.addClickHandler(this);
    searchPanel = new EmontoSearchPanel();
    aboutPanel = new EmontoAboutPanel();
    contactPanel = new EmontoContactPanel();
    footerPanel = new EmontoFooterPanel();
    browsePanel = new EmontoBrowsePanel();

    mainPanel.addNorth(headerPanel, 15);
    mainPanel.addSouth(footerPanel, 2);
    mainPanel.addEast(new HTML(""), 4);
    mainPanel.addWest(new HTML(""), 4);
    mainPanel.add(mainCenterPanel);
    setActivePage(ActivePage.ABOUT);

    // Attach the LayoutPanel to the RootLayoutPanel. The latter will listen for
    // resize events on the window to ensure that its children are informed of
    // possible size changes.
    RootLayoutPanel.get().add(mainPanel);

    // initialize the ontology knowledge base on the server side
    AsyncCallback<Void> callback =
        new AsyncCallback<Void>() {
          public void onFailure(Throwable caught) {
            // TODO: Do something with errors. (e.g. status message: not connected!)
          }

          public void onSuccess(Void result) {
            // TODO: Do something on success (e.g. status message: connected!)
          }
        };

    kbSvc.initializeKB(callback);
  }
  public Widget draw() {

    // contentWidget.setSize("100%", "100%");

    DockLayoutPanel ft = new DockLayoutPanel(Style.Unit.PX);
    contentWidget.setWidget(ft);

    final DataGrid gridTable = new DataGrid();
    gridTable.setSize("100%", "100%");

    final ArrayList<Attribute> vosList = new ArrayList<Attribute>();
    final GetAttributesV2 getVos =
        new GetAttributesV2(
            new JsonCallbackEvents() {
              public void onFinished(JavaScriptObject jso) {
                vosList.addAll(
                    new TableSorter<Attribute>()
                        .sortByAttrNameTranslation(JsonUtils.<Attribute>jsoAsList(jso)));
                gridTable.setRowData(vosList);
                gridTable.redraw();
              }
            });
    getVos.getUserAttributes(3411);
    getVos.retrieveData();

    gridTable.setSelectionModel(
        new MultiSelectionModel<Attribute>(new GeneralKeyProvider<Attribute>()));
    final SelectionModel<Attribute> selectionModel = gridTable.getSelectionModel();
    gridTable.setKeyboardSelectionPolicy(
        HasKeyboardSelectionPolicy.KeyboardSelectionPolicy.DISABLED);

    Column<Attribute, Boolean> checkBoxColumn =
        new Column<Attribute, Boolean>(new CheckboxCell(true, true)) {
          @Override
          public Boolean getValue(Attribute object) {
            // Get the value from the selection model.
            return selectionModel.isSelected(object);
          }
        };
    checkBoxColumn.setFieldUpdater(
        new FieldUpdater<Attribute, Boolean>() {
          @Override
          public void update(int i, Attribute Attribute, Boolean aBoolean) {
            selectionModel.setSelected(Attribute, aBoolean);
          }
        });

    // Checkbox column header
    CheckboxCell cb = new CheckboxCell();
    Header<Boolean> checkBoxHeader =
        new Header<Boolean>(cb) {
          public Boolean getValue() {
            return false; // return true to see a checked checkbox.
          }
        };
    checkBoxHeader.setUpdater(
        new ValueUpdater<Boolean>() {
          public void update(Boolean value) {
            // sets selected to all, if value = true, unselect otherwise
            for (Attribute obj : vosList) {
              selectionModel.setSelected(obj, value);
            }
          }
        });

    gridTable.addColumn(checkBoxColumn, checkBoxHeader, checkBoxHeader);
    gridTable.setColumnWidth(checkBoxColumn, 40.0, Style.Unit.PX);

    TextColumn<Attribute> idColumn =
        new TextColumn<Attribute>() {
          @Override
          public String getValue(Attribute object) {
            return String.valueOf(object.getId());
          }
        };

    if (JsonUtils.isExtendedInfoVisible()) {
      gridTable.addColumn(idColumn, "Id", "Id");
      gridTable.setColumnWidth(idColumn, "90px");
    }

    // Name column
    Column<Attribute, Attribute> nameColumn = JsonUtils.addColumn(new PerunAttributeNameCell());

    // Description column
    Column<Attribute, Attribute> descriptionColumn =
        JsonUtils.addColumn(new PerunAttributeDescriptionCell());

    // Value column
    Column<Attribute, Attribute> valueColumn =
        JsonUtils.addColumn(
            new PerunAttributeValueCell(),
            new FieldUpdater<Attribute, Attribute>() {
              public void update(int index, Attribute object, Attribute value) {
                object = value;
                selectionModel.setSelected(object, object.isAttributeValid());
              }
            });

    ColumnSortEvent.ListHandler<Attribute> columnSortHandler =
        new ColumnSortEvent.ListHandler<Attribute>(vosList);
    gridTable.addColumnSortHandler(columnSortHandler);

    // Sorting name column
    nameColumn.setSortable(true);
    columnSortHandler.setComparator(
        nameColumn, new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_NAME));

    // Sorting description column
    descriptionColumn.setSortable(true);
    columnSortHandler.setComparator(
        descriptionColumn,
        new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_DESCRIPTION));

    // Add sorting
    gridTable.addColumnSortHandler(columnSortHandler);

    // updates the columns size
    gridTable.setColumnWidth(nameColumn, 200.0, Style.Unit.PX);
    gridTable.setColumnWidth(valueColumn, 420.0, Style.Unit.PX);

    gridTable.addColumn(nameColumn, "Name");
    gridTable.addColumn(valueColumn, "Value");
    gridTable.addColumn(descriptionColumn, "Description");

    TabMenu tabMenu = new TabMenu();

    tabMenu.addWidget(
        TabMenu.getPredefinedButton(
            ButtonType.ADD,
            "",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent clickEvent) {
                session.getTabManager().addTabToCurrentTab(new TestDataGridTabItem(), true);
              }
            }));

    ft.addNorth(tabMenu, 50);
    ft.add(gridTable);

    return getWidget();
  }
Esempio n. 17
0
  @Inject
  public SelectPathViewImpl(CoreLocalizationConstant locale, SelectPathViewImplUiBinder uiBinder) {
    setTitle(locale.selectPathWindowTitle());

    Widget widget = uiBinder.createAndBindUi(this);
    setWidget(widget);

    UniqueKeyProvider<Node> uniqueKeyProvider =
        new NodeUniqueKeyProvider() {
          @NotNull
          @Override
          public String getKey(@NotNull Node item) {
            if (item instanceof HasStorablePath) {
              return ((HasStorablePath) item).getStorablePath();
            } else {
              return String.valueOf(item.hashCode());
            }
          }
        };
    FolderNodeInterceptor interceptor = new FolderNodeInterceptor();
    Set<NodeInterceptor> interceptors = new HashSet<>();
    interceptors.add(interceptor);
    NodeLoader loader = new NodeLoader(interceptors);
    NodeStorage nodeStorage = new NodeStorage(uniqueKeyProvider);

    tree = new Tree(nodeStorage, loader);
    tree.setAutoSelect(true);
    tree.getSelectionModel().setSelectionMode(SINGLE);
    treeContainer.add(tree);

    KeyboardNavigationHandler handler =
        new KeyboardNavigationHandler() {
          @Override
          public void onEnter(NativeEvent evt) {
            evt.preventDefault();
            acceptButtonClicked();
          }
        };

    handler.bind(tree);

    cancelButton =
        createButton(
            locale.cancel(),
            "select-path-cancel-button",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                hide();
              }
            });

    acceptButton =
        createPrimaryButton(
            locale.ok(),
            "select-path-ok-button",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                acceptButtonClicked();
              }
            });

    addButtonToFooter(acceptButton);
    addButtonToFooter(cancelButton);
  }
Esempio n. 18
0
  public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get();
    RootPanel RootMenu = RootPanel.get("Menu");

    MenuBar menuBar = new MenuBar(false);
    RootMenu.add(menuBar);

    MenuItem CloseBoton =
        new MenuItem(
            "Close",
            false,
            new Command() {
              public void execute() {
                if (ActualUser.getUser().getProfile().equals(Constants.PROFESSOR))
                  Controlador.change2Administrator();
                else if (ActualUser.getUser().getProfile().equals(Constants.STUDENT))
                  Controlador.change2MyActivities();
              }
            });
    menuBar.addItem(CloseBoton);

    SimplePanel simplePanel = new SimplePanel();
    rootPanel.add(simplePanel, 0, 25);
    simplePanel.setSize("100%", "100%");

    DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.EM);
    simplePanel.setWidget(dockLayoutPanel);
    dockLayoutPanel.setSize("100%", "100%");

    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    dockLayoutPanel.addWest(verticalPanel, 32.2);
    verticalPanel.setSize("100%", "100%");

    HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
    horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel.add(horizontalPanel_1);
    horizontalPanel_1.setWidth("100%");

    VerticalPanel PanelCampos = new VerticalPanel();
    PanelCampos.setSpacing(10);
    horizontalPanel_1.add(PanelCampos);
    PanelCampos.setWidth("100%");

    HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
    horizontalPanel_2.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    PanelCampos.add(horizontalPanel_2);
    horizontalPanel_2.setWidth("100%");

    Label lblNewLabel = new Label("Nombre");
    horizontalPanel_2.add(lblNewLabel);

    NameText = new TextBox();
    NameText.setMaxLength(25);
    NameText.setVisibleLength(25);
    horizontalPanel_2.add(NameText);
    NameText.setWidth("90%");
    String Nombre = "";
    if ((ActualUser.getUser().getName() != null) && (!ActualUser.getUser().getName().isEmpty()))
      Nombre = ActualUser.getUser().getName();
    NameText.setText(Nombre);

    HorizontalPanel horizontalPanel_3 = new HorizontalPanel();
    horizontalPanel_3.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    PanelCampos.add(horizontalPanel_3);
    horizontalPanel_3.setWidth("100%");

    Label lblNewLabel_1 = new Label("Apellidos");
    horizontalPanel_3.add(lblNewLabel_1);

    ApellidosText = new TextBox();
    ApellidosText.setVisibleLength(25);
    ApellidosText.setMaxLength(120);
    horizontalPanel_3.add(ApellidosText);
    ApellidosText.setWidth("90%");
    String Apellido = "";
    if ((ActualUser.getUser().getLastName() != null)
        && (!ActualUser.getUser().getLastName().isEmpty()))
      Apellido = ActualUser.getUser().getLastName();
    ApellidosText.setText(Apellido);

    HorizontalPanel horizontalPanel_4 = new HorizontalPanel();
    horizontalPanel_4.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel_4.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    PanelCampos.add(horizontalPanel_4);
    horizontalPanel_4.setWidth("100%");

    SimplePanel simplePanel_1 = new SimplePanel();
    horizontalPanel_4.add(simplePanel_1);

    Button btnNewButton = new Button("Save");
    simplePanel_1.setWidget(btnNewButton);
    btnNewButton.setSize("100%", "100%");
    btnNewButton.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonCenter");
          }
        });

    btnNewButton.addMouseDownHandler(
        new MouseDownHandler() {
          public void onMouseDown(MouseDownEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush");
          }
        });

    btnNewButton.addMouseOutHandler(
        new MouseOutHandler() {
          public void onMouseOut(MouseOutEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonCenter");
          }
        });

    btnNewButton.addMouseOverHandler(
        new MouseOverHandler() {
          public void onMouseOver(MouseOverEvent event) {

            ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver");
          }
        });

    btnNewButton.setStyleName("gwt-ButtonCenter");
    btnNewButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            UserApp AU = ActualUser.getUser();
            AU.setName(NameText.getText());
            AU.setLastName(ApellidosText.getText());
            LoadingPanel.getInstance().center();
            LoadingPanel.getInstance().setLabelTexto("Updating...");
            bookReaderServiceHolder.saveUser(
                AU,
                new AsyncCallback<Boolean>() {

                  public void onSuccess(Boolean result) {
                    bookReaderServiceHolder.loadUserById(
                        ActualUser.getUser().getId(),
                        new AsyncCallback<UserApp>() {

                          public void onSuccess(UserApp result) {
                            ActualUser.setUser(result);
                            bookReaderServiceHolder.updateRenameOfUser(
                                result.getId(),
                                new AsyncCallback<Void>() {

                                  public void onSuccess(Void result) {

                                    LoadingPanel.getInstance().hide();
                                    if (ActualUser.getUser()
                                        .getProfile()
                                        .equals(Constants.PROFESSOR))
                                      Controlador.change2Administrator();
                                    else if (ActualUser.getUser()
                                        .getProfile()
                                        .equals(Constants.STUDENT))
                                      Controlador.change2MyActivities();
                                  }

                                  public void onFailure(Throwable caught) {
                                    LoadingPanel.getInstance().hide();
                                    Window.alert(
                                        "I can refresh the old anotations, please re-save your name to fix it");
                                  }
                                });
                          }

                          public void onFailure(Throwable caught) {
                            Window.alert(
                                "I can reload the update User, if you want to show the new userInformation please reload the page");
                            LoadingPanel.getInstance().hide();
                          }
                        });
                  }

                  public void onFailure(Throwable caught) {
                    Window.alert("Error updating User.");
                    LoadingPanel.getInstance().hide();
                  }
                });
          }
        });

    VerticalPanel verticalPanel_1 = new VerticalPanel();
    verticalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    dockLayoutPanel.add(verticalPanel_1);
    verticalPanel_1.setSize("100%", "100%");

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel_1.add(horizontalPanel);

    Image image = new Image("Logo.jpg");
    horizontalPanel.add(image);
  }
  public com.google.gwt.user.client.ui.Widget createAndBindUi(
      final com.testroo.client.scaffold.ScaffoldDesktopShell owner) {

    com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenBundle
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
            (com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenBundle)
                GWT.create(
                    com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenBundle.class);
    com.google.gwt.resources.client.ImageResource gwtLogo =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.gwtLogo();
    com.google.gwt.resources.client.ImageResource rooLogo =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.rooLogo();
    com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenCss_style style =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style();
    com.google.gwt.dom.client.DivElement error = null;
    java.lang.String domId0 = com.google.gwt.dom.client.Document.get().createUniqueId();
    java.lang.String domId1 = com.google.gwt.dom.client.Document.get().createUniqueId();
    com.google.gwt.requestfactory.ui.client.LoginWidget loginWidget =
        (com.google.gwt.requestfactory.ui.client.LoginWidget)
            GWT.create(com.google.gwt.requestfactory.ui.client.LoginWidget.class);
    com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel2 =
        new com.google.gwt.user.client.ui.HTMLPanel(
            "<div class='"
                + ""
                + style.banner()
                + ""
                + "'> <div class='"
                + ""
                + style.error()
                + ""
                + "' id='"
                + domId0
                + "'></div> <span class='"
                + ""
                + style.title()
                + ""
                + "'><h2>Data Browser</h2></span> <span id='"
                + domId1
                + "'></span> </div>");
    com.google.gwt.user.client.ui.HTML f_HTML3 =
        (com.google.gwt.user.client.ui.HTML) GWT.create(com.google.gwt.user.client.ui.HTML.class);
    com.google.gwt.user.client.ui.ValuePicker placesBox = owner.placesBox;
    com.google.gwt.user.client.ui.SimplePanel f_SimplePanel5 =
        (com.google.gwt.user.client.ui.SimplePanel)
            GWT.create(com.google.gwt.user.client.ui.SimplePanel.class);
    com.google.gwt.user.client.ui.NotificationMole mole =
        (com.google.gwt.user.client.ui.NotificationMole)
            GWT.create(com.google.gwt.user.client.ui.NotificationMole.class);
    com.google.gwt.user.client.ui.SimplePanel master =
        (com.google.gwt.user.client.ui.SimplePanel)
            GWT.create(com.google.gwt.user.client.ui.SimplePanel.class);
    com.google.gwt.user.client.ui.FlowPanel f_FlowPanel6 =
        (com.google.gwt.user.client.ui.FlowPanel)
            GWT.create(com.google.gwt.user.client.ui.FlowPanel.class);
    com.google.gwt.user.client.ui.SimplePanel details =
        (com.google.gwt.user.client.ui.SimplePanel)
            GWT.create(com.google.gwt.user.client.ui.SimplePanel.class);
    com.google.gwt.user.client.ui.FlowPanel f_FlowPanel4 =
        (com.google.gwt.user.client.ui.FlowPanel)
            GWT.create(com.google.gwt.user.client.ui.FlowPanel.class);
    com.google.gwt.user.client.ui.DockLayoutPanel f_DockLayoutPanel1 =
        new com.google.gwt.user.client.ui.DockLayoutPanel(com.google.gwt.dom.client.Style.Unit.EM);

    loginWidget.setStyleName("" + style.login() + "");
    f_HTMLPanel2.setStyleName("" + style.centered() + "");
    f_DockLayoutPanel1.addNorth(f_HTMLPanel2, 6);
    f_HTML3.setHTML(
        "<div class='"
            + ""
            + style.logos()
            + ""
            + "'> <span>Powered by: </span> <a href='http://code.google.com/webtoolkit/'><div class='"
            + ""
            + style.gwtLogo()
            + ""
            + "'></div></a> <a href='http://www.springsource.org/roo/'><div class='"
            + ""
            + style.rooLogo()
            + ""
            + "'></div></a> </div>");
    f_DockLayoutPanel1.addSouth(f_HTML3, 2);
    placesBox.setStyleName("" + style.entitiesList() + "");
    placesBox.setWidth("100%");
    placesBox.setPageSize(100);
    f_SimplePanel5.add(placesBox);
    f_SimplePanel5.setStyleName("" + style.entities() + "");
    f_FlowPanel4.add(f_SimplePanel5);
    mole.setMessage("loading...");
    mole.setAnimationDuration(0);
    f_FlowPanel6.add(mole);
    master.setStyleName("" + style.entityDetails() + "");
    f_FlowPanel6.add(master);
    f_FlowPanel4.add(f_FlowPanel6);
    details.setStyleName("" + style.entityDetails() + "");
    f_FlowPanel4.add(details);
    f_FlowPanel4.setStyleName("" + style.content() + " " + style.centered() + "");
    f_DockLayoutPanel1.add(f_FlowPanel4);

    UiBinderUtil.TempAttachment attachRecord0 = UiBinderUtil.attachToDom(f_HTMLPanel2.getElement());
    error = com.google.gwt.dom.client.Document.get().getElementById(domId0).cast();
    error.removeAttribute("id");
    com.google.gwt.user.client.Element domId1Element =
        com.google.gwt.dom.client.Document.get().getElementById(domId1).cast();
    attachRecord0.detach();
    f_HTMLPanel2.addAndReplaceElement(loginWidget, domId1Element);

    owner.details = details;
    owner.error = error;
    owner.loginWidget = loginWidget;
    owner.master = master;
    owner.mole = mole;
    clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected();

    return f_DockLayoutPanel1;
  }
Esempio n. 20
0
  public void layout() {

    // clear any backgrounded processes.
    for (Timer t : bgList) {
      t.cancel();
    }

    table = new FlexTable();
    mainPanel.clear();
    if (!StringUtils.isEmpty(name) || !StringUtils.isEmpty(helpId)) {

      String n = StringUtils.isEmpty(name) ? "" : name.trim();
      HorizontalPanel h = new HorizontalPanel();
      h.setWidth("100%");
      HTML lname = new HTML("<b>" + n + "</b>");
      if (shortDesc != null) {
        lname.setTitle(shortDesc);
      }
      GwtUtil.setStyles(lname, "textAlign", "center");
      h.add(lname);
      h.setCellWidth(lname, "100%");

      if (!StringUtils.isEmpty(helpId)) {
        final Widget helpIcon = HelpManager.makeHelpIcon(helpId);
        h.add(helpIcon);
        GwtUtil.setStyles(helpIcon, "marginRight", "11px");
      }
      mainPanel.addNorth(h, 20);
    }

    // setup group by selection
    if (groupByCols != null && groupByCols.size() > 1) {
      EnumFieldDef gb = new EnumFieldDef("groupBy");
      gb.setLabel("Group By");
      gb.setDesc("Select a group by column to update the data table");
      gb.setPreferWidth(200);
      gb.setDefaultValue(curGroupByName);
      for (TableDataView.Column item : headers) {
        if (groupByCols.contains(item.getName())) {
          gb.addItem(item.getName(), item.getTitle());
        }
      }
      final SimpleInputField sif = SimpleInputField.createByDef(gb);
      mainPanel.addNorth(sif, 28);
      sif.getField()
          .addValueChangeHandler(
              new ValueChangeHandler() {
                public void onValueChange(ValueChangeEvent ve) {
                  curGroupByName = sif.getValue();
                  layout();
                }
              });
    }

    ScrollPanel sp = new ScrollPanel();
    sp.add(table);

    mainPanel.add(sp);

    table.setStyleName("firefly-summary-table");
    table.setSize("100%", "100%");
    iconColIdx = headers.size();
    String titleCol = null;

    // render headers
    int colIdx = 0;
    for (int i = 0; i < headers.size(); i++) {
      TableDataView.Column col = headers.get(i);
      if (curGroupByName == null || !curGroupByName.equals(col.getName())) {
        table.setText(0, colIdx, col.getTitle());
        table.getCellFormatter().setStyleName(0, colIdx, "title-bar");
        colIdx++;
        if (titleCol == null) {
          titleCol = col.getName();
        }
      }
    }
    table.setText(0, headers.size(), "");
    table.getCellFormatter().setWidth(0, headers.size(), "100%");

    ArrayList<SearchSummaryItem> itemList = searchItems;

    if (!StringUtils.isEmpty(curGroupByName)) {
      itemList = new ArrayList<SearchSummaryItem>();

      GroupFinder finder = new GroupFinder("");
      List<GroupedSummaryItem> groupList = new ArrayList<GroupedSummaryItem>();
      for (int i = 0; i < searchItems.size(); i++) {
        SearchSummaryItem dsi = searchItems.get(i);
        String cGroupValue = dsi.getValue(curGroupByName);
        GroupedSummaryItem cGroup =
            CollectionUtil.findFirst(groupList, finder.setName(cGroupValue));
        if (cGroup == null) {
          cGroup = new GroupedSummaryItem(cGroupValue);
          groupList.add(cGroup);
          itemList.add(cGroup);
        }
        cGroup.addChild(dsi);
      }
    }

    for (SearchSummaryItem ssi : itemList) {
      ssi.setTitleCol(titleCol);
      layout(ssi, 0);
    }
  }