Tabnine Logo
SInstance.getField
Code IndexAdd Tabnine to your IDE (free)

How to use
getField
method
in
org.opensingular.form.SInstance

Best Java code snippets using org.opensingular.form.SInstance.getField (Showing top 12 results out of 315)

origin: org.opensingular/singular-form-core

/**
 * Retorna o campo cujo o nome seja igual ao do tipo informado e verifica se o campo encontrado é do mesmo tipo
 * informado. Caso não seja do mesmo tipo, dispara uma exception.
 */
public <II extends SISimple<T>, T extends Serializable> T getFieldValue(STypeSimple<II, T> type) {
  return getField(type).getValue();
}
origin: org.opensingular/singular-form-core

public SInstance getField(String path) {
  return getField(new PathReader(path));
}
origin: org.opensingular/singular-form-core

/**
 * Resolves a field instance and sets its value.
 *
 * @param value              new value
 * @param rootTypeClass      root type class
 * @param targetTypeFunction function that receives the root type and returns the field type
 * @param <RT>               root type
 * @param <RI>               root instance
 * @param <TT>               target type
 * @param <TI>               target instance
 * @param <VAL>              value
 * @throws ClassCastException     if this instance type doesn't match rootTypeClass
 * @throws NoSuchElementException if type returned by the function doesn't match a descendant type
 */
public <RT extends SType<RI>,
    RI extends SInstance,
    TT extends STypeSimple<TI, VAL>,
    TI extends SISimple<VAL>,
    VAL extends Serializable> void setValue(
    VAL value,
    Class<RT> rootTypeClass,
    IFunction<RT, TT> targetTypeFunction) {
  getField(rootTypeClass, targetTypeFunction).setValue(value);
}
origin: org.opensingular/singular-form-core

/**
 * Retorna o campo cujo o nome seja igual ao do tipo informado e verifica se o campo encontrado é do mesmo tipo
 * informado. Caso não seja do mesmo tipo, dispara uma exception.
 */
@SuppressWarnings("unchecked")
public <II extends SInstance> II getField(SType<II> type) {
  SInstance instance = getField(type.getNameSimple());
  type.checkIfIsInstanceOf(instance);
  return (II) instance;
}

origin: org.opensingular/singular-form-core

public FieldRefSelectionBuilder<STL, ST, SI> display(SType<?> field) {
  return display(it -> defaultString(it.getField(field).toStringDisplay()));
}
origin: org.opensingular/singular-form-core

public <V> void setAttributeCalculation(@Nonnull AttrInternalRef ref, @Nullable String subPath,
    @Nullable SimpleValueCalculation<V> valueCalculation) {
  SInstance instanceAtr = getCreating(ref);
  if (subPath != null) {
    instanceAtr = instanceAtr.getField(new PathReader(subPath));
  }
  if (!(instanceAtr instanceof SISimple)) {
    throw new SingularFormException(
        "O atributo " + instanceAtr.getPathFull() + " não é do tipo " + SISimple.class.getName(),
        instanceAtr);
  }
  ((SISimple) instanceAtr).setValueCalculation(valueCalculation);
}
origin: org.opensingular/form-core

static <V> void setValueCalculation(SInstance instance, String subPath, SimpleValueCalculation<V> valueCalculation) {
  if (subPath != null) {
    instance = instance.getField(new PathReader(subPath));
  }
  if (!(instance instanceof SISimple)) {
    throw new SingularFormException("O atributo " + instance.getPathFull() + " não é do tipo " + SISimple.class.getName(),
        instance);
  }
  ((SISimple) instance).setValueCalculation(valueCalculation);
}
origin: org.opensingular/singular-form-wicket

private boolean isAnyChildrenVisible(String tabId) {
  BSTab     bsTab    = tabMap.get(tabId);
  SInstance instance = bsTab.getModelObject();
  if ((instance instanceof SIComposite) && instance.asAtr().exists() && instance.asAtr().isVisible()) {
    for (String typeName : bsTab.getSubtree()) {
      SInstance field = instance.getField(typeName);
      if (field.asAtr().exists() && field.asAtr().isVisible()) {
        return true;
      }
    }
  }
  return false;
}
origin: org.opensingular/singular-form-wicket

private boolean isAnyChildrenVisible() {
  SInstance instance = ctx.getCurrentInstance();
  if ((instance instanceof SIComposite) && instance.asAtr().exists() && instance.asAtr().isVisible()) {
    for (String typeName : block.getTypes()) {
      SInstance field = instance.getField(typeName);
      if (field.asAtr().exists() && field.asAtr().isVisible()) {
        return true;
      }
    }
  }
  return false;
}
origin: org.opensingular/singular-form-core

  @Override
  public void onAction(SInstanceAction action, ISupplier<SInstance> fieldInstance, Delegate delegate) {
    ISupplier<SInstance> formSupplier = () -> {
      SInstance ins = SDocumentFactory.empty().createInstance(new EditAnotacaoRefType());
      ins.getField(EditAnotacaoRefType.APPROVED)
          .setValue(fieldInstance.get().asAtrAnnotation().approved());
      ins.getField(EditAnotacaoRefType.JUSTIFICATION)
          .setValue(fieldInstance.get().asAtrAnnotation().text());
      return ins;
    };
    Out<SInstanceAction.FormDelegate> formDelegate = new Out<>();
    delegate.openForm(formDelegate,
        getEditActionTitle(fieldInstance.get()),
        null,
        formSupplier,
        fd -> Arrays.asList(
            new SInstanceAction(SInstanceAction.ActionType.CONFIRM)
                .setText("Confirmar")
                .setActionHandler(new ConfirmarEdicaoHandler(fd)), //
            new SInstanceAction(SInstanceAction.ActionType.CANCEL)
                .setText("Cancelar")
                .setActionHandler(new CloseFormHandler(fd)) //
        ));
  }
}
origin: org.opensingular/singular-form-wicket

} else {
  tab.getTypesNames()
      .forEach(tp -> ctx.getModel().getObject().getField(tp).asAtr().visible(false));
origin: org.opensingular/singular-studio-core

configuredStudioTable
    .getColumns()
    .forEach((name, path) -> tableBuilder.appendPropertyColumn(Model.of(name), path, ins -> ins.getField(path).toStringDisplay()));
org.opensingular.formSInstancegetField

Javadoc

Resolves a field instance and returns it, or null if empty.

Popular methods of SInstance

  • getDocument
    Retorna o documento ao qual pertence a instância atual.
  • getType
  • toStringDisplay
  • getId
    Retorna um ID único dentre as instâncias do mesmo documento. Um ID nunca é reutilizado, mesmo se a i
  • getAttributeValue
  • findNearest
    Returns the nearest SInstance for the given type in the form SInstance tree. The search is performed
  • setId
    Apenas para uso nas soluções de persistencia. Não deve ser usado fora dessa situação.
  • clearInstance
    Apaga os valores associados a instância. Se for uma lista ou composto, apaga os valores em profundid
  • getName
  • getParent
  • getValue
  • isEmptyOfData
    Retorna true se a instancia não conter nenhuma informação diferente de null. A pesquisa é feita em
  • getValue,
  • isEmptyOfData,
  • asAtr,
  • asAtrAnnotation,
  • asAtrProvider,
  • attachEventCollector,
  • detachEventCollector,
  • getDictionary,
  • getPathFromRoot

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • JCheckBox (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Github Copilot alternatives
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