1 11 package org.eclipse.jdt.internal.debug.ui.console; 12 13 import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants; 14 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 15 import org.eclipse.jface.preference.IPreferenceStore; 16 import org.eclipse.jface.text.ITextOperationTarget; 17 import org.eclipse.swt.widgets.Composite; 18 import org.eclipse.ui.console.TextConsoleViewer; 19 20 23 public class JavaStackTraceConsoleViewer extends TextConsoleViewer { 24 25 private JavaStackTraceConsole fConsole; 26 private boolean fAutoFormat = false; 27 28 33 public JavaStackTraceConsoleViewer(Composite parent, JavaStackTraceConsole console) { 34 super(parent, console); 35 fConsole = console; 36 37 IPreferenceStore fPreferenceStore = JDIDebugUIPlugin.getDefault().getPreferenceStore(); 38 fAutoFormat = fPreferenceStore.getBoolean(IJDIPreferencesConstants.PREF_AUTO_FORMAT_JSTCONSOLE); 39 } 40 41 44 public void doOperation(int operation) { 45 super.doOperation(operation); 46 47 if (fAutoFormat && operation == ITextOperationTarget.PASTE) 48 fConsole.format(); 49 } 50 51 55 public void setAutoFormat(boolean checked) { 56 fAutoFormat = checked; 57 } 58 } 59 | Popular Tags |