yayayokoho3
yayayokoho3

Reputation: 1199

Find currently opened dialog in Eclipse RCP

My question is: I want to find the name of currently opened dialog(being displayed on top of all views) and finally reload it. Can anyone guide me for this ?

Upvotes: 3

Views: 2212

Answers (1)

Baz
Baz

Reputation: 36894

If the dialog is focused, you can access its Shell via:

Shell active = Display.getCurrent().getActiveShell();
String title = active.getText();

If you are using Eclipse RCP, you can do the same by using:

Shell active = PlatformUI.getWorkbench().getDisplay().getActiveShell();
String title = active.getText();

Upvotes: 3

Related Questions