private void resetColumnWidth() {
   grid.getColumn(STATUS).setWidthUndefined();
   grid.getColumn(PROGRESS).setWidthUndefined();
   grid.getColumn(FILE_NAME).setWidthUndefined();
   grid.getColumn(REASON).setWidthUndefined();
   grid.getColumn(SPUILabelDefinitions.NAME_VERSION).setWidthUndefined();
 }
 private void setColumnWidth() {
   grid.getColumn(STATUS).setWidth(60);
   grid.getColumn(PROGRESS).setWidth(150);
   grid.getColumn(FILE_NAME).setWidth(200);
   grid.getColumn(REASON).setWidth(290);
   grid.getColumn(SPUILabelDefinitions.NAME_VERSION).setWidth(200);
 }
 private void setGridColumnProperties() {
   grid.getColumn(STATUS).setRenderer(new StatusRenderer());
   grid.getColumn(PROGRESS).setRenderer(new ProgressBarRenderer());
   grid.setColumnOrder(STATUS, PROGRESS, FILE_NAME, SPUILabelDefinitions.NAME_VERSION, REASON);
   setColumnWidth();
   grid.getColumn(SPUILabelDefinitions.NAME_VERSION)
       .setHeaderCaption(i18n.get("upload.swModuleTable.header"));
   grid.setFrozenColumnCount(5);
 }
 private void resizeWindow(final ClickEvent event) {
   if (FontAwesome.EXPAND.equals(event.getButton().getIcon())) {
     event.getButton().setIcon(FontAwesome.COMPRESS);
     setWindowMode(WindowMode.MAXIMIZED);
     resetColumnWidth();
     grid.getColumn(STATUS).setExpandRatio(0);
     grid.getColumn(PROGRESS).setExpandRatio(1);
     grid.getColumn(FILE_NAME).setExpandRatio(2);
     grid.getColumn(REASON).setExpandRatio(3);
     grid.getColumn(SPUILabelDefinitions.NAME_VERSION).setExpandRatio(4);
     mainLayout.setSizeFull();
   } else {
     event.getButton().setIcon(FontAwesome.EXPAND);
     setWindowMode(WindowMode.NORMAL);
     setColumnWidth();
     setPopupSizeInMinMode();
   }
 }
