Some more i18n and @NonNls for platform-impl

GitOrigin-RevId: 59fe19a97c532e7b0f4b443998e725c9266a2b91
This commit is contained in:
Dmitry Jemerov
2020-08-06 12:47:44 +02:00
committed by intellij-monorepo-bot
parent 4bdc61ba16
commit 4b75ccd3a0
12 changed files with 36 additions and 26 deletions

View File

@@ -25,6 +25,9 @@
<val name="flagsFromClass" val="java.awt.event.InputEvent.class" /> <val name="flagsFromClass" val="java.awt.event.InputEvent.class" />
</annotation> </annotation>
</item> </item>
<item name='java.awt.AWTPermission AWTPermission(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NonNls'/>
</item>
<item name="java.awt.BasicStroke BasicStroke(float, int, int) 1"> <item name="java.awt.BasicStroke BasicStroke(float, int, int) 1">
<annotation name="org.intellij.lang.annotations.MagicConstant"> <annotation name="org.intellij.lang.annotations.MagicConstant">
<val name="intValues" val="{java.awt.BasicStroke.CAP_BUTT, java.awt.BasicStroke.CAP_ROUND, java.awt.BasicStroke.CAP_SQUARE}" /> <val name="intValues" val="{java.awt.BasicStroke.CAP_BUTT, java.awt.BasicStroke.CAP_ROUND, java.awt.BasicStroke.CAP_SQUARE}" />

View File

@@ -402,6 +402,9 @@
</annotation> </annotation>
<annotation name='org.jetbrains.annotations.NotNull'/> <annotation name='org.jetbrains.annotations.NotNull'/>
</item> </item>
<item name='java.lang.Class java.net.URL getResource(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NonNls'/>
</item>
<item name='java.lang.ClassLoader java.io.InputStream getResourceAsStream(java.lang.String)'> <item name='java.lang.ClassLoader java.io.InputStream getResourceAsStream(java.lang.String)'>
<annotation name='org.jetbrains.annotations.Nullable'/> <annotation name='org.jetbrains.annotations.Nullable'/>
</item> </item>

View File

@@ -0,0 +1,5 @@
<root>
<item name='org.w3c.dom.Document org.w3c.dom.NodeList getElementsByTagName(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NonNls'/>
</item>
</root>

View File

