本文整理汇总了Java中com.intellij.openapi.actionSystem.Presentation.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Presentation.setDescription方法的具体用法?Java Presentation.setDescription怎么用?Java Presentation.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.actionSystem.Presentation
的用法示例。
在下文中一共展示了Presentation.setDescription方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
public void update(@NotNull AnActionEvent e) {
Presentation presentation = e.getPresentation();
OpenInBrowserRequest result = BaseOpenInBrowserAction.doUpdate(e);
if (result == null) {
return;
}
String description = getTemplatePresentation().getDescription();
if (HtmlUtil.isHtmlFile(result.getFile())) {
description += " (hold Shift to open URL of local file)";
}
presentation.setText(getTemplatePresentation().getText());
presentation.setDescription(description);
WebBrowser browser = findUsingBrowser();
if (browser != null) {
presentation.setIcon(browser.getIcon());
}
if (ActionPlaces.isPopupPlace(e.getPlace())) {
presentation.setVisible(presentation.isEnabled());
}
}
示例2: updateOnTextChange
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
protected void updateOnTextChange(final String text, final Presentation presentation) {
try {
Pattern pattern = Pattern.compile(text);
presentation.putClientProperty(TEXT_FIELD_BACKGROUND, null);
} catch (IllegalArgumentException | IndexOutOfBoundsException e) {
presentation.setDescription(e.getMessage());
presentation.putClientProperty(TEXT_FIELD_BACKGROUND, BackgroundColor.of(Utils.errorColor(UIUtil.getTextFieldBackground())));
}
}
示例3: update
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
public void update(final AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
final Presentation presentation = e.getPresentation();
presentation.setVisible(project != null);
presentation.setEnabled(project != null);
presentation.setDescription(SvnBundle.message("action.show.svn.map.description"));
presentation.setIcon(SvnIcons.ShowWorkingCopies);
}
示例4: ActivityMenuAction
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
public ActivityMenuAction(RenderContext renderContext) {
myRenderContext = renderContext;
Presentation presentation = getTemplatePresentation();
presentation.setIcon(AndroidIcons.Activity);
presentation.setDescription("Associate with Activity...");
updatePresentation(presentation);
}
示例5: updatePresentation
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
private void updatePresentation(Presentation presentation) {
Configuration configuration = myRenderContext.getConfiguration();
boolean visible = configuration != null;
if (visible) {
String brief = getThemeLabel(configuration.getTheme(), true);
presentation.setText(brief, false);
presentation.setDescription(getThemeLabel(configuration.getTheme(), false));
}
if (visible != presentation.isVisible()) {
presentation.setVisible(visible);
}
}
示例6: LayoutAction
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
protected LayoutAction(@NotNull DesignerEditorPanel designer, @NotNull String description, @Nullable String label, @Nullable Icon icon) {
myDesigner = designer;
Presentation presentation = getTemplatePresentation();
presentation.setDescription(description);
if (label != null) {
presentation.setText(label);
}
if (icon != null) {
presentation.setIcon(icon);
}
}
示例7: updatePresentation
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
protected void updatePresentation(@NotNull Presentation presentation, @Nullable DeploymentNode node) {
if (node != null && node.isDeployed()) {
presentation.setText("Redeploy");
presentation.setDescription("Redeploy '" + node.getDeploymentName() + "'");
}
else {
presentation.setText(getTemplatePresentation().getText());
presentation.setDescription(getTemplatePresentation().getDescription());
}
}
示例8: CloseTabToolbarAction
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
public CloseTabToolbarAction() {
copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_CLOSE_ACTIVE_TAB));
Presentation presentation = getTemplatePresentation();
presentation.setIcon(AllIcons.Actions.Cancel);
presentation.setText(CommonBundle.getCloseButtonText());
presentation.setDescription(null);
}
示例9: update
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
public void update(final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
presentation.setIcon(SvnIcons.ShowIntegratedFrom);
presentation.setText(SvnBundle.message("committed.changes.action.enable.merge.highlighting"));
presentation.setDescription(SvnBundle.message("committed.changes.action.enable.merge.highlighting.description.text"));
}
示例10: EditMultipleSourcesAction
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
public EditMultipleSourcesAction() {
Presentation presentation = getTemplatePresentation();
presentation.setText(ActionsBundle.actionText("EditSource"));
presentation.setIcon(AllIcons.Actions.EditSource);
presentation.setDescription(ActionsBundle.actionDescription("EditSource"));
// TODO shortcuts
// setShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE).getShortcutSet());
}
示例11: ShowExpert
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
public ShowExpert(RadPropertyTable table) {
myTable = table;
Presentation presentation = getTemplatePresentation();
String text = DesignerBundle.message("designer.properties.show.expert");
presentation.setText(text);
presentation.setDescription(text);
presentation.setIcon(AllIcons.General.Filter);
}
示例12: ShowColumns
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
public ShowColumns(RadPropertyTable table) {
myTable = table;
Presentation presentation = getTemplatePresentation();
String text = DesignerBundle.message("designer.properties.show.columns");
presentation.setText(text);
presentation.setDescription(text);
}
示例13: AbstractGravityAction
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
public AbstractGravityAction(DesignerEditorPanel designer, List<? extends RadViewComponent> components) {
myDesigner = designer;
myComponents = components;
Presentation presentation = getTemplatePresentation();
presentation.setDescription("Gravity");
presentation.setIcon(Gravity.ICON);
}
示例14: TargetMenuAction
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
public TargetMenuAction(RenderContext renderContext) {
myRenderContext = renderContext;
Presentation presentation = getTemplatePresentation();
presentation.setDescription("Android version to use when rendering layouts in the IDE");
presentation.setIcon(AndroidIcons.Targets);
updatePresentation(presentation);
}
示例15: update
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent event) {
Presentation p = event.getPresentation();
if (TestFinderHelper.getFinders().length == 0) {
p.setVisible(false);
return;
}
p.setEnabled(false);
Project project = event.getData(CommonDataKeys.PROJECT);
Editor editor = event.getData(CommonDataKeys.EDITOR);
if (editor == null || project == null) return;
PsiFile psiFile = PsiUtilBase.getPsiFileInEditor(editor, project);
if (psiFile == null) return;
PsiElement element = GotoTestOrCodeHandler.getSelectedElement(editor, psiFile);
if (TestFinderHelper.findSourceElement(element) == null) return;
p.setEnabled(true);
if (TestFinderHelper.isTest(element)) {
p.setText(ActionsBundle.message("action.GotoTestSubject.text"));
p.setDescription(ActionsBundle.message("action.GotoTestSubject.description"));
} else {
p.setText(ActionsBundle.message("action.GotoTest.text"));
p.setDescription(ActionsBundle.message("action.GotoTest.description"));
}
}