0 Replies Latest reply: Jun 27, 2013 3:31 AM by fabsav RSS

    Custom Components skin

    fabsav

      Hi!

      I've some doubts about how to implementing skin in a component created by myself.

       

      I tried this:
      <code>

      public class XSkin implements Skin<X> {
      private X x;
      XSkin(X x){
      this.x= x;
      }
      @Override
      public void dispose() {
      x= null;
      }

       

       

      @Override
      public Node getNode() {
      layout.getStyleClass().add("x-css-class");
      return layout;
      }

       

       

      @Override
      public X getSkinnable() {
      return x;
      }
      }

      </code>

       

      in X contructor the first line is

      <code>

           this.setSkin(new XSkin(this));

      </code>

       

      Am I right? What's missing?

      Thank you!