Skip to content

Commit 147a990

Browse files
tab can not be clicked if has tooltip
1 parent dc8163e commit 147a990

File tree

1 file changed

+7
-8
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook

1 file changed

+7
-8
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook/AzureSdkFeatureDetailPanel.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,21 @@ private void buildTabs(AzureSdkFeatureEntity feature) {
5555
this.addGroup("Client SDK", CLIENT_TIP, clientArtifacts);
5656
}
5757
if (CollectionUtils.isNotEmpty(springArtifacts)) {
58-
this.addGroup("Spring", SPRING_TIP, springArtifacts);
58+
final int index = this.addGroup("Spring", SPRING_TIP, springArtifacts);
59+
final JLabel tabHeader = (JLabel) this.tabPane.getTabComponentAt(index);
60+
tabHeader.setHorizontalTextPosition(SwingConstants.LEFT);
61+
tabHeader.setIcon(AllIcons.General.ContextHelp);
5962
}
6063
if (CollectionUtils.isNotEmpty(managementArtifacts)) {
6164
this.addGroup("Management SDK", MANAGEMENT_TIP, managementArtifacts);
6265
}
6366
}
6467

65-
private void addGroup(final String title, final String tooltip, final List<? extends AzureSdkArtifactEntity> clientArtifacts) {
68+
private int addGroup(final String title, final String tooltip, final List<? extends AzureSdkArtifactEntity> clientArtifacts) {
6669
final int index = this.tabPane.getTabCount();
6770
final AzureSdkArtifactGroupPanel clientPanel = new AzureSdkArtifactGroupPanel();
68-
this.tabPane.insertTab(title, null, clientPanel.getContentPanel(), "", index);
71+
this.tabPane.insertTab(title, null, clientPanel.getContentPanel(), tooltip, index);
6972
clientPanel.setData(clientArtifacts);
70-
final JLabel tabHeader = (JLabel) this.tabPane.getTabComponentAt(index);
71-
tabHeader.setIcon(AllIcons.General.ContextHelp);
72-
tabHeader.setToolTipText(tooltip);
73-
tabHeader.setHorizontalTextPosition(SwingConstants.LEFT);
74-
tabHeader.repaint();
73+
return index;
7574
}
7675
}

0 commit comments

Comments
 (0)