|
Lines 8-13
Link Here
|
| 8 |
|
8 |
|
| 9 |
package org.eclipse.mylyn.internal.sandbox.ui.editors; |
9 |
package org.eclipse.mylyn.internal.sandbox.ui.editors; |
| 10 |
|
10 |
|
|
|
11 |
import org.eclipse.jface.layout.GridDataFactory; |
| 11 |
import org.eclipse.jface.text.Document; |
12 |
import org.eclipse.jface.text.Document; |
| 12 |
import org.eclipse.jface.text.ITextListener; |
13 |
import org.eclipse.jface.text.ITextListener; |
| 13 |
import org.eclipse.jface.text.TextEvent; |
14 |
import org.eclipse.jface.text.TextEvent; |
|
Lines 28-33
Link Here
|
| 28 |
import org.eclipse.swt.events.SelectionEvent; |
29 |
import org.eclipse.swt.events.SelectionEvent; |
| 29 |
import org.eclipse.swt.events.SelectionListener; |
30 |
import org.eclipse.swt.events.SelectionListener; |
| 30 |
import org.eclipse.swt.graphics.Font; |
31 |
import org.eclipse.swt.graphics.Font; |
|
|
32 |
import org.eclipse.swt.layout.GridLayout; |
| 31 |
import org.eclipse.swt.widgets.Composite; |
33 |
import org.eclipse.swt.widgets.Composite; |
| 32 |
import org.eclipse.ui.PlatformUI; |
34 |
import org.eclipse.ui.PlatformUI; |
| 33 |
import org.eclipse.ui.contexts.IContextActivation; |
35 |
import org.eclipse.ui.contexts.IContextActivation; |
|
Lines 42-47
Link Here
|
| 42 |
* create its own SourceViewer without overriding createControl and copying the code in it |
44 |
* create its own SourceViewer without overriding createControl and copying the code in it |
| 43 |
* |
45 |
* |
| 44 |
* @author Jingwen Ou |
46 |
* @author Jingwen Ou |
|
|
47 |
* @author David Green added context activation, layout |
| 45 |
*/ |
48 |
*/ |
| 46 |
public class ExtensibleRichTextAttributeEditor extends RichTextAttributeEditor { |
49 |
public class ExtensibleRichTextAttributeEditor extends RichTextAttributeEditor { |
| 47 |
|
50 |
|
|
Lines 81-86
Link Here
|
| 81 |
setControl(source instanceof Viewer ? ((Viewer) source).getControl() : source.getTextWidget()); |
84 |
setControl(source instanceof Viewer ? ((Viewer) source).getControl() : source.getTextWidget()); |
| 82 |
} else { |
85 |
} else { |
| 83 |
CTabFolder folder = new CTabFolder(parent, SWT.FLAT | SWT.BOTTOM); |
86 |
CTabFolder folder = new CTabFolder(parent, SWT.FLAT | SWT.BOTTOM); |
|
|
87 |
folder.setLayout(new GridLayout()); |
| 84 |
|
88 |
|
| 85 |
/** wikitext markup editor **/ |
89 |
/** wikitext markup editor **/ |
| 86 |
|
90 |
|
|
Lines 89-94
Link Here
|
| 89 |
viewerItem.setToolTipText("Edit Source"); |
93 |
viewerItem.setToolTipText("Edit Source"); |
| 90 |
|
94 |
|
| 91 |
source = extension.createEditor(taskRepository, folder, styles | SWT.V_SCROLL); |
95 |
source = extension.createEditor(taskRepository, folder, styles | SWT.V_SCROLL); |
|
|
96 |
source.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); |
| 97 |
|
| 92 |
if (source.getDocument() == null) { |
98 |
if (source.getDocument() == null) { |
| 93 |
source.setDocument(new Document(getValue())); |
99 |
source.setDocument(new Document(getValue())); |
| 94 |
} |
100 |
} |