View | Details | Raw Unified | Return to bug 184473
Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-2 / +4 lines)
Lines 9-18 Link Here
9
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
9
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
10
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
10
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
11
 org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
11
 org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
12
 org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)";resolution:=optional
12
 org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)";resolution:=optional,
13
 org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)";resolution:=optional
13
Eclipse-LazyStart: true
14
Eclipse-LazyStart: true
14
Export-Package: org.eclipse.pde.internal.runtime;x-internal:=true,
15
Export-Package: org.eclipse.pde.internal.runtime;x-internal:=true,
15
 org.eclipse.pde.internal.runtime.logview;x-friends:="org.eclipse.pde.ui",
16
 org.eclipse.pde.internal.runtime.logview;x-friends:="org.eclipse.pde.ui",
16
 org.eclipse.pde.internal.runtime.registry;x-internal:=true
17
 org.eclipse.pde.internal.runtime.registry;x-internal:=true
17
Import-Package: com.ibm.icu.text
18
Import-Package: com.ibm.icu.text,
19
 org.eclipse.ui.texteditor
18
Bundle-RequiredExecutionEnvironment: J2SE-1.4
20
Bundle-RequiredExecutionEnvironment: J2SE-1.4
(-)src/org/eclipse/pde/internal/runtime/logview/OpenIDELogFileAction.java (-10 / +25 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Peter Friese <peter.friese@gentleware.com> - bug 184473
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.pde.internal.runtime.logview;
12
package org.eclipse.pde.internal.runtime.logview;
12
13
Lines 15-51 Link Here
15
import org.eclipse.core.runtime.IPath;
16
import org.eclipse.core.runtime.IPath;
16
import org.eclipse.core.runtime.Path;
17
import org.eclipse.core.runtime.Path;
17
import org.eclipse.jface.action.Action;
18
import org.eclipse.jface.action.Action;
19
import org.eclipse.jface.text.IDocument;
18
import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
20
import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
21
import org.eclipse.ui.IEditorPart;
19
import org.eclipse.ui.IWorkbenchPage;
22
import org.eclipse.ui.IWorkbenchPage;
20
import org.eclipse.ui.IWorkbenchWindow;
23
import org.eclipse.ui.IWorkbenchWindow;
21
import org.eclipse.ui.PartInitException;
24
import org.eclipse.ui.PartInitException;
22
import org.eclipse.ui.ide.IDE;
25
import org.eclipse.ui.ide.IDE;
26
import org.eclipse.ui.texteditor.AbstractTextEditor;
27
import org.eclipse.ui.texteditor.IDocumentProvider;
28
import org.eclipse.ui.texteditor.ITextEditor;
23
29
24
/*
30
/*
25
 * This action is used to Open the Log File from the LogView if both org.eclipse.ui.ide and 
31
 * This action is used to Open the Log File from the LogView if both
26
 * org.eclipse.core.filesystem are available.  If both plugins are resolved, we will open
32
 * org.eclipse.ui.ide and org.eclipse.core.filesystem are available. If both
27
 * the log file through the IDE's file association preferences.  Otherwise, 
33
 * plugins are resolved, we will open the log file through the IDE's file
28
 * LogView.getOpenLogJob() is called to open the file.
34
 * association preferences. Otherwise, LogView.getOpenLogJob() is called to open
35
 * the file.
29
 */
36
 */
30
public class OpenIDELogFileAction extends Action {
37
public class OpenIDELogFileAction extends Action {
31
	
38
32
	private LogView fView;
39
	private LogView fView;
33
	
40
34
	public OpenIDELogFileAction (LogView logView) {
41
	public OpenIDELogFileAction(LogView logView) {
35
		fView = logView;
42
		fView = logView;
36
	}
43
	}
37
44
38
	public void run() {
45
	public void run() {
39
		IPath logPath = new Path(fView.getLogFile().getAbsolutePath());
46
		IPath logPath = new Path(fView.getLogFile().getAbsolutePath());
40
		IFileStore fileStore= EFS.getLocalFileSystem().getStore(logPath);
47
		IFileStore fileStore = EFS.getLocalFileSystem().getStore(logPath);
41
		if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
48
		if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
42
			IWorkbenchWindow ww = PDERuntimePlugin.getActiveWorkbenchWindow();
49
			IWorkbenchWindow ww = PDERuntimePlugin.getActiveWorkbenchWindow();
43
			IWorkbenchPage page = ww.getActivePage();
50
			IWorkbenchPage page = ww.getActivePage();
44
			try {
51
			try {
45
				IDE.openEditorOnFileStore(page, fileStore);
52
				IEditorPart editorPart = IDE.openEditorOnFileStore(page, fileStore);
53
54
				// bug 184473: try to jump right to the end of the file
55
				if (!(editorPart instanceof AbstractTextEditor))
56
					return;
57
				ITextEditor editor = (ITextEditor) editorPart;
58
				IDocumentProvider dp = editor.getDocumentProvider();
59
				IDocument doc = dp.getDocument(editor.getEditorInput());
60
				int offset = doc.getLength();
61
				editor.selectAndReveal(offset, 0);
46
			} catch (PartInitException e) {
62
			} catch (PartInitException e) {
47
			}
63
			}
48
		}
64
		}
49
	}
65
	}
50
51
}
66
}
(-)src/org/eclipse/pde/internal/runtime/logview/LogView.java (+3 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Peter Friese <peter.friese@gentleware.com> - bug 184473     
10
 *******************************************************************************/
11
 *******************************************************************************/
11
12
12
package org.eclipse.pde.internal.runtime.logview;
13
package org.eclipse.pde.internal.runtime.logview;
Lines 331-336 Link Here
331
			Class.forName("org.eclipse.ui.ide.IDE"); //$NON-NLS-1$
332
			Class.forName("org.eclipse.ui.ide.IDE"); //$NON-NLS-1$
332
			// check to see if org.eclipse.core.filesystem is available
333
			// check to see if org.eclipse.core.filesystem is available
333
			Class.forName("org.eclipse.core.filesystem.IFileStore"); //$NON-NLS-1$
334
			Class.forName("org.eclipse.core.filesystem.IFileStore"); //$NON-NLS-1$
335
			// check to see if org.eclipse.jface.text is available
336
			Class.forName("org.eclipse.jface.text.IDocument"); //$NON-NLS-1$
334
			action = new OpenIDELogFileAction(this);
337
			action = new OpenIDELogFileAction(this);
335
		} catch (ClassNotFoundException e) {
338
		} catch (ClassNotFoundException e) {
336
			action = new Action() {
339
			action = new Action() {

Return to bug 184473