Package com.extjs.gxt.samples.resources.client.model

Examples of com.extjs.gxt.samples.resources.client.model.Folder


      wrapper.layout();
      return;
    }

    if (event.getType() == AppEvents.ViewMailItems) {
      Folder f = (Folder) event.getData("folder");
      mailListPanel.setHeading(f.getName());
     
      ListStore<MailItem> store = mailListPanel.getStore();
      store.removeAll();
  
      store.add(event.<List<MailItem>>getData());
View Full Code Here


    return teamsales;
  }

  public static Folder getTreeModel() {
    Folder[] folders = new Folder[] {
        new Folder("Beethoven",
            new Folder[] {

                new Folder("Quartets",
                    new Music[] {
                        new Music("Six String Quartets", "Beethoven", "Quartets"),
                        new Music("Three String Quartets", "Beethoven", "Quartets"),
                        new Music("Grosse Fugue for String Quartets", "Beethoven",
                            "Quartets"),}),
                new Folder("Sonatas", new Music[] {
                    new Music("Sonata in A Minor", "Beethoven", "Sonatas"),
                    new Music("Sonata in F Major", "Beethoven", "Sonatas"),}),

                new Folder("Concertos", new Music[] {
                    new Music("No. 1 - C", "Beethoven", "Concertos"),
                    new Music("No. 2 - B-Flat Major", "Beethoven", "Concertos"),
                    new Music("No. 3 - C Minor", "Beethoven", "Concertos"),
                    new Music("No. 4 - G Major", "Beethoven", "Concertos"),
                    new Music("No. 5 - E-Flat Major", "Beethoven", "Concertos"),}),

                new Folder("Symphonies", new Music[] {
                    new Music("No. 1 - C Major", "Beethoven", "Symphonies"),
                    new Music("No. 2 - D Major", "Beethoven", "Symphonies"),
                    new Music("No. 3 - E-Flat Major", "Beethoven", "Symphonies"),
                    new Music("No. 4 - B-Flat Major", "Beethoven", "Symphonies"),
                    new Music("No. 5 - C Minor", "Beethoven", "Symphonies"),
                    new Music("No. 6 - F Major", "Beethoven", "Symphonies"),
                    new Music("No. 7 - A Major", "Beethoven", "Symphonies"),
                    new Music("No. 8 - F Major", "Beethoven", "Symphonies"),
                    new Music("No. 9 - D Minor", "Beethoven", "Symphonies"),}),}),
        new Folder("Brahms",
            new Folder[] {
                new Folder("Concertos", new Music[] {
                    new Music("Violin Concerto", "Brahms", "Concertos"),
                    new Music("Double Concerto - A Minor", "Brahms", "Concertos"),
                    new Music("Piano Concerto No. 1 - D Minor", "Brahms", "Concertos"),
                    new Music("Piano Concerto No. 2 - B-Flat Major", "Brahms",
                        "Concertos"),}),
                new Folder("Quartets",
                    new Music[] {
                        new Music("Piano Quartet No. 1 - G Minor", "Brahms", "Quartets"),
                        new Music("Piano Quartet No. 2 - A Major", "Brahms", "Quartets"),
                        new Music("Piano Quartet No. 3 - C Minor", "Brahms", "Quartets"),
                        new Music("String Quartet No. 3 - B-Flat Minor", "Brahms",
                            "Quartets"),}),
                new Folder("Sonatas", new Music[] {
                    new Music("Two Sonatas for Clarinet - F Minor", "Brahms", "Sonatas"),
                    new Music("Two Sonatas for Clarinet - E-Flat Major", "Brahms",
                        "Sonatas"),}),
                new Folder("Symphonies", new Music[] {
                    new Music("No. 1 - C Minor", "Brahms", "Symphonies"),
                    new Music("No. 2 - D Minor", "Brahms", "Symphonies"),
                    new Music("No. 3 - F Major", "Brahms", "Symphonies"),
                    new Music("No. 4 - E Minor", "Brahms", "Symphonies"),}),}),
        new Folder("Mozart", new Folder[] {new Folder("Concertos", new Music[] {
            new Music("Piano Concerto No. 12", "Mozart", "Concertos"),
            new Music("Piano Concerto No. 17", "Mozart", "Concertos"),
            new Music("Clarinet Concerto", "Mozart", "Concertos"),
            new Music("Violin Concerto No. 5", "Mozart", "Concertos"),
            new Music("Violin Concerto No. 4", "Mozart", "Concertos"),}),}),};

    Folder root = new Folder("root");
    for (int i = 0; i < folders.length; i++) {
      root.add((Folder) folders[i]);
    }

    return root;
  }
