Exemplo n.º 1
0
  public FormRevalorizaP() {
    setColumns(5); // columnas que aceptara el grid en las posiciones
    setRows(3); // filas que aceptara el grid
    setWidth("100%"); // ancho de todo el grid
    setMargin(true); // espacio de los cuatro costados
    setSpacing(true); // distancia de componente a componente

    this.dt_fecha = new DateField("Fecha:");
    this.txt_no_resolucion = new TextField("No. Resolucion");

    pitm_Revaloriza.addItemProperty("fecha", new ObjectProperty<Date>(new Date()));
    pitm_Revaloriza.addItemProperty("resolucion", new ObjectProperty<String>(""));

    this.binder_Revaloriza = new FieldGroup(pitm_Revaloriza);
    // instanciando FieldGroup mandandole PropertysetItem
    this.binder_Revaloriza.bind(this.dt_fecha, "fecha");
    this.binder_Revaloriza.bind(this.txt_no_resolucion, "resolucion");
    this.binder_Revaloriza.clear();

    this.txt_no_resolucion.setRequired(true);
    this.dt_fecha.setRequired(true);
    this.txt_no_resolucion.addValidator(new NullValidator("", false));
    // new NullValidator("", false) por es una clase de vaadin --> no da errores pero tampoco deja
    // registrar
    //		this.dt_fecha.setEnabled(false);

    this.dt_fecha.setWidth("40%");
    this.txt_no_resolucion.setWidth("90%");

    buildContent();
    Responsive.makeResponsive(this);
  }
Exemplo n.º 2
0
  public FormEstadoSoporte() {

    super.setColumns(4);
    super.setRows(3);
    setSpacing(true);
    setMargin(true);
    setWidth("100%");

    this.txt_id_estado_soporte = new TextField("Id. Estado Soporte:");
    this.txt_nombre_esoporte = new TextField("Descripcion del Estado de Soporte: ");
    this.mensajes = new ArrayList<BarMessage>();

    pitm_esoporte.addItemProperty("id_estado_soporte", new ObjectProperty<Integer>(0));
    pitm_esoporte.addItemProperty("nombre_estado_soporte", new ObjectProperty<String>(""));
    pitm_esoporte.addItemProperty("sigla", new ObjectProperty<String>(""));

    this.binder_esoporte = new FieldGroup(this.pitm_esoporte);

    binder_esoporte.bind(this.txt_id_estado_soporte, "id_estado_soporte");
    binder_esoporte.bind(this.txt_nombre_esoporte, "nombre_estado_soporte");

    this.txt_nombre_esoporte.setRequired(true);
    this.txt_nombre_esoporte.addValidator(new NullValidator("No Nulo", false));
    this.txt_nombre_esoporte.addValidator(
        new StringLengthValidator(Messages.STRING_LENGTH_MESSAGE(3, 50), 3, 50, false));
    this.txt_id_estado_soporte.setEnabled(false);

    txt_id_estado_soporte.setWidth("90%");
    txt_nombre_esoporte.setWidth("90%");

    updateId();
    buildContent();
    Responsive.makeResponsive(this);
  }
Exemplo n.º 3
0
  public FormHistorico() {
    super(3, 4);
    setWidth("100%");
    setMargin(true);
    setSpacing(true);

    this.cb_Grupo = new ComboBox("Elija un Grupo Contable");
    this.cb_Grupo.addValueChangeListener(this);
    this.cb_Auxiliar = new ComboBox("Elija un Auxiliar Contable");
    this.cb_Auxiliar.addValueChangeListener(this);
    this.cb_Activos = new ComboBox("Elija un Activo");

    pitm_Kardex.addItemProperty("grupo_contable", new ObjectProperty<String>(""));
    pitm_Kardex.addItemProperty("auxiliar_contable", new ObjectProperty<String>(""));
    pitm_Kardex.addItemProperty("activos", new ObjectProperty<String>(""));

    this.binder_Kardex = new FieldGroup(pitm_Kardex);

    this.binder_Kardex.bind(this.cb_Grupo, "grupo_contable");
    this.binder_Kardex.bind(this.cb_Auxiliar, "auxiliar_contable");
    this.binder_Kardex.bind(this.cb_Activos, "activos");
    this.binder_Kardex.clear();

    this.cb_Grupo.addValidator(new NullValidator("", false));
    this.cb_Auxiliar.addValidator(new NullValidator("", false));
    this.cb_Activos.addValidator(new NullValidator("", false));

    this.dtf_fechaElaboracion.setValue(new Date());
    fillcbGrupo();
    buildContent();
  }
