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); }
@Override public Field createField(Item item, Object propertyId, Component uiContext) { Field f; if ("annexNote".equals(propertyId)) { f = new TextArea(); ((TextArea) f).setInputPrompt("Note at bottom of receipts"); ((TextArea) f).setColumns(25); } else { f = super.createField(item, propertyId, uiContext); } if (f instanceof TextArea) { ((TextArea) f).setNullRepresentation(""); } return f; }
private void createEditorArea() { Panel editorArea = new Panel(); GridLayout grid = new GridLayout(2, 3); grid.setSizeFull(); grid.setSpacing(true); keyLabel = new Label(); keyLabel.setValue(Messages.getString("PropertiesEditor_NO_SELECTION_LABEL")); // $NON-NLS-1$ grid.addComponent(keyLabel, 0, 0, 1, 0); grid.setColumnExpandRatio(0, 1.0f); grid.setColumnExpandRatio(1, 1.0f); orignal = new TextArea(); orignal.setRows(3); orignal.setReadOnly(true); orignal.setWidth(100, TextArea.UNITS_PERCENTAGE); grid.addComponent(orignal); translated = new TextArea(); translated.setRows(3); translated.setInvalidCommitted(true); translated.setWidth(100, TextArea.UNITS_PERCENTAGE); translated.setNullRepresentation(""); // $NON-NLS-1$ translated.addListener((TextChangeListener) this); translated.setWriteThrough(true); translated.setImmediate(true); translated.setTextChangeEventMode(TextChangeEventMode.LAZY); translated.setTextChangeTimeout(500); grid.addComponent(translated); orignalComment = new TextArea(); orignalComment.setReadOnly(true); orignalComment.setWidth(100, TextArea.UNITS_PERCENTAGE); orignalComment.setRows(3); orignalComment.setNullRepresentation(""); // $NON-NLS-1$ grid.addComponent(orignalComment); translatedComment = new TextArea(); translatedComment.setImmediate(true); translatedComment.setWidth(100, TextArea.UNITS_PERCENTAGE); translatedComment.setRows(3); translatedComment.setNullRepresentation(""); // $NON-NLS-1$ translatedComment.setInputPrompt( Messages.getString("PropertiesEditor_COMMENT_INPUT_PROMPT")); // $NON-NLS-1$ translatedComment.setWriteThrough(true); translatedComment.addListener((TextChangeListener) this); grid.addComponent(translatedComment); safeButton = new Button(); safeButton.setEnabled(false); safeButton.setCaption( Messages.getString("PropertiesEditor_SAVE_BUTTON_CAPTION")); // $NON-NLS-1$ safeButton.addListener( new ClickListener() { @Override public void buttonClick(ClickEvent event) { setDirty(false); PropertyPersistenceService propertyPersistence = MainDashboard.getCurrent().getPropertyPersistence(); propertyPersistence.saveProperties(descriptor, target); layout .getWindow() .showNotification( Messages.getString("PropertiesEditor_SAVED_CONFIRMATION_DIALOG_TITLE"), descriptor.getLocation().lastSegment()); // $NON-NLS-1$ } }); editorArea.setContent(grid); HorizontalLayout buttonArea = new HorizontalLayout(); buttonArea.setSpacing(true); layout.addComponent(editorArea); layout.setExpandRatio(editorArea, 0); buttonArea.addComponent(safeButton); Button editTemplate = new Button( Messages.getString("PropertiesEditor_EDIT_TEMPLATE_BUTTON_CAPTION")); // $NON-NLS-1$ editTemplate.addListener( new ClickListener() { @Override public void buttonClick(ClickEvent event) { BreadCrumb crumb = MainDashboard.getCurrent().getBreadcrumbs(); crumb.walkTo("?master"); // $NON-NLS-1$ } }); buttonArea.addComponent(editTemplate); layout.addComponent(buttonArea); layout.setExpandRatio(buttonArea, 0); }
/** Set all components to default status. */ public void resetComponents() { textAreaSentence.setValue(""); textAreaSentence.setInputPrompt("Please insert a sentence here."); // buttonAnnotate.setEnabled(false); listSelectAnnotation.removeAllItems(); }