Skip to content

Commit 4380732

Browse files
authored
v0.4.6 (#705)
* archive media * should be only place that needs null check * revert to dynamic * fixes #701 * use readme for unreleased * verify oldest version * bump vertx * determine locale * translate * bump
1 parent 2e5c128 commit 4380732

File tree

8 files changed

+61
-30
lines changed

8 files changed

+61
-30
lines changed

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ kotlin.code.style=official
44

55
pluginGroup = spp.jetbrains
66
pluginName = Source++
7-
projectVersion=0.4.5
7+
projectVersion=0.4.6
88
pluginSinceBuild = 202.4357
99
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
1010
# See https://jb.gg/intellij-platform-builds-list for available build versions
11-
pluginVerifierIdeVersions = 2020.3.2, 2021.3.3
11+
pluginVerifierIdeVersions = 2020.2.4, 2021.3.3
1212

1313
platformType = IC
1414
ideVersion = 2021.3.3
@@ -22,7 +22,7 @@ platformPlugins = java, Groovy, Kotlin, PythonCore:213.5744.223, org.intellij.sc
2222
kotlin.stdlib.default.dependency = true
2323

2424
apolloVersion=3.2.0
25-
vertxVersion=4.2.4
25+
vertxVersion=4.2.6
2626
slf4jVersion=1.7.33
2727
jacksonVersion=2.13.1
2828
joorVersion=0.9.13

plugin/src/main/java/spp/jetbrains/sourcemarker/PluginUI.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package spp.jetbrains.sourcemarker;
22

3-
import com.intellij.DynamicBundle;
43
import com.intellij.ui.Gray;
54
import com.intellij.ui.JBColor;
65
import com.intellij.util.ui.UIUtil;
@@ -42,10 +41,10 @@ public class PluginUI {
4241
}
4342
}
4443

45-
public static final Font BIG_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_16 : ROBOTO_LIGHT_PLAIN_17;
46-
public static final Font SMALL_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_15 : ROBOTO_LIGHT_PLAIN_16;
47-
public static final Font SMALLER_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_14 : ROBOTO_LIGHT_PLAIN_15;
48-
public static final Font SMALLEST_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_13 : ROBOTO_LIGHT_PLAIN_14;
44+
public static final Font BIG_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_16 : ROBOTO_LIGHT_PLAIN_17;
45+
public static final Font SMALL_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_15 : ROBOTO_LIGHT_PLAIN_16;
46+
public static final Font SMALLER_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_14 : ROBOTO_LIGHT_PLAIN_15;
47+
public static final Font SMALLEST_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_13 : ROBOTO_LIGHT_PLAIN_14;
4948
public static final Color PANEL_BACKGROUND_COLOR = Gray._37;
5049
public static final Color LABEL_FOREGROUND_COLOR = new Color(152, 118, 170);
5150
public static final Color LABEL_FOREGROUND_COLOR1 = new Color(106, 135, 89);
@@ -69,6 +68,6 @@ public static String getCommandHighlightColor() {
6968
}
7069

7170
public static Color getEditCompleteColor() {
72-
return UIUtil.getWindowColor();//Color.decode("#2B2B2B");
71+
return UIUtil.getWindowColor();
7372
}
7473
}

plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.form

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<properties/>
3838
<border type="none"/>
3939
<children>
40-
<component id="b854b" class="javax.swing.JLabel">
40+
<component id="b854b" class="javax.swing.JLabel" binding="rootSourcePackageLabel">
4141
<constraints>
4242
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
4343
</constraints>
@@ -56,7 +56,7 @@
5656
</component>
5757
</children>
5858
</grid>
59-
<component id="77432" class="javax.swing.JCheckBox" binding="consoleCheckBox">
59+
<component id="77432" class="javax.swing.JCheckBox" binding="debugConsoleCheckBox">
6060
<constraints>
6161
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
6262
</constraints>
@@ -74,7 +74,7 @@
7474
<text resource-bundle="messages/PluginBundle" key="auto_resolve_endpoint_names"/>
7575
</properties>
7676
</component>
77-
<component id="27dfe" class="javax.swing.JCheckBox" binding="autoDisplayEndpointQuickStatCheckBox">
77+
<component id="27dfe" class="javax.swing.JCheckBox" binding="autoDisplayEndpointQuickStatsCheckBox">
7878
<constraints>
7979
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
8080
</constraints>
@@ -92,7 +92,7 @@
9292
<properties/>
9393
<border type="none"/>
9494
<children>
95-
<component id="57fd0" class="javax.swing.JLabel">
95+
<component id="57fd0" class="javax.swing.JLabel" binding="hostLabel">
9696
<constraints>
9797
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
9898
</constraints>
@@ -109,7 +109,7 @@
109109
</constraints>
110110
<properties/>
111111
</component>
112-
<component id="afa10" class="javax.swing.JLabel">
112+
<component id="afa10" class="javax.swing.JLabel" binding="accessTokenLabel">
113113
<constraints>
114114
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
115115
</constraints>
@@ -125,7 +125,7 @@
125125
</constraints>
126126
<properties/>
127127
</component>
128-
<component id="9bd2e" class="javax.swing.JLabel">
128+
<component id="9bd2e" class="javax.swing.JLabel" binding="certificatePinsLabel">
129129
<constraints>
130130
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
131131
</constraints>
@@ -141,7 +141,7 @@
141141
<border type="none"/>
142142
<children/>
143143
</grid>
144-
<component id="99c47" class="javax.swing.JLabel">
144+
<component id="99c47" class="javax.swing.JLabel" binding="serviceLabel">
145145
<constraints>
146146
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
147147
</constraints>

plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.java

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ public class PluginConfigurationPanel {
2929
private JPanel myGlobalSettingsPanel;
3030
private JTextField rootSourcePackageTextField;
3131
private JCheckBox autoResolveEndpointNamesCheckBox;
32-
private JCheckBox consoleCheckBox;
32+
private JCheckBox debugConsoleCheckBox;
3333
private JPanel myServiceSettingsPanel;
3434
private JTextField serviceHostTextField;
3535
private JTextField accessTokenTextField;
3636
private JPanel testPanel;
3737
private JComboBox serviceComboBox;
3838
private JCheckBox verifyHostCheckBox;
3939
private JLabel verifyHostLabel;
40-
private JCheckBox autoDisplayEndpointQuickStatCheckBox;
40+
private JCheckBox autoDisplayEndpointQuickStatsCheckBox;
41+
private JLabel hostLabel;
42+
private JLabel accessTokenLabel;
43+
private JLabel certificatePinsLabel;
44+
private JLabel serviceLabel;
45+
private JLabel rootSourcePackageLabel;
4146
private SourceMarkerConfig config;
4247
private CertificatePinPanel myCertificatePins;
4348

@@ -59,6 +64,17 @@ public PluginConfigurationPanel(SourceMarkerConfig config) {
5964
}
6065
});
6166
}
67+
68+
//todo: shouldn't need to manually update locale text
69+
hostLabel.setText(message("service_host"));
70+
accessTokenLabel.setText(message("access_token"));
71+
verifyHostLabel.setText(message("verify_host"));
72+
certificatePinsLabel.setText(message("certificate_pins"));
73+
serviceLabel.setText(message("service"));
74+
rootSourcePackageLabel.setText(message("root_source_package"));
75+
debugConsoleCheckBox.setText(message("debug_console"));
76+
autoResolveEndpointNamesCheckBox.setText(message("auto_resolve_endpoint_names"));
77+
autoDisplayEndpointQuickStatsCheckBox.setText(message("auto_display_endpoint_quick_stats"));
6278
}
6379

