From c8cfe951a998037050f635144b8c486c0fe75c35 Mon Sep 17 00:00:00 2001 From: Jumper Chen Date: Tue, 13 Oct 2015 10:20:54 +0800 Subject: [PATCH] the function of open in browser support zhtml file type. --- src/org/zkoss/zkidea/dom/ZulDomUtil.java | 2 +- src/org/zkoss/zkidea/editorActions/WebBrowserUrlProvider.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/org/zkoss/zkidea/dom/ZulDomUtil.java b/src/org/zkoss/zkidea/dom/ZulDomUtil.java index e01c3fe..34a1700 100644 --- a/src/org/zkoss/zkidea/dom/ZulDomUtil.java +++ b/src/org/zkoss/zkidea/dom/ZulDomUtil.java @@ -33,7 +33,7 @@ public static boolean isZKFile(PsiFile file) { } public static boolean isZKFile(String ext) { - return ZulFileType.EXTENSION.equalsIgnoreCase(ext); + return ZulFileType.EXTENSION.equalsIgnoreCase(ext) || "zhtml".equalsIgnoreCase(ext); } public static boolean hasViewModel(PsiElement element) { do { diff --git a/src/org/zkoss/zkidea/editorActions/WebBrowserUrlProvider.java b/src/org/zkoss/zkidea/editorActions/WebBrowserUrlProvider.java index 6fa87f8..cfa95e4 100644 --- a/src/org/zkoss/zkidea/editorActions/WebBrowserUrlProvider.java +++ b/src/org/zkoss/zkidea/editorActions/WebBrowserUrlProvider.java @@ -14,7 +14,6 @@ import com.intellij.execution.ExecutionManager; import com.intellij.execution.process.ProcessHandler; import com.intellij.ide.browsers.OpenInBrowserRequest; -import com.intellij.ide.highlighter.XmlFileType; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; @@ -45,7 +44,7 @@ protected Url getUrl(@NotNull OpenInBrowserRequest request, @NotNull VirtualFile String port = "8080"; FileType fileType = file.getFileType(); - if (file.getFileType() instanceof XmlFileType && ZulDomUtil.isZKFile(file.getExtension())) { + if (ZulDomUtil.isZKFile(file.getExtension())) { ProcessHandler[] runningProcesses = ExecutionManager .getInstance(request.getProject()) .getRunningProcesses();