Exemplo n.º 4
0
  private void initLayout() {

    layout.setMargin(true);
    setContent(layout);

    form.setCaption("Employee Details ");
    PropertysetItem item = new PropertysetItem();
    item.addItemProperty("Name", new ObjectProperty<String>(""));
    item.addItemProperty("Address", new ObjectProperty<String>(""));

    ComboBox combobox = new ComboBox("Sex");
    combobox.setInvalidAllowed(true);
    combobox.setNullSelectionAllowed(false);
    combobox.addItem("Male");
    combobox.addItem("Female");
    item.addItemProperty("Age", new ObjectProperty<String>(""));
    item.addItemProperty("Email", new ObjectProperty<String>(""));
    item.addItemProperty("Mobile No", new ObjectProperty<String>(""));

    Form form = new Form();
    final Form reader = new Form();
    form.setCaption("Fill Your Details");
    form.setItemDataSource(item);
    reader.setItemDataSource(item);
    reader.setCaption("Your registation details");
    reader.setReadOnly(true);

    button.addClickListener(
        new Button.ClickListener() {
          public void buttonClick(ClickEvent event) {

            Label message = new Label("You are Registered");
            layout.addComponent(message);
            layout.addComponent(reader);
          }
        });
    layout.addComponent(form);

    final RichTextArea area = new RichTextArea();
    area.setValue("Add more details here");
    layout.addComponent(area);

    layout.addComponent(button);
  }
 private Item cloneItem(Item originalItem) {
   PropertysetItem newItem = new PropertysetItem();
   for (Object propertyId : originalItem.getItemPropertyIds()) {
     Property originalProperty = originalItem.getItemProperty(propertyId);
     newItem.addItemProperty(
         propertyId,
         new ObjectProperty(
             originalProperty.getValue(),
             originalProperty.getType(),
             originalProperty.isReadOnly()));
   }
   return newItem;
 }
Exemplo n.º 6
0
 @Override
 public List<Item> loadItems(final int start, final int count) {
   final List<InfoSystemService> systems =
       AdminServiceProvider.get().queryInfoSystemServices(ids, asc, start, count);
   final List<Item> items = Lists.newArrayListWithExpectedSize(systems.size());
   for (final InfoSystemService s : systems) {
     final PropertysetItem item = new PropertysetItem();
     InfoSystem infoSystem = s.getInfoSystem();
     item.addItemProperty("id", new ObjectProperty<String>(s.getId().toString()));
     item.addItemProperty(
         "infosys", new ObjectProperty<String>(infoSystem == null ? "" : infoSystem.getCode()));
     item.addItemProperty("address", new ObjectProperty<String>(s.getAddress()));
     item.addItemProperty("revision", new ObjectProperty<String>(s.getRevision()));
     item.addItemProperty("sname", new ObjectProperty<String>(s.getSname()));
     item.addItemProperty("sversion", new ObjectProperty<String>(s.getSversion()));
     item.addItemProperty("name", new ObjectProperty<String>(s.getName()));
     item.addItemProperty("available", new ObjectProperty<Boolean>(s.isAvailable()));
     items.add(item);
   }
   return items;
 }
