O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required