Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » TableViewer in Dialog does not show any labels(The TableViewer in a costumDialog contains values, but does not show any name in the column)
TableViewer in Dialog does not show any labels [message #1719255] Wed, 06 January 2016 10:52 Go to next message
Eclipse UserFriend
Hi there,

i got following the problem:

I build a costum dialog extending the jface dialog class. There i want to show a table using the jface tableViewer with one column and text in it.

I did the following in my dialog class to create the tableviewer:

@Override
protected Control createDialogArea(Composite parent) {
Composite comp = (Composite) super.createDialogArea(parent);
comp.setLayout(new GridLayout(1, true));

tableViewer = new TableViewer(comp, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
tableViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,true,1,1));

final Table table = tableViewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);

tableViewer.setContentProvider(new MyContentProvider());

TableViewerColumn col1 = new TableViewerColumn(tableViewer, SWT.NONE);
col1.getColumn().setText("Component Model Name");
col1.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
return "test";
}
});
tableViewer.setInput(inputObject);
}

Now the table viewer shows elements in it and you can choose them and when you click the ok button it knows the tableViewer.getSelection() element and everything works fine. Besides the problem that the viewer does not show the string "test" or any string in its appearance.

the outcome looks like:
index.php/fa/24516/0/

index.php/fa/24517/0/

Any suggestions? Smile

Greetings, lars
  • Attachment: 2.PNG
    (Size: 5.39KB, Downloaded 354 times)
  • Attachment: 1.PNG
    (Size: 5.88KB, Downloaded 321 times)

[Updated on: Wed, 06 January 2016 10:54] by Moderator

Re: TableViewer in Dialog does not show any labels [message #1719268 is a reply to message #1719255] Wed, 06 January 2016 12:09 Go to previous messageGo to next message
Eclipse UserFriend
try so add columns
new TableColumn(tableViewer.getTable(), SWT.LEFT).setText("test1");
tableViewer.getTable().getColumn(1).pack();
...
new TableColumn(tableViewer.getTable(), SWT.LEFT).setText("testN");
tableViewer.getTable().getColumn(N).pack();

[Updated on: Thu, 07 January 2016 07:28] by Moderator

Re: TableViewer in Dialog does not show any labels [message #1719717 is a reply to message #1719268] Mon, 11 January 2016 11:33 Go to previous message
Eclipse UserFriend
Thanks man that solved my problem Smile


Best regards

lars
Previous Topic:Start a rwt standalone app with jetty and spring
Next Topic:[SOLVED] RAP E4 - Window properties and Tags
Goto Forum:
  


Current Time: Thu Nov 06 11:41:09 EST 2025

Powered by FUDForum. Page generated in 0.04006 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top