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


Java Presentation.setIcon方法代碼示例

本文整理匯總了Java中com.intellij.openapi.actionSystem.Presentation.setIcon方法的典型用法代碼示例。如果您正苦於以下問題:Java Presentation.setIcon方法的具體用法?Java Presentation.setIcon怎麽用?Java Presentation.setIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.actionSystem.Presentation的用法示例。


在下文中一共展示了Presentation.setIcon方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public void update(AnActionEvent event)
{
    super.update(event);

    if (event.getProject() == null) {
        event.getPresentation().setEnabled(false);
        return;
    }

    RemoteHost remoteHost = this.container().preferences(event.getProject()).getRemoteHost();

    Presentation presentation = event.getPresentation();

    presentation.setText(this.displayName(remoteHost));
    presentation.setIcon(remoteHost.icon());

    presentation.setEnabledAndVisible(this.shouldActionBeEnabled(event));
}
 
開發者ID:ben-gibson,項目名稱:GitLink,代碼行數:19,代碼來源:Action.java

示例2: SwitchVersionAction

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
/**
 * Creates the action with its text, description and icon.
 *
 * @param tree             LivingDoc repository tree.
 * @param toWorkingVersion true for current/working version. False otherwise.
 */
public SwitchVersionAction(final SimpleTree tree, final boolean toWorkingVersion) {

    super();

    this.repositoryTree = tree;
    this.toCurrentVersion = toWorkingVersion;

    String text;
    Icon icon;

    if (toCurrentVersion) {
        text = I18nSupport.getValue("toolwindows.action.working.tooltip");
        icon = AllIcons.Actions.NewFolder;

    } else {
        text = I18nSupport.getValue("toolwindows.action.implemented.tooltip");
        icon = AllIcons.Actions.Module;
    }
    Presentation presentation = getTemplatePresentation();
    presentation.setText(text);
    presentation.setDescription(text);
    presentation.setIcon(icon);
}
 
開發者ID:testIT-LivingDoc,項目名稱:livingdoc-intellij,代碼行數:30,代碼來源:SwitchVersionAction.java

