Ejemplo n.º 1
0
  /**
   * The constructor should first build the main layout, set the composition root and then do any
   * custom initialization.
   *
   * <p>The constructor will not be automatically regenerated by the visual editor.
   *
   * @throws Exception
   * @throws IllegalArgumentException
   */
  public TireViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    vehicleField.setNullSelectionAllowed(false);
    vehicleField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    vehicleField.setItemCaptionPropertyId("vehicleNumber");

    supplierField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    supplierField.setItemCaptionPropertyId("name");

    supplierField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    supplierField.setItemCaptionPropertyId("name");

    tireTypeField.setNullSelectionAllowed(false);
    tireTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    tireTypeField.setItemCaptionPropertyId("description");

    tireStatusField.setNullSelectionAllowed(false);
    tireStatusField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    tireStatusField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
  }
Ejemplo n.º 2
0
  /**
   * The constructor should first build the main layout, set the composition root and then do any
   * custom initialization.
   *
   * <p>The constructor will not be automatically regenerated by the visual editor.
   *
   * @throws Exception
   * @throws IllegalArgumentException
   */
  public ClientViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    this.userField.setTabSheet(tabSheetClient);
    this.userRoleCollectionField.setContext(context);

    clientTypeField.setNullSelectionAllowed(false);
    clientTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    clientTypeField.setItemCaptionPropertyId("description");

    clientGroupField.setNullSelectionAllowed(false);
    clientGroupField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    clientGroupField.setItemCaptionPropertyId("description");

    addressField.addListenerAddressChange(
        new AddressChangeListener() {
          @Override
          public void addressChange(AddressChangeEvent event) {
            if (client != null) client.setAddress(event.getAddress());
          }
        });

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
  }
  public VentanaAltaConsultaSesion(
      final IPacientes iPacientes, Observer observer, Evaluacion evaluacion) {
    this.iPacientes = iPacientes;
    this.observer = observer;
    this.evaluacion = evaluacion;
    setModal(true);
    setCaption("Ingeso de consulta/sesión");
    layout.setMargin(true);

    fecha = new PopupDateField();
    fecha.setValue(Calendar.getInstance().getTime());
    layout.addComponent(fecha);

    textArea.setInputPrompt("observaciones");
    layout.addComponent(textArea);

    //		containerTipoConsulta = new BeanItemContainer<TipoConsulta>(TipoConsulta.class,
    //				TipoConsulta.getAll());
    containerTipoConsulta =
        new BeanItemContainer<TipoConsulta>(
            TipoConsulta.class, Arrays.asList(TipoConsulta.values()));

    comboBoxTipoConsulta = new ComboBox();
    comboBoxTipoConsulta.setContainerDataSource(containerTipoConsulta);
    comboBoxTipoConsulta.setItemCaptionPropertyId("descripcion");
    comboBoxTipoConsulta.setItemCaptionMode(ItemCaptionMode.PROPERTY);
    comboBoxTipoConsulta.setImmediate(true);
    comboBoxTipoConsulta.addValueChangeListener(
        new ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty() != null) {
              TipoConsulta tipoConsulta = (TipoConsulta) event.getProperty().getValue();
              layoutAdicional.removeAllComponents();
              if (tipoConsulta != null) {
                if (tipoConsulta.equals(TipoConsulta.TERAPIA_FISICA)) {
                  layoutAdicional.addComponent(opcionesTerapiaFisica);
                } else if (tipoConsulta.equals(TipoConsulta.GIMNASIO)) {
                  layoutAdicional.addComponent(opcionesGimnasio);
                }
              }
            }
          }
        });

    layout.addComponent(comboBoxTipoConsulta);
    cargarTipoTerapiaFisica();
    cargarTipoGimnasio();
    layout.addComponent(layoutAdicional);
    layout.addComponent(this.obtenerBotonGuardar());
    this.setContent(layout);
  }
Ejemplo n.º 4
0
    void displayVersions(String path) {
      List<PageVersion> pageVersions = pageService.getPageVersions(path);
      if (pageVersions.size() > 0) {
        final ComboBox pageSelection = new ComboBox();
        content.addComponent(pageSelection);
        pageSelection.setNullSelectionAllowed(false);
        pageSelection.setStyleName("version-selection-box");
        pageSelection.setTextInputAllowed(false);

        pageSelection.addValueChangeListener(
            new ValueChangeListener() {
              private static final long serialVersionUID = 1L;

              @Override
              public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
                selectedVersion = (PageVersion) pageSelection.getValue();
                if (selectedVersion != null) {
                  Page page =
                      pageService.getPageByVersion(beanItem.getPath(), selectedVersion.getName());
                  page.setPath(beanItem.getPath());
                  previewForm.setBean(page);
                  previewLayout.setTitle(page.getSubject());
                  ((PagePreviewFormLayout) previewLayout).displayPageInfo(page);
                }
              }
            });

        pageSelection.setItemCaptionMode(ItemCaptionMode.EXPLICIT);
        pageSelection.setNullSelectionAllowed(false);

        for (int i = 0; i < pageVersions.size(); i++) {
          PageVersion version = pageVersions.get(i);
          pageSelection.addItem(version);
          pageSelection.setItemCaption(version, getVersionDisplay(version, i));
        }

        if (pageVersions.size() > 0) {
          pageSelection.setValue(pageVersions.get(pageVersions.size() - 1));
        }
      }
    }
