예제 #1
0
 @Override
 public void removeEquipos() {
   List<ItemPlanProxy> lista = new ArrayList(grid.getSelectionModel().getSelectedSet());
   if (lista.size() > 0) {
     this.ui.removeEquipos(lista, beanDetalle);
   } else {
     Notification not = new Notification(Notification.ALERT, "Seleccione series a remover");
     not.showPopup();
   }
   hide();
 }
예제 #2
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();
  }
예제 #3
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();
     }
   }
 }
예제 #4
0
 @Override
 public void addEquipos() {
   Set<ItemPlanProxy> lista = grid.getSelectionModel().getSelectedSet();
   if (lista.size() > 0) {
     this.ui.addEquipos(lista, beanDetalle);
   } else {
     Notification not = new Notification(Notification.ALERT, "Seleccione series a agregar");
     not.showPopup();
     this.ui.cleanDataPostItem();
   }
   hide();
 }
예제 #5
0
 public void setModo(String modo, String edit) {
   this.modo = modo;
   if (this.modo.equalsIgnoreCase("ADD")) {
     lblCenter.setText("SELECCIONAR EQUIPOS");
     btnOperacion.setText("Agregar");
     btnOperacion.setVisible(true);
   } else if (this.modo.equalsIgnoreCase("REMOVE")) {
     lblCenter.setText("SELECCIONAR EQUIPOS");
     btnOperacion.setText("Quitar");
     btnOperacion.setVisible(true);
   } else {
     lblCenter.setText("LISTADO DE EQUIPOS");
     btnOperacion.setText("DETALLE");
     btnOperacion.setVisible(false);
   }
   grid.setModo(edit);
 }
예제 #6
0
 private void itemSelected() {
   if (grid.getDataProvider().hasFilter()) {
     ItemPlanProxy beanSerieItem =
         grid.getDataProvider().resulted.get(grid.getKeyboardSelectedRow());
     grid.getSelectionModel().setSelected(beanSerieItem, Boolean.TRUE);
     grid.flush();
     grid.redraw();
   } else {
     ItemPlanProxy beanSerieItem = grid.getData().get(grid.getKeyboardSelectedRow());
     grid.getSelectionModel().setSelected(beanSerieItem, Boolean.TRUE);
     grid.flush();
     grid.redraw();
   }
 }