@@ -2278,3 +2278,6 @@ more.shortcuts.link.text.with.count={0} more
macos.shortcut.conflict.many={0} and {1} shortcuts conflict with the macOS system shortcuts. macos.shortcut.conflict.many={0} and {1} shortcuts conflict with the macOS system shortcuts.
macos.shortcut.conflict.few={0} shortcuts conflict with the macOS system shortcuts. macos.shortcut.conflict.few={0} shortcuts conflict with the macOS system shortcuts.
assign.custom.shortcuts.or.change.the.macos.system.settings=Assign custom shortcuts or change the macOS system settings. assign.custom.shortcuts.or.change.the.macos.system.settings=Assign custom shortcuts or change the macOS system settings.
link.install.required.plugins=Install required plugins
link.enable.required.plugins=Enable required plugins
link.enable.required.plugin=Enable {0}

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* 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.concurrency; package com.intellij.concurrency;
import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationManager;
@@ -23,6 +9,7 @@ import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.progress.ProgressManager;
import com.intellij.util.Processor; import com.intellij.util.Processor;
import com.intellij.util.concurrency.AtomicFieldUpdater; import com.intellij.util.concurrency.AtomicFieldUpdater;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -249,6 +236,7 @@ class ApplierCompleter<T> extends CountedCompleter<Void> {
} }
@Override @Override
@NonNls
public String toString() { public String toString() {
return "("+lo+"-"+hi+")"+(getCompleter() == null ? "" : " parent: "+getCompleter()); return "("+lo+"-"+hi+")"+(getCompleter() == null ? "" : " parent: "+getCompleter());
} }

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.externalDependencies.impl; package com.intellij.externalDependencies.impl;
import com.intellij.externalDependencies.DependencyOnPlugin; import com.intellij.externalDependencies.DependencyOnPlugin;
@@ -16,6 +16,8 @@ import com.intellij.openapi.startup.StartupActivity;
import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.PluginsAdvertiser; import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.PluginsAdvertiser;
import com.intellij.openapi.util.BuildNumber; import com.intellij.openapi.util.BuildNumber;
import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.HtmlBuilder;
import com.intellij.openapi.util.text.HtmlChunk;
import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.text.VersionComparatorUtil; import com.intellij.util.text.VersionComparatorUtil;
import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.Nls;
@@ -118,11 +120,12 @@ final class CheckRequiredPluginsActivity implements StartupActivity {
if (!errorMessages.isEmpty()) { if (!errorMessages.isEmpty()) {
if (!disabled.isEmpty() && notInstalled.isEmpty()) { if (!disabled.isEmpty() && notInstalled.isEmpty()) {
String plugins = disabled.size() == 1 ? disabled.get(0).getName() : "required plugins"; errorMessages.add(HtmlChunk.link("enable", disabled.size() == 1
errorMessages.add("<a href=\"enable\">Enable " + plugins + "</a>"); ? IdeBundle.message("link.enable.required.plugin", disabled.get(0).getName())
: IdeBundle.message("link.enable.required.plugins")).toString());
} }
else if (!disabled.isEmpty() || !notInstalled.isEmpty()) { else if (!disabled.isEmpty() || !notInstalled.isEmpty()) {
errorMessages.add("<a href=\"install\">Install required plugins</a>"); errorMessages.add(HtmlChunk.link("install", IdeBundle.message("link.install.required.plugins")).toString());
} }
NOTIFICATION_GROUP NOTIFICATION_GROUP
.createNotification(IdeBundle.message("notification.title.required.plugins.weren.t.loaded"), StringUtil.join(errorMessages, "<br>"), NotificationType.ERROR, .createNotification(IdeBundle.message("notification.title.required.plugins.weren.t.loaded"), StringUtil.join(errorMessages, "<br>"), NotificationType.ERROR,

View File

@@ -1342,6 +1342,7 @@ public class CaretImpl extends UserDataHolderBase implements Caret, Dumpable {
} }
@Override @Override
@NonNls
public String toString() { public String toString() {
return "Caret at " + (myDocumentUpdateCounter == myCaretModel.myDocumentUpdateCounter ? myVisibleCaret : getOffset()) + return "Caret at " + (myDocumentUpdateCounter == myCaretModel.myDocumentUpdateCounter ? myVisibleCaret : getOffset()) +
(mySelectionMarker == null ? "" : ", selection marker: " + mySelectionMarker); (mySelectionMarker == null ? "" : ", selection marker: " + mySelectionMarker);

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.wm.impl.customFrameDecorations.style package com.intellij.openapi.wm.impl.customFrameDecorations.style
import org.jetbrains.annotations.NonNls
import java.awt.MouseInfo import java.awt.MouseInfo
import java.awt.event.MouseAdapter import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent import java.awt.event.MouseEvent
@@ -12,7 +13,7 @@ import javax.swing.SwingUtilities
class ComponentStyle<T : JComponent>private constructor(private val default: Properties, private val styleMap: Map<ComponentStyleState, Properties>) { class ComponentStyle<T : JComponent>private constructor(private val default: Properties, private val styleMap: Map<ComponentStyleState, Properties>) {
companion object { companion object {
const val ENABLED_PROPERTY = "enabled" @NonNls const val ENABLED_PROPERTY = "enabled"
} }
internal fun applyStyle(component: T) { internal fun applyStyle(component: T) {

View File

@@ -18,6 +18,7 @@ import com.intellij.ui.JBColor;
import com.intellij.ui.LightColors; import com.intellij.ui.LightColors;
import com.intellij.util.ui.CenteredIcon; import com.intellij.util.ui.CenteredIcon;
import com.intellij.util.ui.GraphicsUtil; import com.intellij.util.ui.GraphicsUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.swing.*; import javax.swing.*;
@@ -38,7 +39,7 @@ public class CardActionsPanel extends JPanel {
createCardForGroup(rootGroup, "root", null); createCardForGroup(rootGroup, "root", null);
} }
private void createCardForGroup(ActionGroup group, String cardId, final String parentId) { private void createCardForGroup(ActionGroup group, @NonNls String cardId, final String parentId) {
JPanel card = new JPanel(new BorderLayout()); JPanel card = new JPanel(new BorderLayout());
if (!USE_ICONS) { if (!USE_ICONS) {
card.setOpaque(false); card.setOpaque(false);

View File

@@ -1,6 +1,8 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.diagnostic package com.intellij.diagnostic
import org.jetbrains.annotations.NonNls
inline fun <T> Activity?.runChild(name: String, task: () -> T): T { inline fun <T> Activity?.runChild(name: String, task: () -> T): T {
val activity = this?.startChild(name) val activity = this?.startChild(name)
val result = task() val result = task()
@@ -10,7 +12,7 @@ inline fun <T> Activity?.runChild(name: String, task: () -> T): T {
inline fun <T> runMainActivity(name: String, task: () -> T) = runActivity(name, ActivityCategory.MAIN, task) inline fun <T> runMainActivity(name: String, task: () -> T) = runActivity(name, ActivityCategory.MAIN, task)
inline fun <T> runActivity(name: String, category: ActivityCategory = ActivityCategory.APP_INIT, task: () -> T): T { inline fun <T> runActivity(@NonNls name: String, category: ActivityCategory = ActivityCategory.APP_INIT, task: () -> T): T {
val activity = createActivity(name, category) val activity = createActivity(name, category)
val result = task() val result = task()
activity.end() activity.end()

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.diagnostic; package com.intellij.openapi.diagnostic;
import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.io.FileUtil;
@@ -29,7 +29,7 @@ public class Attachment {
myIncluded = true; myIncluded = true;
} }
public Attachment(@NotNull String path, @NotNull String content) { public Attachment(@NotNull @NonNls String path, @NotNull String content) {
this(path, content, content.getBytes(StandardCharsets.UTF_8), null); this(path, content, content.getBytes(StandardCharsets.UTF_8), null);
} }

View File

@@ -1310,7 +1310,7 @@ public class FileUtil extends FileUtilRt {
} }
@NotNull @NotNull
public static File createTempFile(@NotNull String prefix, @Nullable String suffix, boolean deleteOnExit) public static File createTempFile(@NotNull @NonNls String prefix, @Nullable @NonNls String suffix, boolean deleteOnExit)
throws IOException { throws IOException {
return FileUtilRt.createTempFile(prefix, suffix, deleteOnExit); return FileUtilRt.createTempFile(prefix, suffix, deleteOnExit);
} }