mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-234842 add tooltip to version label if updated icon is displayed
GitOrigin-RevId: a0161d21673e8a70530810a28f31383d5bc2b0e8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d42b988482
commit
8ce0bc0e5b
@@ -455,6 +455,7 @@ plugin.status.not.allowed=Blocked
|
||||
plugin.status.not.allowed.but.enabled=Disable!
|
||||
plugin.status.not.allowed.tooltip=The plugin is not approved by your organization
|
||||
plugin.status.not.allowed.tooltip.but.enabled=Please disable the plugin, it is not approved by your organization
|
||||
plugin.status.is.updated.bundled.plugin.tooltip=Updated version of a bundled plugin
|
||||
plugin.status.bundled=bundled
|
||||
progress.downloading.plugin=Downloading plugin ''{0}''
|
||||
progress.connecting.to.plugin.manager=Connecting to {0}
|
||||
|
||||
@@ -454,13 +454,13 @@ public final class ListPluginComponent extends JPanel {
|
||||
myRating = createRatingLabel(myMetricsPanel, rating, AllIcons.Plugins.Rating);
|
||||
}
|
||||
String version = myInstalledDescriptorForMarketplace == null ? "" : myInstalledDescriptorForMarketplace.getVersion();
|
||||
myVersion = createRatingLabel(myMetricsPanel, version, null);
|
||||
myVersion = createVersionLabel(myMetricsPanel, version, false);
|
||||
myVersion.setVisible(!StringUtil.isEmptyOrSpaces(version));
|
||||
}
|
||||
else {
|
||||
String version = myPlugin.getVersion();
|
||||
if (!StringUtil.isEmptyOrSpaces(version)) {
|
||||
myVersion = createRatingLabel(myMetricsPanel, version, myPlugin.isBundledUpdate() ? AllIcons.Plugins.Updated : null);
|
||||
myVersion = createVersionLabel(myMetricsPanel, version, myPlugin.isBundledUpdate());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ public final class ListPluginComponent extends JPanel {
|
||||
|
||||
if (myUpdateDescriptor == null) {
|
||||
if (myVersion != null) {
|
||||
myVersion.setText(plugin.getVersion());
|
||||
setVersionLabelState(myVersion, plugin.getVersion(), plugin.isBundledUpdate());
|
||||
}
|
||||
if (myUpdateLicensePanel != null) {
|
||||
myLayout.removeLineComponent(myUpdateLicensePanel);
|
||||
@@ -622,7 +622,7 @@ public final class ListPluginComponent extends JPanel {
|
||||
}
|
||||
else {
|
||||
if (myVersion != null) {
|
||||
myVersion.setText(plugin.getVersion());
|
||||
setVersionLabelState(myVersion, plugin.getVersion(), plugin.isBundledUpdate());
|
||||
}
|
||||
if (plugin.getProductCode() == null && myUpdateDescriptor.getProductCode() != null &&
|
||||
!plugin.isBundled() && !LicensePanel.isEA2Product(myUpdateDescriptor.getProductCode()) &&
|
||||
@@ -842,7 +842,7 @@ public final class ListPluginComponent extends JPanel {
|
||||
if (myMarketplace) {
|
||||
myInstallButton.setVisible(false);
|
||||
myEnableDisableButton.setVisible(true);
|
||||
myVersion.setText(myInstalledDescriptorForMarketplace.getVersion());
|
||||
setVersionLabelState(myVersion, myInstalledDescriptorForMarketplace.getVersion(), myInstalledDescriptorForMarketplace.isBundledUpdate());
|
||||
myVersion.setVisible(true);
|
||||
updateEnabledStateUI();
|
||||
fullRepaint();
|
||||
@@ -1320,9 +1320,32 @@ public final class ListPluginComponent extends JPanel {
|
||||
return createRatingLabel(panel, null, text, icon, null, true);
|
||||
}
|
||||
|
||||
static @NotNull JLabel createVersionLabel(@NotNull JPanel panel,
|
||||
@Nullable @Nls String text,
|
||||
boolean isBundledUpdate) {
|
||||
var label = createRatingLabel(panel, null, null, null, null, true);
|
||||
setVersionLabelState(label, text, isBundledUpdate);
|
||||
return label;
|
||||
}
|
||||
|
||||
static void setVersionLabelState(@NotNull JLabel versionLabel, @Nullable @Nls String text, boolean isBundledUpdate) {
|
||||
if (isBundledUpdate) {
|
||||
if (versionLabel.getToolTipText() == null) {
|
||||
versionLabel.setToolTipText(IdeBundle.message("plugin.status.is.updated.bundled.plugin.tooltip"));
|
||||
}
|
||||
if (versionLabel.getIcon() != AllIcons.Plugins.Updated) {
|
||||
versionLabel.setIcon(AllIcons.Plugins.Updated);
|
||||
}
|
||||
} else {
|
||||
versionLabel.setToolTipText(null);
|
||||
versionLabel.setIcon(null);
|
||||
}
|
||||
versionLabel.setText(text);
|
||||
}
|
||||
|
||||
static @NotNull JLabel createRatingLabel(@NotNull JPanel panel,
|
||||
@Nullable Object constraints,
|
||||
@NotNull @Nls String text,
|
||||
@Nullable @Nls String text,
|
||||
@Nullable Icon icon,
|
||||
@Nullable Color color,
|
||||
boolean tiny) {
|
||||
|
||||
+2
-4
@@ -1027,8 +1027,7 @@ class PluginDetailsPageComponent @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
if (myVersion1 != null) {
|
||||
myVersion1!!.icon = descriptorForActions.let { if (it.isBundledUpdate) AllIcons.Plugins.Updated else null }
|
||||
myVersion1!!.text = version
|
||||
ListPluginComponent.setVersionLabelState(myVersion1!!, version, descriptorForActions.isBundledUpdate)
|
||||
myVersion1!!.isVisible = isVersion
|
||||
}
|
||||
|
||||
@@ -1568,8 +1567,7 @@ class PluginDetailsPageComponent @JvmOverloads constructor(
|
||||
installedDescriptorForMarketplace = installedPlugin
|
||||
installedDescriptorForMarketplace?.let { descriptorForMarketplace ->
|
||||
installButton.setVisible(false)
|
||||
myVersion1!!.icon = installedPlugin?.let { if (it.isBundledUpdate) AllIcons.Plugins.Updated else null }
|
||||
myVersion1!!.text = descriptorForMarketplace.version
|
||||
ListPluginComponent.setVersionLabelState(myVersion1!!, descriptorForMarketplace.version, installedPlugin?.isBundledUpdate ?: false)
|
||||
myVersion1!!.isVisible = true
|
||||
updateEnabledState()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user