Package rocket.widget.client

Examples of rocket.widget.client.Panel


    while (true) {
      final List<SplitterItem> items = this.getItems();
      items.add(beforeIndex, item);

      final Panel panel = this.getPanel();
      final Widget widget = item.getWidget();

      // if this is the only widget no need to add a splitter before or
      // after...
      if (items.size() == 1) {
        panel.insert(widget, 0);
        break;
      }

      int panelIndex = beforeIndex * 2;

      // if its the new first widget insert the widget then a splitter
      Widget first = widget;
      Widget second = this.createSplitter();

      if (beforeIndex > 0) {
        // not the first widget insert the splitter then the widget...
        Widget swap = first;
        first = second;
        second = swap;

        panelIndex--;
      }

      panel.insert(first, panelIndex + 0);
      panel.insert(second, panelIndex + 1);
      break;
    }

    this.redraw();
  }
View Full Code Here


    // remove the item from list...
    items.remove(index);

    // remove the widget from the panel...
    final Panel panel = this.getPanel();
    final int panelIndex = index * 2;

    // remove the widget, this may be the widget(when index==0) or
    // slider(when index>0)
    panel.remove(panelIndex);

    // if the widget that was removed was the only widget then there will be
    // no splitter...
    if (panel.getWidgetCount() > 0) {
      panel.remove(panelIndex);
    }

    this.redraw();
  }
View Full Code Here

  public Widget getHandle() {
    return this.getPanel().get(Constants.HANDLE_WIDGET_INDEX);
  }

  public void setHandle(final Widget handle) {
    final Panel panel = this.getPanel();
    panel.remove(Constants.HANDLE_WIDGET_INDEX);
    panel.insert(handle, Constants.HANDLE_WIDGET_INDEX);
  }
View Full Code Here

  public Widget getBackground() {
    return this.getPanel().get(Constants.BACKGROUND_WIDGET_INDEX);
  }

  public void setBackground(final Widget background) {
    final Panel panel = this.getPanel();
    panel.remove(Constants.BACKGROUND_WIDGET_INDEX);
    panel.insert(background, Constants.BACKGROUND_WIDGET_INDEX);
  }
View Full Code Here

  public Widget getHandle() {
    return this.getPanel().get(Constants.HANDLE_WIDGET_INDEX);
  }

  public void setHandle(final Widget handle) {
    final Panel panel = this.getPanel();
    panel.remove(Constants.HANDLE_WIDGET_INDEX);
    panel.insert(handle, Constants.HANDLE_WIDGET_INDEX);
  }
View Full Code Here

  public Widget getBackground() {
    return this.getPanel().get(Constants.BACKGROUND_WIDGET_INDEX);
  }

  public void setBackground(final Widget background) {
    final Panel panel = this.getPanel();
    panel.remove(Constants.BACKGROUND_WIDGET_INDEX);
    panel.insert(background, Constants.BACKGROUND_WIDGET_INDEX);
  }
View Full Code Here

TOP

Related Classes of rocket.widget.client.Panel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.