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

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

Best Java code snippets using com.vaadin.v7.ui.Field.isReadOnly (Showing top 8 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

/**
 * Gets the first focusable field in form. If there are enabled,
 * non-read-only fields, the first one of them is returned. Otherwise, the
 * field for the first property (or null if none) is returned.
 *
 * @return the Field.
 */
private Field<?> getFirstFocusableField() {
  Collection<?> itemPropertyIds = getItemPropertyIds();
  if (itemPropertyIds != null && !itemPropertyIds.isEmpty()) {
    for (Object id : itemPropertyIds) {
      if (id != null) {
        Field<?> field = getField(id);
        if (field.isConnectorEnabled() && !field.isReadOnly()) {
          return field;
        }
      }
    }
    // fallback: first field if none of the fields is enabled and
    // writable
    Object id = itemPropertyIds.iterator().next();
    if (id != null) {
      return getField(id);
    }
  }
  return null;
}
origin: viritin/viritin

  getAnnotation(
    NotNull.class);
if (notNullAnnotation != null && !field.isReadOnly()) {
  field.setRequired(true);
  Locale locale = getLocale();
origin: com.vaadin/vaadin-compatibility-server

final Field<?> f = fields.get(id);
if (!f.isReadOnly()) {
  f.commit();
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

    : new Select();
newField.setCaption(oldField.getCaption());
newField.setReadOnly(oldField.isReadOnly());
newField.setBuffered(oldField.isBuffered());
origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void underlyingJCRPropertyConformsToTransformerReadonlyState() throws Exception {
  // GIVEN
  definition.setReadOnly(true);
  definition.setType("String");
  // WHEN
  fieldFactory = new TestTextFieldFactory(definition, baseItem, null, i18NAuthoringSupport);
  fieldFactory.setComponentProvider(this.componentProvider);
  Field<Object> field = fieldFactory.createField();
  // THEN
  assertTrue(field.isReadOnly());
}
origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void readOnlyStateIsReflectedOnAlreadyExistingProperties() throws Exception {
  // GIVEN
  definition.setReadOnly(true);
  definition.setType("String");
  Property<String> property = new ObjectProperty<>("");
  baseItem.addItemProperty(propertyName, property);
  // WHEN
  fieldFactory = new TestTextFieldFactory(definition, baseItem, null, i18NAuthoringSupport);
  fieldFactory.setComponentProvider(this.componentProvider);
  Field<Object> field = fieldFactory.createField();
  // THEN
  assertTrue(field.isReadOnly());
}
origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void setReadOnlyDefaultValue() throws Exception {
  // GIVEN
  baseItem = new JcrNewNodeAdapter(baseNode, baseNode.getPrimaryNodeType().getName());
  checkBoxField = new CheckBoxFieldFactory(definition, baseItem, uiContext, i18NAuthoringSupport);
  checkBoxField.setComponentProvider(componentProvider);
  definition.setDefaultValue("true");
  definition.setReadOnly(true);
  // WHEN
  Field<Boolean> field = checkBoxField.createField();
  // THEN
  assertEquals(true, field.getValue());
  assertTrue(field.isReadOnly());
  CheckBox checkBox = (CheckBox) ((CheckBoxField) field).iterator().next();
  assertEquals(true, checkBox.getValue());
  assertTrue(checkBox.isReadOnly());
}
com.vaadin.v7.uiFieldisReadOnly

Popular methods of Field

  • setReadOnly
  • getValue
  • setEnabled
  • getPropertyDataSource
  • 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

  • Finding current android device location
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
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