Thanks for the quick reply.
I'm just starting on the HtmlExtension part of the module, so there is not
much to see. The relevant code is as follows:
import org.netbeans.modules.html.editor.api.gsf.HtmlExtension;
import org.netbeans.modules.html.editor.lib.api.HtmlSource;
@MimeRegistrations({
@MimeRegistration(mimeType = "text/html", service =
HtmlExtension.class),
})
public class TemplateHtmlExtension extends HtmlExtension {
Map<String, List<String>> mapNamespacesToElements = new HashMap<>();
public TemplateHtmlExtension() {
mapNamespacesToElements.put("std", Arrays.asList("foreach"));
}
public Map<String, List<String>> getUndeclaredNamespaces(HtmlSource
source) {
return mapNamespacesToElements;
}
}
And the POM file dependencies on editor and editor lib:
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-modules-html-editor</artifactId>
<version>RELEASE802</version>
</dependency>
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-modules-html-editor-lib</artifactId>
<version>RELEASE802</version>
</dependency>
How does the Angular extension access HtmlExtension, is it a friend? If
there is a shortcut that works temporarily (even with a price down the
road) I'd be willing to take it to get the module working sooner.
On Mon, Dec 7, 2020 at 1:11 PM Matthias Bläsing <[email protected]>
wrote:
> Hi,
>
> in principle both html.editor and html.editor.lib modules need to be
> checked and updated to export their API as non-friends.
>
> We have several open complaints about the html editor and it might be a
> good time to open the API up.
>
> I saw at least one point we will need to look critically at and maybe
> we also need to accept, that opening the modules API might also mean,
> that we will introduce breaking chanes in the future.
>
> To better understand the need, I'd like to have a look at your module -
> maybe a stop gap measure is possible. Do you have a repository
> available?
>
> Greetings
>
> Matthias
>
> Am Sonntag, den 06.12.2020, 19:02 -0800 schrieb ScraM Team:
> > I'm working on a NetBeans plugin for TeaVM:
> > https://frequal.com/TeaVM/TeaVMForNetBeans.html
> >
> > The first feature, hyperlinking to HTML templates from Java code,
> > went
> > relatively smoothly.
> >
> > Implementing the next feature is giving me difficulties, I'm hoping
> > someone
> > on this list can help me solve it. I'm trying to add support for the
> > TeaVM
> > elements, like <std:foreach> in the HTML editor. I found the Angular
> > support class "AngularHtmlExtension", which looks similar to what I
> > need:
> >
> https://github.com/apache/netbeans/blob/master/webcommon/html.angular/src/org/netbeans/modules/html/angular/AngularHtmlExtension.java
> >
> > However, I can't get the new TeaVM class I'm writing
> > (TemplateHtmlExtension) to load and be recognized.
> >
> > During the build, I get this error, could this be causing the
> > problem?
> >
> > [INFO] --- nbm-maven-plugin:4.1:manifest (default-manifest) @
> > teavm4nb ---
> > [INFO] NBM Plugin generates manifest
> > [WARNING] Module has friend dependency on
> > org.netbeans.modules.html.editor
> > but is not listed as a friend.
> > [WARNING] Module has friend dependency on
> > org.netbeans.modules.html.editor.lib but is not listed as a friend.
> >
> > I have tried various versions of the nbm-maven-plugin. I have added
> > and
> > removed dependencies. I have tried the
> > 'OpenIDE-Module-Module-Dependencies' manifest entry. So far nothing
> > has
> > worked. I either get:
> > * Class Not Found exceptions at runtime, or
> > * The TeaVM HtmlExtension class doesn't load (constructor not called)
> >
> > Thanks for any advice you can provide.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>