Module org.nasdanika.html.ecore
Package org.nasdanika.html.ecore
Class EModelElementActionSupplier<T extends EModelElement>
java.lang.Object
org.nasdanika.html.ecore.EObjectActionSupplier<T>
org.nasdanika.html.ecore.EModelElementActionSupplier<T>
- All Implemented Interfaces:
AutoCloseable,BiFunction<EClass,,org.nasdanika.common.ProgressMonitor, org.nasdanika.html.model.app.Action> org.nasdanika.common.Diagnosable,org.nasdanika.common.ExecutionParticipant,org.nasdanika.common.ExecutionParticipantInfo,org.nasdanika.common.Function<EClass,,org.nasdanika.html.model.app.Action> EcoreActionSupplier
- Direct Known Subclasses:
ENamedElementActionSupplier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.nasdanika.common.Contextprotected intDescriptions shorter than this value are put on the top of the tabs, longer ones end up in their own tab.protected Predicate<EModelElement>protected Comparator<ENamedElement>static final Stringprotected BiFunction<ENamedElement,String, String> Fields inherited from class org.nasdanika.html.ecore.EObjectActionSupplier
eObjectFields inherited from interface org.nasdanika.common.Diagnosable
SUCCESSFields inherited from interface org.nasdanika.common.Function
NOP -
Constructor Summary
ConstructorsConstructorDescriptionEModelElementActionSupplier(T value, org.nasdanika.common.Context context, Function<EPackage, String> ePackagePathComputer, Predicate<EModelElement> elementPredicate, BiFunction<ENamedElement, String, String> labelProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddContent(org.nasdanika.html.model.app.Action action, String content) Adds textual content.protected static Stringcardinality(ETypedElement typedElement) protected StringcomputeLabel(EGenericType genericType, org.nasdanika.common.ProgressMonitor monitor) encodeEPackage(EPackage ePackage) Encodes ePackage path.org.nasdanika.html.model.app.Actionprotected StringgenericName(EGenericType eGenericType) protected StringgenericName(ETypeParameter typeParameter) protected voidgenericType(EGenericType eGenericType, EClassifier contextClassifier, Consumer<String> accumulator, org.nasdanika.common.ProgressMonitor monitor) Generates generic type text with links to classifiers.protected StringgenericTypeArguments(EGenericType eGenericType) protected voidgenericTypeArguments(EGenericType eGenericType, EClassifier contextClassifier, Consumer<String> accumulator, org.nasdanika.common.ProgressMonitor monitor) protected StringgetEModelElementFirstDocSentence(EModelElement modelElement) protected static Class<?>getInstanceClass(EClassifier eClassifier, Function<String, Object> ePackageResolver) protected Collection<EClass>getReferrers(EClass eClass) In situations where classes referencing this class are known this method can be overridden.protected Collection<EClass>getUses(EClassifier eClassifier) Finds all type uses in the resourceset.protected voidheader(org.nasdanika.html.model.app.Action action, org.nasdanika.common.ProgressMonitor progressMonitor) Content before documentation.protected org.nasdanika.exec.content.MarkdowninterpolatedMarkdown(String markdown, URI location, org.nasdanika.common.ProgressMonitor progressMonitor) protected Stringlink(EClassifier eClassifier, EClassifier contextClassifier) protected Stringlink(EStructuralFeature feature, EClassifier contextClassifier) name()protected Stringpath(EClassifier eClassifier, EClassifier contextClassifier) protected <M extends EModelElement>
List<M>retainDocumentable(Collection<M> elements) Filters the collection retaining only model elements which shall be documented.doublesize()protected StringtypeParameters(EClassifier eClassifier) Methods inherited from class org.nasdanika.html.ecore.EObjectActionSupplier
adaptChildMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface org.nasdanika.common.Diagnosable
diagnoseMethods inherited from interface org.nasdanika.common.ExecutionParticipant
close, commit, rollback, split, split, splitAndCommit, splitAndCommit, splitAndDiagnose, splitAndDiagnose, splitAndRollback, splitAndRollbackMethods inherited from interface org.nasdanika.common.Function
apply, before, splitAndExecute, splitAndExecute, then, then, then, toFunction
-
Field Details
-
labelProvider
-
eNamedElementComparator
-
ICONS_BASE
- See Also:
-
descriptionTabLengthThreshold
Descriptions shorter than this value are put on the top of the tabs, longer ones end up in their own tab. -
context
-
ePackagePathComputer
-
elementPredicate
-
-
Constructor Details
-
EModelElementActionSupplier
public EModelElementActionSupplier(T value, org.nasdanika.common.Context context, Function<EPackage, String> ePackagePathComputer, Predicate<EModelElement> elementPredicate, BiFunction<ENamedElement, String, String> labelProvider)
-
-
Method Details
-
execute
-
header
protected void header(org.nasdanika.html.model.app.Action action, org.nasdanika.common.ProgressMonitor progressMonitor) Content before documentation.- Parameters:
action-progressMonitor-
-
size
-
name
-
interpolatedMarkdown
protected org.nasdanika.exec.content.Markdown interpolatedMarkdown(String markdown, URI location, org.nasdanika.common.ProgressMonitor progressMonitor) - Parameters:
markdown- Markdown text- Returns:
- Spec for interpolating markdown and then converting to HTML.
-
getEModelElementFirstDocSentence
-
getReferrers
In situations where classes referencing this class are known this method can be overridden.- Returns:
-
getUses
Finds all type uses in the resourceset.- Returns:
-
cardinality
-
computeLabel
protected String computeLabel(EGenericType genericType, org.nasdanika.common.ProgressMonitor monitor) -
typeParameters
- Parameters:
eClassifier-- Returns:
- Type parameters string.
-
genericName
-
genericName
-
genericTypeArguments
-
genericType
protected void genericType(EGenericType eGenericType, EClassifier contextClassifier, Consumer<String> accumulator, org.nasdanika.common.ProgressMonitor monitor) Generates generic type text with links to classifiers.- Parameters:
eGenericType-accumulator-
-
path
- Parameters:
eClassifier-- Returns:
- Relative path to the argument
EClassifieror null if the classifier is not part of the documentation resource set.
-
link
- Returns:
- Link to
EClassifierif it is part of the doc or plain text if it is not.
-
link
- Returns:
- Link to
EClassifierif it is part of the doc or plain text if it is not.
-
genericTypeArguments
protected void genericTypeArguments(EGenericType eGenericType, EClassifier contextClassifier, Consumer<String> accumulator, org.nasdanika.common.ProgressMonitor monitor) -
encodeEPackage
Encodes ePackage path.- Parameters:
ePackage-- Returns:
-
addContent
Adds textual content.- Parameters:
content-
-
retainDocumentable
Filters the collection retaining only model elements which shall be documented.- Type Parameters:
M-- Parameters:
elements-- Returns:
-
getInstanceClass
protected static Class<?> getInstanceClass(EClassifier eClassifier, Function<String, Object> ePackageResolver)
-