Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] update on filter and expression viewer

Coming together nicely - code example!

 // Opacity is defined as an _expression_ in the Symbology Encoding Specification  
 IExpressionViewer opacityViewer = new CQLExpressionViewer( composite, SWT.DEFAULT );
  
 ExpressionInput opacity = new ExpressionInput();
 opacity.setRequired(false);
 opacity.setBinding( Float.class );
 opacity.setMin( 0.0 );
 opacity.setMax( 1.0 );
 opacity.setDefault( 1.0 );
  
 // used to suggest literal values  
 opacity.setLiteralList( 0.0, 0.25, 0.5, 0.75, 0.8, 0.85, 0.90, 0.95, 1.0 );
  
 // used to suggest numeric attributes
 opacity.setSchema( featureType );
  
 opacityViewer.setInput( opacity );
  
 // Acts as a normal viewer with the selection being the edited _expression_
 opacityViewer.setSelection( new StructuredSelection( expr ) );
 opacityViewer.setExpression( expr ); // direct access via helper method

Back to the top