replaced a lot of deprecated code; if someone runs into a commit conflict afterwards...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / preferences / TemplateEditorSourceViewerConfiguration.java
index 129292b..7b94aa7 100644 (file)
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
+ * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/cpl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -70,7 +70,7 @@ public class TemplateEditorSourceViewerConfiguration extends PHPSourceViewerConf
                                                        }
                                                }
                                        }
-                               }                               
+                               }
                        } catch (BadLocationException e) {
                        }
                        return null;
@@ -83,18 +83,18 @@ public class TemplateEditorSourceViewerConfiguration extends PHPSourceViewerConf
                        if (textViewer != null) {
                                return JavaWordFinder.findWord(textViewer.getDocument(), offset);
                        }
-                       return null;    
+                       return null;
                }
-               
-       } 
-       
+
+       }
+
        private final TemplateVariableProcessor fProcessor;
 
        public TemplateEditorSourceViewerConfiguration(IColorManager colorManager, IPreferenceStore store, ITextEditor editor, TemplateVariableProcessor processor) {
                super(colorManager, store, editor, IPHPPartitions.PHP_PARTITIONING);
                fProcessor= processor;
        }
-       
+
        /*
         * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer)
         */
@@ -102,14 +102,15 @@ public class TemplateEditorSourceViewerConfiguration extends PHPSourceViewerConf
 
                IPreferenceStore store= PHPeclipsePlugin.getDefault().getPreferenceStore();
                JavaTextTools textTools= PHPeclipsePlugin.getDefault().getJavaTextTools();
-               IColorManager manager= textTools.getColorManager();                                     
-               
+               IColorManager manager= textTools.getColorManager();
+
 
                ContentAssistant assistant= new ContentAssistant();
                assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE);
                        // Register the same processor for strings and single line comments to get code completion at the start of those partitions.
                assistant.setContentAssistProcessor(fProcessor, IPHPPartitions.PHP_STRING_DQ);
                assistant.setContentAssistProcessor(fProcessor, IPHPPartitions.PHP_STRING_SQ);
+               assistant.setContentAssistProcessor(fProcessor, IPHPPartitions.PHP_STRING_HEREDOC);
                assistant.setContentAssistProcessor(fProcessor, IPHPPartitions.PHP_SINGLELINE_COMMENT);
                assistant.setContentAssistProcessor(fProcessor, IPHPPartitions.PHP_MULTILINE_COMMENT);
                assistant.setContentAssistProcessor(fProcessor, IPHPPartitions.PHP_PHPDOC_COMMENT);
@@ -121,7 +122,7 @@ public class TemplateEditorSourceViewerConfiguration extends PHPSourceViewerConf
                assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE);
                assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
 
-               Color background= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, manager);                        
+               Color background= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, manager);
                assistant.setContextInformationPopupBackground(background);
                assistant.setContextSelectorBackground(background);
                assistant.setProposalSelectorBackground(background);
@@ -130,15 +131,15 @@ public class TemplateEditorSourceViewerConfiguration extends PHPSourceViewerConf
                assistant.setContextInformationPopupForeground(foreground);
                assistant.setContextSelectorForeground(foreground);
                assistant.setProposalSelectorForeground(foreground);
-               
+
                return assistant;
-       }       
+       }
 
        private Color getColor(IPreferenceStore store, String key, IColorManager manager) {
                RGB rgb= PreferenceConverter.getColor(store, key);
                return manager.getColor(rgb);
        }
-       
+
        /*
         * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String, int)
         * @since 2.1