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


Java Presentation.setVisible方法代碼示例

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


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

示例1: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
  Presentation presentation = e.getPresentation();
  presentation.setEnabledAndVisible(false);
  Project project = e.getProject();
  if (project == null) {
    return;
  }
  Course course = StudyTaskManager.getInstance(project).getCourse();
  if (course == null) {
    return;
  }

  if (!EduNames.STUDY.equals(course.getCourseMode())) {
    presentation.setVisible(true);
    return;
  }

  if (getAnswerPlaceholder(e) == null) {
    presentation.setEnabledAndVisible(false);
    return;
  }
  presentation.setEnabledAndVisible(true);
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:25,代碼來源:StudyRefreshAnswerPlaceholder.java

示例2: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
  StudyUtils.updateAction(e);
  final Project project = e.getProject();
  if (project != null) {

    Course course = StudyTaskManager.getInstance(project).getCourse();
    Presentation presentation = e.getPresentation();
    if (course != null && !EduNames.STUDY.equals(course.getCourseMode())) {
      presentation.setEnabled(false);
      presentation.setVisible(true);
      return;
    }
    StudyEditor studyEditor = StudyUtils.getSelectedStudyEditor(project);
    StudyState studyState = new StudyState(studyEditor);
    if (!studyState.isValid()) {
      presentation.setEnabledAndVisible(false);
      return;
    }
    TaskFile taskFile = studyState.getTaskFile();
    if (taskFile.getActivePlaceholders().isEmpty()) {
      presentation.setEnabledAndVisible(false);
    }
  }
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:26,代碼來源:StudyFillPlaceholdersAction.java

示例3: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
    super.update(e);
    final Presentation presentation = e.getPresentation();
    if(presentation.isEnabled()) {
        final IdeView view = e.getData(LangDataKeys.IDE_VIEW);
        final Project project = e.getProject();
        if (view != null && project != null) {
            ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
            PsiDirectory[] dirs = view.getDirectories();
            for (PsiDirectory dir : dirs) {
                if (projectFileIndex.isUnderSourceRootOfType(dir.getVirtualFile(), JavaModuleSourceRootTypes.SOURCES) &&
                        JavaDirectoryService.getInstance().getPackage(dir) != null && isValidForClass(project,dir)) {
                    return;
                }
            }
        }
        presentation.setEnabled(false);
        presentation.setVisible(false);
    }
}
 
開發者ID:wangtotang,項目名稱:DaggerHelper,代碼行數:22,代碼來源:BaseAction.java

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

