Ejemplo n.º 1
0
  private ContentPanel createMulti() {
    ContentPanel panel = new SamplePanel();
    panel.setHeading("Multi Columns");

    ToolBar toolBar = new ToolBar();
    panel.setTopComponent(toolBar);

    ButtonGroup group = new ButtonGroup(2);
    group.setHeading("Clipboard");

    Button btn = new Button("Cool", IconHelper.createStyle("add16"));
    group.add(btn);

    btn = new Button("Cut", IconHelper.createStyle("add16"));
    Menu menu = new Menu();
    menu.add(new MenuItem("Copy me"));
    btn.setMenu(menu);
    group.add(btn);

    btn = new Button("Copy", IconHelper.createStyle("add16"));
    group.add(btn);

    btn = new Button("Paste", IconHelper.createStyle("add16"));
    group.add(btn);

    toolBar.add(group);

    group = new ButtonGroup(2);
    group.setHeading("Other Bugus Actions");

    btn = new Button("Cool", IconHelper.createStyle("add16"));
    group.add(btn);

    btn = new Button("Cut", IconHelper.createStyle("add16"));
    menu = new Menu();
    menu.add(new MenuItem("Copy me"));
    btn.setMenu(menu);
    group.add(btn);

    btn = new Button("Copy", IconHelper.createStyle("add16"));
    group.add(btn);

    btn = new Button("Paste", IconHelper.createStyle("add16"));
    group.add(btn);

    toolBar.add(group);
    return panel;
  }
Ejemplo n.º 2
0
  private ContentPanel createMixed() {
    ContentPanel panel = new SamplePanel();
    panel.setHeading("Mix and match icon sizes");

    ToolBar toolBar = new ToolBar();
    panel.setTopComponent(toolBar);

    ButtonGroup group = new ButtonGroup(3);
    group.setHeading("Clipboard");
    toolBar.add(group);

    Button btn = new Button("Paste", Resources.ICONS.add32());
    btn.addStyleName("x-btn-as-arrow");
    btn.setScale(ButtonScale.LARGE);
    btn.setIconAlign(IconAlign.TOP);
    btn.setArrowAlign(ButtonArrowAlign.BOTTOM);
    TableData data = new TableData();
    data.setRowspan(3);

    group.add(btn, data);

    btn = new Button("Format", Resources.ICONS.add32());
    btn.setScale(ButtonScale.LARGE);
    btn.setIconAlign(IconAlign.TOP);
    btn.setArrowAlign(ButtonArrowAlign.BOTTOM);
    Menu menu = new Menu();
    menu.add(new MenuItem("Cool"));
    btn.setMenu(menu);
    group.add(btn, data);

    btn = new Button("Copy", IconHelper.createStyle("add16"));
    menu = new Menu();
    menu.add(new MenuItem("Copy me"));
    btn.setMenu(menu);
    group.add(btn);

    btn = new Button("Cut", IconHelper.createStyle("add16"));
    group.add(btn);

    btn = new Button("Paste", IconHelper.createStyle("add16"));
    group.add(btn);

    group = new ButtonGroup(3);
    group.setHeading("Clipboard");
    toolBar.add(group);

    btn = new Button("Paste", Resources.ICONS.add32());
    btn.addStyleName("x-btn-as-arrow");
    btn.setScale(ButtonScale.LARGE);
    btn.setIconAlign(IconAlign.TOP);
    btn.setArrowAlign(ButtonArrowAlign.BOTTOM);
    data = new TableData();
    data.setRowspan(3);

    group.add(btn, data);

    btn = new Button("Format", Resources.ICONS.add32());
    btn.setScale(ButtonScale.LARGE);
    btn.setIconAlign(IconAlign.TOP);
    btn.setArrowAlign(ButtonArrowAlign.BOTTOM);
    menu = new Menu();
    menu.add(new MenuItem("Cool"));
    btn.setMenu(menu);
    group.add(btn, data);

    btn = new Button("Copy", IconHelper.createStyle("add16"));
    menu = new Menu();
    menu.add(new MenuItem("Copy me"));
    btn.setMenu(menu);
    group.add(btn);

    btn = new Button("Cut", IconHelper.createStyle("add16"));
    group.add(btn);

    btn = new Button("Paste", IconHelper.createStyle("add16"));
    group.add(btn);
    return panel;
  }