List of usage examples for com.google.gwt.user.client.ui FlexTable getFlexCellFormatter
public FlexCellFormatter getFlexCellFormatter()
From source file:com.webgocommerce.client.view.uigerzonal.UIGerZonalImpl.java
@Override public void exportarData() { int row = 0;/*from w ww . j a va2 s . com*/ List<GerenteZonalProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "DNI"); flex.setText(0, 2, "NOMBRES"); flex.setText(0, 3, "APELLIDOS"); flex.setText(0, 4, "CORREO"); flex.setText(0, 5, "CELULAR"); for (int j = 0; j < 6; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { GerenteZonalProxy bean = lista.get(i); flex.setText(fila, 0, bean.getId().toString()); flex.setText(fila, 1, bean.getDni()); flex.setText(fila, 2, bean.getNombres()); flex.setText(fila, 3, bean.getApellidos()); flex.setText(fila, 4, bean.getCorreo()); flex.setText(fila, 5, bean.getCelular()); fila = fila + 1; } TableToExcel.save(flex, "GerenteZonal" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uilistaprecio.UIListaPrecioImpl.java
@Override public void exportarData() { int row = 0;//from w w w .ja v a 2 s .co m List<ListaPrecioProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "CANAL"); flex.setText(0, 2, "CATEGORIA"); flex.setText(0, 3, "DESCRIPCION"); flex.setText(0, 4, "CONDICION"); flex.setText(0, 5, "PAGO"); flex.setText(0, 6, "MESES"); flex.setText(0, 7, "FECHA INI"); flex.setText(0, 8, "FECHA FIN"); flex.setText(0, 9, "ESTADO"); for (int j = 0; j < 10; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { ListaPrecioProxy bean = lista.get(i); flex.setText(fila, 0, bean.getId().toString()); flex.setText(fila, 1, bean.getCanal()); flex.setText(fila, 2, bean.getBeanCategoriaLista().getDescripcion()); flex.setText(fila, 3, bean.getDescripcion()); flex.setText(fila, 4, bean.getCondicion()); flex.setText(fila, 5, bean.getPagoMensual().toString()); flex.setText(fila, 6, bean.getVigencia().toString()); flex.setText(fila, 7, bean.getFechaIni() != null ? dateFormat.format(bean.getFechaIni()) : ""); flex.setText(fila, 8, bean.getFechaFin() != null ? dateFormat.format(bean.getFechaFin()) : ""); flex.setText(fila, 9, bean.getEstadoActiva()); fila = fila + 1; } TableToExcel.save(flex, "listaprecio" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uilocalidad.UILocalidadImpl.java
@Override public void exportarData() { int row = 0;/*from w ww . j a va 2s . co m*/ List<LocalidadProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "DESCRIPCION"); for (int j = 0; j < 2; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { LocalidadProxy bean = lista.get(i); flex.setText(fila, 0, bean.getIdLocalidad().toString()); flex.setText(fila, 1, bean.getDescripcion()); fila = fila + 1; } TableToExcel.save(flex, "localidad" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uimenu.UIMenuImpl.java
@Override public void exportarData() { int row = 0;//from w w w.j av a2s .c o m List<MenuBarProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "TIPO"); flex.setText(0, 2, "VARIABLE"); flex.setText(0, 3, "DESCRIPCION"); flex.setText(0, 4, "NIVEL"); flex.setText(0, 5, "ORDEN"); flex.setText(0, 6, "GRUPO"); flex.setText(0, 7, "NUMSUBMENU"); for (int j = 0; j < 8; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { MenuBarProxy bean = lista.get(i); flex.setText(fila, 0, bean.getIdMenuBar().toString()); flex.setText(fila, 1, bean.getTipo()); flex.setText(fila, 2, bean.getVariable()); flex.setText(fila, 3, bean.getDescripcion()); flex.setText(fila, 4, bean.getNivel().toString()); flex.setText(fila, 5, bean.getOrden().toString()); flex.setText(fila, 6, bean.getGrupo().toString()); flex.setText(fila, 7, bean.getNumSubMenu().toString()); fila = fila + 1; } TableToExcel.save(flex, "Menus" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uimesa.UIMesaImpl.java
@Override public void exportarData() { int row = 0;// w w w . j a v a2 s .c o m List<MesaProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "SUCURSAL"); flex.setText(0, 2, "MESA"); flex.setText(0, 3, "SUPERVISOR"); flex.setText(0, 4, "GERENTE ZONAL"); flex.setText(0, 5, "COORDINADOR"); flex.setText(0, 6, "ESTADO"); flex.setText(0, 7, "FECHA INICIO"); flex.setText(0, 8, "FECHA FIN"); for (int j = 0; j < 9; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { MesaProxy bean = lista.get(i); flex.setText(fila, 0, bean.getIdMesa().toString()); flex.setText(fila, 1, bean.getNomSucursal()); flex.setText(fila, 2, bean.getDescripcion()); flex.setText(fila, 3, bean.getNomSupervisor()); flex.setText(fila, 4, bean.getNomGerenteZonal()); flex.setText(fila, 5, bean.getNomCoordinador()); flex.setText(fila, 6, bean.getEstado()); flex.setText(fila, 7, bean.getFechaIni() != null ? dateFormat.format(bean.getFechaIni()) : ""); flex.setText(fila, 8, bean.getFechaFin() != null ? dateFormat.format(bean.getFechaFin()) : ""); fila = fila + 1; } TableToExcel.save(flex, "mesa" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uiparam.UIParamImpl.java
@Override public void exportarData() { int row = 0;// ww w. ja v a 2s.com List<ParamProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "ABREVIATURA"); flex.setText(0, 2, "DESCRIPCION"); flex.setText(0, 3, "VALOR"); for (int j = 0; j < 4; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { ParamProxy bean = lista.get(i); flex.setText(fila, 0, bean.getIdParam().toString()); flex.setText(fila, 1, bean.getAbreviatura()); flex.setText(fila, 2, bean.getDescripcion()); flex.setText(fila, 3, bean.getValor()); fila = fila + 1; } TableToExcel.save(flex, "parametro" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uisucursal.UISucursalImpl.java
@Override public void exportarData() { int row = 0;/*w ww. j av a 2 s. co m*/ List<SucursalProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "LOCALIDAD"); flex.setText(0, 2, "SUCURSAL"); for (int j = 0; j < 3; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { SucursalProxy bean = lista.get(i); flex.setText(fila, 0, bean.getIdLocalidad().toString()); flex.setText(fila, 1, bean.getNomLocalidad()); flex.setText(fila, 2, bean.getDescripcion()); fila = fila + 1; } TableToExcel.save(flex, "sucursal" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uisupervisor.UISupervisorImpl.java
@Override public void exportarData() { int row = 0;//from w ww . ja v a2s. c om List<SupervisorProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "ID"); flex.setText(0, 1, "CANAL"); flex.setText(0, 2, "SUCURSAL"); flex.setText(0, 3, "TIENDA"); flex.setText(0, 4, "PTO. EMISION"); flex.setText(0, 5, "DNI"); flex.setText(0, 6, "NOMBRES"); flex.setText(0, 7, "APELLIDOS"); flex.setText(0, 8, "COD. ALTERNO"); flex.setText(0, 9, "CORREO"); flex.setText(0, 10, "CELULAR"); flex.setText(0, 11, "MESA"); for (int j = 0; j < 12; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { SupervisorProxy bean = lista.get(i); flex.setText(fila, 0, bean.getIdSupervisor().toString()); flex.setText(fila, 1, bean.getCanal()); flex.setText(fila, 2, bean.getNomSucursal()); flex.setText(fila, 3, bean.getNomTienda()); flex.setText(fila, 4, bean.getNomPtoEmision()); flex.setText(fila, 5, bean.getDni()); flex.setText(fila, 6, bean.getNombres()); flex.setText(fila, 7, bean.getApellidos()); flex.setText(fila, 8, bean.getCodigoAlterno()); flex.setText(fila, 9, bean.getCorreo()); flex.setText(fila, 10, bean.getCelular()); flex.setText(fila, 11, bean.getNomMesa()); fila = fila + 1; } TableToExcel.save(flex, "Supervisor" + (new Date()).getTime()); }
From source file:com.webgocommerce.client.view.uivendedor.UIVendedorImpl.java
@Override public void exportarData() { int row = 0;//from w w w. ja va2s . co m List<VendedorProxy> lista; if (!grid.getDataProvider().hasFilter()) { row = grid.getData().size(); lista = grid.getData(); } else { row = grid.getDataProvider().resulted.size(); lista = grid.getDataProvider().resulted; } if (row == 0) { Notification not = new Notification(Notification.ALERT, "Grid sin datos"); not.showPopup(); return; } FlexTable flex = new FlexTable(); flex.setText(0, 0, "CODIGO"); flex.setText(0, 1, "CANAL"); flex.setText(0, 2, "SUCURSAL"); flex.setText(0, 3, "TIENDA"); flex.setText(0, 4, "PTO. EMISION"); flex.setText(0, 5, "DNI"); flex.setText(0, 6, "VENDEDOR"); flex.setText(0, 7, "COD. ALTERNO"); flex.setText(0, 8, "CORREO"); flex.setText(0, 9, "CELULAR"); flex.setText(0, 10, "MESA"); for (int j = 0; j < 11; j++) { flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontWeight(Style.FontWeight.BOLD); flex.getFlexCellFormatter().getElement(0, j).getStyle().setFontSize(14, Style.Unit.PX); flex.getFlexCellFormatter().getElement(0, j).getStyle().setBackgroundColor("#0170C9"); flex.getFlexCellFormatter().getElement(0, j).getStyle().setColor("#fff"); } int fila = 1; for (int i = 0; i < row; i++) { VendedorProxy bean = lista.get(i); flex.setText(fila, 0, bean.getIdVendedor()); flex.setText(fila, 1, bean.getCanal()); flex.setText(fila, 2, bean.getNomSucursal()); flex.setText(fila, 3, bean.getNomTienda()); flex.setText(fila, 4, bean.getNomPtoEmision()); flex.setText(fila, 5, bean.getDni()); flex.setText(fila, 6, bean.getNomVendedor()); flex.setText(fila, 7, bean.getCodigoAlterno()); flex.setText(fila, 8, bean.getCorreo()); flex.setText(fila, 9, bean.getCelular()); flex.setText(fila, 10, bean.getNomMesa()); fila = fila + 1; } TableToExcel.save(flex, "vendedor" + (new Date()).getTime()); }
From source file:de.atns.common.gwt.client.composite.colorpicker.ColorPicker.java
License:Artistic License
public ColorPicker() { // UI Drawing //------------------ hue = 0;// w w w . java2s .c o m saturation = 100; brightness = 100; red = 255; green = 0; blue = 0; HorizontalPanel panel = new HorizontalPanel(); FlexTable table = new FlexTable(); // Add the large slider map slidermap = new SliderMap(this); panel.add(slidermap); panel.setCellWidth(slidermap, "258px"); panel.setCellHeight(slidermap, "258px"); // Add the small slider bar sliderbar = new SliderBar(this); panel.add(sliderbar); panel.setCellWidth(sliderbar, "40px"); panel.setCellHeight(sliderbar, "258px"); // Define the Flextable's content // Color preview at the top colorpreview = new HTML(""); colorpreview.setWidth("50px"); colorpreview.setHeight("50px"); DOM.setStyleAttribute(colorpreview.getElement(), "border", "1px solid black"); // Radio buttons String rbgroup = "color" + this.hashCode(); rbHue = new RadioButton(rbgroup, "H:"); rbHue.addClickHandler(this); rbSaturation = new RadioButton(rbgroup, "S:"); rbSaturation.addClickHandler(this); rbBrightness = new RadioButton(rbgroup, "V:"); rbBrightness.addClickHandler(this); rbRed = new RadioButton(rbgroup, "R:"); rbRed.addClickHandler(this); rbGreen = new RadioButton(rbgroup, "G:"); rbGreen.addClickHandler(this); rbBlue = new RadioButton(rbgroup, "B:"); rbBlue.addClickHandler(this); // Textboxes tbHue = new TextBox(); tbHue.setText(new Integer(hue).toString()); tbHue.setMaxLength(3); tbHue.setVisibleLength(4); tbHue.addKeyPressHandler(this); tbHue.addChangeHandler(this); tbSaturation = new TextBox(); tbSaturation.setText(new Integer(saturation).toString()); tbSaturation.setMaxLength(3); tbSaturation.setVisibleLength(4); tbSaturation.addKeyPressHandler(this); tbSaturation.addChangeHandler(this); tbBrightness = new TextBox(); tbBrightness.setText(new Integer(brightness).toString()); tbBrightness.setMaxLength(3); tbBrightness.setVisibleLength(4); tbBrightness.addKeyPressHandler(this); tbBrightness.addChangeHandler(this); tbRed = new TextBox(); tbRed.setText(new Integer(red).toString()); tbRed.setMaxLength(3); tbRed.setVisibleLength(4); tbRed.addKeyPressHandler(this); tbRed.addChangeHandler(this); tbGreen = new TextBox(); tbGreen.setText(new Integer(green).toString()); tbGreen.setMaxLength(3); tbGreen.setVisibleLength(4); tbGreen.addKeyPressHandler(this); tbGreen.addChangeHandler(this); tbBlue = new TextBox(); tbBlue.setText(new Integer(blue).toString()); tbBlue.setMaxLength(3); tbBlue.setVisibleLength(4); tbBlue.addKeyPressHandler(this); tbBlue.addChangeHandler(this); tbHexColor = new TextBox(); tbHexColor.setText("ff0000"); tbHexColor.setMaxLength(6); tbHexColor.setVisibleLength(6); tbHexColor.addKeyPressHandler(this); tbHexColor.addChangeHandler(this); // Put together the FlexTable table.setWidget(0, 0, colorpreview); table.getFlexCellFormatter().setColSpan(0, 0, 3); table.setWidget(1, 0, rbHue); table.setWidget(1, 1, tbHue); table.setWidget(1, 2, new HTML("°")); table.setWidget(2, 0, rbSaturation); table.setWidget(2, 1, tbSaturation); table.setText(2, 2, "%"); table.setWidget(3, 0, rbBrightness); table.setWidget(3, 1, tbBrightness); table.setText(3, 2, "%"); table.setWidget(4, 0, rbRed); table.setWidget(4, 1, tbRed); table.setWidget(5, 0, rbGreen); table.setWidget(5, 1, tbGreen); table.setWidget(6, 0, rbBlue); table.setWidget(6, 1, tbBlue); table.setText(7, 0, "#:"); table.setWidget(7, 1, tbHexColor); table.getFlexCellFormatter().setColSpan(7, 1, 2); // Final setup panel.add(table); rbSaturation.setValue(true); setPreview("ff0000"); DOM.setStyleAttribute(colorpreview.getElement(), "cursor", "default"); // First event onClick(rbSaturation); initWidget(panel); }