html.master.html Maven / Gradle / Ivy
Show all versions of geomajas-client-gwt2-plugin-corewidget-documentation
Geomajas geomajas-gwt2-widget plug-in guide Table of Contents
List of Examples
- 2.1. Plug-in dependency
The core widget plugin contains a set of widely used widgets in a
Geomajas application, as well as some very popular map controllers and
events. The current widget set contains:
-
LayerLegendPanel: a panel that shows the title/legend of a layer
and some layer controls
-
MapLegendPanel: a container of LayerLegendPanel instance, one for
each map layer
We also have the following map controllers/listeners:
-
FeatureClickedListener: a listeners that sends an
FeatureClickedEvent
when the user clicks on a feature
-
MouseOverListener: a listeners that that sends an
FeatureMouseOverEvent
when the user hovers over a feature
Table of Contents
Make sure your include the plug-in in your project. If you are using
Maven, add the following dependency to your pom:
Example 2.1. Plug-in dependency
<dependency>
<groupId>org.geomajas.plugin</groupId>
<artifactId>geomajas-client-gwt2-plugin-corewidget</artifactId>
<version>2.4.1</version>
</dependency>
Table of Contents
To replace the default style, define another implementation for the
client resource bundle factory through deferred binding:
<replace-with class="org.geomajas.gwt2.plugin.corewidget.client.resource.MyCoreWidgetClientBundleFactory">
<when-type-is class="org.geomajas.gwt2.plugin.corewidget.client.resource.CoreWidgetClientBundleFactory" />
</replace-with>
MyCoreWidgetClientBundleFactory
should implement the
same methods but use different css files and images.
To replace the default style through css, define the nostyle
implementation for the client resource bundle factory through deferred
binding:
<replace-with class="org.geomajas.gwt2.plugin.corewidget.client.resource.CoreWidgetClientBundleFactoryNoStyle">
<when-type-is class="org.geomajas.gwt2.plugin.corewidget.client.resource.CoreWidgetClientBundleFactory" />
</replace-with>
CoreWidgetClientBundleFactoryNoStyle is an implementation that
provides empty css classes for all the css used. By importing a css file
at the web page level, the web developer can now define his or her own
style for each of these classes. The default css can be found at
org/geomajas/gwt2/plugin/corewidget/client/resource/CoreWidget.css.
To replace the view completely, define another implementation for
the view factory through deferred binding:
<replace-with class="org.geomajas.gwt2.plugin.corewidget.client.MyCoreWidgetViewFactory">
<when-type-is class="org.geomajas.gwt2.plugin.corewidget.client.CoreWidgetViewFactory" />
</replace-with>
The factory has create methods for each widget's view, just replace
the default implementations by your own implementation classes.