0

I tried to apply this solution to my problem, but it doesn't work. I've got a class which extends Wizard and implements INewWizard. It's called by an Activator-class. I don't have wizardDialog anywhere so I unsuccessfully tried it like this:

public SeeTableScreenWizard()
{
    super();
    WizardDialog wizardDialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), this);
    wizardDialog.setPageSize(800, 400);
    setNeedsProgressMonitor(true);
}

The reason why i need it is the following: one of the pages has a org.eclipse.swt.widgets.List which has many entries. Its doesn't have any consequences until i run the wizard for the second time. Its height is being set to the screen height, i suppose because it tries to set the size to that big page created at the first run.

Give me some clues please.

Community
  • 1
  • 1
Danny Lo
  • 1,553
  • 4
  • 26
  • 48
  • 1
    Set a height hint on the Layout for the List – greg-449 Apr 15 '14 at 12:32
  • wow it was surprisingly simple :) – Danny Lo Apr 15 '14 at 12:56
  • @greg-449 is there a possibility to set size for the rows of `Table` widget in the similar way? Right now I'm working with [that](http://pastie.org/9082085) solution, but it is insufficient, because the rows are being resized with quite big delay after the page with table got visible. – Danny Lo Apr 15 '14 at 12:59
  • For a TableViewer a label provider based on `OwnerDrawLabelProvider` or `StyledCellLabelProvider` is what I would use - that ends up using a similar measure call. This should not have a delay. – greg-449 Apr 15 '14 at 13:30
  • How do i apply that? Do i need to set a TableViewer for my Table first? – Danny Lo Apr 15 '14 at 13:51
  • Yes that is for the TableViewer. I don't actually see why there should be any delay using the SWT.MeasureItem listener directly, that is what OwnerDrawLabelProvider uses internally. – greg-449 Apr 15 '14 at 13:54
  • The Table is created in method `createControl(Composite parent)` which overrides `IDialogPage.createControl(Composite)`. This is where I add the Listener too. But i fill the table with its contents in the method `setVisible`. Could that be a problem? – Danny Lo Apr 15 '14 at 13:59
  • Try `Table.setRedraw(false)` before you fill in the table (and set to true again at the end) – greg-449 Apr 15 '14 at 14:01
  • I now realized what really happens for this bug. Not the row height resizing is being delayed, but the positioning of the custom contents in the resized cells. As soon as I open the corresponding wizard screen I see [this](http://i.imgur.com/mGcNbvD.png) picture. After approx. 2 seconds it changes to [this](http://i.imgur.com/z3GuULN.png). Do you have an idea how I could fix it? – Danny Lo Jul 17 '14 at 14:11

0 Answers0