Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1047647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:20:05+00:00 2026-05-16T16:20:05+00:00

I wondered if anyone knew whether it was possible to remove the ‘+’ Sign

  • 0

I wondered if anyone knew whether it was possible to remove the ‘+’ Sign that appears next to the root item in a GWT Tree? I didn’t see a CSS rule to handle it. Can one replace the + sign with say, a GIF?

(Adapted code from GWT manual below, for illustrative purposes)

TreeItem root = new TreeItem(“root”); // Wish to remove + sign from next to this item

  root.addItem("item0");
  root.addItem("item1");
  root.addItem("item2");
  root.setState(true, true);
  // Add a CheckBox to the tree
  TreeItem item = new TreeItem(new CheckBox("item3"));
  root.addItem(item);

  Tree t = new Tree();
  t.addItem(root);

  // Add it to the root panel.
  RootPanel.get().add(t);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:20:05+00:00Added an answer on May 16, 2026 at 4:20 pm

    CSS styling does not apply to this at all. Rather, it requires using a different constructor for tree.. If you set spacer.png to a 1×1 transparent PNG it will remove the + signs. Here is the full code I used.

    The correct way to do it is as follows:

    public interface MyResources extends ClientBundle {
          public static final MyResources INSTANCE =  GWT.create(MyResources.class);
    
          @Source("spacer.png")
          public ImageResource leaf();
    
    
        }
    
    
    public class TreeImagesExample implements Tree.Resources
    {
    
    
        @Override
        public ImageResource treeClosed() {
            // TODO Auto-generated method stub
            return MyResources.INSTANCE.leaf();
        }
    
        @Override
        public ImageResource treeLeaf() {
            // TODO Auto-generated method stub
            return MyResources.INSTANCE.leaf();
        }
    
        @Override
        public ImageResource treeOpen() {
            // TODO Auto-generated method stub
            return MyResources.INSTANCE.leaf();
        }
    
    } 
    
    Main Function:
         TreeImagesExample tx= new TreeImagesExample();
                    Tree t = new Tree(tx);
                    t.addItem(root);
    

    For this to work properly, we will also need a SelectionHandler, of course, so that we can register tree clicks on the tree items rather than the (now non-existent) + signs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just wondered if anyone knew of a simple script available that will do
Wondered if anyone can tell me whether the following is possible within views. I
I wondered if anyone has found a workaround to the behaviour that I'm experiencing.
I'm having the following problem and wondered whether anyone could see why this is
Just wondered if anyone knew a way to animate leaves falling in the wind?
I'm using this simple slideshow and wondered if anyone knew how to make it
I wondered if anyone could shed some light on the way in which layers
I want to trial Windows 7 but wondered if anyone who has done so
I'm learning about composite UIs at the moment and I wondered if anyone could
I'm thinking of writing a new web-based game, and wondered if anyone had any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.