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

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


    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("Family", null);
    store.add(m, false);
    tree.setExpanded(m, true);

    store.add(m, newItem("Darrell", "user"), false);
    store.add(m, newItem("Maro", "user-girl"), false);
    store.add(m, newItem("Lia", "user-kid"), false);
    store.add(m, newItem("Alec", "user-kid"), false);
    store.add(m, newItem("Andrew", "user-kid"), false);

    m = newItem("Friends", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Bob", "user"), false);
    store.add(m, newItem("Mary", "user-girl"), false);
    store.add(m, newItem("Sally", "user-girl"), false);
    store.add(m, newItem("Jack", "user"), false);

    cp.add(tree);

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

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Stuff");
    cp.setBodyStyleName("pad-text");
    cp.addText(TestData.DUMMY_TEXT_SHORT);
    w.add(cp);

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("More Stuff");
    cp.setBodyStyleName("pad-text");
    cp.addText(TestData.DUMMY_TEXT_SHORT);
    w.add(cp);
    return w;
  }
View Full Code Here


    Grid<Stock> grid = new Grid<Stock>(store, cm);
    grid.setView(view);
    grid.setBorders(true);

    ContentPanel panel = new ContentPanel();
    panel.setHeading("Grouping Example");
    // panel.setIcon(Resources.ICONS.table());
    panel.setCollapsible(true);
    panel.setFrame(true);
    panel.setSize(700, 450);
    panel.setLayout(new FitLayout());
    panel.add(grid);

    add(panel);
  }
View Full Code Here

    EditorGrid<Task> grid = new EditorGrid<Task>(store, cm);
    grid.setBorders(true);
    grid.setView(summary);
    grid.getView().setShowDirtyCells(false);

    ContentPanel panel = new ContentPanel();
    panel.setHeading("Sponsored Projects");
    panel.setCollapsible(true);
    panel.setFrame(true);
    panel.setSize(800, 450);
    panel.setLayout(new FitLayout());
    panel.add(grid);
    RootPanel.get().add(panel);

  }
View Full Code Here

  protected void initialize() {

  }

  protected void initUI() {
    ContentPanel west = (ContentPanel) Registry.get(AppView.WEST_PANEL);
    ContentPanel mail = new ContentPanel();
    mail.setAnimCollapse(false);
    mail.setHeading("Mail");
    mail.addListener(Events.Expand, new Listener<ComponentEvent>() {
      public void handleEvent(ComponentEvent be) {
        Dispatcher.get().dispatch(AppEvents.NavMail);
      }
    });

    loader = new BaseTreeLoader<Folder>(new TreeModelReader<List<Folder>>());
    store = new TreeStore<Folder>(loader);

    tree = new TreePanel<Folder>(store);
    tree.getStyle().setLeafIcon(IconHelper.createStyle("tree-folder"));
    tree.setDisplayProperty("name");
    tree.setAutoSelect(true);
    tree.getSelectionModel().addSelectionChangedListener(
        new SelectionChangedListener<Folder>() {

          @Override
          public void selectionChanged(SelectionChangedEvent<Folder> se) {
            Folder f = (Folder) se.getSelection().get(0);
            AppEvent evt = new AppEvent(AppEvents.ViewMailItems, f);
            fireEvent(evt);
          }
        });

    mail.add(tree);
    west.add(mail);
  }
View Full Code Here

  private void createWest() {
    BorderLayoutData data = new BorderLayoutData(LayoutRegion.WEST, 200, 150, 350);
    data.setMargins(new Margins(5, 0, 5, 5));

    west = new ContentPanel();
    west.setBodyBorder(false);
    west.setLayout(new AccordionLayout());
    west.setLayoutOnChange(true);
    west.setHeading("GXT Mail Demo");
View Full Code Here

    RootPanel.get().add(viewport);
   
  }

  private void createCenter() {
    centerPanel = new ContentPanel();
    centerPanel.setBorders(false);
    centerPanel.setHeaderVisible(false);
    centerPanel.setLayout(new FitLayout());

    BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER);
