Changeset 3865
- Timestamp:
- Jul 23, 2008, 4:01:21 PM (12 years ago)
- Location:
- devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/PresentationVisitor.java
r3849 r3865 55 55 public static class StylePosition extends Position { 56 56 private final String key; 57 /** May be <code>null</code>! */ 57 58 private TextAttribute textAttribute = null; 58 59 … … 66 67 } 67 68 69 /** May return <code>null</code>! */ 68 70 public StyleRange getStyleRange () { 71 if (textAttribute == null) 72 return null; 69 73 StyleRange styleRange = new StyleRange(offset, length, textAttribute.getForeground(), textAttribute.getBackground()); 70 74 int style = textAttribute.getStyle(); -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpEditor.java
r3863 r3865 26 26 import org.eclipse.jface.viewers.ISelectionChangedListener; 27 27 import org.eclipse.jface.viewers.SelectionChangedEvent; 28 import org.eclipse.swt.custom.StyleRange; 28 29 import org.eclipse.swt.custom.StyledText; 29 30 import org.eclipse.swt.widgets.Composite; … … 47 48 public class RfpEditor extends TextEditor { 48 49 private static int editorCount = 0; 49 private static ColorManager colorManager; 50 /** May be <code>null</code>! */ 51 private static ColorManager colorManager = null; 50 52 51 53 private static Object getLockObject (IAnnotationModel annotationModel) { … … 58 60 } 59 61 62 /** May return <code>null</code>! */ 60 63 public static ColorManager getColorManager () { 61 64 return colorManager; … … 139 142 propertyChangeListener = new IPropertyChangeListener() { 140 143 public void propertyChange (PropertyChangeEvent event) { 141 for (StylePosition position : stylePositionList) 142 position.updateStyleRange(store); 143 redrawTextAsync(); 144 if (stylePositionList != null) { 145 for (StylePosition position : stylePositionList) 146 position.updateStyleRange(store); 147 redrawTextAsync(); 148 } 144 149 } 145 150 }; … … 147 152 } 148 153 154 /** May be <code>null</code>! */ 149 155 private StylePosition[] stylePositionList = null; 150 156 … … 258 264 if (reg.getOffset() <= stylePosition.getOffset() 259 265 && stylePosition.getOffset() + stylePosition.getLength() <= reg.getOffset() 260 + reg.getLength()) 261 presentation.mergeStyleRange(stylePosition.getStyleRange()); 266 + reg.getLength()) { 267 StyleRange styleRange = stylePosition.getStyleRange(); 268 if (styleRange != null) 269 presentation.mergeStyleRange(styleRange); 270 } 262 271 } 263 272 }); -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/color/ColorScanner.java
r3508 r3865 33 33 } 34 34 35 /** May return <code>null</code>! */ 35 36 public static TextAttribute getTextAttribute (IPreferenceStore store, String key) { 36 Color color = RfpEditor.getColorManager().getColor( 37 ColorManager colorManager = RfpEditor.getColorManager(); 38 if (colorManager == null) 39 return null; 40 Color color = colorManager.getColor( 37 41 PreferenceConverter.getColor(store, IPreferenceConstants.PREFIX + key + ".color")); 38 42 int style = store.getBoolean(IPreferenceConstants.PREFIX + key + ".bold") ? SWT.BOLD : SWT.NORMAL;
Note: See TracChangeset
for help on using the changeset viewer.