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

Examples of com.extjs.gxt.ui.client.widget.toolbar.ToolBar


    panel.setLayout(new FitLayout());
    panel.add(grid);
    panel.setSize(600, 350);
    grid.getAriaSupport().setLabelledBy(panel.getHeader().getId() + "-label");
   
    ToolBar toolBar = new ToolBar();
    toolBar.add(new FillToolItem());

    LiveToolItem item = new LiveToolItem();
    item.bindGrid(grid);

    toolBar.add(item);
    panel.setBottomComponent(toolBar);

    add(panel);

  }
View Full Code Here


          tree.setCheckNodes(CheckNodes.BOTH);
        }
      }
    });

    ToolBar toolBar = new ToolBar();
    toolBar.setBorders(true);

    toolBar.add(new Button("Get Checked", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        StringBuffer sb = new StringBuffer();
        for (ModelData item : tree.getCheckedSelection()) {
          sb.append(", " + (String) item.get("name"));
        }
        String s = sb.toString();
        if (s.length() > 1) s = s.substring(2);
       
      
        Info.display("Checked Items",  Format.ellipse(s, 100), "");
      }
    }));
    toolBar.add(new SeparatorToolItem());
    toolBar.add(new LabelToolItem("Cascade Behavior: "));
    toolBar.add(cascade);
    toolBar.add(new SeparatorToolItem());
    toolBar.add(new LabelToolItem("CheckNode Behavior: "));
    toolBar.add(checkNodes);

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

    ContentPanel cp = new ContentPanel();
    cp.setSize(600, 300);
    cp.setHeading("Grid DND Example");
    cp.setLayout(new RowLayout(Orientation.HORIZONTAL));

    ToolBar toolBar = new ToolBar();
    toolBar.add(new LabelToolItem("Feedback: "));
    final SimpleComboBox<String> type = new SimpleComboBox<String>();
    type.setTriggerAction(TriggerAction.ALL);
    type.setEditable(false);
    type.setWidth(100);
    type.add("Append");
    type.add("Insert");
    type.setSimpleValue("Append");
    type.addListener(Events.Change, new Listener<FieldEvent>() {
      public void handleEvent(FieldEvent be) {
        boolean append = type.getSimpleValue().equals("Append");
        Feedback f = append ? Feedback.APPEND : Feedback.INSERT;
        target.setFeedback(f);
        target2.setFeedback(f);
      }
    });

    toolBar.add(type);
    toolBar.add(new SeparatorToolItem());
    cp.setTopComponent(toolBar);

    ListStore<Stock> store = new ListStore<Stock>();
    store.add(TestData.getStocks());
View Full Code Here

    container.setLayout(new BorderLayout());

    ContentPanel west = new ContentPanel();
    west.setHeading("My Albums");

    ToolBar toolBar = new ToolBar();
    Button newAlbum = new Button("New Album");
    newAlbum.setIcon(Resources.ICONS.album());
    newAlbum.addSelectionListener(new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        MessageBox.prompt("New Album", "Enter the new album name:", new Listener<MessageBoxEvent>() {
          public void handleEvent(MessageBoxEvent be) {
            if (be.getButtonClicked().getItemId().equals(Dialog.OK) && be.getValue() != null) {
              tree.getStore().add(createAlbum(be.getValue()), false);
              tree.setLeaf(tree.getStore().getRootItems().get(tree.getStore().getRootItems().size() - 1), false);
            }
          }
        });
      }
    });
    toolBar.add(newAlbum);
    west.setTopComponent(toolBar);

    TreeStore<ModelData> treeStore = new TreeStore<ModelData>();

    tree = new TreePanel<ModelData>(treeStore);
View Full Code Here

    VBoxLayout layout = new VBoxLayout();
    layout.setVBoxLayoutAlign(VBoxLayoutAlign.STRETCH);
    cp.setLayout(layout);
    cp.setSize(500, 500);

    ToolBar toolBar = new ToolBar();
    toolBar.setBorders(true);
    toolBar.add(new LabelToolItem("Feedback: "));
    final SimpleComboBox<String> type = new SimpleComboBox<String>();
    type.setTriggerAction(TriggerAction.ALL);
    type.setEditable(false);
    type.setWidth(100);
    type.add("Append");
    type.add("Insert");
    type.setSimpleValue("Append");
    type.addListener(Events.Change, new Listener<FieldEvent>() {
      public void handleEvent(FieldEvent be) {
        boolean append = type.getSimpleValue().equals("Append");
        Feedback f = append ? Feedback.APPEND : Feedback.INSERT;
        target.setFeedback(f);
      }
    });
    toolBar.add(type);
    toolBar.add(new SeparatorToolItem());
    cp.setTopComponent(toolBar);

    TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, createColumnModel());
    tree.setBorders(true);
    tree.getStyle().setLeafIcon(Resources.ICONS.music());
