IDEA-134061 Built-in web server does not serve content from JAR files

This commit is contained in:
Vladimir Krivosheev
2014-12-12 11:05:58 +01:00
parent 7ce50b9953
commit 66715b43c8
4 changed files with 11 additions and 48 deletions
@@ -49,7 +49,6 @@ public class GeneralSettings implements PersistentStateComponent<GeneralSettings
private boolean myUseSafeWrite = true;
private final PropertyChangeSupport myPropertyChangeSupport;
private boolean myUseDefaultBrowser = true;
private boolean myConfirmExtractFiles = true;
private boolean mySearchInBackground;
private boolean myConfirmExit = true;
private int myConfirmOpenNewProject = OPEN_PROJECT_ASK;
@@ -96,6 +95,7 @@ public class GeneralSettings implements PersistentStateComponent<GeneralSettings
myBrowserPath = browserPath;
}
@SuppressWarnings("unused")
@Deprecated
public boolean showTipsOnStartup() {
return isShowTipsOnStartup();
@@ -199,12 +199,16 @@ public class GeneralSettings implements PersistentStateComponent<GeneralSettings
myUseDefaultBrowser = value;
}
@SuppressWarnings("unused")
@Transient
@Deprecated
public boolean isConfirmExtractFiles() {
return myConfirmExtractFiles;
return true;
}
@SuppressWarnings("unused")
@Deprecated
public void setConfirmExtractFiles(boolean value) {
myConfirmExtractFiles = value;
}
public boolean isConfirmExit() {
@@ -24,11 +24,9 @@ import com.intellij.ide.BrowserUtil;
import com.intellij.ide.GeneralSettings;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.util.ArrayUtil;
@@ -176,14 +174,6 @@ public class BrowserLauncherAppless extends BrowserLauncher {
}
}
private static File getExtractedFilesDir() {
return new File(PathManager.getSystemPath(), "ExtractedFiles");
}
public static void clearExtractedFiles() {
FileUtil.delete(getExtractedFilesDir());
}
@Override
public void browse(@NotNull String url, @Nullable WebBrowser browser) {
browse(url, browser, null);
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.ide.browsers.BrowserSettingsPanel">
<grid id="27dc6" binding="root" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="root" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="595" height="400"/>
@@ -11,7 +11,7 @@
<grid id="df7ca" binding="defaultBrowserPanel" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -40,28 +40,12 @@
</grid>
<component id="c38a1" class="javax.swing.JComponent" binding="browsersTable" custom-create="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
</component>
<component id="b18a3" class="javax.swing.JCheckBox" binding="confirmExtractFiles" default-binding="true">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Show confirmation before extracting files"/>
</properties>
</component>
<component id="d1faa" class="javax.swing.JButton" binding="clearExtractedFiles" default-binding="true">
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Clear extracted files"/>
</properties>
</component>
<component id="beb5b" class="com.intellij.ui.components.JBCheckBox" binding="showBrowserHover">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Show browser popup in editor"/>
@@ -43,8 +43,6 @@ import javax.swing.border.EmptyBorder;
import javax.swing.event.TableModelEvent;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
@@ -137,8 +135,6 @@ final class BrowserSettingsPanel {
private TextFieldWithBrowseButton alternativeBrowserPathField;
private JCheckBox confirmExtractFiles;
private JButton clearExtractedFiles;
private JPanel defaultBrowserPanel;
@SuppressWarnings("UnusedDeclaration")
@@ -205,13 +201,6 @@ final class BrowserSettingsPanel {
if (UIUtil.isUnderAquaLookAndFeel()) {
defaultBrowserPolicyComboBox.setBorder(new EmptyBorder(3, 0, 0, 0));
}
clearExtractedFiles.addActionListener(new ActionListener() {
@Override
public void actionPerformed(@NotNull ActionEvent e) {
BrowserLauncherAppless.clearExtractedFiles();
}
});
}
private void updateCustomPathTextFieldValue(@NotNull DefaultBrowserPolicy browser) {
@@ -324,7 +313,6 @@ final class BrowserSettingsPanel {
DefaultBrowserPolicy defaultBrowserPolicy = getDefaultBrowser();
if (browserManager.getDefaultBrowserPolicy() != defaultBrowserPolicy ||
generalSettings.isConfirmExtractFiles() != confirmExtractFiles.isSelected() ||
browserManager.isShowBrowserHover() != showBrowserHover.isSelected()) {
return true;
}
@@ -346,8 +334,6 @@ final class BrowserSettingsPanel {
settings.setBrowserPath(alternativeBrowserPathField.getText());
}
settings.setConfirmExtractFiles(confirmExtractFiles.isSelected());
WebBrowserManager browserManager = WebBrowserManager.getInstance();
browserManager.setShowBrowserHover(showBrowserHover.isSelected());
browserManager.defaultBrowserPolicy = getDefaultBrowser();
@@ -366,7 +352,6 @@ final class BrowserSettingsPanel {
defaultBrowserPolicyComboBox.setSelectedItem(effectiveDefaultBrowserPolicy);
GeneralSettings settings = GeneralSettings.getInstance();
confirmExtractFiles.setSelected(settings.isConfirmExtractFiles());
showBrowserHover.setSelected(browserManager.isShowBrowserHover());
browsersEditor.reset(browserManager.getList());