Beispiel #5
0
  /**
   * Creates a new clickable renderer with the given presentation type and null representation.
   *
   * @param presentationType the data type that this renderer displays, not <code>null</code>
   * @param nullRepresentation a string that will be sent to the client instead of a regular value
   *     in case the actual cell value is <code>null</code>. May be <code>null</code>.
   */
  protected ClickableRenderer(Class<V> presentationType, String nullRepresentation) {
    super(presentationType, nullRepresentation);
    registerRpc(
        (RendererClickRpc)
            (String rowKey, String columnId, MouseEventDetails mouseDetails) -> {
              Grid<T> grid = getParentGrid();
              T item = grid.getDataCommunicator().getKeyMapper().get(rowKey);
              Column column = grid.getColumn(columnId);

              fireEvent(new RendererClickEvent<>(grid, item, column, mouseDetails));
            });
  }
  public SubsEditViewImpl() {
    ButtonRenderer deleteButton = createDeleteButton();
    Slider percentSlider = createPercentSlider();
    MultiFileUpload uploader = createUploader();

    // need to update the grid a first time for initialization.
    updateGrid(null);
    grid.getColumn("delete").setRenderer(deleteButton);
    fileDownloader = new FileDownloader(generateResource());
    fileDownloader.extend(downloadButton);

    // create the main layout
    VerticalLayout content = new VerticalLayout();

    // layout which contains the uploader and the percentage - in other words : all the
    // configuration information
    HorizontalLayout configHorizontalLayout = new HorizontalLayout();
    configHorizontalLayout.addComponent(uploader);

    // Configure the layout which contains the percentage slider
    AbsoluteLayout sliderLayout = new AbsoluteLayout();
    sliderLayout.setWidth("100px");
    sliderLayout.setHeight("35px");
    sliderLayout.addComponent(percentSlider);

    // Configure the layout which contains the percentage slider layout and the labels linked to the
    // percentage
    HorizontalLayout percentageLayout = new HorizontalLayout();
    percentageLayout.addComponent(percentSliderTitle);
    percentageLayout.addComponent(sliderLayout);
    percentageLayout.addComponent(percentLabel);
    percentageLayout.setComponentAlignment(percentSliderTitle, Alignment.MIDDLE_LEFT);
    percentageLayout.setComponentAlignment(percentLabel, Alignment.MIDDLE_LEFT);

    // add the percentage Layout to the layout which contains the uploader
    configHorizontalLayout.addComponent(percentageLayout);
    configHorizontalLayout.setComponentAlignment(percentageLayout, Alignment.BOTTOM_LEFT);

    // add every layouts to the principal one
    content.addComponent(configHorizontalLayout);
    content.addComponent(new Label("&nbsp;", Label.CONTENT_XHTML));
    content.addComponents(grid);
    content.addComponent(downloadButton);
    setCompositionRoot(content);
  }
  public GestionNotificacion() {
    super();
    setMargin(true);
    setSpacing(true);
    setSizeFull();
    HorizontalL h1 = new HorizontalL();
    id = new CampoRuc();
    razonSocial = new CampoRazonSocial();
    razonSocial.setWidth("320px");
    direccion = new CampoDireccion();
    direccion.setWidth("450px");
    correoElectronico = new CampoCorreoElectronico();
    correoElectronico.setWidth("260px");

    tipoIdentificacion = new ComboBox();
    tipoIdentificacion.addItem("04");
    tipoIdentificacion.addItem("05");
    tipoIdentificacion.addItem("06");
    tipoIdentificacion.addItem("07");
    tipoIdentificacion.addItem("08");
    tipoIdentificacion.setItemCaption("04", "RUC");
    tipoIdentificacion.setItemCaption("05", "CEDULA");
    tipoIdentificacion.setItemCaption("06", "PASAPORTE");
    tipoIdentificacion.setItemCaption("07", "CONSUMIDOR FINAL");
    tipoIdentificacion.setItemCaption("08", "IDENTIFICADOR EXTERIOR");
    tipoIdentificacion.setNullSelectionAllowed(false);
    tipoIdentificacion.setValue("04");
    tipoIdentificacion.setWidth("140px");

    h1.addComponent(tipoIdentificacion, id);
    h1.addComponent("Razón Social", razonSocial);
    // h1.addComponent("Dirección",direccion);
    h1.addComponent("Email", correoElectronico);
    botonAnadir = new BotonAnadir();

    addComponent(h1);
    setComponentAlignment(h1, Alignment.TOP_CENTER);
    HorizontalL h2 = new HorizontalL();
    h2.addComponent("direccion", direccion);
    h2.addComponent(botonAnadir);
    addComponent(h2);

    grid = new Grid();
    beanItemC = new BeanItemContainer<DemografiaCliente>(DemografiaCliente.class);
    grid.setContainerDataSource(beanItemC);
    //		DemografiaCliente d=new DemografiaCliente();
    //		beanItemC.addBean(d);
    grid.removeColumn("entidadEmisora");
    grid.getColumn("id").setHeaderCaption("Identificacion");
    grid.setColumnOrder("razonSocial", "identificacion", "direccion", "correoElectronico");
    grid.setSizeFull();
    grid.removeColumn("tipoIdentificacion");
    grid.removeColumn("id");
    botonCancelar = new BotonCancelar();

    addComponent(grid);
    addComponent(botonCancelar);
    setComponentAlignment(botonCancelar, Alignment.BOTTOM_RIGHT);
    setComponentAlignment(h2, Alignment.TOP_CENTER);
    setExpandRatio(h1, 1);
    setExpandRatio(h2, 1);
    setExpandRatio(grid, 8);
    setExpandRatio(botonCancelar, 1);
    nuevoDato = new DemografiaCliente();
    beanItem = new BeanItem<DemografiaCliente>(nuevoDato);
    fg = new FieldGroup();
    fg.setItemDataSource(beanItem);
  }