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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:04:14+00:00 2026-06-03T14:04:14+00:00

I am trying to display some content in Cell of TableViewer component. It displays

  • 0

I am trying to display some content in Cell of TableViewer component. It displays almost every character except tab (\t) character. It looks like it ignores \t character. Any one know any fix for this?

For workaround to this issue, I tried replacing \t with few space characters and it looks like behavior of Tab character. But I wan’t to know why ‘\t’ is not properly displayed in TableViewer.

Any suggestion is appreciated.
Thanks.

  • 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-03T14:04:14+00:00Added an answer on June 3, 2026 at 2:04 pm

    You can use Textlayout and set the size of the tabs in pixelsusing setTabs().Here is an example:

    package de.abas.erp.wb.base.tools.identifiersearchview;
    
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.graphics.Rectangle;
    import org.eclipse.swt.graphics.TextLayout;
    import org.eclipse.swt.layout.FillLayout;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Table;
    import org.eclipse.swt.widgets.TableItem;
    
    public class TabSnippet {
    
    public static void main(final String [] args) {
        final Display display = new Display();
        final Shell shell = new Shell(display);
            shell.setText("Table:\t\t Change style \t multiple times in cell");
        shell.setLayout(new FillLayout());
        final Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
        table.setLinesVisible(true);
        for(int i = 0; i < 10; i++) {
            new TableItem(table, SWT.NONE);
        }
        final TextLayout textLayout = new TextLayout(display);
            textLayout.setText("SWT:\t Standard \t Widget \t Toolkit");
            textLayout.setTabs(new int[] { 100 });
    
            /*
             * NOTE: MeasureItem, PaintItem and EraseItem are called repeatedly.
             * Therefore, it is critical for performance that these methods be as
             * efficient as possible.
             */
            table.addListener(SWT.PaintItem, new Listener() {
                @Override
                public void handleEvent(final Event event) {
                    textLayout.draw(event.gc, event.x, event.y);
                }
            });
            final Rectangle textLayoutBounds = textLayout.getBounds();
            table.addListener(SWT.MeasureItem, new Listener() {
                @Override
                public void handleEvent(final Event e) {
                    e.width = textLayoutBounds.width + 2;
                    e.height = textLayoutBounds.height + 2;
                }
            });
        shell.setSize(400, 200);
        shell.open();
        while(!shell.isDisposed()) {
            if(!display.readAndDispatch()) {
                display.sleep();
            }
        }
        textLayout.dispose();
        display.dispose();
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I received the error while trying to display some variable like so: echo id
I'm trying to create a reusable component to display some photo collection. The basic
While trying a sem-complex query to display some ListView content on the page I
I'm trying to display some content based on a post author in Wordpress. Here
I am trying to display some content from a webpage using curl and simple_html_DOM
Im trying to display some files in a web page so the user can
I have been trying to display some basic EXIF data from a photo with
I'm trying to display some large images with HTML img tags. At the moment
I am trying to display some message in span. but it is not working.
I'm trying to display some data from a list sharepoint and then using jquery

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.