Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Update / refresh Part
Update / refresh Part [message #1000295] Mon, 14 January 2013 13:06 Go to next message
Aljoscha Steffens is currently offline 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?
Re: Update / refresh Part [message #1000658 is a reply to message #1000295] Tue, 15 January 2013 07:34 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1285
Registered: July 2012
Senior Member
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
Previous Topic:Injection of extened classes
Next Topic:Why will EModelService not find the part Toolbar?
Goto Forum:
  


Current Time: Wed Sep 17 05:42:51 GMT 2014

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

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