示例5: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(final AnActionEvent e) {
  Presentation p = e.getPresentation();
  p.setVisible(SystemInfo.isMac);

  if (SystemInfo.isMac) {
    Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
    if (project != null) {
      JFrame frame = WindowManager.getInstance().getFrame(project);
      if (frame != null) {
        JRootPane pane = frame.getRootPane();
        p.setEnabled(pane != null && pane.getClientProperty(MacMainFrameDecorator.FULL_SCREEN) == null);
      }
    }
  }
  else {
    p.setEnabled(false);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:MacWindowActionBase.java

示例6: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
public void update(AnActionEvent var1) {
    Presentation var2 = var1.getPresentation();
    DataContext var3 = var1.getDataContext();
    CopyProvider var4 = (CopyProvider) PlatformDataKeys.COPY_PROVIDER.getData(var3);
    boolean var5 = var4 != null && var4.isCopyEnabled(var3) && var4.isCopyVisible(var3);
    var2.setEnabled(var5);
    var2.setVisible(var5);
}
 
開發者ID:kookob,項目名稱:mybatis-log-plugin,代碼行數:9,代碼來源:GoogleTranslateAction.java

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

示例8: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent event) {
  StudyUtils.updateAction(event);
  final Project project = event.getProject();
  if (project != null) {
    StudyEditor studyEditor = StudyUtils.getSelectedStudyEditor(project);
    StudyState studyState = new StudyState(studyEditor);
    Presentation presentation = event.getPresentation();
    if (!studyState.isValid()) {
      presentation.setEnabled(false);
      return;
    }

    Course course = StudyTaskManager.getInstance(project).getCourse();
    if (course == null) {
      return;
    }
    Task task = StudyUtils.getCurrentTask(project);
    if (task == null) {
      return;
    }
    presentation.setText(task instanceof PyCharmTask ? TEXT : RESET_TASK);
    if (!EduNames.STUDY.equals(course.getCourseMode())) {
      presentation.setVisible(true);
      presentation.setEnabled(false);
    }
  }
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:29,代碼來源:StudyRefreshTaskFileAction.java

示例9: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(@NotNull AnActionEvent event) {
  final Presentation presentation = event.getPresentation();
  presentation.setEnabledAndVisible(false);

  CCState state = getState(event);
  if (state == null) {
    return;
  }

  presentation.setVisible(true);
  if (canAddPlaceholder(state)) {
    presentation.setEnabled(true);
  }
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:16,代碼來源:CCAddAnswerPlaceholder.java

示例10: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public final void update(AnActionEvent e) {
  this.dataContext = e.getDataContext();
  final Presentation presentation = e.getPresentation();

  final boolean enabled = isAvailable(dataContext);

  presentation.setVisible(enabled);
  presentation.setEnabled(enabled);
}
 
開發者ID:uber,項目名稱:RIBs,代碼行數:11,代碼來源:GenerateAction.java

示例11: updatePresentation

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
private void updatePresentation(Presentation presentation) {
  Configuration configuration = myRenderContext.getConfiguration();
  boolean visible = configuration != null;
  if (visible) {
    IAndroidTarget target = configuration.getTarget();
    String brief = getRenderingTargetLabel(target, true);
    presentation.setText(brief);
  }
  if (visible != presentation.isVisible()) {
    presentation.setVisible(visible);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:TargetMenuAction.java

示例12: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
  myWrappee.update(e);
  final Presentation p = e.getPresentation();
  if (!p.isVisible()) {
    p.setEnabled(false);
    p.setVisible(true);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:AndroidRefactoringActionWrapper.java

示例13: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
  super.update(e);
  final Presentation presentation = e.getPresentation();
  final ProjectViewImpl projectView = (ProjectViewImpl)ProjectView.getInstance(myProject);
  presentation.setVisible(hasModules() && Comparing.strEqual(projectView.getCurrentViewId(), getId()));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:ShowModulesAction.java

示例14: update

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

  Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if ((project == null) || (ProjectLevelVcsManager.getInstance(project).isBackgroundVcsOperationRunning())) {
    presentation.setEnabled(false);
    presentation.setVisible(false);
    return;
  }

  VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext);
  if (files == null || files.length == 0) {
    presentation.setEnabled(false);
    presentation.setVisible(false);
    return;
  }
  boolean enabled = false;
  boolean visible = false;
  if (files.length == 1 && files [0].isDirectory()) {
    visible = true;
    if (! SvnStatusUtil.isUnderControl(project, files[0])) {
      enabled = true;
    }
  }
  presentation.setEnabled(enabled);
  presentation.setVisible(visible);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:ShareProjectAction.java

示例15: update

import com.intellij.openapi.actionSystem.Presentation; //導入方法依賴的package包/類
@Override
protected void update(VcsContext context, Presentation presentation) {
  LineStatusTracker tracker = myChangeMarkerContext.getLineStatusTracker(context);
  if (tracker == null || tracker.isSilentMode()) {
    presentation.setEnabledAndVisible(false);
    return;
  }

  boolean active = isActive(context);
  presentation.setEnabled(active);
  presentation.setVisible(myChangeMarkerContext.getEditor(context) != null || ActionPlaces.isToolbarPlace(context.getPlace()));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ShowChangeMarkerAction.java


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