KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > launch > SourceNotFoundEditor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.ui.views.launch;
12
13
14 import org.eclipse.core.resources.IMarker;
15 import org.eclipse.core.runtime.IProgressMonitor;
16 import org.eclipse.jface.resource.JFaceColors;
17 import org.eclipse.swt.SWT;
18 import org.eclipse.swt.widgets.Composite;
19 import org.eclipse.swt.widgets.Text;
20 import org.eclipse.ui.IEditorInput;
21 import org.eclipse.ui.IEditorSite;
22 import org.eclipse.ui.IReusableEditor;
23 import org.eclipse.ui.part.EditorPart;
24
25 /**
26  * Editor used when no source if found for a stack frame.
27  *
28  * @since 2.1
29  */

30 public class SourceNotFoundEditor extends EditorPart implements IReusableEditor {
31     
32     /**
33      * Text widget used for this editor
34      */

35     private Text fText;
36
37     /**
38      * @see org.eclipse.ui.IEditorPart#doSave(IProgressMonitor)
39      */

40     public void doSave(IProgressMonitor monitor) {
41     }
42
43     /**
44      * @see org.eclipse.ui.IEditorPart#doSaveAs()
45      */

46     public void doSaveAs() {
47     }
48
49     /**
50      * @see org.eclipse.ui.IEditorPart#gotoMarker(IMarker)
51      */

52     public void gotoMarker(IMarker marker) {
53     }
54
55     /**
56      * @see org.eclipse.ui.IEditorPart#init(IEditorSite, IEditorInput)
57      */

58     public void init(IEditorSite site, IEditorInput input) {
59             setSite(site);
60             setInput(input);
61     }
62
63     /**
64      * @see org.eclipse.ui.IEditorPart#isDirty()
65      */

66     public boolean isDirty() {
67         return false;
68     }
69
70     /**
71      * @see org.eclipse.ui.IEditorPart#isSaveAsAllowed()
72      */

73     public boolean isSaveAsAllowed() {
74         return false;
75     }
76
77     /**
78      * @see org.eclipse.ui.IWorkbenchPart#createPartControl(Composite)
79      */

80     public void createPartControl(Composite parent) {
81         fText = new Text(parent,SWT.MULTI|SWT.READ_ONLY|SWT.WRAP);
82         fText.setForeground(JFaceColors.getErrorText(fText.getDisplay()));
83         fText.setBackground(fText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
84         if (getEditorInput() != null) {
85             setInput(getEditorInput());
86         }
87     }
88
89     /**
90      * @see org.eclipse.ui.IWorkbenchPart#setFocus()
91      */

92     public void setFocus() {
93         if (fText != null) {
94             fText.setFocus();
95         }
96     }
97
98     /**
99      * @see IReusableEditor#setInput(org.eclipse.ui.IEditorInput)
100      */

101     public void setInput(IEditorInput input) {
102         super.setInput(input);
103         setPartName(input.getName());
104         if (fText != null) {
105             fText.setText(input.getToolTipText());
106         }
107     }
108
109 }
110
Popular Tags