FilterViewer
Identifier:
net.refractions.udig.ui.filterViewer
Since:
1.3.2
Description:
Extension Point for creating a custom Filter or Expression viewer
Configuration Markup:
<!ELEMENT extension (expressionViewer | filterViewer)*>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED
>
Used to contribute additional viewers for use with the OGC Filter specification.
Filter Viewers are avaialble in two flacours:
FilterViewers used to select content (for use or display)
ExpressionViewers used to generate a value on demand (for use when defining a Filter, or defining a Color when used in rendering).
<!ELEMENT filterViewer EMPTY>
<!ATTLIST filterViewer
id CDATA #REQUIRED
name CDATA #REQUIRED
class CDATA #REQUIRED
description CDATA #IMPLIED
>
- id -
- name - Display name shown to users allowing them to select this filter viewer.
Example: CQL or Include
- class -
- description - Quick description of this viewer allowing the user to choose.
<!ELEMENT expressionViewer EMPTY>
<!ATTLIST expressionViewer
id CDATA #REQUIRED
name CDATA #REQUIRED
class CDATA #REQUIRED
description CDATA #IMPLIED
>
- id -
- name - Display name shown to users allowing them to select this expression viewer.
Example: CQL or Crayons
- class -
- description - Quick description of this viewer allowing the user to choose.
Examples:
To contribute additional viewers into your application use the extension point as shown below:
<extension id="net.refractions.udig.tutorial.viewers"
point="net.refractions.udig.ui.filterViewer"
name="Custom Filter Viewers">
<filterViewer
id="roadCondition"
name="Road Condition"
class="net.refractions.udig.tutorial.viewer.RoadConditionFilterViewerFactory"
description="Filter sample road dataset using a graphical display of road condition"/>
<expressionViewer
id="crayons"
name="Crayons"
class="net.refractions.udig.tutorial.viewer.CrayonExpressionViewerFactory"
description="Define color using all the crayons in the box"/>
</extension>
API Information:
To contribute a filter viewer you will need to provide an implementation of IFilterViewer (used to edit a provided Filter) and FilterViewerFactory used to determine when your FilterViewer can be succcessfully applied.
Several FilterViewers are available out of the box. You may use these as a starting poitn for your own implementation.
IncludeFilterViewer is an easy to follow example offering two toggle buttons allowing users to enable or disable content.
To contribute an expression viewer you will need to implement IExpressionViewer and ExpressionViewerFactory.
RGBExpressionViewer is an easy to follow example allowing the user to edit a Color using red, green and blue values.
Supplied Implementation:
To use a FilterViewer in your own code you can either use the implementation directly; or offer the user a choice by dropping in the general purpose DefaultFilterViewer (which allows the user to switch between the avaialle implementations using a combo box).