本文整理汇总了Java中com.intellij.openapi.actionSystem.ActionPlaces.isPopupPlace方法的典型用法代码示例。如果您正苦于以下问题:Java ActionPlaces.isPopupPlace方法的具体用法?Java ActionPlaces.isPopupPlace怎么用?Java ActionPlaces.isPopupPlace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.actionSystem.ActionPlaces
的用法示例。
在下文中一共展示了ActionPlaces.isPopupPlace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(final AnActionEvent event) {
Presentation presentation = event.getPresentation();
boolean hidden = isHidden(event);
if (hidden) {
presentation.setEnabledAndVisible(false);
return;
}
boolean enabled = isEnabled(event);
if (myHideDisabledInPopup && ActionPlaces.isPopupPlace(event.getPlace())) {
presentation.setVisible(enabled);
}
else {
presentation.setVisible(true);
}
presentation.setEnabled(enabled);
}
示例2: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
boolean plural = false;
boolean enabled;
DataContext dataContext = e.getDataContext();
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
if (editor != null && FileDocumentManager.getInstance().getFile(editor.getDocument()) != null) {
enabled = true;
}
else {
List<PsiElement> elements = getElementsToCopy(editor, dataContext);
enabled = !elements.isEmpty();
plural = elements.size() > 1;
}
e.getPresentation().setEnabled(enabled);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
e.getPresentation().setVisible(enabled);
}
else {
e.getPresentation().setVisible(true);
}
e.getPresentation().setText(plural ? "Cop&y References" : "Cop&y Reference");
}
示例3: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的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());
}
}
示例4: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
boolean plural = false;
boolean enabled;
DataContext dataContext = e.getDataContext();
Editor editor = dataContext.getData(CommonDataKeys.EDITOR);
if (editor != null && FileDocumentManager.getInstance().getFile(editor.getDocument()) != null) {
enabled = true;
}
else {
List<PsiElement> elements = getElementsToCopy(editor, dataContext);
enabled = !elements.isEmpty();
plural = elements.size() > 1;
}
e.getPresentation().setEnabled(enabled);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
e.getPresentation().setVisible(enabled);
}
else {
e.getPresentation().setVisible(true);
}
e.getPresentation().setText(plural ? "Cop&y References" : "Cop&y Reference");
}
示例5: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(final AnActionEvent event) {
super.update(event);
if (ActionPlaces.isPopupPlace(event.getPlace())) {
event.getPresentation().setVisible(event.getPresentation().isEnabled());
}
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:9,代码来源:AbstractImpexTableFormatAction.java
示例6: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
public void update(AnActionEvent event){
boolean toEnable = getPlace(event) != null;
if (ActionPlaces.isPopupPlace(event.getPlace())) {
event.getPresentation().setVisible(toEnable);
}
else {
event.getPresentation().setEnabled(toEnable);
}
}
示例7: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
public void update(final AnActionEvent e) {
Module module = e.getData(LangDataKeys.MODULE_CONTEXT);
boolean enable = module != null && AddFrameworkSupportDialog.isAvailable(module);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
e.getPresentation().setVisible(enable);
}
else {
e.getPresentation().setEnabled(enable);
}
}
示例8: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
public void update(@NotNull AnActionEvent e) {
Presentation presentation = e.getPresentation();
boolean canShow = isAvailable(e);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
presentation.setVisible(canShow);
}
else {
presentation.setVisible(true);
presentation.setEnabled(canShow);
}
}
示例9: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
super.update(e);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
Presentation presentation = e.getPresentation();
presentation.setVisible(presentation.isEnabled());
}
}
示例10: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent event) {
super.update(event);
if (ActionPlaces.isPopupPlace(event.getPlace())) {
Presentation presentation = event.getPresentation();
presentation.setVisible(presentation.isEnabled());
}
}
示例11: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
final VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
final boolean enabled = isAcceptableFile(file);
e.getPresentation().setEnabled(enabled);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
e.getPresentation().setVisible(enabled);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GenerateSchemaFromInstanceDocumentAction.java
示例12: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(final AnActionEvent e) {
super.update(e);
boolean enabled = isEnabled(e);
e.getPresentation().setEnabled(enabled);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
e.getPresentation().setVisible(enabled);
}
else {
e.getPresentation().setVisible(true);
}
}
示例13: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
e.getPresentation().setVisible(e.getPresentation().isEnabled());
}
}
示例14: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
/**
* Disable the action if the event does not apply in this context.
*
* @param e The update event
*/
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
Presentation presentation = e.getPresentation();
Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
presentation.setEnabled(false);
presentation.setVisible(false);
return;
}
VirtualFile[] vFiles = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
if (vFiles == null || vFiles.length == 0) {
presentation.setEnabled(false);
presentation.setVisible(true);
return;
}
GitVcs vcs = GitVcs.getInstance(project);
boolean enabled = ProjectLevelVcsManager.getInstance(project).checkAllFilesAreUnder(vcs, vFiles) && isEnabled(project, vcs, vFiles);
// only enable action if all the targets are under the vcs and the action supports all of them
presentation.setEnabled(enabled);
if (ActionPlaces.isPopupPlace(e.getPlace())) {
presentation.setVisible(enabled);
}
else {
presentation.setVisible(true);
}
}
示例15: update
import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(AnActionEvent e) {
boolean active = getHandler(e) != null;
if (ActionPlaces.isPopupPlace(e.getPlace())) {
e.getPresentation().setVisible(active);
}
else {
e.getPresentation().setEnabled(active);
}
}