How to mark constants

Questions and answers on developing, deploying and using plugins and JavaBeans

How to mark constants

Postby Marco R. » Mon Jun 16, 2014 7:22 pm

Hi all,

I'm making a servoy plugin and I' would like to give a functionlity like the "APPLICATION_TYPES.HEADLESS_CLIENT".
How can I make it?
By implementing the "IConstantsObject" interface?

if yes:
Have I to make a specific class that implements "IConstantsObject" and have I to return it into the plugin dataprovider?

if No:
What way have I to follow to reproduce that effect/behavior?

Thanks in advace

Marco Rossi
Marco Rossi
Freelance

Main development environment: Servoy 6.1.6 - 7.4.3, Java 1.6u45,7u71 Windows 7/CentOS
Marco R.
 
Posts: 203
Joined: Thu Mar 19, 2009 12:37 pm

Re: How to mark constants

Postby ROCLASI » Mon Jun 16, 2014 10:20 pm

Hi Marco,

You can take a look at how I did it in the JDBC-Metadata plugin.
See here for the specific lines of code.

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

Re: How to mark constants

Postby Marco R. » Wed Jun 18, 2014 11:26 am

Hi Robert,

I've followed your suggestion and I would like to thank you.
By your "way" it works but I get this behavior inside the developer (I'm using servoy 7.1.4):
deprecated.PNG
deprecated.PNG (6.87 KiB) Viewed 2840 times


As you can see, specifying the full plugin's name before the constant's class container, all works fine.
If I use, instead, directly "constants_class_container.MYCONSTANTS", I get a "deprecated" message.

I've placed your plugin under mine, and It seems to have the same characteristics.

If I run the code, the compiler get back an evaluation error on the line in wich the plugin's root is not specified.

Do you know how can we get the same behavior showed by the JSClient constants that are always acknowledged?

Thanks in advace


Marco
Marco Rossi
Freelance

Main development environment: Servoy 6.1.6 - 7.4.3, Java 1.6u45,7u71 Windows 7/CentOS
Marco R.
 
Posts: 203
Joined: Thu Mar 19, 2009 12:37 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 14 guests

cron