Trouble implementing WidgetRules?
Trouble implementing WidgetRules?
Im having an issue implementing setWidgetRules for my addons. Im trying to turn off the widget display for the plots in my addon that way i dont have to manually turn them off when i enable my addons for the 1st time. I tried to use code that i found in this forum post.
I tried to implement it in my initialize code like this....
Indicator Indicator = api.registerIndicator("fstPctLvl ", GraphType.PRIMARY, Double.NaN, true, false);
and i also tried it like this....
private IndicatorModifiable fstPctLvl ;
fstPctLvl = api.registerIndicatorModifiable ("fstPctLvl ", GraphType.PRIMARY, Double.NaN, true, false);
but i cant seem to get it to work. I keep getting this error ...
The method registerIndicator(String, Layer1ApiUserMessageModifyIndicator.GraphType, double) in the type Api is not applicable for the arguments (String, Layer1ApiUserMessageModifyIndicator.GraphType, double, boolean, boolean)
Any help would be appreciated.
Thanks,
Dean
I tried to implement it in my initialize code like this....
Indicator Indicator = api.registerIndicator("fstPctLvl ", GraphType.PRIMARY, Double.NaN, true, false);
and i also tried it like this....
private IndicatorModifiable fstPctLvl ;
fstPctLvl = api.registerIndicatorModifiable ("fstPctLvl ", GraphType.PRIMARY, Double.NaN, true, false);
but i cant seem to get it to work. I keep getting this error ...
The method registerIndicator(String, Layer1ApiUserMessageModifyIndicator.GraphType, double) in the type Api is not applicable for the arguments (String, Layer1ApiUserMessageModifyIndicator.GraphType, double, boolean, boolean)
Any help would be appreciated.
Thanks,
Dean
-
- Posts: 549
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Trouble implementing WidgetRules?
Hi Dean,
I need to see your build.gradle file. It is in your project folder.
I need to see your build.gradle file. It is in your project folder.
Re: Trouble implementing WidgetRules?
Andrey,
Here are the contents of the file....
Thanks,
Dean
Here are the contents of the file....
Code: Select all
apply plugin: 'java'
apply plugin: 'eclipse'
repositories {
mavenCentral()
maven {
url "https://maven.bookmap.com/maven2/releases/"
}
}
eclipse.classpath.downloadJavadoc = true
dependencies {
compileOnly group: 'com.bookmap.api', name: 'api-core', version: '7.1.0.66';
compileOnly group: 'com.bookmap.api', name: 'api-simplified', version: '7.1.0.66';
//compile group: 'com.opencsv', name: 'opencsv', version: '5.3'
implementation group: 'com.opencsv', name: 'opencsv', version: '5.3'
}
Thanks,
Dean
-
- Posts: 549
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Trouble implementing WidgetRules?
Hi Dean,
1) what Bookmap version are you running?
2) do you have this error in runtime (when using your strategy) or in compile time (in your IDE)?
1) what Bookmap version are you running?
2) do you have this error in runtime (when using your strategy) or in compile time (in your IDE)?
Re: Trouble implementing WidgetRules?
Hi Andrey,
Im running 7.2.0 build 16. I get the error in Eclipse as soon as i write the code.
Thanks,
Dean
-
- Posts: 549
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Trouble implementing WidgetRules?
please change the api- libs in your build.gradle to 7.2.0.16 and rebuild your project
Code: Select all
dependencies {
compileOnly group: 'com.bookmap.api', name: 'api-core', version: '7.2.0.16';
compileOnly group: 'com.bookmap.api', name: 'api-simplified', version: '7.2.0.16';
Re: Trouble implementing WidgetRules?
Andrey,
That fixed issue. Thank you. I had this issue once before with something else which forced me to change to the version i had been using.
Question....
In the future should i just always make sure my api-libs for any addons in development match my current Bookmap version? Or do the API versions not change with every new build of Bookmap?
Thanks,
Dean
That fixed issue. Thank you. I had this issue once before with something else which forced me to change to the version i had been using.
Question....
In the future should i just always make sure my api-libs for any addons in development match my current Bookmap version? Or do the API versions not change with every new build of Bookmap?
Thanks,
Dean
-
- Posts: 549
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Trouble implementing WidgetRules?
Sometimes they do. It is better to keep the same version of Bookmap and api libs.
-
- Site Admin
- Posts: 279
- Joined: Mon Jun 11, 2018 11:44 am
- Has thanked: 2 times
- Been thanked: 31 times
Re: Trouble implementing WidgetRules?
Normally, we only add features and try to avoid breaking compatibility. So you typically want to develop for the lowest supported version of API (e.g if you intend your addon to run starting with 7.1.0 build 14, then you want api libs of version 7.1.0.14). That helps you avoid a situation where you accidentally start relying on newer functionality, making it impossible for users with older bookmap builds to run your addon.