Codota Logo
Field.setReadOnly
Code IndexAdd Codota to your IDE (free)

How to use
setReadOnly
method
in
com.vaadin.v7.ui.Field

Best Java code snippets using com.vaadin.v7.ui.Field.setReadOnly (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: com.vaadin/vaadin-compatibility-server

/**
 * Sets the component's to read-only mode to the specified state.
 *
 * @see Component#setReadOnly(boolean)
 */
@Override
public void setReadOnly(boolean readOnly) {
  super.setReadOnly(readOnly);
  for (final Object id : propertyIds) {
    fields.get(id).setReadOnly(readOnly);
  }
}
origin: OpenNMS/opennms

  @Override
  public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) {
    Field<?> field = super.createField(container, itemId, propertyId, uiContext);
    if (propertyId.equals("Key")) {
      field.setReadOnly(true);
    } else {
      field.setSizeFull();
    }
    return field;
  }
});
origin: com.vaadin/vaadin-compatibility-server

/**
 * Sets the read only state to the given value for all fields with writable
 * data source. Fields with read only data source will always be set to read
 * only.
 *
 * @param fieldsReadOnly
 *            true to set the fields with writable data source to read only,
 *            false to set them to read write
 */
public void setReadOnly(boolean fieldsReadOnly) {
  readOnly = fieldsReadOnly;
  for (Field<?> field : getFields()) {
    if (field.getPropertyDataSource() == null
        || !field.getPropertyDataSource().isReadOnly()) {
      field.setReadOnly(fieldsReadOnly);
    } else {
      field.setReadOnly(true);
    }
  }
}
origin: com.vaadin/vaadin-compatibility-server

/**
 * Clears field and any possible existing binding.
 *
 * @param field
 *            The field to be cleared
 * @since 7.7.5
 */
protected void clearField(Field<?> field) {
  // Clear any possible existing binding to clear the field
  field.setPropertyDataSource(null);
  boolean fieldReadOnly = field.isReadOnly();
  if (!fieldReadOnly) {
    field.clear();
  } else {
    // Temporarily make the field read-write so we can clear the
    // value. Needed because setPropertyDataSource(null) does not
    // currently clear the field
    // (https://dev.vaadin.com/ticket/14733)
    field.setReadOnly(false);
    field.clear();
    field.setReadOnly(true);
  }
}
origin: com.vaadin/vaadin-compatibility-server

/**
 * Configures a field with the settings set for this FieldBinder.
 * <p>
 * By default this updates the buffered, read only and enabled state of the
 * field. Also adds validators when applicable. Fields with read only data
 * source are always configured as read only.
 *
 * @param field
 *            The field to update
 */
protected void configureField(Field<?> field) {
  field.setBuffered(isBuffered());
  field.setEnabled(isEnabled());
  if (field.getPropertyDataSource().isReadOnly()) {
    field.setReadOnly(true);
  } else {
    field.setReadOnly(isReadOnly());
  }
}
origin: viritin/viritin

/**
 * Configures a field with the settings set for this FieldBinder.
 * <p>
 * By default this updates the buffered, read only and enabled state of the
 * field. Also adds validators when applicable. Fields with read only data
 * source are always configured as read only.
 * <p>
 * Unlike the default implementation in FieldGroup, MBeanFieldGroup only
 * makes field read only based on the property's hint, not the opposite.
 * This way developer can in form code choose to make some fields read only.
 *
 * @param field The field to update
 */
@Override
protected void configureField(Field<?> field) {
  boolean readOnlyStatus = isReadOnly() || field.getPropertyDataSource().isReadOnly();
  super.configureField(field);
  // reset the badly set readOnlyStatus
  field.setReadOnly(readOnlyStatus);
}
origin: de.mhus.lib/mhu-lib-vaadin

@SuppressWarnings("unchecked")
protected Field<?> createField(Container container,
    Object itemId, Object propertyId, Component uiContext) {
  
  ColumnModel model = getColumnModel(String.valueOf(propertyId));
  boolean editable = tableEditable && itemId.equals(editableId) && model.isEditable() ;
  Field<?> f = null;
  Class<?> type = container.getType(propertyId);
  f = createFieldForType(type);
  f.setCaption(null);
  f.setWidth("100%");
  f.setReadOnly(!editable);
  if (f instanceof AbstractField) {
    if (model.getConverter() == null) {
      model.setConverter(findDefaultConverter(model,type));
    }
    if (model.getConverter() != null)
      ((AbstractField<String>)f).setConverter((Converter<String, ?>)model.generateConverter(type));
  }
  return f;
}
origin: OpenNMS/opennms

@Override
public void selectionChanged(SelectionChangedEvent changeEvent) {
  if (parameter != null) {
    try {
      blockListenerOrValidators = true;
      setData(changeEvent.getSelectedBean());
      setItemId(changeEvent.getSelectedItemId());
      final BeanItem beanItem = new BeanItem(changeEvent.getSelectedBean(), parameter.getEditablePropertyName(), parameter.getNonEditablePropertyName());
      // this is a hack, but we need to know if the selection changed
      beanItem.addItemProperty("selected", changeEvent.getSelectedItem().getItemProperty("selected"));
      captionLabel.setValue(String.format("<b>%s</b>", parameter.getCaption()));
      fieldGroup = new FieldGroup();
      fieldGroup.setBuffered(false);
      fieldGroup.bind(selectedField, "selected");
      fieldGroup.bind(editableField, parameter.getEditablePropertyName());
      fieldGroup.bind(nonEditableField, parameter.getNonEditablePropertyName());
      fieldGroup.setItemDataSource(beanItem);
      fieldGroup.getField(parameter.getNonEditablePropertyName()).setCaption(parameter.getNonEditablePropertyCaption());
      fieldGroup.getField(parameter.getNonEditablePropertyName()).setReadOnly(true);
      fieldGroup.getField(parameter.getEditablePropertyName()).setCaption(parameter.getEditablePropertyCaption());
      fieldGroup.getField(parameter.getEditablePropertyName()).setReadOnly(false);
      updateEnabledState();
      UIHelper.validateField(editableField, true);
    } finally {
      blockListenerOrValidators = false;
    }
  }
}
origin: info.magnolia.activation/magnolia-module-activation

  keyLength.setReadOnly(true);
  createButton.setEnabled(false);
publicKey.setReadOnly(true);
com.vaadin.v7.uiFieldsetReadOnly

Popular methods of Field

  • getValue
  • setEnabled
  • getPropertyDataSource
  • isReadOnly
  • setCaption
  • validate
  • addValueChangeListener
  • discard
  • getCaption
  • getLocale
  • isModified
  • isRequired
    Is this field required. Required fields must filled by the user.
  • isModified,
  • isRequired,
  • isValid,
  • setRequired,
  • setValue,
  • setVisible,
  • setWidth,
  • addListener,
  • addValidator

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • startActivity (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • JTable (javax.swing)
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now