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

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

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

origin: org.opensingular/singular-form-core

  @Nonnull
  private Optional<FlatViewGenerator> getChildFlatViewGen(SInstance child) {
    return child.getAspect(ASPECT_FLAT_VIEW_GENERATOR);
  }
}
origin: org.opensingular/singular-form-wicket

  @Nonnull
  private static IWicketComponentMapper resolveMapper(@Nonnull SInstance instance) {
    return instance.getAspect(IWicketComponentMapper.ASPECT_WICKET_MAPPER).orElseThrow(
        () -> new SingularFormException("Não há mappeamento de componente Wicket para o tipo", instance));
  }
}
origin: org.opensingular/singular-form-core

private void callListItemDoWrite(TableRowDocumentCanvasAdapter row, SInstance field) {
  field.getAspect(FlatViewGenerator.ASPECT_FLAT_VIEW_GENERATOR)
      .ifPresent(viewGenerator -> viewGenerator
          .writeOnCanvas(row, new FlatViewContext(field, true, true)));
}
origin: org.opensingular/singular-requirement-module

  /**
   * This is a method default that used BootstrapHtmlCanvas to generate the html of the requirement.
   *
   * @param root doc in the super class.
   * @return doc in the super class.
   */
  @Override
  public String generate(SInstance root) {
    HtmlCanvas htmlCanvas = new BootstrapHtmlCanvas(true);
    root.getAspect(ASPECT_FLAT_VIEW_GENERATOR).ifPresent(i -> i.writeOnCanvas(htmlCanvas, new FlatViewContext(root)));
    return htmlCanvas.build();
  }
}
origin: org.opensingular/singular-form-core

@Override
protected void doWriteOnCanvas(DocumentCanvas canvas, FlatViewContext context) {
  SIComposite instance = context.getInstanceAs(SIComposite.class);
  DocumentCanvas subcanvas;
  if (isFlatView(context, instance)) {
    subcanvas = canvas;
  } else {
    canvas.addSubtitle(context.getLabel());
    if (instance.getParent() == null) {
      subcanvas = canvas;
    } else {
      subcanvas = canvas.addChild();
    }
  }
  List<SInstance> fields = instance.getAllFields()
      .stream()
      .sorted(Comparator.comparing(this::isChildWithSessionBreaker)).collect(Collectors.toList());
  int rowCount = 0;
  for (SInstance child : fields) {
    rowCount += child.asAtrBootstrap().getColPreference();
    if (rowCount > 12 || isChildWithSessionBreaker(child)) {
      rowCount = 0;
      subcanvas.addLineBreak();
    }
    Optional<FlatViewGenerator> aspect = child.getAspect(ASPECT_FLAT_VIEW_GENERATOR);
    aspect.ifPresent(flatViewGenerator -> flatViewGenerator.writeOnCanvas(subcanvas, new FlatViewContext(child)));
  }
}
origin: org.opensingular/singular-form-core

@Override
protected void doWriteOnCanvas(DocumentCanvas canvas, FlatViewContext context) {
  canvas.addSubtitle(context.getLabel());
  SIComposite instance = (SIComposite) context.getInstance();
  SViewTab viewTab = (SViewTab) ViewResolver.resolveView(instance.getType());
  for (SViewTab.STab tab : viewTab.getTabs()) {
    canvas.addSubtitle(tab.getTitle());
    for (String path : tab.getTypesNames()) {
      SInstance child = instance.getField(path);
      child.getAspect(FlatViewGenerator.ASPECT_FLAT_VIEW_GENERATOR)
          .ifPresent(viewGenerator ->
              callChildWrite(canvas.addChild(), child, viewGenerator));
    }
  }
}
origin: org.opensingular/singular-form-core

FlatViewGenerator flatViewGenerator = f.getAspect(FlatViewGenerator.ASPECT_FLAT_VIEW_GENERATOR).orElse(null);
org.opensingular.formSInstancegetAspect

Javadoc

Looks for the best match implementation of the aspect being request.

To understand the registration and retrieval process see AspectRef.

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,
  • getField,
  • getPathFromRoot

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • String (java.lang)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • 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