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

  • Home
  • SEARCH
  • 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 7736439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:43:54+00:00 2026-06-01T07:43:54+00:00

I have a Tree, which is populated with TreeItems that may have an image

  • 0

I have a Tree, which is populated with TreeItems that may have an image (a row with a thumbnail). I resize the row height with MeasureItem listener, and everything is good.

But, now I want to make this change dynamic. I check if a row should have an image, and if any row in the currently listed rows has an image that should be displayed, I set the row height to 180px, and all the rows have that height. If there is no row with an image, then the row height should be 25px.

The issue is, if at any point the row height is set to 180px, I can’t change it back to 25px.
My code looks like this (simplified):

//this check is run on each page of paginated results fetched from DB
rowHeight=25;
for(Result r : results){
    if(r.hasImage()){
        rowHeight=180;
        break;
    }
}


    // resize the row height using a MeasureItem listener
    tree.addListener(SWT.MeasureItem, new Listener() {
        public void handleEvent(Event event) {
            event.height = rowHeight;
        }
    });

    //added 'event.height=rowHeight' here just to check if it will draw as I want
    tree.addListener(SWT.EraseItem, new Listener() {
        public void handleEvent(Event event) {
            if(event.index!=ColumnType.SCREENSHOT.toIndexNum()){
                event.detail &= ~SWT.FOREGROUND;
            }
            event.height=rowHeight;
        }
    });

The rowHeight variable is set as it should, and also the ‘event.height’ in the MeasureListener is set to the same value. But still doesn’t want to reduce the height. On every page of results I’m clearing the items with tree.removeAll(). Maybe I should dispose and recreate the table/tree (which I don’t want to do)?

So, any idea how to do it?

P.S.
Not to be confused, I don’t need various heights on the rows, I know that it’s not possible under Windows/Mac. I just need a way to reset the height.

  • 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-06-01T07:43:55+00:00Added an answer on June 1, 2026 at 7:43 am

    The fact that you can’t decrease the height of the rows is a known bug.

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

Sidebar

Related Questions

I have a dijit.Tree that's populated by a ItemFileReadStore using JSON. Because of our
I have a tree that gets populated through the web service - this part
I have a simple tree which takes the shape below ROOT /\ A B
Say I have a binary tree which contains pointers at each node going to
I have edits to my working tree which I would like to continue working
In my source tree have Java code which is automatically generated from XSD files.
I have two tree, which contains nodes, after I've created them, I take all
I have a page which has a tree directory of people who work at
I have to build a tree using the following data which comes from a
I have a recursive function which does a sort of tree process where each

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.