temporary warnings

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

temporary warnings

Postby jozef.kopanicak » Tue Nov 27, 2018 3:55 pm

Hello

I have some code, where I'm calling java from javascript (for example, I'm using JavaFX). Generally, it works very good, but I have a minor, reocurring, annoying issue in the developer.

I can annotate the types using the full class hierarchy like this:
Code: Select all
/**
* @param {javafx.scene.Node} node
*/
function someFunction(node) {
  /** @type {javafx.scene.control.TextField} */
  var otherNode = node;
}


As I write the code, I have no warnings. The types resolve ok. After a developer restart and project clean, the developer builds the code and generates warning build markers for every javafx type and almost every plugin ("unknown type xxx"). As if the classes are not loaded. When I open the script file, make some minor change (for example space+backspace) and save, the script gets built again (I have auto-build on), and the warnings disappear for that script. The warnings also disappear completely, when I clean the build a second time.

Does anybody else have the issue?
Jozef Kopanicak
Mirus Software AG
jozef.kopanicak
 
Posts: 11
Joined: Wed Aug 29, 2012 10:17 am

Re: temporary warnings

Postby ROCLASI » Tue Nov 27, 2018 4:04 pm

Hi Josef,

When using Java in your code you need to prefix it with 'Packages'. Then the parser recognises it and the markers disappear.
So your code would look like this:
Code: Select all
/**
* @param {Packages.javafx.scene.Node} node
*/
function someFunction(node) {
    /** @type {Packages.javafx.scene.control.TextField} */
    var otherNode = node;
}


Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 11 guests

cron