Boolean properties and queries

I've extended TheSimplestConcept by a new property "bold : boolean". In my

HelloWorldConsole ClassConcept the main method looks like this:

   StringBuffer buffer = new StringBuffer (  ) ;

   if ( true ) {

     buffer . append ( " * " ) ;

   }

   buffer . append ( " $ " ) ;

   System . out . println ( buffer . toString (  ) ) ;

Now I place the caret in the "true" (BTW, the caret should disappear, when

the focus is somewhere else) and press Ctrl-Shift-M, in the occuring context

menu I select "add/remove property macro". In the Inspector I press

Ctrl-Space, select "New query method" and enter the query method ID "bold".

This creates following new method in Queries.java:

   public static String propertyMacro_bold(SNode sourceNode,

             SNode templateNode,

             PropertyDeclaration property,

             ITemplateGenerator generator)  { }

Unfortunately this returns String instead of the expected boolean, so I

can't simply use that code:

  return ((TheSimplestConcept)sourceNode).getBold();

How should I create a boolean query the right way?

Tom

2 comments
Comment actions Permalink

hi,

for boolean query return "true" or "false"

for integer query return string as "0", "234" etc.

igor

0

Please sign in to leave a comment.