Skip to content

Commit 7814230

Browse files
committed
2025.7.0
1 parent 8a367a2 commit 7814230

File tree

12 files changed

+65
-32
lines changed

12 files changed

+65
-32
lines changed

cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<parent>
55
<groupId>org.nasdanika.models.app</groupId>
6-
<version>2025.6.0</version>
6+
<version>2025.7.0</version>
77
<artifactId>parent</artifactId>
88
<relativePath>..</relativePath>
99
</parent>

cli/src/main/java/org/nasdanika/models/app/cli/DrawioHtmlAppGeneratorCommand.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ public String getIndexName() {
7474
return DrawioHtmlAppGeneratorCommand.this.indexName;
7575
}
7676

77+
@Override
78+
public boolean isUseTooltipIfDocIsEmpty() {
79+
return DrawioHtmlAppGeneratorCommand.this.tooltip;
80+
}
81+
7782
@Override
7883
public void filterRepresentationElement(
7984
ModelElement sourceElement,
@@ -87,6 +92,16 @@ public void filterRepresentationElement(
8792

8893
};
8994
}
95+
96+
@Option(
97+
names = {"--tooltip"},
98+
description = {
99+
"Use tooltip as documentation",
100+
"if documentation is empty.",
101+
"Default: true"
102+
},
103+
negatable = true)
104+
private boolean tooltip;
90105

91106
@Option(
92107
names = {"-b", "--base-uri"},

emf/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<parent>
55
<groupId>org.nasdanika.models.app</groupId>
6-
<version>2025.6.0</version>
6+
<version>2025.7.0</version>
77
<artifactId>parent</artifactId>
88
<relativePath>..</relativePath>
99
</parent>

gen/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<parent>
55
<groupId>org.nasdanika.models.app</groupId>
6-
<version>2025.6.0</version>
6+
<version>2025.7.0</version>
77
<artifactId>parent</artifactId>
88
<relativePath>..</relativePath>
99
</parent>
@@ -50,7 +50,7 @@
5050
<dependency>
5151
<groupId>org.nasdanika.models.bootstrap</groupId>
5252
<artifactId>gen</artifactId>
53-
<version>2025.6.0</version>
53+
<version>2025.7.0</version>
5454
</dependency>
5555
<dependency>
5656
<groupId>org.nasdanika.html</groupId>

generator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<parent>
55
<groupId>org.nasdanika.models.app</groupId>
6-
<version>2025.6.0</version>
6+
<version>2025.7.0</version>
77
<artifactId>parent</artifactId>
88
<relativePath>..</relativePath>
99
</parent>

graph/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<parent>
55
<groupId>org.nasdanika.models.app</groupId>
6-
<version>2025.6.0</version>
6+
<version>2025.7.0</version>
77
<artifactId>parent</artifactId>
88
<relativePath>..</relativePath>
99
</parent>

graph/src/main/java/org/nasdanika/models/app/graph/drawio/BaseProcessor.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
*/
4646
public class BaseProcessor<T extends Element> implements WidgetFactory {
4747

48+
private static final String PLAIN_TEXT = "text/plain";
49+
4850
protected Configuration configuration;
4951

5052
public BaseProcessor(DrawioProcessorFactory configuration) {
@@ -219,6 +221,24 @@ protected Collection<EObject> getDocumentation(ProgressMonitor progressMonitor)
219221
progressMonitor);
220222
}
221223
}
224+
225+
String tooltip = modelElement.getTooltip();
226+
if (!Util.isBlank(tooltip)) {
227+
Optional<DocumentationFactory> dfo = configuration.getDocumentationFactories(progressMonitor)
228+
.stream()
229+
.filter(df -> df.canHandle(PLAIN_TEXT))
230+
.findAny();
231+
232+
if (dfo.isPresent()) {
233+
return dfo.get().createDocumentation(
234+
element,
235+
tooltip,
236+
PLAIN_TEXT,
237+
refBaseUri,
238+
tokenSource,
239+
progressMonitor);
240+
}
241+
}
222242
} catch (Exception e) {
223243
Text text = ContentFactory.eINSTANCE.createText(); // Interpolate with element properties?
224244
text.setContent("<div class=\"nsd-error\">" + e + "</div>");

graph/src/main/java/org/nasdanika/models/app/graph/drawio/Configuration.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ public URI getRefBaseURI(URI docURI) {
230230
public Collection<DocumentationFactory> getDocumentationFactories(ProgressMonitor progressMonitor) {
231231
return Collections.emptyList();
232232
}
233+
234+
public boolean isUseTooltipIfDocIsEmpty() {
235+
return true;
236+
}
233237

234238
protected ResourceSet resourceSet = new ResourceSetImpl();
235239

graph/src/main/java/org/nasdanika/models/app/graph/drawio/DrawioHtmlAppGenerator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ public URI getRefBaseURI(URI docURI) {
142142
return DrawioHtmlAppGenerator.this.getRefBaseURI(docURI);
143143
}
144144

145+
@Override
146+
public boolean isUseTooltipIfDocIsEmpty() {
147+
return DrawioHtmlAppGenerator.this.isUseTooltipIfDocIsEmpty();
148+
}
149+
145150
/**
146151
* Override to implement filtering of representation elements
147152
* @param representationElement

model/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<parent>
55
<groupId>org.nasdanika.models.app</groupId>
6-
<version>2025.6.0</version>
6+
<version>2025.7.0</version>
77
<artifactId>parent</artifactId>
88
<relativePath>..</relativePath>
99
</parent>
@@ -45,7 +45,7 @@
4545
<dependency>
4646
<groupId>org.nasdanika.models.bootstrap</groupId>
4747
<artifactId>model</artifactId>
48-
<version>2025.6.0</version>
48+
<version>2025.7.0</version>
4949
</dependency>
5050
</dependencies>
5151
</project>

0 commit comments

Comments
 (0)