Beispiel #1
0
  private void init() {
    // widgetListTable=new WidgetList();
    // widgetListTable.setRound(true);
    main = new FlowPanel();

    // Window.addResizeHandler(this);
    header = new HeaderMenu();
    lblCenter = new Label(constants.seleccionar());
    header.setCenterWidget(lblCenter);
    btnBack = new PushButton(new Image(MyResource.INSTANCE.getImgBack32()));
    header.setLeftWidget(btnBack);
    btnSelect = new PushButton(new Image(MyResource.INSTANCE.getImgSelect32()));
    header.setRightWidget(btnSelect);
    main.add(header);
    toolBar = new ToolBar();
    main.add(toolBar);

    txtBuscar = new MSearchBox();
    txtBuscar.setPlaceHolder(constants.buscarCliente());
    main.add(txtBuscar);

    headerGrid = new HeaderGrid();
    main.add(headerGrid);

    headerGridDni = new Label(constants.dni());
    headerGrid.add(headerGridDni);

    headerGridCliente = new Label(constants.clientes());
    headerGrid.add(headerGridCliente);

    container = new FlowPanel();
    // main.add(container);

    scrollPanel = new ScrollPanel();
    scrollPanel.setScrollingEnabledY(true);
    scrollPanel.setScrollingEnabledX(false);
    scrollPanel.setAutoHandleResize(true);

    /*scrollPanel.setScrollingEnabledX(false);
    scrollPanel.setScrollingEnabledY(true);
    scrollPanel.setAutoHandleResize(true);*/
    // scrollPanel.setUsePos(MGWT.getOsDetection().isAndroid());

    grid = new GridCliente();
    container.add(grid);
    // widgetListTable.add(container);
    scrollPanel.setWidget(container);
    // cargarTabla();
    main.add(scrollPanel);
    Window.addResizeHandler(
        new ResizeHandler() {

          @Override
          public void onResize(ResizeEvent event) {
            // TODO Auto-generated method stub
            reCalcularWindows();
          }
        });
    initWidget(main);
  }
Beispiel #2
0
 @SuppressWarnings("unchecked")
 private void initWidgetListener() {
   txtBuscar.addValueChangeHandler(this);
   toolBar.getBtnNuevo().addClickHandler(this);
   toolBar.getBtnEditar().addClickHandler(this);
   toolBar.getBtnEliminar().addClickHandler(this);
   toolBar.getBtnActualizar().addClickHandler(this);
   btnSelect.addClickHandler(this);
   btnBack.addClickHandler(this);
 }
Beispiel #3
0
 private void filtrar() {
   grid.getDataProvider().setFilter(txtBuscar.getText());
   if (grid.getDataProvider().hasFilter()) {
     int alto = grid.getDataProvider().resulted.size() * 15;
     // grid.setHeight(alto + "mm");
   } else {
     int alto = grid.getData().size() * 15;
     // grid.setHeight(alto + "mm");
   }
   grid.getDataProvider().refresh();
 }
Beispiel #4
0
 @Override
 public void onKeyUp(KeyUpEvent event) {
   if (event.getSource().equals(txtBuscar.textBox)) {
     grid.getDataProvider().setFilter(txtBuscar.getText());
     grid.getDataProvider().refresh();
   } else if (event.getSource().equals(grid)) {
     if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER
         || event.getNativeEvent().getKeyCode() == KeyCodes.KEY_SPACE) {
       itemSelected();
     }
   }
 }
Beispiel #5
0
 private void initStyle() {
   MyResource.INSTANCE.getStlModel().ensureInjected();
   pnlOperacion.getElement().getStyle().setTextAlign(Style.TextAlign.CENTER);
   btnOperacion.setWidth("90%");
   form.getPnlUnion().setWidth("100%");
   btnBack.addStyleName(MyResource.INSTANCE.getStlModel().pushButton());
   lblCenter.getElement().getStyle().setFontWeight(Style.FontWeight.BOLD);
   form.getPnlBusqueda().setHeight("80px");
   form.getPnlBusqueda().getElement().getStyle().setMarginBottom(10, Style.Unit.PX);
   form.getPnlTabla().setHeight("400px");
   MyResource.INSTANCE.getStlModel().ensureInjected();
   txtBuscar.getElement().getFirstChild().getFirstChild().removeFromParent();
   pnlHeader.setWidth("100%");
 }
Beispiel #6
0
  private void style() {
    MyResource.INSTANCE.getStlUICliente().ensureInjected();
    btnSelect.addStyleName(MyResource.INSTANCE.getStlUICliente().pushButton());
    btnBack.addStyleName(MyResource.INSTANCE.getStlUICliente().pushButton());
    // main.setWidth("100%");
    headerGridDni.setWidth("40%");
    headerGridCliente.setWidth("60%");
    // setHeightContainer(55);
    // setWidthGrid();
    // scrollPanel.setWidth("100%");
    // scrollPanel.setHeight("auto");

    txtBuscar.addStyleName(MyResource.INSTANCE.getStlUICliente().txtBuscarUICliente());
    grid.addStyleName(MyResource.INSTANCE.getStlUICliente().gridUICliente());

    headerGridDni.getElement().getStyle().setFloat(Style.Float.LEFT);
    headerGridCliente.getElement().getStyle().setFloat(Style.Float.LEFT);
  }
Beispiel #7
0
  private void initComponents() {
    pnlHeader = new FlexTable();
    txtBuscar = new MSearchBox();
    txtBuscar.setPlaceHolder("Buscar");
    form = new UIFormMantenimiento();
    header = new HeaderMenu();
    lblCenter = new Label("SELECCIONAR EQUIPOS");
    btnBack = new PushButton(new Image(MyResource.INSTANCE.getImgBack32()));
    btnBack.setTitle("Volver Atras");
    header.setLeftWidget(btnBack);
    header.setCenterWidget(lblCenter);
    grid = new GridItemPlan();
    // grid.setAlwaysShowScrollBars(true);
    // grid.setMinimumTableWidth(1024, Style.Unit.PX);
    pnlOperacion = new FlowPanel();
    btnOperacion = new Button("Agregar");
    pnlOperacion.add(btnOperacion);
    btnOperacion.setConfirm(true);
    form.getPnlTabla().add(grid);
    form.getPnlTabla().add(grid.getPager());
    form.getPnlTabla().add(pnlOperacion);

    pnlHeader.setWidget(0, 0, header);
    pnlHeader.setWidget(1, 0, txtBuscar);
    form.getPnlBusqueda().add(pnlHeader);
    form.getPnlBotones().setVisible(false);
    grid.addHandler(this, KeyUpEvent.getType());
    grid.getSelectionModel()
        .addSelectionChangeHandler(
            new SelectionChangeEvent.Handler() {
              @Override
              public void onSelectionChange(SelectionChangeEvent event) {}
            });
    this.add(form);
    this.setGlassEnabled(true);
    this.setAnimationEnabled(true);
    this.setModal(true);
    this.setAutoHideEnabled(true);
    this.setSize("700px", "540px");
    this.center();
  }