Пример #1
0
  @Override
  public Object createContainer() {
    mySlide = new TipiSwingSlider();

    TipiHelper th = new TipiSwingHelper();
    th.initHelper(this);
    addHelper(th);

    mySlide.addFocusListener(
        new FocusListener() {

          @Override
          public void focusGained(FocusEvent e) {
            try {
              performTipiEvent("onFocusGained", null, false);
            } catch (TipiBreakException e1) {
              logger.debug("Error detected", e1);
            } catch (TipiException e1) {
              logger.error("Error detected", e1);
            }
          }

          @Override
          public void focusLost(FocusEvent e) {
            try {
              performTipiEvent("onFocusLost", null, false);
            } catch (TipiBreakException e1) {
              logger.debug("Error detected", e1);
            } catch (TipiException e1) {
              logger.error("Error detected", e1);
            }
          }
        });

    mySlide.addChangeListener(
        new ChangeListener() {

          @Override
          public void stateChanged(ChangeEvent e) {
            try {
              performTipiEvent("onValueChanged", null, false);
            } catch (TipiBreakException e1) {
              logger.debug("Error detected", e1);
            } catch (TipiException e1) {
              logger.error("Error detected", e1);
            }
          }
        });
    return mySlide;
  }
Пример #2
0
 @Override
 public Object getComponentValue(String name) {
   if (name.equals("value")) {
     return mySlide.getValue();
   }
   return super.getComponentValue(name);
 }