Lines 11-16
Link Here
|
11 |
* Michel Ishizuka (cqw10305@nifty.com) - http://bugs.eclipse.org/bugs/show_bug.cgi?id=68963 |
11 |
* Michel Ishizuka (cqw10305@nifty.com) - http://bugs.eclipse.org/bugs/show_bug.cgi?id=68963 |
12 |
* Genady Beryozkin, me@genady.org - https://bugs.eclipse.org/bugs/show_bug.cgi?id=11668 |
12 |
* Genady Beryozkin, me@genady.org - https://bugs.eclipse.org/bugs/show_bug.cgi?id=11668 |
13 |
* Benjamin Muskalla <b.muskalla@gmx.net> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=41573 |
13 |
* Benjamin Muskalla <b.muskalla@gmx.net> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=41573 |
|
|
14 |
* Cagatay Calli - https://bugs.eclipse.org/bugs/show_bug.cgi?id=195455 |
14 |
*******************************************************************************/ |
15 |
*******************************************************************************/ |
15 |
package org.eclipse.ui.texteditor; |
16 |
package org.eclipse.ui.texteditor; |
16 |
|
17 |
|
Lines 23-71
Link Here
|
23 |
import java.util.Map; |
24 |
import java.util.Map; |
24 |
import java.util.ResourceBundle; |
25 |
import java.util.ResourceBundle; |
25 |
|
26 |
|
26 |
import org.osgi.framework.Bundle; |
|
|
27 |
|
28 |
import org.eclipse.swt.SWT; |
29 |
import org.eclipse.swt.custom.BusyIndicator; |
30 |
import org.eclipse.swt.custom.ST; |
31 |
import org.eclipse.swt.custom.StyledText; |
32 |
import org.eclipse.swt.custom.VerifyKeyListener; |
33 |
import org.eclipse.swt.dnd.DND; |
34 |
import org.eclipse.swt.dnd.DragSource; |
35 |
import org.eclipse.swt.dnd.DragSourceAdapter; |
36 |
import org.eclipse.swt.dnd.DragSourceEvent; |
37 |
import org.eclipse.swt.dnd.DropTargetAdapter; |
38 |
import org.eclipse.swt.dnd.DropTargetEvent; |
39 |
import org.eclipse.swt.dnd.DropTargetListener; |
40 |
import org.eclipse.swt.dnd.TextTransfer; |
41 |
import org.eclipse.swt.dnd.Transfer; |
42 |
import org.eclipse.swt.events.KeyEvent; |
43 |
import org.eclipse.swt.events.KeyListener; |
44 |
import org.eclipse.swt.events.MouseEvent; |
45 |
import org.eclipse.swt.events.MouseListener; |
46 |
import org.eclipse.swt.events.VerifyEvent; |
47 |
import org.eclipse.swt.events.VerifyListener; |
48 |
import org.eclipse.swt.graphics.Color; |
49 |
import org.eclipse.swt.graphics.Font; |
50 |
import org.eclipse.swt.graphics.FontData; |
51 |
import org.eclipse.swt.graphics.GC; |
52 |
import org.eclipse.swt.graphics.Image; |
53 |
import org.eclipse.swt.graphics.ImageData; |
54 |
import org.eclipse.swt.graphics.PaletteData; |
55 |
import org.eclipse.swt.graphics.Point; |
56 |
import org.eclipse.swt.graphics.RGB; |
57 |
import org.eclipse.swt.widgets.Caret; |
58 |
import org.eclipse.swt.widgets.Composite; |
59 |
import org.eclipse.swt.widgets.Control; |
60 |
import org.eclipse.swt.widgets.Display; |
61 |
import org.eclipse.swt.widgets.Menu; |
62 |
import org.eclipse.swt.widgets.Shell; |
63 |
|
64 |
import org.eclipse.core.commands.operations.IOperationApprover; |
27 |
import org.eclipse.core.commands.operations.IOperationApprover; |
65 |
import org.eclipse.core.commands.operations.IOperationHistory; |
28 |
import org.eclipse.core.commands.operations.IOperationHistory; |
66 |
import org.eclipse.core.commands.operations.IUndoContext; |
29 |
import org.eclipse.core.commands.operations.IUndoContext; |
67 |
import org.eclipse.core.commands.operations.OperationHistoryFactory; |
30 |
import org.eclipse.core.commands.operations.OperationHistoryFactory; |
68 |
|
|
|
69 |
import org.eclipse.core.runtime.Assert; |
31 |
import org.eclipse.core.runtime.Assert; |
70 |
import org.eclipse.core.runtime.CoreException; |
32 |
import org.eclipse.core.runtime.CoreException; |
71 |
import org.eclipse.core.runtime.IConfigurationElement; |
33 |
import org.eclipse.core.runtime.IConfigurationElement; |
Lines 76-85
Link Here
|
76 |
import org.eclipse.core.runtime.Platform; |
38 |
import org.eclipse.core.runtime.Platform; |
77 |
import org.eclipse.core.runtime.SafeRunner; |
39 |
import org.eclipse.core.runtime.SafeRunner; |
78 |
import org.eclipse.core.runtime.Status; |
40 |
import org.eclipse.core.runtime.Status; |
79 |
|
|
|
80 |
import org.eclipse.text.undo.DocumentUndoManagerRegistry; |
81 |
import org.eclipse.text.undo.IDocumentUndoManager; |
82 |
|
83 |
import org.eclipse.jface.action.Action; |
41 |
import org.eclipse.jface.action.Action; |
84 |
import org.eclipse.jface.action.GroupMarker; |
42 |
import org.eclipse.jface.action.GroupMarker; |
85 |
import org.eclipse.jface.action.IAction; |
43 |
import org.eclipse.jface.action.IAction; |
Lines 96-112
Link Here
|
96 |
import org.eclipse.jface.preference.PreferenceConverter; |
54 |
import org.eclipse.jface.preference.PreferenceConverter; |
97 |
import org.eclipse.jface.resource.ImageDescriptor; |
55 |
import org.eclipse.jface.resource.ImageDescriptor; |
98 |
import org.eclipse.jface.resource.JFaceResources; |
56 |
import org.eclipse.jface.resource.JFaceResources; |
99 |
import org.eclipse.jface.util.IPropertyChangeListener; |
|
|
100 |
import org.eclipse.jface.util.PropertyChangeEvent; |
101 |
import org.eclipse.jface.util.SafeRunnable; |
102 |
import org.eclipse.jface.viewers.IPostSelectionProvider; |
103 |
import org.eclipse.jface.viewers.ISelection; |
104 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
105 |
import org.eclipse.jface.viewers.ISelectionProvider; |
106 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
107 |
import org.eclipse.jface.viewers.StructuredSelection; |
108 |
import org.eclipse.jface.window.IShellProvider; |
109 |
|
110 |
import org.eclipse.jface.text.AbstractInformationControlManager; |
57 |
import org.eclipse.jface.text.AbstractInformationControlManager; |
111 |
import org.eclipse.jface.text.BadLocationException; |
58 |
import org.eclipse.jface.text.BadLocationException; |
112 |
import org.eclipse.jface.text.DefaultInformationControl; |
59 |
import org.eclipse.jface.text.DefaultInformationControl; |
Lines 165-171
Link Here
|
165 |
import org.eclipse.jface.text.source.SourceViewer; |
112 |
import org.eclipse.jface.text.source.SourceViewer; |
166 |
import org.eclipse.jface.text.source.SourceViewerConfiguration; |
113 |
import org.eclipse.jface.text.source.SourceViewerConfiguration; |
167 |
import org.eclipse.jface.text.source.VerticalRuler; |
114 |
import org.eclipse.jface.text.source.VerticalRuler; |
168 |
|
115 |
import org.eclipse.jface.util.IPropertyChangeListener; |
|
|
116 |
import org.eclipse.jface.util.PropertyChangeEvent; |
117 |
import org.eclipse.jface.util.SafeRunnable; |
118 |
import org.eclipse.jface.viewers.IPostSelectionProvider; |
119 |
import org.eclipse.jface.viewers.ISelection; |
120 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
121 |
import org.eclipse.jface.viewers.ISelectionProvider; |
122 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
123 |
import org.eclipse.jface.viewers.StructuredSelection; |
124 |
import org.eclipse.jface.window.IShellProvider; |
125 |
import org.eclipse.swt.SWT; |
126 |
import org.eclipse.swt.custom.BusyIndicator; |
127 |
import org.eclipse.swt.custom.ST; |
128 |
import org.eclipse.swt.custom.StyledText; |
129 |
import org.eclipse.swt.custom.VerifyKeyListener; |
130 |
import org.eclipse.swt.dnd.DND; |
131 |
import org.eclipse.swt.dnd.DragSource; |
132 |
import org.eclipse.swt.dnd.DragSourceAdapter; |
133 |
import org.eclipse.swt.dnd.DragSourceEvent; |
134 |
import org.eclipse.swt.dnd.DropTargetAdapter; |
135 |
import org.eclipse.swt.dnd.DropTargetEvent; |
136 |
import org.eclipse.swt.dnd.DropTargetListener; |
137 |
import org.eclipse.swt.dnd.TextTransfer; |
138 |
import org.eclipse.swt.dnd.Transfer; |
139 |
import org.eclipse.swt.events.KeyEvent; |
140 |
import org.eclipse.swt.events.KeyListener; |
141 |
import org.eclipse.swt.events.MouseEvent; |
142 |
import org.eclipse.swt.events.MouseListener; |
143 |
import org.eclipse.swt.events.VerifyEvent; |
144 |
import org.eclipse.swt.events.VerifyListener; |
145 |
import org.eclipse.swt.graphics.Color; |
146 |
import org.eclipse.swt.graphics.Font; |
147 |
import org.eclipse.swt.graphics.FontData; |
148 |
import org.eclipse.swt.graphics.GC; |
149 |
import org.eclipse.swt.graphics.Image; |
150 |
import org.eclipse.swt.graphics.ImageData; |
151 |
import org.eclipse.swt.graphics.PaletteData; |
152 |
import org.eclipse.swt.graphics.Point; |
153 |
import org.eclipse.swt.graphics.RGB; |
154 |
import org.eclipse.swt.layout.FillLayout; |
155 |
import org.eclipse.swt.layout.GridData; |
156 |
import org.eclipse.swt.layout.GridLayout; |
157 |
import org.eclipse.swt.widgets.Caret; |
158 |
import org.eclipse.swt.widgets.Composite; |
159 |
import org.eclipse.swt.widgets.Control; |
160 |
import org.eclipse.swt.widgets.Display; |
161 |
import org.eclipse.swt.widgets.Menu; |
162 |
import org.eclipse.swt.widgets.Shell; |
163 |
import org.eclipse.text.undo.DocumentUndoManagerRegistry; |
164 |
import org.eclipse.text.undo.IDocumentUndoManager; |
169 |
import org.eclipse.ui.IActionBars; |
165 |
import org.eclipse.ui.IActionBars; |
170 |
import org.eclipse.ui.IEditorDescriptor; |
166 |
import org.eclipse.ui.IEditorDescriptor; |
171 |
import org.eclipse.ui.IEditorInput; |
167 |
import org.eclipse.ui.IEditorInput; |
Lines 209-214
Link Here
|
209 |
import org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor; |
205 |
import org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor; |
210 |
import org.eclipse.ui.texteditor.rulers.RulerColumnPreferenceAdapter; |
206 |
import org.eclipse.ui.texteditor.rulers.RulerColumnPreferenceAdapter; |
211 |
import org.eclipse.ui.texteditor.rulers.RulerColumnRegistry; |
207 |
import org.eclipse.ui.texteditor.rulers.RulerColumnRegistry; |
|
|
208 |
import org.osgi.framework.Bundle; |
212 |
|
209 |
|
213 |
|
210 |
|
214 |
/** |
211 |
/** |
Lines 2498-2503
Link Here
|
2498 |
* @since 3.3 |
2495 |
* @since 3.3 |
2499 |
*/ |
2496 |
*/ |
2500 |
private InformationPresenter fInformationPresenter; |
2497 |
private InformationPresenter fInformationPresenter; |
|
|
2498 |
|
2499 |
/** Composite under the editor that holds QuickFindBar */ |
2500 |
private Composite fFindComposite; |
2501 |
|
2502 |
/** QuickFind bar */ |
2503 |
private QuickFindBar fQuickFind; |
2504 |
|
2505 |
private Composite fMainComposite; |
2501 |
|
2506 |
|
2502 |
|
2507 |
|
2503 |
/** |
2508 |
/** |
Lines 3188-3197
Link Here
|
3188 |
*/ |
3193 |
*/ |
3189 |
public void createPartControl(Composite parent) { |
3194 |
public void createPartControl(Composite parent) { |
3190 |
|
3195 |
|
|
|
3196 |
fMainComposite = new Composite(parent,SWT.NONE); |
3197 |
GridLayout layout = new GridLayout(); |
3198 |
layout.marginWidth = 0; |
3199 |
layout.marginHeight = 0; |
3200 |
fMainComposite.setLayout(layout); |
3201 |
GridData gd = new GridData(SWT.FILL,SWT.FILL,true,true,1,2); |
3202 |
fMainComposite.setLayoutData(gd); |
3203 |
|
3191 |
fVerticalRuler= createVerticalRuler(); |
3204 |
fVerticalRuler= createVerticalRuler(); |
|
|
3205 |
|
3206 |
Composite sourceComposite = new Composite(fMainComposite,SWT.NONE); |
3207 |
sourceComposite.setLayout(new FillLayout()); |
3208 |
gd = new GridData(SWT.FILL,SWT.FILL,true,true); |
3209 |
sourceComposite.setLayoutData(gd); |
3192 |
|
3210 |
|
3193 |
int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION; |
3211 |
int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION; |
3194 |
fSourceViewer= createSourceViewer(parent, fVerticalRuler, styles); |
3212 |
fSourceViewer= createSourceViewer(sourceComposite, fVerticalRuler, styles); |
|
|
3213 |
|
3214 |
// add a composite to hold lightweight Find/Replace bar |
3215 |
fFindComposite = new Composite(fMainComposite,SWT.BORDER); |
3216 |
fFindComposite.setLayout(new FillLayout()); |
3217 |
gd = new GridData(SWT.FILL,SWT.FILL,true,false); |
3218 |
gd.exclude = true; |
3219 |
fFindComposite.setLayoutData(gd); |
3220 |
|
3221 |
// add a Text widget into the composite for testing |
3222 |
// replace this with a QuickFindBar class |
3223 |
fQuickFind = new QuickFindBar(fFindComposite,SWT.NONE); |
3195 |
|
3224 |
|
3196 |
if (fConfiguration == null) |
3225 |
if (fConfiguration == null) |
3197 |
fConfiguration= new SourceViewerConfiguration(); |
3226 |
fConfiguration= new SourceViewerConfiguration(); |
Lines 5425-5431
Link Here
|
5425 |
action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_PREVIOUS); |
5454 |
action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_PREVIOUS); |
5426 |
setAction(ITextEditorActionConstants.FIND_PREVIOUS, action); |
5455 |
setAction(ITextEditorActionConstants.FIND_PREVIOUS, action); |
5427 |
|
5456 |
|
5428 |
action= new IncrementalFindAction(EditorMessages.getBundleForConstructedKeys(), "Editor.FindIncremental.", this, true); //$NON-NLS-1$ |
5457 |
//action= new IncrementalFindAction(EditorMessages.getBundleForConstructedKeys(), "Editor.FindIncremental.", this, true); //$NON-NLS-1$ |
|
|
5458 |
action= new QuickFindAction(EditorMessages.getBundleForConstructedKeys(), "Editor.QuickFind.", this); //$NON-NLS-1$ |
5429 |
action.setHelpContextId(IAbstractTextEditorHelpContextIds.FIND_INCREMENTAL_ACTION); |
5459 |
action.setHelpContextId(IAbstractTextEditorHelpContextIds.FIND_INCREMENTAL_ACTION); |
5430 |
action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_INCREMENTAL); |
5460 |
action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_INCREMENTAL); |
5431 |
setAction(ITextEditorActionConstants.FIND_INCREMENTAL, action); |
5461 |
setAction(ITextEditorActionConstants.FIND_INCREMENTAL, action); |
Lines 6899-6903
Link Here
|
6899 |
fSourceViewer.setIndentPrefixes(prefixes, types[i]); |
6929 |
fSourceViewer.setIndentPrefixes(prefixes, types[i]); |
6900 |
} |
6930 |
} |
6901 |
} |
6931 |
} |
|
|
6932 |
|
6933 |
/** |
6934 |
* Returns the composite that holds QuickFindBar |
6935 |
* @return a Composite |
6936 |
*/ |
6937 |
public Composite getFindComposite(){ |
6938 |
return fFindComposite; |
6939 |
} |
6940 |
|
6941 |
public QuickFindBar getQuickFindBar(){ |
6942 |
return fQuickFind; |
6943 |
} |
6944 |
|
6945 |
public Composite getMainComposite(){ |
6946 |
return fMainComposite; |
6947 |
} |
6902 |
|
6948 |
|
6903 |
} |
6949 |
} |