/**
   * Page widgets.
   *
   * @param cellTree the cell tree
   */
  public void createPageView(CellTree cellTree) {
    this.cellTree = cellTree;
    mainPanel.setStyleName("div-wrapper"); // main div

    SimplePanel leftPanel = new SimplePanel();
    leftPanel.getElement().setId("leftPanel_SimplePanel");
    leftPanel.setStyleName("div-first bottomPadding10px"); // left side div which will  have tree

    SimplePanel rightPanel = new SimplePanel();
    rightPanel.getElement().setId("rightPanel_SimplePanel");
    rightPanel.setStyleName("div-second"); // right div having tree creation inputs.

    VerticalPanel treePanel = new VerticalPanel();
    treePanel.getElement().setId("treePanel_VerticalPanel");
    HorizontalPanel expandCollapse = new HorizontalPanel();
    expandCollapse.getElement().setId("expandCollapse_HorizontalPanel");
    expandCollapse.setStyleName("leftAndTopPadding");
    expandCollapse.setSize("100px", "20px");
    buttonExpand.setStylePrimaryName("expandAllButton");
    buttonCollapse.setStylePrimaryName("collapseAllButton");
    buttonExpand.setTitle("Expand All (Shift +)");
    buttonCollapse.setTitle("Collapse All (Shift -)");
    expandCollapse.add(buttonExpand);
    expandCollapse.add(buttonCollapse);
    buttonExpand.setFocus(true);
    buttonCollapse.setVisible(true);

    treePanel.add(expandCollapse);
    treePanel.add(cellTree);
    leftPanel.add(treePanel);

    SimplePanel bottomSavePanel = new SimplePanel();
    bottomSavePanel.getElement().setId("bottomSavePanel_SimplePanel");
    bottomSavePanel.setStyleName("div-first buttonPadding");
    VerticalPanel vp = new VerticalPanel();
    HorizontalPanel savePanel = new HorizontalPanel();
    savePanel.getElement().setId("savePanel_VerticalPanel");
    savePanel.add(new SpacerWidget());
    //		savePanel.add(errorMessageDisplay);
    vp.add(successMessageDisplay);
    //		saveBtn.setTitle("Ctrl+Alt+s");
    savePanel.add(saveBtn);
    validateBtn.setTitle("Validate");
    savePanel.add(validateBtn);
    vp.add(warningMessageDisplay);
    vp.add(savePanel);
    bottomSavePanel.add(vp);

    SimplePanel errPanel = new SimplePanel();
    errPanel.getElement().setId("errPanel_SimplePanel");
    errPanel.add(errorMessageDisplay);
    mainPanel.add(errPanel);
    mainPanel.add(leftPanel);
    mainPanel.add(rightPanel);
    mainPanel.add(bottomSavePanel);
    focusPanel.addKeyDownHandler(this);
    focusPanel.addFocusHandler(this);
    cellTreeHandlers();
  }
Пример #2
0
  @Inject
  BudgetSiderView(
      Binder uiBinder,
      BudgetCell budgetCell,
      Resources resources,
      SiderListStyle siderListResources) {
    this.keyProvider = setupKeyProvider();
    this.dataProvider = new ListDataProvider<Budget>(keyProvider);

    budgetList = new CellList<Budget>(budgetCell, siderListResources);
    selectionModel = new SingleSelectionModel<Budget>(keyProvider);

    // Init The UI Binder
    initWidget(uiBinder.createAndBindUi(this));

    // Set up CSS Style Classes
    addNew.setStylePrimaryName(resources.buttonStyleCss().button());
    addNew.setStyleName(resources.buttonStyleCss().medium(), true);
    addNew.setStyleName(resources.buttonStyleCss().gray(), true);

    budgetList.setKeyboardSelectionPolicy(
        HasKeyboardSelectionPolicy.KeyboardSelectionPolicy.DISABLED);
    budgetList.setSelectionModel(selectionModel);
    dataProvider.addDataDisplay(budgetList);

    selectionModel.addSelectionChangeHandler(
        new SelectionChangeEvent.Handler() {
          @Override
          public void onSelectionChange(SelectionChangeEvent selectionChangeEvent) {
            getUiHandlers().budgetSelected(selectionModel.getSelectedObject());
          }
        });
  }