View Full Code Here

    complex.setMaximizable(true);
    complex.setHeading("Accordion Window");
    complex.setWidth(200);
    complex.setHeight(350);

    ToolBar toolBar = new ToolBar();
    Button item = new Button();
    item.setIcon(Resources.ICONS.connect());
    toolBar.add(item);

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

    item = new Button();
    item.setIcon(Resources.ICONS.user_add());
    toolBar.add(item);

    item = new Button();
    item.setIcon(Resources.ICONS.user_delete());
    toolBar.add(item);

    complex.setIcon(Resources.ICONS.accordion());
    complex.setLayout(new AccordionLayout());

    ContentPanel cp = new ContentPanel();
View Full Code Here

    grid.setAutoExpandColumn("name");
    grid.setBorders(true);
    grid.addPlugin(checkColumn);
    cp.add(grid);

    ToolBar toolBar = new ToolBar();
    Button add = new Button("Add Plant");
    add.addSelectionListener(new SelectionListener<ButtonEvent>() {

      @Override
      public void componentSelected(ButtonEvent ce) {
        Plant plant = new Plant();
        plant.setName("New Plant 1");
        plant.setLight("Mostly Shady");
        plant.setPrice(0);
        plant.setAvailable(new DateWrapper().clearTime().asDate());
        plant.setIndoor(false);

        grid.stopEditing();
        store.insert(plant, 0);
        grid.startEditing(store.indexOf(plant), 0);
      }

    });
    toolBar.add(add);
    cp.setTopComponent(toolBar);
    cp.setButtonAlign(HorizontalAlignment.CENTER);
    cp.addButton(new Button("Reset", new SelectionListener<ButtonEvent>() {

      @Override
View Full Code Here

    panel.setFrame(true);
    panel.setSize(700, 450);
    panel.setLayout(new FitLayout());
    panel.add(grid);
   
    ToolBar toolBar = new ToolBar();
    toolBar.add(new LabelToolItem("Selection Mode: "));
    final SimpleComboBox<String> type = new SimpleComboBox<String>();
    type.setTriggerAction(TriggerAction.ALL);
    type.setEditable(false);
    type.setFireChangeEventOnSetValue(true);
    type.setWidth(100);
    type.add("Multi");
    type.add("Simple");
    type.setSimpleValue("Multi");
    type.addListener(Events.Change, new Listener<FieldEvent>() {
      public void handleEvent(FieldEvent be) {
        boolean simple = type.getSimpleValue().equals("Simple");
        sm.deselectAll();
        sm.setSelectionMode(simple ? SelectionMode.SIMPLE : SelectionMode.MULTI);
      }
    });

    toolBar.add(type);
    toolBar.add(new SeparatorToolItem());
    panel.setTopComponent(toolBar);

    add(panel);
  }
View Full Code Here

    grid.addPlugin(checkColumn);
    grid.addPlugin(re);
    grid.getAriaSupport().setLabelledBy(cp.getHeader().getId() + "-label");
    cp.add(grid);

    ToolBar toolBar = new ToolBar();
    Button add = new Button("Add Plant");
    add.addSelectionListener(new SelectionListener<ButtonEvent>() {

      @Override
      public void componentSelected(ButtonEvent ce) {
        Plant plant = new Plant();
        plant.setName("New Plant 1");
        plant.setLight("Mostly Shady");
        plant.setPrice(0);
        plant.setAvailable(new DateWrapper().clearTime().asDate());
        plant.setIndoor(false);

        re.stopEditing(false);
        store.insert(plant, 0);
        re.startEditing(store.indexOf(plant), true);

      }

    });
    toolBar.add(add);
    cp.setTopComponent(toolBar);
    cp.setButtonAlign(HorizontalAlignment.CENTER);
    cp.addButton(new Button("Reset", new SelectionListener<ButtonEvent>() {

      @Override
View Full Code Here

  private ListStore<MailItem> store;

  public MailListPanel() {
    setLayout(new FitLayout());

    ToolBar toolBar = new ToolBar();
    Button create = new Button("Create");
    create.setIcon(IconHelper.createStyle("icon-email-add"));
    toolBar.add(create);

    Button reply = new Button("Reply");
    reply.setIcon(IconHelper.createStyle("icon-email-reply"));
    toolBar.add(reply);

    setTopComponent(toolBar);

    ColumnConfig sender = new ColumnConfig("sender", "Sender", 200);
    ColumnConfig email = new ColumnConfig("email", "Email", 100);
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.toolbar.ToolBar

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.