mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't hardcode Web URls for keymap (IDEADEV-41996)
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
<feedback eap-url="http://youtrack.jetbrains.net" release-url="http://www.jetbrains.com/feedback/feedback.jsp?product=IDEA&build=$BUILD&timezone=$TIMEZONE&eval=$EVAL"/>
|
||||
<plugins url="http://plugins.intellij.net"/>
|
||||
<whatsnew url="http://www.jetbrains.com/idea/whatsnew/index.html"/>
|
||||
<keymap win="http://www.jetbrains.com/idea/docs/IntelliJIDEA9_ReferenceCard.pdf"
|
||||
mac="http://www.jetbrains.com/idea/docs/IntelliJIDEA9_ReferenceCard_Mac.pdf"/>
|
||||
|
||||
<plugins-page category="VCS Integration" title="Select VCS Integration Plugins"/>
|
||||
<plugins-page title="Select Other Plugins"/>
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.actionSystem.ActionPlaces;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.ex.ApplicationInfoEx;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -38,9 +39,11 @@ public class RefCardAction extends AnAction implements DumbAware {
|
||||
BrowserUtil.launchBrowser(url);
|
||||
}
|
||||
else {
|
||||
BrowserUtil.launchBrowser(SystemInfo.isMac
|
||||
? "http://www.jetbrains.com/idea/docs/IntelliJIDEA8_ReferenceCard_Mac.pdf"
|
||||
: "http://www.jetbrains.com/idea/docs/IntelliJIDEA8_ReferenceCard.pdf");
|
||||
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
|
||||
String webUrl = SystemInfo.isMac ? appInfo.getMacKeymapUrl() : appInfo.getWinKeymapUrl();
|
||||
if (webUrl != null) {
|
||||
BrowserUtil.launchBrowser(webUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,10 @@ public abstract class ApplicationInfoEx extends ApplicationInfo {
|
||||
|
||||
public abstract String getWhatsNewUrl();
|
||||
|
||||
public abstract String getWinKeymapUrl();
|
||||
|
||||
public abstract String getMacKeymapUrl();
|
||||
|
||||
public interface UpdateUrls {
|
||||
String getCheckingUrl();
|
||||
String getPatchesUrl();
|
||||
|
||||
+19
@@ -65,6 +65,8 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
private String myPluginsDownloadUrl;
|
||||
private String myDefaultUpdateChannel;
|
||||
private String myWhatsNewUrl;
|
||||
private String myWinKeymapUrl;
|
||||
private String myMacKeymapUrl;
|
||||
private boolean myEAP;
|
||||
@NonNls private String myHelpFileName = "ideahelp.jar";
|
||||
@NonNls private String myHelpRootName = "idea";
|
||||
@@ -112,6 +114,9 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
@NonNls private static final String ATTRIBUTE_DOWNLOAD_URL = "download-url";
|
||||
@NonNls private static final String ATTRIBUTE_WEBHELP_URL = "webhelp-url";
|
||||
@NonNls private static final String ELEMENT_WHATSNEW = "whatsnew";
|
||||
@NonNls private static final String ELEMENT_KEYMAP = "keymap";
|
||||
@NonNls private static final String ATTRIBUTE_WINDOWS_URL = "win";
|
||||
@NonNls private static final String ATTRIBUTE_MAC_URL = "mac";
|
||||
private static final String DEFAULT_PLUGINS_HOST = "http://plugins.intellij.net";
|
||||
|
||||
public void initComponent() { }
|
||||
@@ -243,6 +248,14 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
return myWhatsNewUrl;
|
||||
}
|
||||
|
||||
public String getWinKeymapUrl() {
|
||||
return myWinKeymapUrl;
|
||||
}
|
||||
|
||||
public String getMacKeymapUrl() {
|
||||
return myMacKeymapUrl;
|
||||
}
|
||||
|
||||
public String getFullApplicationName() {
|
||||
@NonNls StringBuilder buffer = new StringBuilder();
|
||||
buffer.append(getVersionName());
|
||||
@@ -420,6 +433,12 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
myPluginsDownloadUrl = myPluginsDownloadUrl.replace(DEFAULT_PLUGINS_HOST, pluginsHost);
|
||||
}
|
||||
|
||||
Element keymapElement = parentNode.getChild(ELEMENT_KEYMAP);
|
||||
if (keymapElement != null) {
|
||||
myWinKeymapUrl = keymapElement.getAttributeValue(ATTRIBUTE_WINDOWS_URL);
|
||||
myMacKeymapUrl = keymapElement.getAttributeValue(ATTRIBUTE_MAC_URL);
|
||||
}
|
||||
|
||||
myPluginChooserPages = new ArrayList<PluginChooserPage>();
|
||||
final List children = parentNode.getChildren(PLUGINS_PAGE_ELEMENT_NAME);
|
||||
for(Object child: children) {
|
||||
|
||||
Reference in New Issue
Block a user