Changeset 3875 for devel-tools
- Timestamp:
- Jul 23, 2008, 9:43:51 PM (12 years ago)
- Location:
- devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/PresentationVisitor.java
r3874 r3875 54 54 public static class StylePosition extends Position { 55 55 private final String key; 56 /** May be <code>null</code>! */ 57 private TextAttribute textAttribute = null; 56 private TextAttribute textAttribute = RfpPreferences.defaultTextAttribute; 58 57 59 58 public StylePosition (SrcPosition pos, String key) { … … 66 65 } 67 66 68 /** May return <code>null</code>! */69 67 public StyleRange getStyleRange () { 70 if (textAttribute == null)71 return null;72 68 StyleRange styleRange = new StyleRange(offset, length, textAttribute.getForeground(), textAttribute 73 69 .getBackground()); -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpEditor.java
r3874 r3875 26 26 import org.eclipse.jface.viewers.ISelectionChangedListener; 27 27 import org.eclipse.jface.viewers.SelectionChangedEvent; 28 import org.eclipse.swt.custom.StyleRange;29 28 import org.eclipse.swt.custom.StyledText; 30 29 import org.eclipse.swt.widgets.Composite; … … 266 265 if (reg.getOffset() <= stylePosition.getOffset() 267 266 && stylePosition.getOffset() + stylePosition.getLength() <= reg.getOffset() 268 + reg.getLength()) { 269 StyleRange styleRange = stylePosition.getStyleRange(); 270 if (styleRange != null) 271 presentation.mergeStyleRange(styleRange); 272 } 267 + reg.getLength()) 268 presentation.mergeStyleRange(stylePosition.getStyleRange()); 273 269 } 274 270 }); -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/preferences/RfpPreferences.java
r3874 r3875 11 11 12 12 public class RfpPreferences { 13 public static final TextAttribute defaultTextAttribute = new TextAttribute(null, null, SWT.NORMAL); 14 13 15 private final IPreferenceStore store; 14 16 … … 25 27 } 26 28 27 28 /** May return <code>null</code>! */29 29 public TextAttribute getTextAttribute (String key) { 30 30 ColorManager colorManager = RfpEditor.getColorManager(); 31 31 if (colorManager == null) 32 return null;32 return defaultTextAttribute; 33 33 Color color = colorManager.getColor(PreferenceConverter.getColor(store, key + ".color")); 34 34 int style = store.getBoolean(key + ".bold") ? SWT.BOLD : SWT.NORMAL;
Note: See TracChangeset
for help on using the changeset viewer.