Update / refresh Part [message #1000295] |
Mon, 14 January 2013 13:06 |
Aljoscha Steffens Messages: 302 Registered: November 2012 |
Senior Member |
|
|
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?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02486 seconds