Update / refresh Part [message #1000295] |
Mon, 14 January 2013 08:06  |
Eclipse User |
|
|
|
Hello there,
I actually can't believe, but I just can't find a soultion to this simple problem.
Say I have a couple of partstacks visible in my application. I then add a new part to one of the stacks. The part is displayed correctly, but when I resize the part, the items in it jump into a slightly differen position (just different distances between the items, the layout remains the same).
Same if I create a NatTable item, I need to resize the part befor I can make use of the scrollbars in the part (they are there, but only after resize, they actually move the table).
So I guess I need to somehow update the part.
This is what I've tried so far:
///// creation of the part
MPartStack stack = (MPartStack) modelService.find("TEST.partstack.editors", app);
MInputPart part = MBasicFactory.INSTANCE.createInputPart();
part.setContributionURI("bundleclass://TEST/ui.parts.DataSetEditor");
stack.getChildren().add(part);
partService.showPart(part, PartState.ACTIVATE);
((DataSetEditor)part.getObject()).setDisplayedItem(dataSet);
((DataSetEditor)part.getObject()).refresh();
// in the DataSetEditor
@PostConstruct
private void createContents(Composite parent){
this.parent = parent;
dataTable = new NatTable(parent, false);
}
public void refresh(){
dataTable.layout();
parent.redraw();
parent.layout();
parent.update();
}
So... what do I need to do?
|
|
|
Re: Update / refresh Part [message #1000658 is a reply to message #1000295] |
Tue, 15 January 2013 02:34  |
Eclipse User |
|
|
|
Hi,
you should definitely have a look on how to use layout managers in SWT.
The question about NatTable I answered in the NatTable forum. Your issue there is related on how you create your NatTable. And NatTable has a refresh() method. There should be no need to tell the parent to redraw.
Greez,
Dirk
|
|
|
Powered by
FUDForum. Page generated in 0.05045 seconds