congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Field.isReadOnly
Code IndexAdd Tabnine 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)

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

  • Start an intent from android
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • putExtra (Intent)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now