Search This Blog

Monday 13 February 2017

How to create osgi configuration with selection dropdown property/fields



@Property(label = "Select One Value", name = "label", options = {

                     @PropertyOption(name = "title1", value = "value1"),

                     @PropertyOption(name = "title2", value = "value2") 

      }, value = "defaultvalue", description =  "Some Description")

private static final String 

PROPERTY_SCHEDULER_DATASOURCE = "label";



private String label;

//And then

@Activate

protected void activate(final Map < String, Object > config) {

        this.lebel = PropertiesUtil.toString(config.get("label"), 

                           "some_default_value");


}


1 comment:

  1. Can I get a reference to add values programatically into OSGI dropdown?

    ReplyDelete