當前位置: 首頁>>代碼示例>>Java>>正文


Java Presentation.setDescription方法代碼示例

本文整理匯總了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());
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:OpenFileInDefaultBrowserAction.java

示例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())));
    }
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:11,代碼來源:PatternAction.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ShowSvnMapAction.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:ActivityMenuAction.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ThemeMenuAction.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:LayoutAction.java

示例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());
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:DeployAction.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:CloseTabToolbarAction.java

示例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"));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:ShowHideMergePanelAction.java

示例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());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:EditMultipleSourcesAction.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:ShowExpert.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:ShowColumns.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:AbstractGravityAction.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:TargetMenuAction.java

示例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"));
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:GotoTestOrCodeAction.java


注:本文中的com.intellij.openapi.actionSystem.Presentation.setDescription方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。