示例3: actionPerformed

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public synchronized void actionPerformed(AnActionEvent anActionEvent) {
  boolean newState = !allSelected;
  for (int i = 0; i < tableModel.enabled.length; i++) {
    table.setValueAt(newState, i, 0);
  }
  allSelected = newState;
  Presentation presentation = anActionEvent.getPresentation();
  if (allSelected) {
    presentation.setText("Deselect All");
    presentation.setIcon(AllIcons.Actions.Unselectall);
  } else {
    presentation.setText("Select All");
    presentation.setIcon(AllIcons.Actions.Selectall);
  }
  tableModel.fireTableDataChanged();
  table.revalidate();
  table.repaint();
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:20,代碼來源:ExportRunConfigurationDialog.java

示例4: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public void update(final AnActionEvent e) {
  final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  final Presentation presentation = e.getPresentation();

  if (project == null) {
    presentation.setEnabled(false);
    presentation.setVisible(false);
    return;
  }

  presentation.setText(SvnBundle.message("configure.branches.item"));
  presentation.setDescription(SvnBundle.message("configure.branches.item"));
  presentation.setIcon(SvnIcons.ConfigureBranches);

  presentation.setVisible(true);
  
  final ChangeList[] cls = e.getData(VcsDataKeys.CHANGE_LISTS);
  presentation.setEnabled((cls != null) && (cls.length > 0) &&
                          (SvnVcs.getInstance(project).getName().equals(((CommittedChangeList) cls[0]).getVcs().getName())) &&
                          (((SvnChangeList) cls[0]).getRoot() != null));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:ConfigureBranchesAction.java

示例5: getPresentation

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@NotNull
public final Presentation getPresentation(@NotNull AnAction action){
  Presentation presentation = myAction2Presentation.get(action);
  if (presentation == null || !action.isDefaultIcon()){
    Presentation templatePresentation = action.getTemplatePresentation();
    if (presentation == null) {
      presentation = templatePresentation.clone();
      myAction2Presentation.put(action, presentation);
    }
    if (!action.isDefaultIcon()) {
      presentation.setIcon(templatePresentation.getIcon());
      presentation.setDisabledIcon(templatePresentation.getDisabledIcon());
    }
    processPresentation(presentation);
  }
  return presentation;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:PresentationFactory.java

示例6: updatePresentation

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
private void updatePresentation(Presentation presentation) {
  Configuration configuration = myRenderContext.getConfiguration();
  boolean visible = configuration != null;
  if (visible) {
    // TEMPORARY WORKAROUND:
    // We don't properly sync the project locale to layouts yet, so in the mean time
    // show the actual locale being used rather than the intended locale, so as not
    // to be totally confusing:
    //Locale locale = configuration.isLocaleSpecificLayout()
    //                ? configuration.getLocale() : configuration.getConfigurationManager().getLocale();
    Locale locale = configuration.getLocale();
    if (locale == Locale.ANY) {
      presentation.setIcon(AndroidIcons.Globe);
    } else {
      presentation.setIcon(locale.getFlagImage());
    }
    String brief = getLocaleLabel(locale, true);
    presentation.setText(brief);
  } else {
    presentation.setIcon(AndroidIcons.Globe);
  }
  if (visible != presentation.isVisible()) {
    presentation.setVisible(visible);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:LocaleMenuAction.java

示例7: 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

示例8: PreviewAction

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public PreviewAction(@NotNull RenderContext renderContext, @NotNull String title, int action,
                     @Nullable RenderPreviewMode mode, boolean enabled) {
  super(title, null, null);
  myRenderContext = renderContext;
  myAction = action;
  myMode = mode;

  if (mode != null && mode == RenderPreviewMode.getCurrent()) {
    // Select
    Presentation templatePresentation = getTemplatePresentation();
    templatePresentation.setIcon(AllIcons.Actions.Checked);
    templatePresentation.setEnabled(false);
  }

  if (!enabled) {
    getTemplatePresentation().setEnabled(false);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:ConfigurationMenuAction.java

示例9: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public void update(final AnActionEvent e) {
  final Presentation presentation = e.getPresentation();
  CaptionSelection selection = CaptionSelection.DATA_KEY.getData(e.getDataContext());
  if (selection == null) {
    presentation.setEnabled(false);
  }
  else {
    presentation.setEnabled(selection.getContainer() != null && selection.getFocusedIndex() >= 0);
    if (!selection.isRow()) {
      presentation.setText(myColumnText);
      if (myColumnIcon != null) {
        presentation.setIcon(myColumnIcon);
      }
    }
    else {
      presentation.setText(myRowText);
      if (myRowIcon != null) {
        presentation.setIcon(myRowIcon);
      }
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:RowColumnAction.java

示例10: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public static void update(@NotNull Presentation presentation,
                          @NotNull Presentation templatePresentation,
                          @Nullable ProcessHandler processHandler) {
  boolean enable = false;
  Icon icon = templatePresentation.getIcon();
  String description = templatePresentation.getDescription();
  if (processHandler != null && !processHandler.isProcessTerminated()) {
    enable = true;
    if (processHandler.isProcessTerminating() && processHandler instanceof KillableProcess) {
      KillableProcess killableProcess = (KillableProcess) processHandler;
      if (killableProcess.canKillProcess()) {
        // 'force quite' action presentation
        icon = AllIcons.Debugger.KillProcess;
        description = "Kill process";
      }
    }
  }
  presentation.setEnabled(enable);
  presentation.setIcon(icon);
  presentation.setDescription(description);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:StopProcessAction.java

示例11: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent event) {
    final Project project = event.getData(PlatformDataKeys.PROJECT);
    final Presentation presentation = event.getPresentation();
    if (project == null) {
        presentation.setVisible(false);
        return;
    }
    presentation.setIcon(HybrisIcons.HYBRIS_ICON);
    presentation.setVisible(CommonIdeaService.getInstance().isHybrisProject(project));
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:12,代碼來源:ProjectRefreshAction.java

示例12: showPresention

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public void showPresention(Presentation presentation,boolean show){
    if(show){
        presentation.setIcon(AllIcons.General.InspectionsOK);
    }else{
        presentation.setIcon(null);
    }
}
 
開發者ID:quietUncle,項目名稱:vartrans,代碼行數:8,代碼來源:BaseConfigAction.java

示例13: SwitchToVariationAction

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public SwitchToVariationAction(String title, @NotNull Project project, VirtualFile file, boolean select) {
  super(title, null, null);
  myFile = file;
  myProject = project;
  if (select) {
    Presentation templatePresentation = getTemplatePresentation();
    templatePresentation.setIcon(AllIcons.Actions.Checked);
    templatePresentation.setEnabled(false);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:ConfigurationMenuAction.java

示例14: updateForBlazeProject

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
protected void updateForBlazeProject(Project project, AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  if (isEnabled(event)) {
    String text = String.format("New %s Package", Blaze.buildSystemName(project));
    presentation.setEnabledAndVisible(true);
    presentation.setText(text);
    presentation.setDescription(text);
    presentation.setIcon(PlatformIcons.PACKAGE_ICON);
  } else {
    presentation.setEnabledAndVisible(false);
  }
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:14,代碼來源:NewBlazePackageAction.java

示例15: 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


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