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 6098351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:08:53+00:00 2026-05-23T13:08:53+00:00

Which approach to use to have ability to hide/delete columns in the table in

  • 0

Which approach to use to have ability to hide/delete columns in the table in SWT (in Eclipse plugin in particular)?

  1. A cannot transfer this functionality to rows, since I need insert and hide(or delete) of both rows and columns.
  2. I tried to delete them with TableColumn.dispose(), but according ColumnWeightData in the layout was not deleted and resetting the whole table layout with new TableLayout did not delete information about the columns from the layout.
  3. I tried to create all the needed columns, and hide with setWidth(0) those that should be hidden/deleted. The sample code that I written is here. This approach is not good:
    3.1. It does not scale. In my case the maximum quantity of columns may be several thousand with only few really needed by the user.
    3.2. Dealing with resizing is really a hell. AFAIU, even after setResizable(false) column may be resized if the parent component is resized. To deal with it I need to write huge listeners for parent component. I didn’t try yet.

So should I

  1. Investigate disposing table columns further and use it?
  2. Stack with setWidth(0) for a while, as I have not met scaling issues yet?
  3. Look in the direction of some third-party table components (Nattable…)? – If yes, preferably open-source, as my Eclipse-plugin is open-source.
  • 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-23T13:08:54+00:00Added an answer on May 23, 2026 at 1:08 pm

    We do that on many of our tables here.

    First, we make sure the user does not see what we’re doing.

    table.setRedraw( false );
    

    Then we remove all columns.

    while ( table.getColumnCount() > 0 ) {
        table.getColumns()[ 0 ].dispose();
    }
    

    And then we add the needed ones.

    ArrayList<Column> columns = getShownColumns();
    
    for ( Column column : columns ) {
        TableColumn tableColumn = new TableColumn( table, column.getStyle() );
        tableColumn.setText( column.getTitle() );
        tableColumn.setWidth( column.getWidth() );
    }
    

    And finally we let the user see what we did.

    table.setRedraw( true );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 3-tier .NET service app, which follows the standard approach: Frontend ->
I am creating my own jQuery plugin. Here is the code which I have
I have a static class which I use to get access to my public
What factors determine which approach is more appropriate?
Nested If or single if with And operator, which is better approach? Single If
Which is the best timer approach for a C# console batch application that has
Which Database table Schema is more efficient and why? Users (UserID, UserName, CompamyId) Companies
Which of the following has the best performance? I have seen method two implemented
Using xslt/xpath, I need to be able to select the two elements which have
I have a model which is essentially just a string (django.db.models.CharField). There will only

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.