Time for action – creating an extension

The steps for creating an extension to hide a label when the mouse pointer moves over it are as follows:

  1. Create a new Vaadin project with the name extension using your IDE.
  2. Create a new server-side extension class:
    public class HideOnHover extends AbstractExtension {
    
      public void extend(Label label) {
        super.extend(label);
      }
    
    }
  3. Create a new client side connector (remember to put this class inside a .client package):
    @Connect(HideOnHover.class)
    public class HideOnHoverConnector extends AbstractExtensionConnector {
    
      @Override
      protected void extend(ServerConnector target) { final Widget widget = ((ComponentConnector) target).getWidget(); widget.addHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent ...

Get Vaadin 7 UI Design By Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.