View Full Code Here

  private void createWest() {
    BorderLayoutData data = new BorderLayoutData(LayoutRegion.WEST, 220, 150, 320);
    data.setMargins(new Margins(5, 5, 5, 5));
    data.setCollapsible(true);
    westPanel = new ContentPanel();

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

    viewport.add(westPanel, data);
View Full Code Here

    TableLayout layout = new TableLayout(1);
    layout.setWidth("100%");
    setLayout(layout);

    buttonPanel1 = new ContentPanel();
    buttonPanel1.setLayout(new CardLayout());
    buttonPanel1.setHeaderVisible(false);
    buttonPanel1.setBorders(false);
    buttonPanel1.setBodyBorder(false);
    buttonPanel1.setHeight(40);
    buttonPanel1.setButtonAlign(HorizontalAlignment.CENTER);

    buttonPanel1.addButton(new Button(messages.printAll(), new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        bus.fireEvent(new ExportFicheStEvent());
      }
    }));

    buttonPanel1.addButton(new Button(messages.print(), new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        bus.fireEvent(new ExportGestionPanelEvent());
      }
    }));

    buttonPanel1.addButton(new Button(messages.printPromotions(), new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        bus.fireEvent(new ExportAvancementPanelEvent());
      }
    }));

    buttonPanel1.addButton(new Button(messages.printAcomptes(), new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        bus.fireEvent(new ExportSuiviDesAccomptesPanelEvent());
      }
    }));

    add(buttonPanel1);

    buttonPanel2 = new ContentPanel();
    buttonPanel2.setLayout(new CardLayout());
    buttonPanel2.setHeaderVisible(false);
    buttonPanel2.setBorders(false);
    buttonPanel2.setBodyBorder(false);
    buttonPanel2.setHeight(40);
View Full Code Here

    ListLoader<ListLoadResult<Photo>> loader = new BaseListLoader<ListLoadResult<Photo>>(
        proxy, new BeanModelReader());
    ListStore<BeanModel> store = new ListStore<BeanModel>(loader);
    loader.load();

    final ContentPanel panel = new ContentPanel();
    panel.setCollapsible(true);
    panel.setAnimCollapse(false);
    panel.setFrame(true);
    panel.setId("images-view");
    panel.setHeading("Simple ListView (0 items selected)");
    panel.setWidth(535);
    panel.setAutoHeight(true);
    panel.setBodyBorder(false);

    ListView<BeanModel> view = new ListView<BeanModel>() {
      @Override
      protected BeanModel prepareData(BeanModel model) {
        String s = model.get("name");
        model.set("shortName", Format.ellipse(s, 15));
        model.set("path", GWT.getHostPageBaseURL() + model.get("path"))
        return model;
      }

    };

    view.setTemplate(getTemplate());
    view.setStore(store);
    view.setItemSelector("div.thumb-wrap");
    view.getSelectionModel().addListener(Events.SelectionChange,
        new Listener<SelectionChangedEvent<BeanModel>>() {

          public void handleEvent(SelectionChangedEvent<BeanModel> be) {
            panel.setHeading("Simple ListView (" + be.getSelection().size()
                + " items selected)");
          }

        });
    panel.add(view);
    add(panel);
  }
View Full Code Here

    grid.setBorders(true);
    grid.setLoadMask(true);
    grid.getView().setEmptyText("Please hit the load button.");
    grid.setAutoExpandColumn("Sender");

    ContentPanel panel = new ContentPanel();
    panel.setFrame(true);
    panel.setCollapsible(true);
    panel.setAnimCollapse(false);
    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.setIcon(Resources.ICONS.table());
    panel.setHeading("JSON Table Demo");
    panel.setLayout(new FitLayout());
    panel.add(grid);
    panel.setSize(575, 350);

    // add buttons
    Button load = new Button("Load JSON", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        loader.load();
      }
    });

    panel.addButton(load);
    grid.getAriaSupport().setLabelledBy(panel.getHeader().getId() + "-label");
    add(panel);

  }
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.