Ejemplo n.º 5
0
  public void initUI() {
    try {
      setModal(true);
      VerticalLayout layout = (VerticalLayout) this.getContent();
      layout.setMargin(true);
      layout.setSpacing(true);
      layout.setStyleName(Reindeer.LAYOUT_WHITE);

      processesComboBox =
          new ComboBox(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("processToCategory"));
      processesComboBox.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
      //            processesComboBox.setItemCaptionPropertyId("name");
      processesComboBox.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_EXPLICIT);
      processesComboBox.setWidth("100%");

      bar.setWidth("100%");
      bar.addComponent(processesComboBox);
      bar.setExpandRatio(processesComboBox, 1);

      addBtn =
          new Button(ProcessbaseApplication.getCurrent().getPbMessages().getString("btnAdd"), this);
      bar.addComponent(addBtn);
      bar.setComponentAlignment(addBtn, Alignment.BOTTOM_RIGHT);

      layout.addComponent(bar);
      layout.addComponent(table);

      deleteBtn =
          new Button(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("btnDelete"), this);
      deleteBtn.setDescription(
          ProcessbaseApplication.getCurrent().getPbMessages().getString("deleteCategory"));
      cancelBtn =
          new Button(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("btnCancel"), this);
      saveBtn =
          new Button(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("btnSave"), this);
      buttons.addButton(deleteBtn);
      buttons.setComponentAlignment(deleteBtn, Alignment.MIDDLE_RIGHT);
      buttons.addButton(saveBtn);
      buttons.setComponentAlignment(saveBtn, Alignment.MIDDLE_RIGHT);
      buttons.setExpandRatio(saveBtn, 1);
      buttons.addButton(cancelBtn);
      buttons.setComponentAlignment(cancelBtn, Alignment.MIDDLE_RIGHT);
      buttons.setMargin(false);
      buttons.setHeight("30px");
      buttons.setWidth("100%");
      addComponent(buttons);
      setWidth("70%");
      //            setHeight("70%");
      setResizable(false);

      table.addContainerProperty(
          "name",
          String.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionProcessName"),
          null,
          null);
      table.setColumnExpandRatio("name", 1);
      table.addContainerProperty(
          "version",
          String.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionVersion"),
          null,
          null);
      table.setColumnWidth("version", 50);
      table.addContainerProperty(
          "deployedBy",
          String.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionDeployedBy"),
          null,
          null);
      table.addContainerProperty(
          "actions",
          TableLinkButton.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionActions"),
          null,
          null);
      table.setColumnWidth("actions", 50);
      table.setSelectable(false);
      table.setImmediate(true);
      table.setWidth("100%");
      table.setPageLength(10);
      refreshTable();
    } catch (Exception ex) {
      ex.printStackTrace();
      showError(ex.getMessage());
    }
  }
Ejemplo n.º 6
0
  /**
   * The constructor should first build the main layout, set the composition root and then do any
   * custom initialization.
   *
   * <p>The constructor will not be automatically regenerated by the visual editor.
   *
   * @throws Exception
   * @throws IllegalArgumentException
   */
  public JobViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    cronExpressionField.setVisible(false);
    future_timeField.setEnabled(false);
    startTimeField.setResolution(DateField.RESOLUTION_SEC);
    endTimeField.setResolution(DateField.RESOLUTION_SEC);

    // configure Type data
    areaField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    areaField.setItemCaptionPropertyId("name");

    jobTriggerTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    jobTriggerTypeField.setItemCaptionPropertyId("description");

    jobIntervalTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    jobIntervalTypeField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();

    futureField.setImmediate(true);
    futureField.addListener(
        new ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty().getValue() == null) return;

            if ((Boolean) event.getProperty().getValue()) future_timeField.setEnabled(true);
            else {
              future_timeField.setValue(null);
              future_timeField.setEnabled(false);
            }
          }
        });

    jobTriggerTypeField.setImmediate(true);
    jobTriggerTypeField.setNullSelectionAllowed(false);
    jobTriggerTypeField.addListener(
        new ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty().getValue() == null) return;

            if (((JobTriggerType) event.getProperty().getValue())
                .getCode()
                .equals(Job.JOB_TRIGGER_TYPE.SIMPLE.name())) {
              jobIntervalField.setVisible(true);
              jobIntervalTypeField.setVisible(true);
              repeatCountField.setVisible(true);
              cronExpressionField.setVisible(false);
            } else {
              jobIntervalField.setVisible(false);
              jobIntervalTypeField.setVisible(false);
              repeatCountField.setVisible(false);
              cronExpressionField.setVisible(true);
            }
          }
        });
  }