1 11 package org.eclipse.debug.internal.ui.actions.variables.details; 12 13 import org.eclipse.debug.internal.ui.DebugUIPlugin; 14 import org.eclipse.debug.internal.ui.IDebugHelpContextIds; 15 import org.eclipse.debug.internal.ui.actions.ActionMessages; 16 import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; 17 import org.eclipse.jface.action.Action; 18 import org.eclipse.jface.action.IAction; 19 import org.eclipse.jface.text.ITextViewer; 20 import org.eclipse.ui.PlatformUI; 21 22 26 public class DetailPaneWordWrapAction extends Action { 27 28 ITextViewer fTextViewer; 29 30 public DetailPaneWordWrapAction(ITextViewer textViewer) { 31 super(ActionMessages.DetailPaneWordWrapAction_0,IAction.AS_CHECK_BOX); 32 33 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DETAIL_PANE_WORD_WRAP_ACTION); 34 35 fTextViewer = textViewer; 36 setEnabled(true); 37 38 boolean prefSetting = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP); 39 fTextViewer.getTextWidget().setWordWrap(prefSetting); 40 setChecked(prefSetting); 41 42 43 } 44 45 48 public void run() { 49 fTextViewer.getTextWidget().setWordWrap(isChecked()); 50 DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP,isChecked()); 51 DebugUIPlugin.getDefault().savePluginPreferences(); 52 } 53 54 } 55 | Popular Tags |