File tree Expand file tree Collapse file tree 12 files changed +65
-32
lines changed
src/main/java/org/nasdanika/models/app/cli
src/main/java/org/nasdanika/models/app/graph/drawio Expand file tree Collapse file tree 12 files changed +65
-32
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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" },
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 4545 */
4646public 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>" );
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 >
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 >
You can’t perform that action at this time.
0 commit comments