use of org.eclipse.jface.dialogs.MessageDialogWithToggle in project jbosstools-openshift by jbosstools.
the class DialogProvider method message.
@Override
public int message(String title, int type, String message, Consumer<String> callback, LinkedHashMap<String, Integer> buttonLabelToIdMap, int defaultButton, String preferencesKey) {
boolean show = isShowDialog(preferencesKey);
if (!show) {
return IDialogProvider.NO_ID;
}
final int[] answer = new int[1];
Display.getDefault().syncExec(() -> {
MessageDialogWithToggle dialog = new LinkTextMessageDialogWithToggle(Display.getDefault().getActiveShell(), title, null, message, type | SWT.SHEET, buttonLabelToIdMap, defaultButton, MSG_DONT_REMIND_AGAIN, !show, callback);
dialog.setPrefStore(OpenShiftUIActivator.getDefault().getPreferenceStore());
dialog.setPrefKey(preferencesKey);
answer[0] = dialog.open();
});
return answer[0];
}
Aggregations