From af49a13f045ba0fbdf942e9e9adac738f85e3eab Mon Sep 17 00:00:00 2001
From: "Vassiliy.Kudryashov"
Date: Fri, 2 Dec 2016 13:41:25 +0300
Subject: [PATCH] IDEA-164734 Update screen is too big
---
.../impl/AbstractUpdateDialog.java | 1 +
.../impl/ShowUpdateInfoDialogAction.java | 129 ++++++++++++++++++
.../updateSettings/impl/UpdateInfoDialog.java | 18 +++
.../updateSettings/impl/UpdateInfoPanel.form | 40 +++---
.../src/idea/PlatformActions.xml | 1 +
5 files changed, 168 insertions(+), 21 deletions(-)
create mode 100644 platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/ShowUpdateInfoDialogAction.java
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java
index 8b4b417239f8..0d3b1bc817b3 100644
--- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java
@@ -75,6 +75,7 @@ public abstract class AbstractUpdateDialog extends DialogWrapper {
area.setBackground(UIUtil.getPanelBackground());
area.setBorder(IdeBorderFactory.createEmptyBorder());
area.setText(text);
+ area.setCaretPosition(0);
area.setEditable(false);
if (listener == null && myEnableLink) {
diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/ShowUpdateInfoDialogAction.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/ShowUpdateInfoDialogAction.java
new file mode 100644
index 000000000000..d813d34d191b
--- /dev/null
+++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/ShowUpdateInfoDialogAction.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.updateSettings.impl;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.application.ApplicationInfo;
+import com.intellij.openapi.util.JDOMUtil;
+
+import java.util.Collections;
+
+public class ShowUpdateInfoDialogAction extends AnAction {
+ private boolean myShowBigData = false;
+
+ public ShowUpdateInfoDialogAction() {
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ try {
+ myShowBigData = ! myShowBigData;
+ UpdateChannel channel = new UpdateChannel(JDOMUtil.loadDocument(getXML(myShowBigData)).getRootElement());
+ BuildInfo newBuild = channel.getBuilds().get(0);
+ PatchInfo patchInfo = new PatchInfo(
+ JDOMUtil.loadDocument("")
+ .getRootElement());
+ new UpdateInfoDialog(channel, newBuild, patchInfo, true, UpdateSettings.getInstance().canUseSecureConnection(),
+ Collections.emptyList(), Collections.emptyList()).show();
+ }
+ catch (Exception ignored) {
+ ignored.printStackTrace();
+ }
+ }
+
+
+ private static final String PARAGRAPH = " Refactoring to Java 8: more powerful inspections.\n" +
+ " JVM Debugger: Class-level Watches; the JVM Memory View plugin.\n" +
+ " User Interface: Parameter Hints; Semantic Highlighting; flat file icons.\n" +
+ " Build Tools: Delegate IDE build/run actions to Gradle; Composite
\n" +
+ " Builds support; Polyglot Maven.\n" +
+ " Scala: scala.meta and Scala.js\n" +
+ " JavaScript: refactoring to ECMAScript 6; Flow-based inspections;
\n" +
+ " React Native debugger, Protractor, Stylelint, PostCSS, and more.\n" +
+ " VCS: Faster and more ergonomic Log for Git/Mercurial; automatic
\n" +
+ " resolving conflicts; managing Git remotes.\n" +
+ " Android: Blueprint; Constraint Layout, APK Analyzer, and better Instant Run.\n" +
+ " Database: editing multiple cells at once; submit changes in bulk;
\n" +
+ " find usages of objects within the source code of other objects.\n";
+
+ private static final String CHANNEL_XML_START = "\n" +
+ "\n" +
+ " \n" +
+ " Please meet IntelliJ IDEA 2016.3, the third update planned for 2016!
\n" +
+ "\n" +
+ "Visit What's New page for a full list of new features and an overview video.
\n" +
+ "\n" +
+ "And here're the highlights:
\n" +
+ "\n" +
+ "\n";
+
+ private static final String CHANNEL_XML_END = "
\n" +
+ "]]>\n" +
+ "