Tabnine Logo
SType.asAtr
Code IndexAdd Tabnine to your IDE (free)

How to use
asAtr
method
in
org.opensingular.form.SType

Best Java code snippets using org.opensingular.form.SType.asAtr (Showing top 20 results out of 315)

origin: org.opensingular/form-core

/**
 * Listener é invocado quando o campo do qual o tipo depende
 * é atualizado ( a dependencia é expressa via depends on)
 */
public SType<I> withUpdateListener(IConsumer<I> consumer) {
  asAtr().setAttributeValue(SPackageBasic.ATR_UPDATE_LISTENER, consumer);
  return this;
}
origin: org.opensingular/form-core

@SuppressWarnings("unchecked")
public IConsumer<SInstance> getUpdateListener() {
  return asAtr().getAttributeValue(SPackageBasic.ATR_UPDATE_LISTENER);
}
origin: org.opensingular/form-core

public SType<I> withInitListener(IConsumer<I> initListener) {
  this.asAtr().setAttributeValue(SPackageBasic.ATR_INIT_LISTENER, initListener);
  return this;
}
origin: org.opensingular/form-core

/**
 * Run initialization code for new created instance. Recebe uma referência que
 * pode ser de inicialização lazy.
 */
@SuppressWarnings("unchecked")
void init(Supplier<I> instanceRef) {
  IConsumer<I> initListener = asAtr().getAttributeValue(SPackageBasic.ATR_INIT_LISTENER);
  if (initListener != null) {
    initListener.accept(instanceRef.get());
  }
}
origin: org.opensingular/singular-form-wicket

public static String defineLabel(WicketBuildContext ctx) {
  SType<?> type = ctx.getCurrentInstance().getType();
  AbstractSViewListWithControls<?> view = (AbstractSViewListWithControls<?>) ctx.getView();
  return view.label().orElse(
    Optional.ofNullable(Optional.ofNullable(type.asAtr().getItemLabel()).orElseGet(() -> type.asAtr().getLabel()))
      .map((x) -> {
        String[] parts = x.trim().split(" ");
        return "Adicionar " + parts[0];
      })
      .orElse("Adicionar item"));
}
origin: org.opensingular/singular-form-core

/**
 * Cria um novo campo com o nome informado como sendo do tipo informado e já marcado como obrigatório.
 */
public <T extends SType<?>> T addField(String fieldSimpleName, Class<T> type, boolean required) {
  T field = addField(fieldSimpleName, type);
  field.asAtr().required(required);
  return field;
}
origin: org.opensingular/singular-form-wicket

private static boolean shouldRenderHeaderForSType(SType<?> type, ISupplier<SViewListByTable> viewSupplier) {
  if (viewSupplier.get().isRenderCompositeFieldsAsColumns() && (!type.asAtr().isExists() || !type.asAtr().isVisible())) {
    return false;
  }
  return true;
}
origin: org.opensingular/form-wicket

protected List<String> getAllowedTypes() {
  return defaultIfNull(
      getModelObject().getElementsType().asAtr().getAllowedFileTypes(),
      Collections.<String>emptyList());
}
origin: org.opensingular/form-core

private <T extends SType<I>, I extends SInstance, V> void adicionarDefinicaoColuna(PackageBuilder pb, AtrRef<T, I, V> atrRef, String label) {
  pb.createAttributeType(atrRef);
  pb.addAttribute(SType.class, atrRef);
  pb.getAttribute(atrRef)
    .asAtr().label(("Largura preferencial " + defaultIfNull(label, "")).trim());
}
origin: org.opensingular/singular-form-core

private static void readXsdOwnAttributes(ElementReader element, SType<?> newType) {
  if (element.isTagAttribute()) {
    String value = element.getAttr("use");
    if (value != null) {
      newType.asAtr().required("required".equals(value));
    }
  } else {
    readXsdOwnAttributeMinOccurs(element, newType);
    readXsdOwnAttributeMaxOccurs(element, newType);
  }
}
origin: org.opensingular/singular-requirement-module

@SuppressWarnings("unchecked")
private void addForms(BoxConfigurationData boxConfigurationMetadata) {
  for (Class<? extends SType<?>> formClass : singularModuleConfiguration.getFormTypes()) {
    String name = SFormUtil.getTypeName(formClass);
    Optional<SType<?>> sTypeOptional = singularFormConfig.getTypeLoader().loadType(name);
    if (sTypeOptional.isPresent()) {
      SType<?> sType = sTypeOptional.get();
      String label = sType.asAtr().getLabel();
      boxConfigurationMetadata.getForms().add(new FormDTO(name, sType.getNameSimple(), label));
    }
  }
}
origin: org.opensingular/form-wicket

  private void buildHeader(BSContainer<?> header, Form<?> form, IModel<SIList<SInstance>> list,
               WicketBuildContext ctx, SViewListByTable view, boolean isEdition) {

    final IModel<String> label = $m.ofValue(ctx.getCurrentInstance().getType().asAtr().getLabel());
    final Label          title = new Label("_title", label);

    ctx.configureContainer(label);
    header.appendTag("span", title);
//        header.add($b.visibleIf($m.get(() -> !Strings.isNullOrEmpty(label.getObject()))));

    final SType<SInstance> elementsType = list.getObject().getElementsType();

    if (!elementsType.isComposite() && elementsType.asAtr().isRequired()) {
      title.add($b.classAppender("singular-form-required"));
    }

  }

