Package com.extjs.gxt.ui.client.widget

Examples of com.extjs.gxt.ui.client.widget.ContentPanel


    add(vp);

  };

  private ContentPanel createStandard() {
    ContentPanel panel = new SamplePanel();
    panel.setHeading("Standard");

    ToolBar toolBar = new ToolBar();

    Button btn = new Button("Cool", IconHelper.createStyle("add16"));
    toolBar.add(btn);
    Menu menu = new Menu();
    menu.add(new MenuItem("Ribbons are cool"));
    btn.setMenu(menu);
    toolBar.add(new SeparatorToolItem());

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

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

    btn = new Button("Paste", IconHelper.createStyle("add16"));
    toolBar.add(btn);
    menu = new Menu();
    menu.add(new MenuItem("Ribbons are cool"));
    btn.setMenu(menu);
    toolBar.add(new SeparatorToolItem());

    ToggleButton toggleBtn = new ToggleButton("Format");
    toggleBtn.toggle(true);
    toolBar.add(toggleBtn);

    panel.setTopComponent(toolBar);

    return panel;
  }
View Full Code Here


    return panel;
  }

  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"));
View Full Code Here

    return panel;

  }

  private ContentPanel createMulti2() {
    ContentPanel panel = new SamplePanel();
    panel.setHeading("Multi Columns No Titles");

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

    ButtonGroup group = new ButtonGroup(2);
    group.setHeaderVisible(false);
    Button btn = new Button("Cool", IconHelper.createStyle("add16"));
    group.add(btn);
View Full Code Here

    toolBar.add(group);
    return panel;
  }

  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);
View Full Code Here

  @Override
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setScrollMode(Scroll.AUTOY);
    ContentPanel panel = new ContentPanel();
    panel.setHeading("RowLayout: Orientation set to vertical");
    panel.setLayout(new RowLayout(Orientation.VERTICAL));
    panel.setSize(400, 300);
    panel.setFrame(true);
    panel.setCollapsible(true);

    Text label1 = new Text("Test Label 1");
    label1.addStyleName("pad-text");
    label1.setStyleAttribute("backgroundColor", "white");
    label1.setBorders(true);

    Text label2 = new Text("Test Label 2");
    label2.addStyleName("pad-text");
    label2.setStyleAttribute("backgroundColor", "white");
    label2.setBorders(true);

    Text label3 = new Text("Test Label 3");
    label3.addStyleName("pad-text");
    label3.setStyleAttribute("backgroundColor", "white");
    label3.setBorders(true);

    panel.add(label1, new RowData(1, -1, new Margins(4)));
    panel.add(label2, new RowData(1, 1, new Margins(0, 4, 0, 4)));
    panel.add(label3, new RowData(1, -1, new Margins(4)));

    add(panel, new FlowData(10));

    panel = new ContentPanel();
    panel.setHeading("RowLayout: Orientation set to horizontal");
    panel.setLayout(new RowLayout(Orientation.HORIZONTAL));
    panel.setSize(400, 300);
    panel.setFrame(true);
    panel.setCollapsible(true);

    label1 = new Text("Test Label 1");
    label1.addStyleName("pad-text");
    label1.setStyleAttribute("backgroundColor", "white");
    label1.setBorders(true);

    label2 = new Text("Test Label 2");
    label2.addStyleName("pad-text");
    label2.setStyleAttribute("backgroundColor", "white");
    label2.setBorders(true);

    label3 = new Text("Test Label 3");
    label3.addStyleName("pad-text");
    label3.setStyleAttribute("backgroundColor", "white");
    label3.setBorders(true);

    panel.add(label1, new RowData(-1, 1, new Margins(4)));
    panel.add(label2, new RowData(1, 1, new Margins(4, 0, 4, 0)));
    panel.add(label3, new RowData(-1, 1, new Margins(4)));

    add(panel, new FlowData(10));
  }