Exemplo n.º 7
0
  public DateFields() {
    setMargin(true);

    Label h1 = new Label("Date Fields");
    h1.addStyleName(ValoTheme.LABEL_H1);
    addComponent(h1);

    HorizontalLayout row = new HorizontalLayout();
    row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    row.setSpacing(true);
    addComponent(row);

    DateField date = new DateField("Default resolution");
    setDate(date);
    row.addComponent(date);

    date = new DateField("Error");
    setDate(date);
    date.setComponentError(new UserError("Fix it, now!"));
    row.addComponent(date);

    date = new DateField("Error, borderless");
    setDate(date);
    date.setComponentError(new UserError("Fix it, now!"));
    date.addStyleName(ValoTheme.DATEFIELD_BORDERLESS);
    row.addComponent(date);

    CssLayout group = new CssLayout();
    group.setCaption("Grouped with a Button");
    group.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    row.addComponent(group);

    final DateField date2 = new DateField();
    group.addComponent(date2);

    Button today =
        new Button(
            "Today",
            new ClickListener() {
              @Override
              public void buttonClick(ClickEvent event) {
                date2.setValue(new Date());
              }
            });
    group.addComponent(today);

    date = new DateField("Default resolution, explicit size");
    setDate(date);
    row.addComponent(date);
    date.setWidth("260px");
    date.setHeight("60px");

    date = new DateField("Second resolution");
    setDate(date);
    date.setResolution(Resolution.SECOND);
    row.addComponent(date);

    date = new DateField("Minute resolution");
    setDate(date);
    date.setResolution(Resolution.MINUTE);
    row.addComponent(date);

    date = new DateField("Hour resolution");
    setDate(date);
    date.setResolution(Resolution.HOUR);
    row.addComponent(date);

    date = new DateField("Disabled");
    setDate(date);
    date.setResolution(Resolution.HOUR);
    date.setEnabled(false);
    row.addComponent(date);

    date = new DateField("Day resolution");
    setDate(date);
    date.setResolution(Resolution.DAY);
    row.addComponent(date);

    date = new DateField("Month resolution");
    setDate(date);
    date.setResolution(Resolution.MONTH);
    row.addComponent(date);

    date = new DateField("Year resolution");
    setDate(date);
    date.setResolution(Resolution.YEAR);
    row.addComponent(date);

    date = new DateField("Custom color");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName("color1");
    row.addComponent(date);

    date = new DateField("Custom color");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName("color2");
    row.addComponent(date);

    date = new DateField("Custom color");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName("color3");
    row.addComponent(date);

    date = new DateField("Small");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName(ValoTheme.DATEFIELD_SMALL);
    row.addComponent(date);

    date = new DateField("Large");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName(ValoTheme.DATEFIELD_LARGE);
    row.addComponent(date);

    date = new DateField("Borderless");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName(ValoTheme.DATEFIELD_BORDERLESS);
    row.addComponent(date);

    date = new DateField("Week numbers");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.setLocale(new Locale("fi", "fi"));
    date.setShowISOWeekNumbers(true);
    row.addComponent(date);

    date = new DateField("US locale");
    setDate(date);
    date.setResolution(Resolution.SECOND);
    date.setLocale(new Locale("en", "US"));
    row.addComponent(date);

    date = new DateField("Custom format");
    setDate(date);
    date.setDateFormat("E dd/MM/yyyy");
    row.addComponent(date);

    date = new DateField("Tiny");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName(ValoTheme.DATEFIELD_TINY);
    row.addComponent(date);

    date = new DateField("Huge");
    setDate(date);
    date.setResolution(Resolution.DAY);
    date.addStyleName(ValoTheme.DATEFIELD_HUGE);
    row.addComponent(date);

    date = new InlineDateField("Date picker");
    setDate(date);
    setDateRange(date);
    row.addComponent(date);

    date = new InlineDateField("Date picker with week numbers");
    setDate(date);
    date.setLocale(new Locale("fi", "fi"));
    date.setShowISOWeekNumbers(true);
    row.addComponent(date);

    PropertysetItem item = new PropertysetItem();
    item.addItemProperty("date", new ObjectProperty<Date>(getDefaultDate()));

    FormLayout form = new FormLayout();
    form.setMargin(false);

    FieldGroup binder = new FieldGroup(item);
    form.addComponent(binder.buildAndBind("Picker in read-only field group", "date"));
    binder.setReadOnly(true);

    row.addComponent(form);
  }