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

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

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

origin: org.opensingular/singular-form-wicket

private String processPhraseBreak(SInstance mi) {
  PhraseBreak phraseBreak = mi.asAtr().phraseBreak();
  if (phraseBreak == PhraseBreak.BREAK_LINE) {
    return "\n";
  } else if (phraseBreak == PhraseBreak.COMMA) {
    return ", ";
  }
  return "";
}
origin: org.opensingular/form-wicket

protected static String getTitle(ISInstanceAwareModel<SIComposite> referenced) {
  final String annotationLabel = referenced.getMInstancia().asAtrAnnotation().label();
  if (isNotBlank(annotationLabel))
    return annotationLabel;
  final String referencedLabel = referenced.getMInstancia().asAtr().getLabel();
  if (isNotBlank(referencedLabel))
    return String.format("Comentários sobre %s", referencedLabel);
  return "Comentários";
}
origin: org.opensingular/singular-form-core

@Override
protected void doWriteOnCanvas(DocumentCanvas canvas, FlatViewContext context) {
  SInstance instance = context.getInstance();
  canvas.addFormItem(new FormItem(instance.asAtr().getLabel(),
      format(instance), instance.asAtrBootstrap().getColPreference()));
}
origin: org.opensingular/singular-form-core

private static String getEditActionTitle(SInstance instance) {
  String label = instance.asAtr().getLabel();
  if (label != null) {
    return "Comentários sobre " + label;
  } else {
    return "Comentário";
  }
}
origin: org.opensingular/singular-form-core

  private Boolean isChildWithSessionBreaker(SInstance a) {
    return (a.asAtrBootstrap().getColPreference(12) == 12 && a.getType().isComposite()
        && a.asAtr().getLabel() != null) || a.getType().isList();
  }
}
origin: org.opensingular/form-core

public final String toStringDisplay() {
  return asAtr().getDisplayString();
}
origin: org.opensingular/singular-form-core

@Override
protected void doWriteOnCanvas(DocumentCanvas canvas, FlatViewContext context) {
  SInstance instance = context.getInstance();
  canvas.addFormItem(new FormItem(instance.asAtr().getLabel(),
      instance.toStringDisplay(), instance.asAtrBootstrap().getColPreference()));
}
origin: org.opensingular/singular-form-core

public boolean shouldRender() {
  return instance.asAtr().isVisible()
      && instance.asAtr().isExists()
      && (renderIfEmpty || !instance.isEmptyOfData());
}
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/form-wicket

public String getRootTypeSubtitle() {
  return getRootInstance().getObject().asAtr().getSubtitle();
}
origin: org.opensingular/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 = ((SIComposite) instance).getField(typeName);
      if (field.asAtr().exists() && field.asAtr().isVisible()) {
        return true;
      }
    }
  }
  return false;
}
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/form-core

private void invokeUpdateListeners(){
  for (SType type : this.getType().getDependentTypes()){
    SInstance dependentInstance = (SInstance) this.findNearest(type).orElse(null);
    if (dependentInstance != null && dependentInstance.asAtr().getUpdateListener() != null){
      dependentInstance.asAtr().getUpdateListener().accept(this);
    }
  }
}
origin: org.opensingular/singular-form-core

@SuppressWarnings("unchecked")
public String getLabel() {
  String label = instance.asAtr().getLabel();
  if (label == null) {
    label = SFormUtil.getTypeLabel((Class<? extends SType<?>>) instance.getType().getClass()).orElse(null);
  }
  if (label == null) {
    label = instance.getName();
  }
  return label;
}
origin: org.opensingular/singular-form-wicket

private IModel<String> newBlockLabelModel(Block block, WicketBuildContext ctx) {
  String label;
  if (isNotBlank(block.getName()))
    label = block.getName();
  else {
    SInstance parent = ctx.getCurrentInstance();
    label = block.getSingleType(parent)
      .map(it -> it.asAtr().getLabel())
      .orElse(null);
  }
  return Model.of(label);
}
origin: org.opensingular/singular-form-core

private void invokeUpdateListeners(){
  if (!getDocument().isRestoreMode()) {
    for (SType<?> type : this.getType().getDependentTypes()) {
      SInstance dependentInstance = (SInstance) this.findNearest(type).orElse(null);
      if (dependentInstance != null && dependentInstance.asAtr().getUpdateListener() != null) {
        dependentInstance.asAtr().getUpdateListener().accept(dependentInstance);
      }
    }
  }
}
origin: org.opensingular/form-wicket

protected static String resolveSimpleLabel(FormComponent<?> formComponent) {
  IModel<?> model = formComponent.getModel();
  if (model instanceof ISInstanceAwareModel<?>) {
    SInstance instancia = ((ISInstanceAwareModel<?>) model).getMInstancia();
    return instancia.asAtr().getLabel();
  }
  return "[" + formComponent.getId() + "]";
}
origin: org.opensingular/singular-form-wicket

protected static String resolveSimpleLabel(FormComponent<?> formComponent) {
  IModel<?> model = formComponent.getModel();
  if (model instanceof ISInstanceAwareModel<?>) {
    SInstance instance = ((ISInstanceAwareModel<?>) model).getSInstance();
    return instance.asAtr().getLabel();
  }
  return "[" + formComponent.getId() + "]";
}
origin: org.opensingular/singular-form-core

  @Override
  public Iterable<SInstanceAction> getActions(ISInstanceActionCapable target, SInstance instance) {
    final String helpText = instance.asAtr().getHelp();
    return (isBlank(helpText))
      ? Collections.emptyList()
      : Arrays.asList(new SInstanceAction(SInstanceAction.ActionType.NORMAL)
        .setIcon(SIcon.resolve("question"))
        .setText("Ajuda")
        .setPosition(Integer.MIN_VALUE)
        .setPreview(new SInstanceAction.Preview()
          .setMessage(helpText)));
  }
}
origin: org.opensingular/singular-form-wicket

private void build(WicketBuildContext ctx) {
  label = new Label("label", Model.of(Optional.ofNullable(ctx.getCurrentInstance().asAtr().getLabel()).orElse(EMPTY)));
  htmlContent = new Label("htmlContent", new SInstanceValueModel<>(ctx.getModel()));
  hiddenInput = new HiddenField<>("hiddenInput", new SInstanceValueModel<>(ctx.getModel()));
  add(label);
  add(htmlContent);
  add(hiddenInput);
  buttonEditar = createButtonOpenEditor();
  buttonEditar.add(configureLabelButton());
  add(buttonEditar);
  htmlContent.setEscapeModelStrings(false);
}
org.opensingular.formSInstanceasAtr

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,
  • asAtrAnnotation,
  • asAtrProvider,
  • attachEventCollector,
  • detachEventCollector,
  • getDictionary,
  • getField,
  • getPathFromRoot

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • JFrame (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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