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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:30:59+00:00 2026-05-29T09:30:59+00:00

I’ve currently implemented a Table with a TableEditor in my Eclipse plugin to support

  • 0

I’ve currently implemented a Table with a TableEditor in my Eclipse plugin to support cell-level editing with keyboard support (to traverse cells with the editor).

I also need a way to delete rows, and I didn’t want to go with the practice of adding a delete button next to the table as it requires 2 clicks to delete a row (1 to select a row, and 1 to delete it). Instead I want a separate column which is populated with delete icons. I’ve thought of 2 ways to accomplish this and have run into issues with both:

  1. Add another column to the Table, set the icon with TableItem.setImage(). There are multiple issues with this approach, and you can see them below:

    • When selecting a row, the icon gets selected too
    • When hovering over the icon, it gets a tooltip of the image which apparently can’t be disabled
    • Can’t seem to vertically center the image inside the cell
       

    Delete column approach #1

  2. Add a ScrolledComposite next to the table and fill it with delete icons. This sounds a little insane, but I’ve actually made it pretty far with this one. The idea is to fill a ScrolledComposite with delete icons, force it to scroll with the table’s scrollbar, and delete the corresponding row when an icon is clicked. I’ve only run into one blocking issue with this approach:

    • Can’t seem to hide the scrollbar
       

    Delete column approach #2

So my questions are:

  • How I can solve the issues mentioned for either of these approaches?
  • Is there some other better approach?
  • 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-29T09:30:59+00:00Added an answer on May 29, 2026 at 9:30 am

    I found a way to hide the scrollbar for my 2nd approach. Basically all you need to do is:

    // ScrolledComposite sc;
    sc.setAlwaysShowScrollBars(true);
    sc.getVerticalBar().setVisible(false);
    

    And then set the width of the ScrolledComposite to 1 to get rid of the extra space the invisible ScrollBar takes up.

    And to keep the scrollbars in sync:

    // Table table;
    // ScrolledComposite sc;
    // int tableRowHeight;
    
    protected void createTable() {
    
      ...
    
      // Set the listener that dictates the table row height.
      table.addListener(SWT.MeasureItem, new Listener() {
        @Override
        public void handleEvent(Event event) {
          event.height = tableRowHeight;
        }
      });
    
      // Set the listener for keeping the scrollbars in sync.
      table.getVerticalBar().addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          syncDeleteColumnScrollBar();
        }
      });
    }
    
    // This is extracted out into a method so it can also be called
    // when removing a table row.
    protected void syncDeleteColumnScrollBar() {
      sc.setOrigin(0, table.getVerticalBar().getSelection() * tableRowHeight);
    }
    

    The result:

    Delete column image

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am currently running into a problem where an element is coming back from
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.