6480
public JComponent getContentPane() {
@@ -72,7 +88,7 @@ boolean isModified() {
7288
if (!Objects.equals(autoResolveEndpointNamesCheckBox.isSelected(), config.getAutoResolveEndpointNames())) {
7389
return true;
7490
}
75-
if (!Objects.equals(consoleCheckBox.isSelected(), config.getPluginConsoleEnabled())) {
91+
if (!Objects.equals(debugConsoleCheckBox.isSelected(), config.getPluginConsoleEnabled())) {
7692
return true;
7793
}
7894
if (!Objects.equals(serviceHostTextField.getText(), config.getServiceHost())) {
@@ -90,7 +106,7 @@ boolean isModified() {
90106
if (!Objects.equals(serviceComboBox.getSelectedItem(), config.getServiceName())) {
91107
return config.getServiceName() != null || serviceComboBox.getSelectedItem() != "All Services";
92108
}
93-
if (!Objects.equals(autoDisplayEndpointQuickStatCheckBox.isSelected(), config.getAutoDisplayEndpointQuickStats())) {
109+
if (!Objects.equals(autoDisplayEndpointQuickStatsCheckBox.isSelected(), config.getAutoDisplayEndpointQuickStats())) {
94110
return true;
95111
}
96112
return false;
@@ -106,26 +122,26 @@ public SourceMarkerConfig getPluginConfig() {
106122
Arrays.stream(rootSourcePackageTextField.getText().split(","))
107123
.map(String::trim).collect(Collectors.toList()),
108124
autoResolveEndpointNamesCheckBox.isSelected(),
109-
true, consoleCheckBox.isSelected(),
125+
true, debugConsoleCheckBox.isSelected(),
110126
serviceHostTextField.getText(),
111127
accessTokenTextField.getText(),
112128
new ArrayList<>(Collections.list(myCertificatePins.listModel.elements())),
113129
null,
114130
verifyHostCheckBox.isSelected(),
115131
currentService,
116-
autoDisplayEndpointQuickStatCheckBox.isSelected()
132+
autoDisplayEndpointQuickStatsCheckBox.isSelected()
117133
);
118134
}
119135

120136
public void applySourceMarkerConfig(SourceMarkerConfig config) {
121137
this.config = config;
122138
rootSourcePackageTextField.setText(String.join(",", config.getRootSourcePackages()));
123139
autoResolveEndpointNamesCheckBox.setSelected(config.getAutoResolveEndpointNames());
124-
consoleCheckBox.setSelected(config.getPluginConsoleEnabled());
140+
debugConsoleCheckBox.setSelected(config.getPluginConsoleEnabled());
125141
serviceHostTextField.setText(config.getServiceHost());
126142
accessTokenTextField.setText(config.getAccessToken());
127143
verifyHostCheckBox.setSelected(config.getVerifyHost());
128-
autoDisplayEndpointQuickStatCheckBox.setSelected(config.getAutoDisplayEndpointQuickStats());
144+
autoDisplayEndpointQuickStatsCheckBox.setSelected(config.getAutoDisplayEndpointQuickStats());
129145

130146
myCertificatePins = new CertificatePinPanel();
131147
myCertificatePins.listModel.addAll(config.getCertificatePins());

plugin/src/main/kotlin/spp/jetbrains/sourcemarker/PluginBundle.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
package spp.jetbrains.sourcemarker
1919

2020
import com.intellij.AbstractBundle
21-
import com.intellij.DynamicBundle
21+
import com.intellij.ide.plugins.PluginManager
22+
import com.intellij.openapi.extensions.PluginId
2223
import org.jetbrains.annotations.NonNls
2324
import org.jetbrains.annotations.PropertyKey
2425
import java.util.*
@@ -34,9 +35,18 @@ private const val BUNDLE = "messages.PluginBundle"
3435
*/
3536
object PluginBundle : AbstractBundle(BUNDLE) {
3637

38+
val LOCALE: Locale by lazy {
39+
val chineseLanguagePlugin = "com.intellij.zh"
40+
if (PluginManager.isPluginInstalled(PluginId.getId(chineseLanguagePlugin))) {
41+
Locale.CHINA
42+
} else {
43+
Locale.ROOT
44+
}
45+
}
46+
3747
//todo: shouldn't need to manually load bundle.
3848
val LOCALE_BUNDLE: ResourceBundle by lazy {
39-
ResourceBundle.getBundle(BUNDLE, DynamicBundle.getLocale(), PluginBundle::class.java.classLoader)
49+
ResourceBundle.getBundle(BUNDLE, LOCALE, PluginBundle::class.java.classLoader)
4050
}
4151

4252
@Suppress("SpreadOperator")

plugin/src/main/kotlin/spp/jetbrains/sourcemarker/view/ActivityQuickStatsIndicator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
package spp.jetbrains.sourcemarker.view
1919

20-
import com.intellij.DynamicBundle
2120
import com.intellij.openapi.application.ApplicationManager
2221
import com.intellij.ui.JBColor
2322
import io.vertx.core.json.Json
@@ -42,6 +41,7 @@ import spp.jetbrains.monitor.skywalking.bridge.EndpointMetricsBridge
4241
import spp.jetbrains.monitor.skywalking.model.GetEndpointMetrics
4342
import spp.jetbrains.monitor.skywalking.model.ZonedDuration
4443
import spp.jetbrains.monitor.skywalking.toProtocol
44+
import spp.jetbrains.sourcemarker.PluginBundle
4545
import spp.jetbrains.sourcemarker.PluginBundle.message
4646
import spp.jetbrains.sourcemarker.PluginUI
4747
import spp.jetbrains.sourcemarker.SourceMarkerPlugin.vertx
@@ -123,7 +123,7 @@ class ActivityQuickStatsIndicator(val config: SourceMarkerConfig) : SourceMarkEv
123123
inlay.putUserData(SHOWING_QUICK_STATS, true)
124124
inlay.configuration.virtualText = InlayMarkVirtualText(inlay, formatMetricResult(metricResult))
125125
inlay.configuration.virtualText!!.textAttributes.foregroundColor = inlayForegroundColor
126-
if (DynamicBundle.getLocale().language == "zh") {
126+
if (PluginBundle.LOCALE.language == "zh") {
127127
inlay.configuration.virtualText!!.font = PluginUI.MICROSOFT_YAHEI_PLAIN_14
128128
inlay.configuration.virtualText!!.xOffset = 15
129129
}

plugin/src/main/resources/messages/PluginBundle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,7 @@ type=Type
138138
count=Count
139139
operation_name=Operation Name
140140
sec_letter=s
141-
day=Day
141+
day=Day
142+
verify_host=Verify Host
143+
certificate_pins=Certificate Pins
144+
service=Service

plugin/src/main/resources/messages/PluginBundle_zh.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,7 @@ type=类
137137
count=
138138
operation_name=操作名称
139139
sec_letter=
140-
day=
140+
day=
141+
verify_host=验证主机
142+
certificate_pins=证书别针
143+
service=营运

0 commit comments

Comments
 (0)