Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » @Focus in Eclipse 4.3 M3
@Focus in Eclipse 4.3 M3 [message #986413] Tue, 20 November 2012 06:00 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 524
Registered: July 2012
Senior Member
Hi,

today I installed Eclipse 4.3 M3. On trying to run the application I migrated to Eclipse 4 I noticed a different behaviour for @Focus. It seems the call stack has changed and @Focus is called before @PostConstruct. This leads to a NPE if I'm trying to do something like this (got this from some well known tutorials):

private TableViewer viewer;

@PostConstruct
public void createPart(Composite parent) {
	viewer = new TableViewer(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
}

@Focus
public void setFocus() {
	viewer.getTable().setFocus();
}


This code works with 4.2.1. So the question is, is the new behaviour intended or a bug?

Greez,
Dirk
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Mechanism to provide IAdapterFactory for classes, not instances?
Next Topic:Contacts Demo not working properly
Goto Forum:
  


Current Time: Thu May 23 17:39:38 EDT 2013

Powered by FUDForum. Page generated in 0.03198 seconds