Пример #3
0
  private SecurityPanel() {

    saveButton.setStylePrimaryName("pentaho-button");

    HorizontalPanel roleTypeSelectionPanel = new HorizontalPanel();
    regularRolesBtn.addValueChangeHandler(this);
    systemRolesBtn.addValueChangeHandler(this);
    roleTypeSelectionPanel.add(regularRolesBtn);
    roleTypeSelectionPanel.add(systemRolesBtn);

    // add role type panel
    FlexTable securityPanel = new FlexTable();
    securityPanel.setWidget(0, 0, roleTypeSelectionPanel);
    securityPanel.getFlexCellFormatter().setColSpan(0, 0, 2);

    // add available roles list
    securityPanel.setWidget(1, 0, createRolesListBox());
    securityPanel.getFlexCellFormatter().setRowSpan(1, 0, 2);

    saveButton.addClickHandler(this);
    securityPanel.setWidget(2, 0, saveButton);

    securityPanel.setWidget(1, 1, createPermissionPanel());
    securityPanel.getFlexCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP);

    setWidget(securityPanel);

    initializeAvailUserRoles();
    initializeSystemRoles();
    initializeLogicalRoleMappings();
  }
  /**
   * Die onLoad-Methode wird verwendet um in der Seite die verschiedenen Panels anzuordnen. Sie
   * startet beim Ausführen der Seite, da sie das Pendant zur <code>main()</code>-Methode einer
   * normalen Java Applikation darstellt
   */
  public void onLoad() {
    vonDateBox.setFormat(new DateBox.DefaultFormat(dF));
    bisDateBox.setFormat(new DateBox.DefaultFormat(dF));
    final HTML headline =
        new HTML(
            " <div class='"
                + "subline"
                + "'><h2>Reportgenerator 2: Alle Nachrichten je Zeitraum anzeigen </h2></div> ");
    // final HTML subtext = new HTML(" <div class='"+ "subtext"+ "'><h4> Der Report 2 gibt alle
    // Nachrichten in einen bestimmten Zeitraum aus  </h4></div> ");

    // Die Panels werden anschaulich angeordnet

    reportPanel.add(ueberSchrift2);
    reportPanel2.add(reportPanel2_left);
    reportPanel2.add(reportPanel2_right);
    reportPanel2_left.add(subSchrift2);
    reportPanel2_left.add(vonDateBox);
    reportPanel2_left.add(bisDateBox);
    reportPanel2_left.add(report2Generieren);
    report2Generieren.setStylePrimaryName("neueNchrichtBtn");

    reportPanel2_right.add(headline);
    //	reportPanel2_right.add(subtext);

    reportPanel2_right.add(beschreibung2);
    reportPanel.add(reportPanel2);

    /*
     * Das RootPanel wird gesäubert und die verschiedenen Elemente für
     * Report 2 zugeordnet.
     */
    RootPanel.get("content").clear();
    RootPanel.get("content_left").clear();
    RootPanel.get("content_right").clear();
    RootPanel.get("content_right").add(reportPanel2_right);
    RootPanel.get("content_left").add(reportPanel2_left);

    /*
     * Der jeweilige Zeitraum wird ausgewählt.
     */
    vonDateBox.addValueChangeHandler(
        new ValueChangeHandler<Date>() {
          @Override
          public void onValueChange(ValueChangeEvent<Date> event) {}
        });

    bisDateBox.addValueChangeHandler(
        new ValueChangeHandler<Date>() {
          @Override
          public void onValueChange(ValueChangeEvent<Date> event) {}
        });
    /*
     * Der Button <code>report2Generieren</code> bekommt eine Funktion,
     * damit der Report 2 generiert werden kann.
     */
    report2Generieren.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (vonDateBox.getValue() == null || bisDateBox.getValue() == null) {
              Window.alert("Bitte beide Datumfelder befüllen");
            } else {

              RootPanel.get("content_left").clear();
              RootPanel.get("content_right").clear();

              VerticalPanel ladenPanel = new VerticalPanel();
              ladenPanel.setStylePrimaryName("ladenPanel");

              Image ladenImg = new Image("laden.gif");
              ladenImg.setStylePrimaryName("ladenImg");
              ladenPanel.add(ladenImg);

              HTML ladenLabel =
                  new HTML(
                      "<h1> Bitte warten <h1><br /><h3>Bitte warte einen Augenblick bis der Report generiert wurde. Vielen Dank.</h3>");
              ladenPanel.add(ladenLabel);

              RootPanel.get("content").add(ladenPanel);

              nutzer = TellMeReport.gibEingeloggterBenutzer().getUser();
              NutzerDataProvider.gib(1)
                  .report2Generieren(
                      nutzer,
                      new Timestamp(vonDateBox.getValue().getTime()),
                      new Timestamp(bisDateBox.getValue().getTime()));
            }
          }
        });
  }
  public ResizableDialogBox(
      final String headerText,
      String okText,
      String cancelText,
      final Widget content,
      final boolean modal) {
    this.content = content;
    boundaryPanel =
        new AbsolutePanel() {
          public void onBrowserEvent(Event event) {
            super.onBrowserEvent(event);
            if (!modal && event.getTypeInt() == Event.ONCLICK) {
              hide();
            }
          }
        };
    boundaryPanel.setSize(
        "100%",
        Window.getClientHeight() + Window.getScrollTop() + "px"); // $NON-NLS-1$ //$NON-NLS-2$
    boundaryPanel.setVisible(true);
    RootPanel.get().add(boundaryPanel, 0, 0);
    boundaryPanel.sinkEvents(Event.ONCLICK);
    boundaryPanel
        .getElement()
        .getStyle()
        .setProperty("cursor", "wait"); // $NON-NLS-1$ //$NON-NLS-2$

    // initialize window controller which provides drag and resize windows
    WindowController windowController = new WindowController(boundaryPanel);

    // content wrapper
    Button ok = new Button(okText);
    ok.setStylePrimaryName("pentaho-button");
    ok.getElement().setAttribute("id", "okButton"); // $NON-NLS-1$ //$NON-NLS-2$
    ok.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            if (validatorCallback == null
                || (validatorCallback != null && validatorCallback.validate())) {
              try {
                if (callback != null) {
                  callback.okPressed();
                }
              } catch (Throwable dontCare) {
              }
              hide();
            }
          }
        });
    final HorizontalPanel dialogButtonPanel = new HorizontalPanel();
    dialogButtonPanel.setSpacing(2);
    dialogButtonPanel.add(ok);
    if (cancelText != null) {
      Button cancel = new Button(cancelText);
      cancel.setStylePrimaryName("pentaho-button");
      cancel.getElement().setAttribute("id", "cancelButton"); // $NON-NLS-1$ //$NON-NLS-2$
      cancel.addClickHandler(
          new ClickHandler() {

            public void onClick(ClickEvent event) {
              try {
                if (callback != null) {
                  callback.cancelPressed();
                }
              } catch (Throwable dontCare) {
              }
              hide();
            }
          });
      dialogButtonPanel.add(cancel);
    }
    HorizontalPanel dialogButtonPanelWrapper = new HorizontalPanel();
    if (okText != null && cancelText != null) {
      dialogButtonPanelWrapper.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    } else {
      dialogButtonPanelWrapper.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    }
    dialogButtonPanelWrapper.setStyleName("dialogButtonPanel"); // $NON-NLS-1$
    dialogButtonPanelWrapper.setWidth("100%"); // $NON-NLS-1$
    dialogButtonPanelWrapper.add(dialogButtonPanel);

    Grid dialogContent = new Grid(2, 1);
    dialogContent.setCellPadding(0);
    dialogContent.setCellSpacing(0);
    dialogContent.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
    dialogContent
        .getCellFormatter()
        .setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_LEFT);
    // add content
    dialogContent.setWidget(0, 0, content);
    dialogContent.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    // add button panel
    dialogContent.setWidget(1, 0, dialogButtonPanelWrapper);
    dialogContent.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_BOTTOM);
    dialogContent.setWidth("100%"); // $NON-NLS-1$
    dialogContent.setHeight("100%"); // $NON-NLS-1$

    windowPanel = new WindowPanel(windowController, headerText, dialogContent, true);
  }
  private Widget createEmailPanel() {
    VerticalPanel mailPanel = new VerticalPanel();

    SimplePanel vSpacer = new SimplePanel();
    vSpacer.setHeight("15px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("smtpHost") + ":"));
    smtpHostTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            String text = smtpHostTextBox.getText();
            return (text != null && text.length() > 0);
          }
        };
    smtpHostTextBox.setValidationMessage(Messages.getString("smtpHostValidationMessage"));
    smtpHostTextBox.setWidth("400px");
    mailPanel.add(smtpHostTextBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("port") + ":"));
    portTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            return isPortValid(portTextBox.getText());
          }
        };
    portTextBox.setValidationMessage(Messages.getString("portValidationMessage"));
    portTextBox.setWidth("400px");
    mailPanel.add(portTextBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("protocol") + ":"));
    protocolsListBox = new ListBox();
    protocolsListBox.addItem(Messages.getString("smtp"));
    protocolsListBox.addItem(Messages.getString("smtps"));
    mailPanel.add(protocolsListBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    useStartTLSCheckBox = new CheckBox(Messages.getString("useStartTLS"));
    mailPanel.add(useStartTLSCheckBox);

    useSSLCheckBox = new CheckBox(Messages.getString("useSSL"));
    mailPanel.add(useSSLCheckBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("fromName") + ":"));
    fromNameTextBox = new TextBox();
    fromNameTextBox.setWidth("400px");
    mailPanel.add(fromNameTextBox);

    mailPanel.add(new Label(Messages.getString("defaultFromAddress") + ":"));
    HorizontalPanel hPanel = new HorizontalPanel();
    fromAddressTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            return isValidEmail(fromAddressTextBox.getText());
          }
        };
    fromAddressTextBox.setValidationMessage(Messages.getString("fromAddressValidationMessage"));
    fromAddressTextBox.setWidth("400px");
    hPanel.add(fromAddressTextBox);
    SimplePanel hSpacer = new SimplePanel();
    hSpacer.setWidth("15px");
    hPanel.add(hSpacer);
    Label emailOrginLabel = new Label(Messages.getString("emailOriginLabel"));
    emailOrginLabel.setStyleName("msg-Label");
    hPanel.add(emailOrginLabel);
    mailPanel.add(hPanel);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    authenticationCheckBox = new CheckBox(Messages.getString("useAuthentication"));
    mailPanel.add(authenticationCheckBox);

    authenticationPanel = new VerticalPanel();
    mailPanel.add(authenticationPanel);
    authenticationPanel.add(new Label(Messages.getString("userName") + ":"));
    userNameTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            return !StringUtils.isEmpty(userNameTextBox.getText());
          }
        };
    userNameTextBox.setValidationMessage(Messages.getString("usernameValidationMessage"));
    userNameTextBox.setWidth("400px");
    authenticationPanel.add(userNameTextBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    authenticationPanel.add(vSpacer);

    authenticationPanel.add(new Label(Messages.getString("password") + ":"));
    hPanel = new HorizontalPanel();
    passwordTextBox =
        new ValidationPasswordTextBox() {

          @Override
          public boolean validate() {
            return !StringUtils.isEmpty(passwordTextBox.getText());
          }
        };
    passwordTextBox.setValidationMessage(Messages.getString("passwordValidationMessage"));
    passwordTextBox.setWidth("319px");
    hPanel.add(passwordTextBox);

    hSpacer = new SimplePanel();
    hSpacer.setWidth("15px");
    hPanel.add(hSpacer);

    editPasswordButton = new Button(Messages.getString("edit") + "...");
    editPasswordButton.setStylePrimaryName("pentaho-button");
    hPanel.add(editPasswordButton);
    editPasswordButton.setEnabled(false);
    authenticationPanel.add(hPanel);

    debuggingCheckBox = new CheckBox(Messages.getString("enableDebugging"));
    mailPanel.add(debuggingCheckBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("20px");
    mailPanel.add(vSpacer);

    HorizontalPanel buttonsPanel = new HorizontalPanel();
    mailPanel.add(buttonsPanel);

    hSpacer = new SimplePanel();
    hSpacer.setWidth("339px");
    buttonsPanel.add(hSpacer);

    testButton = new Button(Messages.getString("test"));
    testButton.setStylePrimaryName("pentaho-button");
    buttonsPanel.add(testButton);

    return mailPanel;
  }