|
Lines 42-47
Link Here
|
| 42 |
import org.eclipse.jface.text.source.Annotation; |
42 |
import org.eclipse.jface.text.source.Annotation; |
| 43 |
import org.eclipse.jface.text.source.IAnnotationHover; |
43 |
import org.eclipse.jface.text.source.IAnnotationHover; |
| 44 |
import org.eclipse.jface.text.source.ISourceViewer; |
44 |
import org.eclipse.jface.text.source.ISourceViewer; |
|
|
45 |
import org.eclipse.jface.util.IPropertyChangeListener; |
| 46 |
import org.eclipse.jface.util.PropertyChangeEvent; |
| 45 |
import org.eclipse.jface.viewers.ILabelProvider; |
47 |
import org.eclipse.jface.viewers.ILabelProvider; |
| 46 |
import org.eclipse.swt.SWT; |
48 |
import org.eclipse.swt.SWT; |
| 47 |
import org.eclipse.swt.graphics.Color; |
49 |
import org.eclipse.swt.graphics.Color; |
|
Lines 87-93
Link Here
|
| 87 |
* @see org.eclipse.wst.sse.ui.internal.StructuredTextViewer |
89 |
* @see org.eclipse.wst.sse.ui.internal.StructuredTextViewer |
| 88 |
* @since 1.0 |
90 |
* @since 1.0 |
| 89 |
*/ |
91 |
*/ |
| 90 |
public class StructuredTextViewerConfiguration extends TextSourceViewerConfiguration { |
92 |
public class StructuredTextViewerConfiguration extends TextSourceViewerConfiguration implements IPropertyChangeListener { |
| 91 |
/* |
93 |
/* |
| 92 |
* One instance per configuration because creating a second assistant that |
94 |
* One instance per configuration because creating a second assistant that |
| 93 |
* is added to a viewer can cause odd key-eating by the wrong one. |
95 |
* is added to a viewer can cause odd key-eating by the wrong one. |
|
Lines 117-122
Link Here
|
| 117 |
// initialize fPreferenceStore with same preference store used in |
119 |
// initialize fPreferenceStore with same preference store used in |
| 118 |
// StructuredTextEditor |
120 |
// StructuredTextEditor |
| 119 |
fPreferenceStore = createCombinedPreferenceStore(); |
121 |
fPreferenceStore = createCombinedPreferenceStore(); |
|
|
122 |
fPreferenceStore.addPropertyChangeListener(this); |
| 120 |
} |
123 |
} |
| 121 |
|
124 |
|
| 122 |
/** |
125 |
/** |
|
Lines 273-278
Link Here
|
| 273 |
color = getColor(EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND); |
276 |
color = getColor(EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND); |
| 274 |
fContentAssistant.setContextInformationPopupForeground(color); |
277 |
fContentAssistant.setContextInformationPopupForeground(color); |
| 275 |
fContentAssistant.setContextSelectorForeground(color); |
278 |
fContentAssistant.setContextSelectorForeground(color); |
|
|
279 |
|
| 280 |
fContentAssistant.enableAutoInsert(fPreferenceStore.getBoolean(EditorPreferenceNames.INSERT_SINGLE_SUGGESTION)); |
| 276 |
} |
281 |
} |
| 277 |
} |
282 |
} |
| 278 |
|
283 |
|
|
Lines 687-690
Link Here
|
| 687 |
public void setHighlighter(ReconcilerHighlighter highlighter) { |
692 |
public void setHighlighter(ReconcilerHighlighter highlighter) { |
| 688 |
fHighlighter = highlighter; |
693 |
fHighlighter = highlighter; |
| 689 |
} |
694 |
} |
|
|
695 |
|
| 696 |
public void propertyChange(PropertyChangeEvent event) { |
| 697 |
if(fContentAssistant != null && EditorPreferenceNames.INSERT_SINGLE_SUGGESTION.equals(event.getProperty())) { |
| 698 |
Object value = event.getNewValue(); |
| 699 |
if (value instanceof Boolean) |
| 700 |
fContentAssistant.enableAutoInsert(((Boolean) value).booleanValue()); |
| 701 |
} |
| 702 |
} |
| 690 |
} |
703 |
} |