mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[platform] refactoring: introduce UpdateStrategyCustomization.showWhatIsNewPageAfterUpdate (IJPL-204)
...as a replacement for 'show-on-update' attribute in 'whatsnew' tag in ApplicationInfo.xml IntelliJ IDEA has been migrated to use the new property. GitOrigin-RevId: 13f502c36c30b971f028d732e3c67202cb11c11c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4a00023eab
commit
80980fc2b7
@@ -19,5 +19,8 @@
|
||||
<applicationService serviceInterface="com.intellij.platform.ide.customization.ExternalProductResourceUrls"
|
||||
serviceImplementation="com.intellij.idea.customization.base.IntelliJIdeaExternalResourceUrls"
|
||||
overrides="true"/>
|
||||
<applicationService serviceInterface="com.intellij.openapi.updateSettings.UpdateStrategyCustomization"
|
||||
serviceImplementation="com.intellij.idea.customization.base.IntelliJIdeaUpdateStrategyCustomization"
|
||||
overrides="true"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
<essential-plugin>com.intellij.java</essential-plugin>
|
||||
<essential-plugin>com.intellij.java.ide</essential-plugin>
|
||||
|
||||
<whatsnew show-on-update="true"/>
|
||||
</component>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.intellij.idea.customization.base
|
||||
|
||||
import com.intellij.openapi.updateSettings.UpdateStrategyCustomization
|
||||
|
||||
class IntelliJIdeaUpdateStrategyCustomization : UpdateStrategyCustomization() {
|
||||
override val showWhatIsNewPageAfterUpdate: Boolean
|
||||
get() = true
|
||||
}
|
||||
@@ -97,6 +97,9 @@ interface ExternalProductResourceUrls {
|
||||
* Returns URL of the page containing information about new features in the product.
|
||||
* It's opened in the browser or in the editor when a user invokes the "What's New" action.
|
||||
* If the property returns `null`, the action won't be shown.
|
||||
*
|
||||
* This page will be also shown in IDE automatically if [UpdateStrategyCustomization.showWhatIsNewPageAfterUpdate][com.intellij.openapi.updateSettings.UpdateStrategyCustomization.showWhatIsNewPageAfterUpdate]
|
||||
* returns `true`.
|
||||
*/
|
||||
val whatIsNewPageUrl: Url?
|
||||
get() = null
|
||||
|
||||
@@ -3,11 +3,15 @@ package com.intellij.ide.actions;
|
||||
|
||||
import com.intellij.idea.AppMode;
|
||||
import com.intellij.openapi.application.ex.ApplicationInfoEx;
|
||||
import com.intellij.openapi.updateSettings.UpdateStrategyCustomization;
|
||||
import com.intellij.platform.ide.customization.ExternalProductResourceUrls;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
public final class WhatsNewUtil {
|
||||
@ApiStatus.Internal
|
||||
public static boolean isWhatsNewAvailable() {
|
||||
return ApplicationInfoEx.getInstanceEx().isShowWhatsNewOnUpdate() && !AppMode.isRemoteDevHost();
|
||||
return (UpdateStrategyCustomization.getInstance().getShowWhatIsNewPageAfterUpdate() || ApplicationInfoEx.getInstanceEx().isShowWhatsNewOnUpdate())
|
||||
&& ExternalProductResourceUrls.getInstance().getWhatIsNewPageUrl() != null
|
||||
&& !AppMode.isRemoteDevHost();
|
||||
}
|
||||
}
|
||||
@@ -84,4 +84,11 @@ open class UpdateStrategyCustomization {
|
||||
if (ApplicationInfoEx.getInstanceEx().isMajorEAP && forceEapUpdateChannelForEapBuilds())
|
||||
IdeBundle.message("updates.settings.channel.locked")
|
||||
else null
|
||||
|
||||
/**
|
||||
* Override this property and return `true` to show [What's New][com.intellij.platform.ide.customization.ExternalProductResourceUrls.whatIsNewPageUrl]
|
||||
* page after update.
|
||||
*/
|
||||
open val showWhatIsNewPageAfterUpdate: Boolean
|
||||
get() = false
|
||||
}
|
||||
Reference in New Issue
Block a user