本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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()));
}
示例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);
}
示例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()));
}