Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 217644
Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsoleFactory.java (+13 lines)
Lines 43-48 Link Here
43
        
43
        
44
        });
44
        });
45
    }
45
    }
46
    
46
    /* (non-Javadoc)
47
    /* (non-Javadoc)
47
     * @see org.eclipse.ui.console.IConsoleFactory#openConsole()
48
     * @see org.eclipse.ui.console.IConsoleFactory#openConsole()
48
     */
49
     */
Lines 54-57 Link Here
54
        }
55
        }
55
        fConsoleManager.showConsoleView(fConsole);
56
        fConsoleManager.showConsoleView(fConsole);
56
    }
57
    }
58
    
59
    public void openConsole(String initialText) {
60
        if (fConsole == null) {
61
            fConsole = new JavaStackTraceConsole(); 
62
            fConsole.initializeDocument();
63
            fConsole.getDocument().set(initialText);
64
	        fConsoleManager.addConsoles(new IConsole[]{fConsole});
65
        }
66
        fConsoleManager.showConsoleView(fConsole);
67
    }
68
   
69
    
57
}
70
}
(-)src/org/eclipse/ui/internal/views/log/LogView.java (-1 / +1 lines)
Lines 224-230 Link Here
224
		final Action importLogAction = createImportLogAction();
224
		final Action importLogAction = createImportLogAction();
225
		toolBarManager.add(importLogAction);
225
		toolBarManager.add(importLogAction);
226
226
227
		toolBarManager.add(new Separator());
227
		toolBarManager.add(new Separator("additions"));
228
228
229
		final Action clearAction = createClearAction();
229
		final Action clearAction = createClearAction();
230
		toolBarManager.add(clearAction);
230
		toolBarManager.add(clearAction);
(-)plugin.xml (+18 lines)
Lines 1888-1891 Link Here
1888
          </menuContribution>
1888
          </menuContribution>
1889
          -->
1889
          -->
1890
       </extension>
1890
       </extension>
1891
       <extension
1892
             point="org.eclipse.ui.viewActions">
1893
          <viewContribution
1894
                id="org.eclipse.pde.ui.logViewActions"
1895
                targetID="org.eclipse.pde.runtime.LogView">
1896
             <action
1897
                   class="org.eclipse.pde.internal.ui.ShowErrorInStackTraceConsoleAction"
1898
                   disabledIcon="$nl$/icons/obj16/open_artifact_obj.gif"
1899
                   enablesFor="+"
1900
                   hoverIcon="$nl$/icons/obj16/open_artifact_obj.gif"
1901
                   icon="$nl$/icons/obj16/open_artifact_obj.gif"
1902
                   id="org.eclipse.jdt.debug.ui.LogViewActions.showStackTrace"
1903
                   label="Show in Stack Trace Console View"
1904
                   toolbarPath="additions"
1905
                   tooltip="Display the stack trace from the currently selected error in the java stack trace console">
1906
             </action>
1907
          </viewContribution>
1908
       </extension>
1891
</plugin>
1909
</plugin>
(-)src/org/eclipse/pde/internal/ui/ShowErrorInStackTraceConsoleAction.java (+40 lines)
Added Link Here
1
package org.eclipse.pde.internal.ui;
2
3
import org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceConsoleFactory;
4
import org.eclipse.jface.action.IAction;
5
import org.eclipse.jface.viewers.ISelection;
6
import org.eclipse.jface.viewers.IStructuredSelection;
7
import org.eclipse.ui.IViewActionDelegate;
8
import org.eclipse.ui.IViewPart;
9
import org.eclipse.ui.internal.views.log.LogEntry;
10
11
public class ShowErrorInStackTraceConsoleAction implements IViewActionDelegate {
12
13
	String fSelectedStack;
14
15
	public void init(IViewPart view) {
16
	}
17
18
	public void run(IAction action) {
19
		if (fSelectedStack != null) {
20
			JavaStackTraceConsoleFactory factory = new JavaStackTraceConsoleFactory();
21
			factory.openConsole(fSelectedStack);
22
		}
23
	}
24
25
	public void selectionChanged(IAction action, ISelection selection) {
26
		fSelectedStack = null;
27
		action.setEnabled(false);
28
		if (selection instanceof IStructuredSelection) {
29
			Object firstObject = ((IStructuredSelection) selection).getFirstElement();
30
			if (firstObject instanceof LogEntry) {
31
				String stack = ((LogEntry) firstObject).getStack();
32
				if (stack != null && stack.length() > 0) {
33
					action.setEnabled(true);
34
					fSelectedStack = stack;
35
				}
36
			}
37
		}
38
	}
39
40
}

Return to bug 217644