Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.Tree$ImagesFromImageBase


   * @return the new tree
   */
  @ShowcaseSource
  private Tree createDynamicTree() {
    // Create a new tree
    Tree dynamicTree = new Tree();

    // Add some default tree items
    for (int i = 0; i < 5; i++) {
      TreeItem item = dynamicTree.addItem(constants.cwTreeItem() + " " + i);

      // Temporarily add an item so we can expand this node
      item.addItem("");
    }

    // Add a handler that automatically generates some children
    dynamicTree.addOpenHandler(new OpenHandler<TreeItem>() {
      public void onOpen(OpenEvent<TreeItem> event) {
        TreeItem item = event.getTarget();
        if (item.getChildCount() == 1) {
          // Close the item immediately
          item.setState(false, false);
View Full Code Here


    String[] composers = constants.cwTreeComposers();
    String concertosLabel = constants.cwTreeConcertos();
    String quartetsLabel = constants.cwTreeQuartets();
    String sonatasLabel = constants.cwTreeSonatas();
    String symphoniesLabel = constants.cwTreeSymphonies();
    Tree staticTree = new Tree();

    // Add some of Beethoven's music
    TreeItem beethovenItem = staticTree.addItem(composers[0]);
    addMusicSection(beethovenItem, concertosLabel,
        constants.cwTreeBeethovenWorkConcertos());
    addMusicSection(
        beethovenItem, quartetsLabel, constants.cwTreeBeethovenWorkQuartets());
    addMusicSection(
        beethovenItem, sonatasLabel, constants.cwTreeBeethovenWorkSonatas());
    addMusicSection(beethovenItem, symphoniesLabel,
        constants.cwTreeBeethovenWorkSymphonies());

    // Add some of Brahms's music
    TreeItem brahmsItem = staticTree.addItem(composers[1]);
    addMusicSection(
        brahmsItem, concertosLabel, constants.cwTreeBrahmsWorkConcertos());
    addMusicSection(
        brahmsItem, quartetsLabel, constants.cwTreeBrahmsWorkQuartets());
    addMusicSection(
        brahmsItem, sonatasLabel, constants.cwTreeBrahmsWorkSonatas());
    addMusicSection(
        brahmsItem, symphoniesLabel, constants.cwTreeBrahmsWorkSymphonies());

    // Add some of Mozart's music
    TreeItem mozartItem = staticTree.addItem(composers[2]);
    addMusicSection(
        mozartItem, concertosLabel, constants.cwTreeMozartWorkConcertos());

    // Return the tree
    return staticTree;
View Full Code Here

   * @param images the {@link Images} used in the Mail options
   * @return the {@link Tree} of mail options
   */
  @ShowcaseSource
  private Tree createMailItem(Images images) {
    Tree mailPanel = new Tree(images);
    TreeItem mailPanelRoot = mailPanel.addItem("foo@example.com");
    String[] mailFolders = constants.cwStackPanelMailFolders();
    addItem(mailPanelRoot, images.inbox(), mailFolders[0]);
    addItem(mailPanelRoot, images.drafts(), mailFolders[1]);
    addItem(mailPanelRoot, images.templates(), mailFolders[2]);
    addItem(mailPanelRoot, images.sent(), mailFolders[3]);
View Full Code Here

   * @param images the {@link Images} used in the Mail options
   * @return the {@link Tree} of mail options
   */
  @ShowcaseSource
  private Widget createMailItem(Images images) {
    Tree mailPanel = new Tree(images);
    TreeItem mailPanelRoot = mailPanel.addItem("foo@example.com");
    String[] mailFolders = constants.cwStackLayoutPanelMailFolders();
    addItem(mailPanelRoot, images.inbox(), mailFolders[0]);
    addItem(mailPanelRoot, images.drafts(), mailFolders[1]);
    addItem(mailPanelRoot, images.templates(), mailFolders[2]);
    addItem(mailPanelRoot, images.sent(), mailFolders[3]);
View Full Code Here

  protected void  processResults(){
   
    selectFolder.setVisible(false);
    DocsFolderItem docsFolderItem = null;
    TreeItem treeItem  = null;
    Tree root = new Tree();
    TreeLabel itemLabel = null;
     
      for (int y =0; y< itemsList.size(); y++){
         
        docsFolderItem = new DocsFolderItem(itemsList.get(y));
         
         // find root level foders
          if (!docsFolderItem.hasParent()){
          
            itemLabel = new TreeLabel(docsFolderItem.getID(),docsFolderItem.getTitle());
           
            //itemLabel.addStyleName("treeItemSelect");
            itemLabel.addClickHandler(new ClickHandler() {
              @Override
            public void onClick(ClickEvent event) {
                // set the User pref
                String id =   ((TreeLabel)event.getSource()).getID();
                prefs.set("selectedFolder", id);
                String title =  ((TreeLabel)event.getSource()).getText();
                prefs.set("selectedFolderTitle", title);
               
                holder.setVisible(false) ;
                               
                DocsFolderGadget.DL.init();
              }
            });
                   
            treeItem = new TreeItem(itemLabel);
            root.addItem(treeItem);
            buildSubFoders( docsFolderItem, treeItem);
          }
      }
    
      holder.add(root);
View Full Code Here

            return null;
        }
    }

    public Tree createTree() {
        return new Tree();
    }
View Full Code Here

public class FactTypeBrowser extends Composite {

    public FactTypeBrowser(SuggestionCompletionEngine sce,
            final ClickEvent ev) {
        final Tree tree = new Tree();

        final VerticalPanel panel = new VerticalPanel();

        final HorizontalPanel hpFactsAndHide = new HorizontalPanel();
        final HorizontalPanel hpShow = new HorizontalPanel();

        hpShow.add(new ClickableLabel(Constants.INSTANCE.ShowFactTypes(),
                new ClickHandler() {
                    public void onClick(com.google.gwt.event.dom.client.ClickEvent event) {
                        hpShow.setVisible(false);
                        hpFactsAndHide.setVisible(true);
                        tree.setVisible(true);
                    }
                }));
        panel.add(hpShow);

        hpFactsAndHide.add(new SmallLabel(Constants.INSTANCE.FactTypes()));
        hpFactsAndHide.add(new ClickableLabel(Constants.INSTANCE.hide(),
                new ClickHandler() {
                    public void onClick(com.google.gwt.event.dom.client.ClickEvent event) {
                        hpShow.setVisible(true);
                        hpFactsAndHide.setVisible(false);
                        tree.setVisible(false);
                    }
                }));
        panel.add(hpFactsAndHide);

        panel.add(tree);
        if (sce.getFactTypes() != null) {
            for (String type : sce.getFactTypes()) {
                TreeItem it = new TreeItem();
                it.setHTML(AbstractImagePrototype.create(DroolsGuvnorImages.INSTANCE.classImage()).getHTML()
                        + "<small>"
                        + type + "</small>");
                it.setUserObject(type + "( )");
                tree.addItem(it);

                String[] fields = (String[]) sce.getModelFields(type);
                if (fields != null) {
                    for (String field : fields) {
                        TreeItem fi = new TreeItem();
                        fi.setHTML(AbstractImagePrototype.create(DroolsGuvnorImages.INSTANCE.field()).getHTML()
                                + "<small>"
                                + field + "</small>");
                        fi.setUserObject(field);
                        it.addItem(fi);
                    }
                }
            }
        }

        tree.setStyleName("category-explorer-Tree"); //NON-NLS
        tree.addSelectionHandler(new SelectionHandler<TreeItem>() {

            public void onSelection(SelectionEvent<TreeItem> event) {
                Object o = event.getSelectedItem().getUserObject();
                if (o instanceof String) {
                    ev.selected((String) o);
                }
            }
        });

        tree.setVisible(false);
        hpFactsAndHide.setVisible(false);
        hpShow.setVisible(true);

        initWidget(panel);
    }
View Full Code Here

    public VerifierResultWidget(AnalysisReport report,
                                boolean showFactUsage) {
       
        FormStyleLayout layout = new FormStyleLayout();

        Tree tree = new Tree();

        TreeItem errors = doMessageLines( Constants.INSTANCE.Errors(),
                                          DroolsGuvnorImages.INSTANCE.error(),
                                          report.errors );
        tree.addItem( errors );

        TreeItem warnings = doMessageLines( Constants.INSTANCE.Warnings(),
                                            DroolsGuvnorImages.INSTANCE.warning(),
                                            report.warnings );
        tree.addItem( warnings );

        TreeItem notes = doMessageLines( Constants.INSTANCE.Notes(),
                                         DroolsGuvnorImages.INSTANCE.note(),
                                         report.notes );
        tree.addItem( notes );

        if ( showFactUsage ) {
            tree.addItem( new FactUsagesItem( report.factUsages ) );
        }

        tree.addCloseHandler( new CloseHandler<TreeItem>() {
            public void onClose(CloseEvent<TreeItem> event) {
                swapTitleWithUserObject( event.getTarget() );
            }
        } );
        tree.addOpenHandler( new OpenHandler<TreeItem>() {
            public void onOpen(OpenEvent<TreeItem> event) {
                swapTitleWithUserObject( event.getTarget() );
            }
        } );
        layout.addRow( tree );
View Full Code Here

       
        for (Map.Entry<String,String> entry : springContextElements.entrySet()) {
            mainPanel.add(new PanelButton(entry.getKey(), entry.getValue()));
        }

        final Tree resourcesTree = new Tree();
        mainPanel.add(resourcesTree);

        final TreeItem rootItem = new TreeItem(Constants.INSTANCE.Packages());

        //Global Area Data
        RepositoryServiceFactory.getPackageService().loadGlobalModule(new AsyncCallback<Module>()   {

            public void onFailure(Throwable caught) {
                ErrorPopup.showMessage("Error listing Global Area information!");
            }

            public void onSuccess(Module result) {
                populatePackageTree(result, rootItem);
            }
        });

        //Packages Data
        RepositoryServiceFactory.getPackageService().listModules(new AsyncCallback<Module[]>()    {

            public void onFailure(Throwable caught) {
                ErrorPopup.showMessage("Error listing package information!");
            }

            public void onSuccess(Module[] result) {
                for (int i = 0; i < result.length; i++) {
                    final Module packageConfigData = result[i];
                    populatePackageTree(packageConfigData, rootItem);
                }
            }
        });

        resourcesTree.addItem(rootItem);
        resourcesTree.setStyleName("category-explorer-Tree"); //NON-NLS
        resourcesTree.addSelectionHandler(new SelectionHandler<TreeItem>()    {

            public void onSelection(SelectionEvent<TreeItem> event) {
                Object o = event.getSelectedItem().getUserObject();
                if (o instanceof String) {
                }
View Full Code Here

        innerlayout.setStyleName("fill-layout-width");

        serverPicker = new ServerPicker();
        innerlayout.add(serverPicker.asWidget());

        Tree statusTree = new LHSNavTree("domain-runtime");
        TreeItem servers = new DefaultTreeItem("Domain Status");
        statusTree.addItem(servers);

        LHSNavTreeItem serverInstances= new LHSNavTreeItem(Console.CONSTANTS.common_label_serverInstances(), new ClickHandler()
        {
            @Override
            public void onClick(ClickEvent event) {
                Console.MODULES.getPlaceManager().revealPlace(
                        new PlaceRequest(NameTokens.InstancesPresenter)
                );
            }
        });


        LHSNavTreeItem jvm = new LHSNavTreeItem("JVM Status", NameTokens.HostVMMetricPresenter);

        servers.addItem(serverInstances);
        servers.addItem(jvm);

        innerlayout.add(statusTree);


        // -------------

        Tree metricTree = new LHSNavTree("domain-runtime");

        TreeItem subsystems = new DefaultTreeItem("Subsystem Metrics");

        LHSNavTreeItem datasources = new LHSNavTreeItem("Datasources", "ds-metrics");
        LHSNavTreeItem jmsQueues = new LHSNavTreeItem("JMS Destinations", "jms-metrics");
        LHSNavTreeItem web = new LHSNavTreeItem("Web", "web-metrics");
        LHSNavTreeItem tx = new LHSNavTreeItem("Transactions", "tx-metrics");

        subsystems.addItem(datasources);
        subsystems.addItem(jmsQueues);
        subsystems.addItem(web);
        subsystems.addItem(tx);

        metricTree.addItem(subsystems);
        subsystems.setState(true); // open by default
        servers.setState(true);

        innerlayout.add(metricTree);


        DisclosurePanel statusPanel  = new DisclosureStackPanel("Status", true).asWidget();
        statusPanel.setContent(innerlayout);

        stack.add(statusPanel);

        // ----------------------------------------------------

        Tree deploymentTree = new LHSNavTree("domain-runtime");
        DisclosurePanel deploymentPanel  = new DisclosureStackPanel("Deployments").asWidget();
        deploymentPanel.setContent(deploymentTree);

        deploymentTree.addItem(new LHSNavTreeItem("Manage Deployments", NameTokens.DeploymentsPresenter));

        stack.add(deploymentPanel);

        layout.add(stack);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.Tree$ImagesFromImageBase

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.