JAVA/tips
RCP에서 AbstractUIPlugin 구현 클래스 자동으로 activate 설정
hun.a
2017. 10. 18. 10:46
반응형
Eclipse Rich Client Platform (이하 RCP) 에서 AbstractUIPlugin 클래스를 구현해서 사용해야 할 일이 생겼다.
처음 template을 통해 Plugin project를 생성할 때 따로 Activator를 지정하지 않았고
나중에 AbstractUIPlugin 클래스를 구현하였는데...
RCP application이 실행되면서 AbstractUIPlugin을 구현한 클래스가 수행되지 않는 문제가 있었다.
덕분에 여기저기서 NullPointerException이 주루루루루루루루루룩은 아니고 시작하면서 NPE 뜨면서 프로그램이 걍 죽었다.
자 그럼 이러한 문제를 어떻게 해결해야 할까?!!
정답은 여기에서 찾았다.
주요 내용은 다음과 같다.
바로 "Eclipse-LazyStart: true" 이걸 MANIFEST 파일에 추가해주면 된다는 사실!
바로 추가했더니 RCP application이 실행되면서 AbstractUIPlugin을 구현한 클래스도 이쁘게 잘 수행됬다.
아! 물론 MANIFEST 파일에 "Bundle-Activator: class 명"도 있어야 한다.
처음 template을 통해 Plugin project를 생성할 때 따로 Activator를 지정하지 않았고
나중에 AbstractUIPlugin 클래스를 구현하였는데...
RCP application이 실행되면서 AbstractUIPlugin을 구현한 클래스가 수행되지 않는 문제가 있었다.
덕분에 여기저기서 NullPointerException이 주루루루루루루루루룩은 아니고 시작하면서 NPE 뜨면서 프로그램이 걍 죽었다.
자 그럼 이러한 문제를 어떻게 해결해야 할까?!!
정답은 여기에서 찾았다.
주요 내용은 다음과 같다.
Re: auto activate bundle Karl wrote: > Hi,all: > When I create a new bundle, it is not activated autoly by RCP framework > when startup and I must manually call the bundle's start() method to > activate it. Is there any configuration place to let it start auto? > Regards, > Karl. > Your MANIFEST should have a line in it like this: Eclipse-LazyStart: true or Eclipse-AutoStart: true Eclipse will automatically start your bundle the first time a class is loaded from your bundle. For example, when the user clicks on an action eclipse will load your ActionDelegate, and that will cause Bundle#start(*) to be called. It doesn't mean eclipse will start your bundle on startup. Later, PW
바로 "Eclipse-LazyStart: true" 이걸 MANIFEST 파일에 추가해주면 된다는 사실!
바로 추가했더니 RCP application이 실행되면서 AbstractUIPlugin을 구현한 클래스도 이쁘게 잘 수행됬다.
아! 물론 MANIFEST 파일에 "Bundle-Activator: class 명"도 있어야 한다.
반응형