1) Added missing strings for italic, underline and strike through.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPEditor.java
index e8de8e0..cc75aed 100644 (file)
@@ -34,6 +34,7 @@ import net.sourceforge.phpdt.core.ISourceReference;
 import net.sourceforge.phpdt.core.JavaCore;
 import net.sourceforge.phpdt.core.JavaModelException;
 import net.sourceforge.phpdt.core.compiler.ITerminalSymbols;
+import net.sourceforge.phpdt.core.compiler.ITerminalSymbols.TokenName;
 import net.sourceforge.phpdt.core.compiler.InvalidInputException;
 import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
 import net.sourceforge.phpdt.internal.compiler.parser.SyntaxError;
@@ -61,6 +62,7 @@ import net.sourceforge.phpdt.ui.text.JavaTextTools;
 import net.sourceforge.phpdt.ui.text.PHPSourceViewerConfiguration;
 import net.sourceforge.phpdt.ui.text.folding.IJavaFoldingStructureProvider;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.builder.ExternalEditorInput;
 import net.sourceforge.phpeclipse.ui.editor.BrowserUtil;
 import net.sourceforge.phpeclipse.webbrowser.views.BrowserView;
 
@@ -127,7 +129,9 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
 import org.eclipse.jface.text.source.projection.ProjectionSupport;
 import org.eclipse.jface.text.source.projection.ProjectionViewer;
 import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
+//incastrix
+//import org.eclipse.jface.util.ListenerList;
+import org.eclipse.core.runtime.ListenerList;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -3588,7 +3592,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
        protected void createActions() {
                super.createActions();
 
-               ActionGroup oeg, ovg, jsg, sg;
+               ActionGroup oeg/*, ovg, jsg, sg*/;
                fActionGroups = new CompositeActionGroup(
                                new ActionGroup[] { oeg = new OpenEditorActionGroup(this),
                                // sg= new ShowActionGroup(this),
@@ -5199,17 +5203,16 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
                        throws BadLocationException {
 
                IRegion line = document.getLineInformationOfOffset(lineOffset);
-               ITypedRegion[] linePartitioning = document.computePartitioning(
-                               lineOffset, line.getLength());
+               ITypedRegion[] linePartitioning = document.computePartitioning (lineOffset, line.getLength());
 
                List segmentation = new ArrayList();
+               
                for (int i = 0; i < linePartitioning.length; i++) {
-                       if (IPHPPartitions.PHP_STRING_DQ.equals(linePartitioning[i]
-                                       .getType())) {
-                               segmentation.add(linePartitioning[i]);
-                       } else if (IPHPPartitions.PHP_STRING_HEREDOC
-                                       .equals(linePartitioning[i].getType())) {
-                               segmentation.add(linePartitioning[i]);
+                       if (IPHPPartitions.PHP_STRING_DQ.equals (linePartitioning[i].getType())) {
+                               segmentation.add (linePartitioning[i]);
+                       } 
+                       else if (IPHPPartitions.PHP_STRING_HEREDOC.equals (linePartitioning[i].getType())) {
+                               segmentation.add (linePartitioning[i]);
                        }
                }
 
@@ -5599,9 +5602,9 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
         *         is <code>true</code>
         * @since 3.0
         */
-       private boolean getBoolean(IPreferenceStore store, String key) {
-               return key != null && store.getBoolean(key);
-       }
+//     private boolean getBoolean(IPreferenceStore store, String key) {
+//             return key != null && store.getBoolean(key);
+//     }
 
        protected boolean isPrefQuickDiffAlwaysOn() {
                return false; // never show change ruler for the non-editable java
@@ -5870,15 +5873,19 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
        }
 
        public ShowInContext getShowInContext() {
-               IFile file;
+               IFile file = null;
                if(getEditorInput() instanceof FileStoreEditorInput){
                        FileStoreEditorInput fei = (FileStoreEditorInput) getEditorInput();
                        file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fei.getURI().getPath()));
-               } else {
+               } else if (getEditorInput() instanceof FileEditorInput) {
                        FileEditorInput fei = (FileEditorInput) getEditorInput();
                        // added to fix ticket 637
                        file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fei.getURI().getPath()));
+               } else if (getEditorInput() instanceof ExternalEditorInput) {
+                       ExternalEditorInput fei = (ExternalEditorInput) getEditorInput();
+                       file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fei.getFullPath()/* .getURI().getPath()*/));
                }
+
                ShowInContext context = BrowserUtil.getShowInContext(file,
                                false, "");
                if (context != null) {
@@ -5957,15 +5964,15 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
                                                fMarkOccurrenceTargetRegion.getLength());
                                if (wordStr != null) {
                                        word = wordStr.toCharArray();
-                                       int fToken = ITerminalSymbols.TokenNameEOF;
+                                       TokenName fToken = ITerminalSymbols.TokenName.EOF;
                                        try {
                                                fToken = fScanner.getNextToken();
-                                               while (fToken != ITerminalSymbols.TokenNameEOF) { // &&
+                                               while (fToken != ITerminalSymbols.TokenName.EOF) { // &&
                                                                                                                                                        // fToken
                                                                                                                                                        // !=
-                                                       // TokenNameERROR) {
-                                                       if (fToken == ITerminalSymbols.TokenNameVariable
-                                                                       || fToken == ITerminalSymbols.TokenNameIdentifier) {
+                                                       // TokenName.ERROR) {
+                                                       if (fToken == ITerminalSymbols.TokenName.VARIABLE
+                                                                       || fToken == ITerminalSymbols.TokenName.IDENTIFIER) {
                                                                // global variable
                                                                if (fScanner.equalsCurrentTokenSource(word)) {
                                                                        matches