Boolean enabled = action.isChecked();
IPreferenceStore preferenceStore = PlatformUI.getPreferenceStore();
if (enabled) {
String htmlEditorPath = preferenceStore.getString(PluginConstants.EXTERNAL_EDITOR_PREFERENCE_ID);
ExternalEditorDialog editorDialog = new ExternalEditorDialog(window.getShell(), htmlEditorPath);
if (editorDialog.open() == Dialog.OK) {
htmlEditorPath = editorDialog.getPath();
if (htmlEditorPath == null) {
htmlEditorPath = "";
}
preferenceStore.putValue(PluginConstants.EXTERNAL_EDITOR_PREFERENCE_ID, htmlEditorPath);