Beispiel #1
0
  private Window createGeolocationWindow() {

    final Window w = new Window();
    w.setMinimizable(true);
    w.setMaximizable(true);
    w.setIcon(IconHelper.createStyle("accordion"));
    w.setHeading("Contact list");
    w.setWidth(500);
    w.setHeight(500);
    w.setLayout(new FitLayout());

    ContentPanel cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Localize your friends");
    cp.setScrollMode(Scroll.NONE);
    cp.setLayout(new FitLayout());

    Frame frame = new Frame();
    frame.setUrl("geolocation.html");
    frame.setLayoutData(new FitLayout());
    cp.add(frame);

    w.add(cp);
    return w;
  }
Beispiel #2
0
  private Window createAccordionWindow() {
    final Window w = new Window();
    w.setMinimizable(true);
    w.setMaximizable(true);
    w.setIcon(IconHelper.createStyle("accordion"));
    w.setHeading("Contact list");
    w.setWidth(200);
    w.setHeight(350);

    ToolBar toolBar = new ToolBar();
    Button item = new Button();
    item.setIcon(IconHelper.createStyle("icon-connect"));
    toolBar.add(item);

    toolBar.add(new SeparatorToolItem());
    w.setTopComponent(toolBar);

    item = new Button();
    item.setIcon(IconHelper.createStyle("icon-user-add"));
    toolBar.add(item);

    item = new Button();
    item.setIcon(IconHelper.createStyle("icon-user-delete"));
    toolBar.add(item);

    w.setLayout(new AccordionLayout());

    ContentPanel cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Online Users");
    cp.setScrollMode(Scroll.AUTO);
    cp.getHeader().addTool(new ToolButton("x-tool-refresh"));

    w.add(cp);

    TreeStore<ModelData> store = new TreeStore<ModelData>();
    TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
    tree.setIconProvider(
        new ModelIconProvider<ModelData>() {

          public AbstractImagePrototype getIcon(ModelData model) {
            if (model.get("icon") != null) {
              return IconHelper.createStyle((String) model.get("icon"));
            } else {
              return null;
            }
          }
        });
    tree.setDisplayProperty("name");

    ModelData m = newItem("Eurecom", null);
    store.add(m, false);
    tree.setExpanded(m, true);

    store.add(m, newItem("Emerson Milton", "user-suit"), false);
    store.add(m, newItem("Christina Blake", "user-girl"), false);
    store.add(m, newItem("Heriberto Rush", "user-kid"), false);
    store.add(m, newItem("Candice Carson", "user-girl"), false);
    store.add(m, newItem("Bell Snedden", "user-kid"), false);
    store.add(m, newItem("Dirk Newman", "user-kid"), false);
    store.add(m, newItem("Chad Andrews", "user-suit"), false);

    m = newItem("Italy", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Benito Meeks", "user-suit"), false);
    store.add(m, newItem("Gail Horton", "user-girl"), false);

    m = newItem("Paris", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Claudio Engle", "user-suit"), false);
    store.add(m, newItem("Sine", "user-girl"), false);

    m = newItem("Hometown", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Hollie Voss", "user-girl"), false);

    cp.add(tree);

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Settings");
    cp.setBodyStyleName("pad-text");
    cp.addText("Smape1");
    w.add(cp);

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Blocked");
    cp.setBodyStyleName("pad-text");
    cp.addText("Smape2");
    w.add(cp);

    return w;
  }