mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-211630 IDEA UI Guidelines: "Action" text capitalization: AnAction/ActionGroup
GitOrigin-RevId: 274bf502ce44a07ac653031589dd70aa70662449
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0d22ff54d4
commit
6da7e42c26
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2019 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.
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.actionSystem;
|
||||
|
||||
import com.intellij.util.ReflectionUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -69,12 +70,14 @@ public abstract class ActionGroup extends AnAction {
|
||||
* @param popup {@code true} if this group is a popup, {@code false}
|
||||
* otherwise
|
||||
*/
|
||||
public ActionGroup(String shortName, boolean popup){
|
||||
public ActionGroup(@Nls(capitalization = Nls.Capitalization.Title) String shortName, boolean popup){
|
||||
super(shortName);
|
||||
setPopup(popup);
|
||||
}
|
||||
|
||||
public ActionGroup(String text, String description, Icon icon) {
|
||||
public ActionGroup(@Nls(capitalization = Nls.Capitalization.Title) String text,
|
||||
@Nls(capitalization = Nls.Capitalization.Sentence) String description,
|
||||
Icon icon) {
|
||||
super(text, description, icon);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 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-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.
|
||||
package com.intellij.openapi.actionSystem;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -10,6 +10,7 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.intellij.lang.annotations.JdkConstants;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -88,7 +89,7 @@ public abstract class AnAction implements PossiblyDumbAware {
|
||||
* @param text Serves as a tooltip when the presentation is a button and the name of the
|
||||
* menu item when the presentation is a menu item.
|
||||
*/
|
||||
public AnAction(@Nullable String text){
|
||||
public AnAction(@Nullable @Nls(capitalization = Nls.Capitalization.Title) String text){
|
||||
this(text, null, null);
|
||||
}
|
||||
|
||||
@@ -103,7 +104,9 @@ public abstract class AnAction implements PossiblyDumbAware {
|
||||
*
|
||||
* @param icon Action's icon
|
||||
*/
|
||||
public AnAction(@Nullable String text, @Nullable String description, @Nullable Icon icon) {
|
||||
public AnAction(@Nullable @Nls(capitalization = Nls.Capitalization.Title) String text,
|
||||
@Nullable @Nls(capitalization = Nls.Capitalization.Sentence) String description,
|
||||
@Nullable Icon icon) {
|
||||
Presentation presentation = getTemplatePresentation();
|
||||
presentation.setText(text);
|
||||
presentation.setDescription(description);
|
||||
@@ -350,6 +353,7 @@ public abstract class AnAction implements PossiblyDumbAware {
|
||||
* @return action presentable text without private user data
|
||||
*/
|
||||
@Nullable
|
||||
@Nls(capitalization = Nls.Capitalization.Title)
|
||||
public String getTemplateText() {
|
||||
return getTemplatePresentation().getText();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user