View Full Code Here

  private void processFolder(Folder folder) {
    folders.put(folder.getId(), folder);
    for (ModelData model : folder.getChildren()) {
      if (model instanceof Folder) {
        Folder child = (Folder) model;
        processFolder(child);
      }
    }
  }
View Full Code Here

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    String id = req.getParameter("id");

    Folder folder = null;
    if (id != null) {
      Integer iid = Integer.parseInt(id);
      folder = folders.get(iid);
    } else {
      folder = root;
View Full Code Here

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

  protected void handleEvent(AppEvent event) {
    if (event.getType() == AppEvents.Init) {
      initUI();
    } else if (event.getType() == AppEvents.NavMail) {
      Folder f = event.getData();
      if (f != null) {
        loader.addListener(Loader.Load, new LoadListener() {
          @Override
          public void loaderLoad(LoadEvent le) {
            loader.removeLoadListener(this);
View Full Code Here

      forwardToView(mailView, event);
    }
  }

  private void onViewMailItems(final AppEvent event) {
    final Folder f = event.getData();
    if (f != null) {
      service.getMailItems(f, new AsyncCallback<List<MailItem>>() {
        public void onSuccess(List<MailItem> result) {
          AppEvent ae = new AppEvent(event.getType(), result);
          ae.setData("folder", f);
View Full Code Here

  private Folder inbox;
  private Folder sent;
  private Folder trash;

  public MailModel() {
    inbox = new Folder("Inbox");
    sent = new Folder("Sent Items");
    trash = new Folder("Trash");

    List<MailItem> items = TestData.getMailItems();
    int count = items.size();

    List<MailItem> inlist = new ArrayList<MailItem>();
View Full Code Here

    super.onRender(parent, index);

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(10);

    Folder model = TestData.getTreeModel();

    TreeStore<ModelData> store = new TreeStore<ModelData>();
    store.add(model.getChildren(), true);

    ContentPanel cp = new ContentPanel();
    cp.setBodyBorder(false);
    cp.setFrame(true);
    cp.setHeading("TreeGrid to TreeGrid Example");
    cp.setButtonAlign(HorizontalAlignment.CENTER);

    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());
    tree.setAutoExpandColumn("name");
    tree.setTrackMouseOver(false);

    new TreeGridDragSource(tree);

    VBoxLayoutData data = new VBoxLayoutData(6, 0, 6, 0);
    data.setFlex(10);
    cp.add(tree, data);

    Folder f = new Folder("My Music");
    TreeStore<ModelData> dropStore = new TreeStore<ModelData>();
    dropStore.add(f, false);

    tree = new TreeGrid<ModelData>(dropStore, createColumnModel()) {
      @Override
View Full Code Here

  private List<MailItem> inboxItems;
  private List<MailItem> sentItems;
  private List<MailItem> trashItems;

  public MailServiceImpl() {
    mail = new Folder();
    Folder inbox = new Folder("Inbox");
    Folder sent = new Folder("Sent Items");
    Folder trash = new Folder("Trash");

    List<MailItem> items = TestData.getMailItems();
    int count = items.size();

    inboxItems = new ArrayList<MailItem>();
View Full Code Here

TOP

Related Classes of com.extjs.gxt.samples.resources.client.model.Folder

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.