origin: org.opensingular/singular-form-core

DiffInfo(SInstance original, SInstance newer, DiffType type) {
  this.original = original;
  this.newer = newer;
  this.type = type;
  //Copia dados básicos para o caso do diff ser serializado
  SInstance instance = newer == null ? original : newer;
  this.simpleName = instance.getType().getNameSimple();
  this.simpleLabel = instance.getType().asAtr().getLabel();
}
origin: org.opensingular/form-core

DiffInfo(SInstance original, SInstance newer, DiffType type) {
  this.original = original;
  this.newer = newer;
  this.type = type;
  //Copia dados básicos para o caso do diff ser serializado
  SInstance instance = newer == null ? original : newer;
  this.simpleName = instance.getType().getNameSimple();
  this.simpleLabel = instance.getType().asAtr().getLabel();
}
origin: org.opensingular/singular-form-samples

private void addImplantacaoInstituicao() {
  final STypeComposite<SIComposite> implantacaoInstituicao = this.addFieldComposite("implantacaoInstituicao");
  implantacaoInstituicao.addFieldListOf("cursosPrevistos", STypeCurso.class)
    .withView(SViewListByMasterDetail::new)
    .asAtr().label("Cursos Previstos").itemLabel("Curso Previsto");
}

origin: org.opensingular/form-wicket

@Override
protected void onConfigure() {
  super.onConfigure();
  final FileUploadManager fileUploadManager = getFileUploadManager();
  if (uploadId == null || !fileUploadManager.findUploadInfo(uploadId).isPresent()) {
    final AtrBasic atrAttachment = getModelObject().getElementsType().asAtr();
    this.uploadId = fileUploadManager.createUpload(atrAttachment.getMaxFileSize(), null, atrAttachment.getAllowedFileTypes(), this::getTemporaryHandler);
  }
}
origin: org.opensingular/singular-form-wicket

@Override
protected void onConfigure() {
  super.onConfigure();
  final FileUploadManager fileUploadManager = getFileUploadManager();
  if (uploadId == null || !fileUploadManager.findUploadInfoByAttachmentKey(uploadId).isPresent()) {
    final AtrBasic atrAttachment = getModelObject().getElementsType().asAtr();
    this.uploadId = fileUploadManager.createUpload(atrAttachment.getMaxFileSize(), null, atrAttachment.getAllowedFileTypes(), this::getTemporaryHandler);
  }
}
origin: org.opensingular/exemplos-form

private void addAcondicionamentos() {
  acondicionamentos = addFieldListOf("acondicionamentos", STypeAcondicionamentoGAS.class);
  acondicionamentos.withMiniumSizeOf(1);
  acondicionamentos
      .withView(new SViewListByMasterDetail()
          .col(acondicionamentos.getElementsType().embalagemPrimaria, "Embalagem primária"))
      .asAtr().label("Acondicionamento");
}
origin: org.opensingular/exemplos-form

@Override
protected void onLoadType(TypeBuilder tb) {
  final STypeInteger exercicio = addFieldInteger(FIELD_EXERCICIO, true);
  exercicio.asAtr().label("Exercício");
  exercicio.selection()
    .selfIdAndDisplay()
    .simpleProviderOf(2016, 2017, 2018, 2019);
  addFieldMonetary(FIELD_VALOR_EMPENHADO)
    .withRequired(true).asAtr().label("Valor Empenhado");
}
origin: org.opensingular/exemplos-form

private void addInfraestruturaInstalacoesAcademicas() {
  final STypeComposite<SIComposite> infraestruturaInstalacoesAcademicas = this.addFieldComposite("infraestruturaInstalacoesAcademicas");
  
  final STypeList<STypeComposite<SIComposite>, SIComposite> enderecoes = infraestruturaInstalacoesAcademicas.addFieldListOfComposite("enderecoes", "encereco");
  enderecoes.withView(SViewListByMasterDetail::new)
    .asAtr().label("Endereços").itemLabel("Endereço");
  final STypeComposite<SIComposite> endereco = enderecoes.getElementsType();
  endereco.addFieldString("endereco").asAtr().required().label("Endereço");
  endereco.addField("cep", STypeCEP.class);
}

org.opensingular.formSTypeasAtr

Popular methods of SType

  • getNameSimple
  • getName
  • asAtrProvider
  • getAttributeValue
  • isList
    Verificar se o tipo é um tipo lista ( STypeList).
  • getValidators
  • withView
  • asAtrBootstrap
  • getInstanceClass
  • isComposite
    Verificar se o tipo é um tipo composto ( STypeComposite).
  • getDependentTypes
  • getDictionary
  • getDependentTypes,
  • getDictionary,
  • hasAttributeDefinedInHierarchy,
  • isDependentType,
  • isTypeOf,
  • newInstance,
  • addAttribute,
  • addDependentType,
  • addInstanceValidator

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • Kernel (java.awt.image)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JCheckBox (javax.swing)
  • Top Vim plugins
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