Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@OnShow method not called on application start #33

Open
misty000 opened this issue May 21, 2015 · 7 comments
Open

@OnShow method not called on application start #33

misty000 opened this issue May 21, 2015 · 7 comments
Assignees
Milestone

Comments

@misty000
Copy link

@onshow method of default Perspective is not called on application start, and @OnHide method is not called on shutdown application.

五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.perspective.PerspectiveOne onStartPerspective
信息: on PostConstruct of PerspectiveOne
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.callback.StatefulCallback onPostConstructComponent
信息: run on start of StatefulCallback
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.perspective.PerspectiveTwo onStartPerspective
信息: on PostConstruct of PerspectiveTwo
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.perspective.PerspectiveTwo handlePerspective
信息: message to PerspectiveTwo:org.jacpfx.rcp.message.MessageImpl@59318c5c
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.callback.StatelessCallback onPostConstructComponent
信息: run on start of StatelessCallback
五月 21, 2015 11:54:39 下午 org.jacpfx.rcp.workbench.AFXWorkbench init
信息: INIT
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.component.ComponentLeftTop onPostConstructComponent
信息: run on start of ComponentLeft
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.component.ComponentLeftTop onPostConstructComponent
信息: run on start of ComponentLeft
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.component.ComponentRight onPostConstructComponent
信息: run on start of ComponentRight
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.component.ComponentRight onPostConstructComponent
信息: run on start of ComponentRight
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.component.ComponentLeft onPostConstructComponent
信息: run on start of ComponentLeft
五月 21, 2015 11:54:39 下午 org.jacpfx.jfxMPD.component.ComponentLeft onPostConstructComponent
信息: run on start of ComponentLeft
p1.button pressed
on ##hide## of PerspectiveTwo
on ##show## of PerspectiveOne
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[ComponentDelegator,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[MessageDelegatorImpl,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.delegator.ComponentDelegator run
信息: queue in ComponentDelegator interrupted
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.delegator.MessageDelegatorImpl run
信息: queue in ComponentDelegator interrupted
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[MessageCoordinator,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[MessageCoordinator,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.coordinator.ACoordinator run
信息: queue in ACoordinator interrupted
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[MessageCoordinator,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.coordinator.ACoordinator run
信息: queue in ACoordinator interrupted
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.coordinator.ACoordinator run
信息: queue in ACoordinator interrupted
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[statefulCallback,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[SimpleView,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[SimpleView,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[SimpleView,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[SimpleView,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[SimpleView,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.rcp.util.ShutdownThreadsHandler shutdowAll
信息: shutdown thread: Thread[SimpleView,5,main]
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.component.ComponentLeft onPreDestroyComponent
信息: run on tear down of ComponentLeft
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.component.ComponentRight onPreDestroyComponent
信息: run on tear down of ComponentRight
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.component.ComponentLeftTop onPreDestroyComponent
信息: run on tear down of ComponentLeft
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.callback.StatefulCallback onPreDestroyComponent
信息: run on tear down of StatefulCallback
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.perspective.PerspectiveOne onTearDownPerspective
信息: on PreDestroy of PerspectiveOne
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.component.ComponentLeft onPreDestroyComponent
信息: run on tear down of ComponentLeft
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.component.ComponentRight onPreDestroyComponent
信息: run on tear down of ComponentRight
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.component.ComponentLeftTop onPreDestroyComponent
信息: run on tear down of ComponentLeft
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.callback.StatelessCallback onPreDestroyComponent
信息: run on tear down of StatelessCallback
五月 21, 2015 11:54:50 下午 org.jacpfx.jfxMPD.perspective.PerspectiveTwo onTearDownPerspective
信息: on PreDestroy of PerspectiveTwo

@amoAHCP
Copy link
Collaborator

amoAHCP commented May 21, 2015

Hi, this is correct. You can use @PostConstruct and @Predestroy (see: http://jacpfx.org/documentation_main.html#Annotations%20overview19)... I wanted to separate those lifecycle events, because a Perspective can be started and is not visible.

Andy

@amoAHCP amoAHCP closed this as completed May 21, 2015
@misty000
Copy link
Author

@PostConstruct will call if a Perspective is not visible, but I want do something in visible Perspective.

for example:
Android Activity lifecycle is:

GroovyActivity﹕ onCreate   // @PostConstruct first create activity
GroovyActivity﹕ onStart      // @OnShow the activity is visible
GroovyActivity﹕ onStop      // @OnHide another activity is visible

GroovyActivity﹕ onStart      // @OnShow the activity is created and visible

And JacpFX lifecycle is:

@PostConstruct   // first create
                              // visible but no events
@OnHide             // another perspective show

@amoAHCP
Copy link
Collaborator

amoAHCP commented May 22, 2015

Hi,
typically you can use @PostConstruct to build the UI of you perspective. I don't get what exactly you are missing. I can implement @PostConstruct->@onshow but what is the usecase? Can you give me an example?

@amoAHCP amoAHCP reopened this May 22, 2015
@misty000
Copy link
Author

Hi,
For example, there are two perspectives, when application start, two @PostConstruct methods will be called. I just want do something in current visible perspective. for example, register EventBus on @onshow, and unregister on @OnHide.

@amoAHCP amoAHCP added this to the 2.1-M1 milestone May 22, 2015
@amoAHCP amoAHCP self-assigned this May 22, 2015
@amoAHCP
Copy link
Collaborator

amoAHCP commented May 22, 2015

OK... got it. I will add it.

@misty000
Copy link
Author

Great, I'm tring to do it myself today, but the project was so complicated :)

@amoAHCP
Copy link
Collaborator

amoAHCP commented May 22, 2015

:-D I hope the result is not too complicated... but yes, the internals are not that easy... especially all the async stuff. If you are interested I can do some comments on the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants