if (desc == null || desc.length() == 0)
message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessage, finalPersp.getLabel());
else
message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessageWithDesc, new String[] { finalPersp.getLabel(), desc });
MessageDialogWithToggle dialog = MessageDialogWithToggle
.openYesNoQuestion(window.getShell(),
ResourceMessages.NewProject_perspSwitchTitle, message,
null /* use the default message for the toggle */,
false /* toggle is initially unchecked */, store,
IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
int result = dialog.getReturnCode();
// If we are not going to prompt anymore propagate the choice.
if (dialog.getToggleState()) {
String preferenceValue;
if (result == IDialogConstants.YES_ID) {
// Doesn't matter if it is replace or new window
// as we are going to use the open perspective setting
preferenceValue = IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE;