Mahendra Prajapati
Mahendra Prajapati

Reputation: 49

How to Reset Eclipse RCP perspective programmatically

I have made RCP product file in which I have to reset perspective every time. Is there any way by which it will reset perspective before it load ?

Upvotes: 2

Views: 1827

Answers (2)

Georgian
Georgian

Reputation: 8960

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();

Eclipse 3.x - for Eclipse 4.x, see greg's answer.

Upvotes: 1

greg-449
greg-449

Reputation: 111217

If you always want your RCP to start in the same state you can specify the flags

-clearPersistedState -persistState false

in the Program Arguments section on the Launching tab of the .product file.

-clearPersistedState causes Eclipse to drop any persisted state during starting.

-persistState false stops Eclipse for persisting the state on exit.

This is for Eclipse 4.x only.

Upvotes: 2

Related Questions