Re: Module-wide @ServiceProvider/@MimeRegistration?

2023-10-09 Thread Javier Llorente
I get the XML/JSON from a HTTP response.
I haven't explored the path of using an extended MIME type. According to the 
javadocs, it should be a matter of registering the extended MIME type in 
MimeLookup. I don't know if there is an easier way of doing that other than 
implementing a class that extends XMLKit/PlainKit and using @MimeRegistration.

Thanks,
Javier

El domingo, 8 de octubre de 2023 23:43:46 (CEST) Svata Dedic escribió:
> Can you invent your own MIME type for your file content (= is it some
> special - purpose JSON/XML) ? If so, then you could use (for XML)
> composed mime type text/javier-content+xml
> The editor pane will inherit everything registered for plain XML +
> you'll be able to register specific services for just the
> text/javier-content+xml
> 
> Similarly, you can invent application/javier-content+json for your JSON
> content.
> 
> -S.
> 
> On 08. 10. 23 18:28, Javier Llorente wrote:
> > Hello,
> > 
> > I was wondering if it is possible to register a module-wide
> > @ServiceProvider/ @MimeRegistration.
> > 
> > I want links found in a JSON/XML displayed by my module TopComponent's
> > JEditorPane to be opened by another instance of the same TopComponent. For
> > that purpose, I have another class that extends HtmlBrowser.URLDisplayer.
> > However, I don't want to be responsible for opening all links in NetBeans
> > (ie: javadocs).
> > 
> > Implementing a HyperlinkProviderExt (and registering MIME types "text/
> > plain" and "text/xml") improves the situation a bit; javadocs links are
> > now
> > opened by an external browser but links found in any plain text or XML
> > file are also opened by my module.
> > 
> > Any suggestions?
> > 
> > Thanks,
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: dev-h...@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


-- 
Javier Llorente

signature.asc
Description: This is a digitally signed message part.


Re: Module-wide @ServiceProvider/@MimeRegistration?

2023-10-08 Thread Svata Dedic
Can you invent your own MIME type for your file content (= is it some 
special - purpose JSON/XML) ? If so, then you could use (for XML) 
composed mime type text/javier-content+xml
The editor pane will inherit everything registered for plain XML + 
you'll be able to register specific services for just the 
text/javier-content+xml


Similarly, you can invent application/javier-content+json for your JSON 
content.


-S.

On 08. 10. 23 18:28, Javier Llorente wrote:

Hello,

I was wondering if it is possible to register a module-wide @ServiceProvider/
@MimeRegistration.

I want links found in a JSON/XML displayed by my module TopComponent's
JEditorPane to be opened by another instance of the same TopComponent. For
that purpose, I have another class that extends HtmlBrowser.URLDisplayer.
However, I don't want to be responsible for opening all links in NetBeans (ie:
javadocs).

Implementing a HyperlinkProviderExt (and registering MIME types "text/
plain" and "text/xml") improves the situation a bit; javadocs links are now
opened by an external browser but links found in any plain text or XML file are
also opened by my module.

Any suggestions?

Thanks,



-
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists





Module-wide @ServiceProvider/@MimeRegistration?

2023-10-08 Thread Javier Llorente
Hello,

I was wondering if it is possible to register a module-wide @ServiceProvider/ 
@MimeRegistration.

I want links found in a JSON/XML displayed by my module TopComponent's 
JEditorPane to be opened by another instance of the same TopComponent. For 
that purpose, I have another class that extends HtmlBrowser.URLDisplayer.
However, I don't want to be responsible for opening all links in NetBeans (ie: 
javadocs).

Implementing a HyperlinkProviderExt (and registering MIME types "text/
plain" and "text/xml") improves the situation a bit; javadocs links are now 
opened by an external browser but links found in any plain text or XML file are 
also opened by my module.

Any suggestions?

Thanks,
-- 
Javier Llorente

signature.asc
Description: This is a digitally signed message part.