View Full Code Here

    ListStore<Stock> store = new ListStore<Stock>();
    store.add(TestData.getStocks());

    cm = new ColumnModel(configs);

    ContentPanel cp = new ContentPanel();
    cp.setBodyBorder(true);
    cp.setIcon(Resources.ICONS.table());
    cp.setHeading("Basic Grid");
    cp.setButtonAlign(HorizontalAlignment.CENTER);
    cp.setLayout(new FitLayout());
    cp.getHeader().setIconAltText("Grid Icon");
    cp.setSize(600, 300);

    final Grid<Stock> grid = new Grid<Stock>(store, cm);
    grid.setStyleAttribute("borderTop", "none");
    grid.setAutoExpandColumn("name");
    grid.setBorders(false);
    grid.setStripeRows(true);
    grid.setColumnLines(true);
    grid.setColumnReordering(true);
    grid.getAriaSupport().setLabelledBy(cp.getHeader().getId() + "-label");
    cp.add(grid);

    ToolBar toolBar = new ToolBar();
    toolBar.getAriaSupport().setLabel("Grid Options");

    toolBar.add(new LabelToolItem("Selection Mode: "));
    final SimpleComboBox<String> type = new SimpleComboBox<String>();
    type.getAriaSupport().setLabelledBy(toolBar.getItem(0).getId());
    type.setTriggerAction(TriggerAction.ALL);
    type.setEditable(false);
    type.setFireChangeEventOnSetValue(true);
    type.setWidth(100);
    type.add("Row");
    type.add("Cell");
    type.setSimpleValue("Row");
    type.addListener(Events.Change, new Listener<FieldEvent>() {
      public void handleEvent(FieldEvent be) {
        boolean cell = type.getSimpleValue().equals("Cell");
        grid.getSelectionModel().deselectAll();
        if (cell) {
          grid.setSelectionModel(new CellSelectionModel<Stock>());
        } else {
          grid.setSelectionModel(new GridSelectionModel<Stock>());
        }
      }
    });
    toolBar.add(type);

    cp.setTopComponent(toolBar);

    add(cp);

    // needed to enable quicktips (qtitle for the heading and qtip for the
    // content) that are setup in the change GridCellRenderer
View Full Code Here

    toolBar.add(new FillToolItem());
    ThemeSelector selector = new ThemeSelector();
    toolBar.add(selector);

    ContentPanel panel = new ContentPanel();
    panel.setCollapsible(true);
    panel.setFrame(true);
    panel.setHeading("ToolBar & Menu Demo");
    panel.setLayout(new FitLayout());
    panel.setSize(GXT.isAriaEnabled() ? 800 : 550, 300);
    panel.setTopComponent(toolBar);

    LayoutContainer c = new LayoutContainer();
    c.setStyleAttribute("backgroundColor", "white");
    c.setBorders(true);
    panel.add(c);

    add(panel);
  }
View Full Code Here

    ColumnConfig size = new ColumnConfig("genre", "Genre", 100);
    size.setEditor(new CellEditor(new TextField<String>()));

    ColumnModel cm = new ColumnModel(Arrays.asList(name, author, size));

    ContentPanel cp = new ContentPanel();
    cp.setBodyBorder(false);
    cp.setHeading("RowEditor TreeGrid");
    cp.setButtonAlign(HorizontalAlignment.CENTER);
    cp.setLayout(new FitLayout());
    cp.setFrame(true);
    cp.setSize(600, 300);

    TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);
    tree.setBorders(true);
    tree.getStyle().setLeafIcon(Resources.ICONS.music());
    tree.setSize(400, 400);
    tree.setAutoExpandColumn("name");
    tree.setTrackMouseOver(false);
   
    RowEditor<ModelData> editor = new RowEditor<ModelData>();
    tree.addPlugin(editor);

    cp.add(tree);

    add(cp);
  }
View Full Code Here

  @Override
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setStyleAttribute("margin", "10px");
   
    ContentPanel panel = new ContentPanel();
    panel.setSize(400, 100);
    panel.setFrame(true);
    panel.setHeading("CardLayout Example");
    panel.setButtonAlign(HorizontalAlignment.CENTER);

    final CardLayout layout = new CardLayout();
    panel.setLayout(layout);

    for (int i = 0; i < 4; i++) {
      final LayoutContainer c = new LayoutContainer();
      c.addText("This is the contents for card: " + (i + 1));
      panel.add(c);
      panel.addButton(new Button("Card " + (i + 1), new SelectionListener<ButtonEvent>() {
        @Override
        public void componentSelected(ButtonEvent ce) {
          layout.setActiveItem(c);
        }
      }));
    }
   
    layout.setActiveItem(panel.getItem(0));
   
    add(panel);
  }
View Full Code Here

    ColumnConfig date = new ColumnConfig("author", "Author", 100);
    ColumnConfig size = new ColumnConfig("genre", "Genre", 100);

    ColumnModel cm = new ColumnModel(Arrays.asList(numberer, name, date, size));

    ContentPanel cp = new ContentPanel();
    cp.setBodyBorder(false);
    cp.setHeading("RowNumber TreeGrid");
    cp.setButtonAlign(HorizontalAlignment.CENTER);
    cp.setLayout(new FitLayout());
    cp.setFrame(true);
    cp.setSize(600, 300);

    TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);
    tree.addPlugin(numberer);
    tree.setBorders(true);
    tree.getStyle().setLeafIcon(Resources.ICONS.music());
    tree.setSize(400, 400);
    tree.setAutoExpandColumn("name");
    tree.setTrackMouseOver(false);

    cp.add(tree);

    add(cp);
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.ContentPanel

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.