shortened display text of variable proposal in content assist
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / PHPEclipseShowAction.java
index 6a9430d..d6881ed 100644 (file)
@@ -2,25 +2,22 @@
  * Copyright (c) 2000, 2002 IBM Corp. and others. 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 implementation Klaus Hartlage - www.eclipseproject.de
+ *
+ * Contributors: IBM Corporation - Initial implementation
+ *               www.phpeclipse.de
  **********************************************************************************************************************************/
 package net.sourceforge.phpeclipse.actions;
 
-import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.text.MessageFormat;
 import java.util.Iterator;
 
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
 import net.sourceforge.phpeclipse.ui.IPreferenceConstants;
 import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction;
-import net.sourceforge.phpeclipse.ui.overlaypages.Util;
+import net.sourceforge.phpeclipse.ui.overlaypages.ProjectPrefUtil;
 import net.sourceforge.phpeclipse.webbrowser.IWebBrowser;
 import net.sourceforge.phpeclipse.webbrowser.internal.BrowserManager;
-import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUtil;
-import net.sourceforge.phpeclipse.webbrowser.views.BrowserView;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
@@ -33,8 +30,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IActionDelegate;
 import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 
 
@@ -60,7 +55,6 @@ public class PHPEclipseShowAction implements IObjectActionDelegate {
     selectionProvider = workbenchPart.getSite().getSelectionProvider();
     StructuredSelection selection = null;
     selection = (StructuredSelection) selectionProvider.getSelection();
-    //    PHPConsole console = PHPConsole.getInstance();
     IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
     Shell shell = null;
     Iterator iterator = null;
@@ -77,23 +71,24 @@ public class PHPEclipseShowAction implements IObjectActionDelegate {
           // single file:
           IFile previewFile = (IFile) resource;
           String extension = previewFile.getFileExtension().toLowerCase();
-          boolean bringToTopPreview = Util.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT);
-          boolean showHTMLFilesLocal = Util.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL);
-          boolean showXMLFilesLocal = Util.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_SHOW_XML_FILES_LOCAL);
+          boolean bringToTopPreview = ProjectPrefUtil.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT);
+//          boolean showHTMLFilesLocal = ProjectPrefUtil.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL);
+//          boolean showXMLFilesLocal = ProjectPrefUtil.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_SHOW_XML_FILES_LOCAL);
           boolean isHTMLFileName = "html".equals(extension) || "htm".equals(extension) || "xhtml".equals(extension);
           boolean isXMLFileName = "xml".equals(extension) || "xsd".equals(extension) || "dtd".equals(extension);
 
           String localhostURL;
-          if (showHTMLFilesLocal && isHTMLFileName) {
-            localhostURL = "file://"+previewFile.getLocation().toString();
-          } else if (showXMLFilesLocal && isXMLFileName) {
-            localhostURL = "file://"+previewFile.getLocation().toString();
-          } else if ((localhostURL = ShowExternalPreviewAction.getLocalhostURL(store, previewFile)) == null) {
+//          if (showHTMLFilesLocal && isHTMLFileName) {
+//            localhostURL = "file://"+previewFile.getLocation().toString();
+//          } else if (showXMLFilesLocal && isXMLFileName) {
+//            localhostURL = "file://"+previewFile.getLocation().toString();
+//          } else
+          if ((localhostURL = ShowExternalPreviewAction.getLocalhostURL(store, previewFile)) == null) {
             MessageDialog.openInformation(shell, "Couldn't create localhost URL",
             "Please configure your localhost and documentRoot");
             return;
           }
-        
+
           try {
 //            if (store.getBoolean(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF)) {
 //              String[] arguments = { localhostURL };