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

Examples of com.google.gwt.user.client.ui.TreeItem$ContentPanel


    private void printLayoutError(ValueMap valueMap, TreeItem parent,
            final ApplicationConnection ac) {
        final String pid = valueMap.getString("id");
        final Paintable paintable = ac.getPaintable(pid);

        TreeItem errorNode = new TreeItem();
        VerticalPanel errorDetails = new VerticalPanel();
        errorDetails.add(new Label(Util.getSimpleName(paintable) + " id: "
                + pid));
        if (valueMap.containsKey("heightMsg")) {
            errorDetails.add(new Label("Height problem: "
                    + valueMap.getString("heightMsg")));
        }
        if (valueMap.containsKey("widthMsg")) {
            errorDetails.add(new Label("Width problem: "
                    + valueMap.getString("widthMsg")));
        }
        final CheckBox emphasisInUi = new CheckBox("Emphasize component in UI");
        emphasisInUi.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (paintable != null) {
                    Element element2 = ((Widget) paintable).getElement();
                    Widget.setStyleName(element2, "invalidlayout",
                            emphasisInUi.getValue());
                }
            }
        });
        errorDetails.add(emphasisInUi);
        errorNode.setWidget(errorDetails);
        if (valueMap.containsKey("subErrors")) {
            HTML l = new HTML(
                    "<em>Expand this node to show problems that may be dependent on this problem.</em>");
            errorDetails.add(l);
            JsArray<ValueMap> suberrors = valueMap
View Full Code Here


                                                         public void onSuccess(String[] categories) {
                                                             selectedPath = null;
                                                             navTreeWidget.removeItems();

                                                             TreeItem root = new TreeItem();
                                                             root.setHTML( "<img src='" + new Image( images.desc() ).getUrl() + "'/>" );
                                                             navTreeWidget.addItem( root );

                                                             if ( categories.length == 0 ) {
                                                                 showEmptyTree();
                                                             } else {
                                                                 hideEmptyTree();
                                                             }
                                                             for ( int i = 0; i < categories.length; i++ ) {
                                                                 TreeItem it = new TreeItem();
                                                                 it.setHTML( "<img src='" + new Image( images.categorySmall() ).getUrl() + "'/>" + h( categories[i] ) );
                                                                 it.setUserObject( categories[i] );
                                                                 it.addItem( new PendingItem() );
                                                                 root.addItem( it );
                                                             }

                                                             root.setState( true );
                                                         }
View Full Code Here

        this.selectedPath = getPath( event.getSelectedItem() );
        this.categorySelectHandler.selected( selectedPath );
    }

    public void onOpen(OpenEvent<TreeItem> event) {
        TreeItem item = event.getTarget();

        if ( hasBeenLoaded( item ) ) {
            return;
        }

        final TreeItem root = item;

        //walk back up to build a tree
        this.selectedPath = getPath( item );

        categoryService.loadChildCategories( selectedPath,
                                             new GenericCallback<String[]>() {

                                                 public void onSuccess(String[] list) {
                                                     TreeItem child = root.getChild( 0 );
                                                     if ( child instanceof PendingItem ) {
                                                         // root.removeItem( child );
                                                         child.setVisible( false );
                                                     }
                                                     for ( int i = 0; i < list.length; i++ ) {
                                                         TreeItem it = new TreeItem();
                                                         it.setHTML( "<img src='" + new Image( images.categorySmall() ).getUrl() + "'/>" + h( list[i] ) );
                                                         it.setUserObject( list[i] );
                                                         it.addItem( new PendingItem() );

                                                         root.addItem( it );
                                                     }
                                                 }
View Full Code Here

    }

    private String getPath(TreeItem item) {
        String categoryPath = (String) item.getUserObject();
        if ( categoryPath == null ) return null;
        TreeItem parent = item.getParentItem();
        while ( parent.getUserObject() != null ) {
            categoryPath = ((String) parent.getUserObject()) + "/" + categoryPath;
            parent = parent.getParentItem();
        }
        return categoryPath;
    }
View Full Code Here

        panel.add( hp );

        panel.add( tree );
        if ( sce.getFactTypes() != null ) {
            for ( String type : sce.getFactTypes() ) {
                TreeItem it = new TreeItem();
                it.setHTML( "<img src='" + new Image( images.classImage() ).getUrl() + "'/><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( "<img src='" + new Image( images.field() ).getUrl() + "'/><small>"
                                + field + "</small>" );
                        fi.setUserObject( field );
                        it.addItem( fi );
                    }
                }
            }
        }
