Example #1
0
  @Override
  public void initialize() {
    container =
        Panels.content(
            null,
            false,
            Layouts.vBoxLayout(
                VBoxLayout.VBoxLayoutAlign.STRETCH, new Layouts.LayoutOptions(new Padding(10))),
            "x-border-layout-ct");
    container.setScrollMode(Style.Scroll.AUTOY);
    container.addStyleName("contact-details-container");
    add(container);

    saveButton = Forms.button(I18N.CONSTANTS.save(), IconImageBundle.ICONS.save());
    deleteButton = Forms.button(I18N.CONSTANTS.delete(), IconImageBundle.ICONS.remove());
    exportButton = Forms.button(I18N.CONSTANTS.export(), IconImageBundle.ICONS.excel());

    toolBar = new ToolBar();
    toolBar.setAlignment(Style.HorizontalAlignment.LEFT);
    toolBar.setBorders(false);
    toolBar.add(saveButton);
    toolBar.add(deleteButton);
    toolBar.add(exportButton);

    container.setTopComponent(toolBar);
  }
Example #2
0
  /** {@inheritDoc} */
  @Override
  public void buildExportDialog(final ContactDetailsPresenter.ExportActionHandler handler) {

    final Window w = new Window();
    w.setPlain(true);
    w.setModal(true);
    w.setBlinkModal(true);
    w.setLayout(new FitLayout());
    w.setSize(400, 180);
    w.setHeadingHtml(I18N.CONSTANTS.exportData());

    final FormPanel panel = Forms.panel();

    final CheckBox synthesisBox = Forms.checkbox(I18N.CONSTANTS.caracteristics(), Boolean.TRUE);
    synthesisBox.setEnabled(false);
    final CheckBox allRelationsBox = Forms.checkbox(I18N.CONSTANTS.allRelations());
    final CheckBox frameworkRelationsBox = Forms.checkbox(I18N.CONSTANTS.frameworkRelations());
    final CheckBox relationsByElementBox = Forms.checkbox(I18N.CONSTANTS.relationsByElement());

    final CheckBoxGroup options =
        Forms.checkBoxGroup(
            I18N.CONSTANTS.exportOptions(),
            com.extjs.gxt.ui.client.Style.Orientation.VERTICAL,
            synthesisBox,
            allRelationsBox,
            frameworkRelationsBox,
            relationsByElementBox);

    panel.add(options);

    final Button export = Forms.button(I18N.CONSTANTS.export());
    panel.getButtonBar().add(export);
    export.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(final ButtonEvent ce) {
            if (handler != null) {
              handler.onExportContact(
                  synthesisBox.getValue(),
                  allRelationsBox.getValue(),
                  frameworkRelationsBox.getValue(),
                  relationsByElementBox.getValue());
            }
            w.hide();
          }
        });

    w.add(panel);
    w.show();
  }