added textArea as a temporary report area. will be replaced by a tree at some point...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPSourceViewerConfiguration.java
index 038abd3..0353b6d 100644 (file)
@@ -22,6 +22,7 @@ import net.sourceforge.phpdt.internal.ui.text.JavaOutlineInformationControl;
 import net.sourceforge.phpdt.internal.ui.text.JavaReconciler;
 import net.sourceforge.phpdt.internal.ui.text.java.JavaFormattingStrategy;
 import net.sourceforge.phpdt.internal.ui.text.java.JavaReconcilingStrategy;
+import net.sourceforge.phpdt.internal.ui.text.java.JavaStringAutoIndentStrategy;
 import net.sourceforge.phpdt.internal.ui.text.java.hover.JavaEditorTextHoverDescriptor;
 import net.sourceforge.phpdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy;
 import net.sourceforge.phpdt.internal.ui.text.phpdoc.PHPDocCompletionProcessor;
@@ -34,7 +35,7 @@ import net.sourceforge.phpeclipse.phpeditor.php.PHPAutoIndentStrategy;
 import net.sourceforge.phpeclipse.phpeditor.php.PHPCompletionProcessor;
 import net.sourceforge.phpeclipse.phpeditor.php.PHPDoubleClickSelector;
 import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider;
-import org.eclipse.core.resources.IFile;
+
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.text.DefaultAutoIndentStrategy;
@@ -69,8 +70,6 @@ import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.jface.text.source.SourceViewerConfiguration;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
 /**
  * Configuration for an <code>SourceViewer</code> which shows PHP code.
  */
@@ -203,6 +202,9 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
         */
        public IAutoIndentStrategy getAutoIndentStrategy(
                        ISourceViewer sourceViewer, String contentType) {
+               if (IPHPPartitions.PHP_STRING_DQ.equals(contentType))
+                       return new JavaStringAutoIndentStrategy(getConfiguredDocumentPartitioning(sourceViewer));
+
                return (IPHPPartitions.PHP_PARTITIONING.equals(contentType)
                                ? new PHPAutoIndentStrategy()
                                : new DefaultAutoIndentStrategy());
@@ -336,7 +338,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
                return new String[]{IPHPPartitions.HTML,
                                IPHPPartitions.HTML_MULTILINE_COMMENT,
                                IPHPPartitions.PHP_PARTITIONING,
-                               IPHPPartitions.PHP_MULTILINE_COMMENT,
+                               IPHPPartitions.PHP_PHPDOC_COMMENT,
                                IPHPPartitions.CSS,
                                IPHPPartitions.CSS_MULTILINE_COMMENT,
                                IPHPPartitions.JAVASCRIPT,
@@ -373,7 +375,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
                assistant.setContentAssistProcessor(new PHPCompletionProcessor(),
                                IPHPPartitions.PHP_PARTITIONING);
                assistant.setContentAssistProcessor(new PHPDocCompletionProcessor(),
-                               IPHPPartitions.PHP_MULTILINE_COMMENT);
+                               IPHPPartitions.PHP_PHPDOC_COMMENT);
                //    assistant.enableAutoActivation(true);
                //    assistant.setAutoActivationDelay(500);
                //    assistant.setProposalPopupOrientation(ContentAssistant.PROPOSAL_OVERLAY);
@@ -496,9 +498,9 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
                reconciler.setRepairer(dr, IPHPPartitions.PHP_PARTITIONING);
                dr = new DefaultDamagerRepairer(getPHPDocScanner());
                reconciler.setDamager(dr,
-                               IPHPPartitions.PHP_MULTILINE_COMMENT);
+                               IPHPPartitions.PHP_PHPDOC_COMMENT);
                reconciler.setRepairer(dr,
-                               IPHPPartitions.PHP_MULTILINE_COMMENT);
+                               IPHPPartitions.PHP_PHPDOC_COMMENT);
                return reconciler;
        }
        /*
@@ -624,7 +626,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
                presenter.setInformationProvider(provider,
                                IPHPPartitions.PHP_PARTITIONING);
                presenter.setInformationProvider(provider,
-                               IPHPPartitions.PHP_MULTILINE_COMMENT);
+                               IPHPPartitions.PHP_PHPDOC_COMMENT);
                presenter.setInformationProvider(provider,
                                IPHPPartitions.SMARTY_MULTILINE_COMMENT);
                presenter.setInformationProvider(provider,