View Full Code Here

    // Package snapshot
    public static final String PACKAGE_SNAPSHOTS = "packageSnapshots";

    public static TreeItem getPackageItemStructure( String moduleName ) {
        TreeItem moduleTreeItem = new TreeItem( Util.getHeader( images.packages(),
                moduleName ) );
        fillModuleItemStructure( moduleTreeItem );

        return moduleTreeItem;
    }
View Full Code Here

                formatListGroupedByTitles.add( formatListWithSameTile );
            }
        }

        for (List<String> formatList : formatListGroupedByTitles) {
            TreeItem item = new TreeItem( Util.getHeader(
                    factory.getAssetEditorIcon( formatList.get( 0 ) ),
                    factory.getAssetEditorTitle( formatList.get( 0 ) ) ) );
            if ( formatList.size() == 1 && "".equals( formatList.get( 0 ) ) ) {
                item.setUserObject( new String[0] );
            } else {
                String[] formats = new String[formatList.size()];
                formats = formatList.toArray( formats );
                item.setUserObject( formats );
            }
            moduleTreeItem.addItem( item );
        }
    }
View Full Code Here

            moduleTreeItem.addItem( item );
        }
    }

    public static void setupDeploymentTree( Tree tree, Map<TreeItem, String> itemWidgets ) {
        TreeItem root = tree.addItem( Util.getHeader( images.chartOrganisation(), constants.PackageSnapshots() ) );
        root.setState( true );
        itemWidgets.put( root, PACKAGE_SNAPSHOTS );
        deploymentListPackages( root );
    }
View Full Code Here

        } );
    }

    private static void buildDeploymentTree( TreeItem root, Folder fldr ) {
        if ( fldr.getPackageConfigData() != null ) {
            TreeItem pkg = new TreeItem( Util.getHeader( images.snapshotSmall(), fldr.getPackageConfigData().name ) );
            pkg.setUserObject( fldr.getPackageConfigData() );
            pkg.addItem( new TreeItem( constants.PleaseWaitDotDotDot() ) );
            root.addItem( pkg );
        } else {
            TreeItem tn = new TreeItem( Util.getHeader( images.emptyPackage(), fldr.getFolderName() ) );
            root.addItem( tn );
            for (Folder c : fldr.getChildren()) {
                buildDeploymentTree( tn, c );
            }
        }
View Full Code Here

            private void createChildNodes( final TreeItem treeItem, final String path, final Map<TreeItem, String> itemWidgets, String[] value ) {
                for (int i = 0; i < value.length; i++) {

                    final String current = value[i];
                    final TreeItem childNode = new TreeItem( Util.getHeader( images.categorySmall(), current ) );

                    //ID for category tabs.
                    String widgetId = CATEGORY_ID + "-" + ((path.equals( "/" )) ? current : path + "/" + current);
                    itemWidgets.put( childNode, widgetId );
                    treeItem.addItem( childNode );

                    childNode.addItem( new TreeItem( Util.getHeader( images.categorySmall(), constants.PleaseWaitDotDotDot() ) ) );
                    childNode.getTree().addOpenHandler( createOpenHandlerForTree( itemWidgets, childNode ) );
                }
            }

            private void newRepoDialogIfShowAdminAndPathMatches( final String path ) {
                if ( path.equals( "/" ) && UserCapabilities.INSTANCE.hasCapability( Capability.SHOW_ADMIN ) ) {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.TreeItem$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.