public static final String IMG_OBJS_INTERFACE= NAME_PREFIX + "int_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_INTERFACEALT= NAME_PREFIX + "intf_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_INTERFACE_DEFAULT= NAME_PREFIX + "int_default_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJS_CUNIT= NAME_PREFIX + "jcu_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_CUNIT= NAME_PREFIX + "phpedit.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_CUNIT_RESOURCE= NAME_PREFIX + "jcu_resource_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_CFILE= NAME_PREFIX + "classf_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_CFILECLASS= NAME_PREFIX + "class_obj.gif"; //$NON-NLS-1$
* Contributors: IBM Corporation - Initial implementation Klaus Hartlage -
* www.eclipseproject.de
******************************************************************************/
+import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil;
import net.sourceforge.phpeclipse.IPreferenceConstants;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import net.sourceforge.phpeclipse.actions.PHPEclipseShowAction;
* Code called when the action is fired.
*/
public void run() {
- IFile fileToParse = getFile();
- if (fileToParse == null) {
+ IFile previewFile = getFile();
+ if (previewFile == null) {
// should never happen
return;
}
- boolean autoPreview = Util.getPreviewBooleanValue(fileToParse,
+ boolean autoPreview = Util.getPreviewBooleanValue(previewFile,
IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT);
- boolean bringToTopPreview = Util.getPreviewBooleanValue(fileToParse,
+ boolean bringToTopPreview = Util.getPreviewBooleanValue(previewFile,
IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT);
- if (autoPreview) {
+ boolean showHTMLFilesLocal = Util.getPreviewBooleanValue(previewFile,
+ IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL);
+ boolean isPHPFileName = PHPFileUtil.isPHPFileName(previewFile.getLocation().toString());
+
+ if (autoPreview) {
String localhostURL;
- if ((localhostURL = PHPEclipseShowAction.getLocalhostURL(null,
- fileToParse)) == null) {
+ if (showHTMLFilesLocal && (!isPHPFileName)) {
+ localhostURL = previewFile.getLocation().toString();
+ } else if ((localhostURL = PHPEclipseShowAction.getLocalhostURL(null,
+ previewFile)) == null) {
return;
}
IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
}
}
}
+
public void refresh() {
IFile fileToParse = getFile();
if (fileToParse == null) {
addField(new BooleanFieldEditor(
IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT, PHPPreferencesMessages
.getString("PHPPreviewProjectPreferences.bring_to_top_preview"), composite));
+ addField(new BooleanFieldEditor(
+ IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL, PHPPreferencesMessages
+ .getString("PHPPreviewProjectPreferences.show_html_files_local"), composite));
//if (!isPropertyPage)) {
//
//}