user2480688
user2480688

Reputation: 3

RCP Eclipse Model Window

I am building a RCP application using SWT/Jface and stuck at a point where I need to open a model/window/popup on a perspective action.

I want to open a model/popup/window(having ok/cancel button only) from a perspective listener and wants the control to wait for the model/popup/window ok/cancel button response and executes the popup/model/window listner ........ and than the perspective listener logic complete.

It is like forcing the perspective control to wait for the popup/model/window action to complete.

Any suggestions will be very helful.

Upvotes: 0

Views: 161

Answers (1)

Baz
Baz

Reputation: 36904

I guess you want a modal Dialog. Here is the interesting part from the documentation of Shell:

The modality of an instance may be specified using style bits. The modality style bits are used to determine whether input is blocked for other shells on the display. The PRIMARY_MODAL style allows an instance to block input to its parent. The APPLICATION_MODAL style allows an instance to block input to every other shell in the display. The SYSTEM_MODAL style allows an instance to block input to all shells, including shells belonging to different applications.

So just create a JFace Dialog using this tutorial and create a new instance of it using SWT.APPLICATION_MODAL as the style bit.

Upvotes: 1

Related Questions