本文整理汇总了Java中com.intellij.openapi.actionSystem.Presentation.isVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Presentation.isVisible方法的具体用法?Java Presentation.isVisible怎么用?Java Presentation.isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.actionSystem.Presentation
的用法示例。
在下文中一共展示了Presentation.isVisible方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
protected void update(final VcsContext vcsContext, final Presentation presentation) {
super.update(vcsContext, presentation);
if (presentation.isVisible() && presentation.isEnabled()) {
final ChangeList[] selectedChangeLists = vcsContext.getSelectedChangeLists();
final Change[] selectedChanges = vcsContext.getSelectedChanges();
if (vcsContext.getPlace().equals(ActionPlaces.CHANGES_VIEW_POPUP)) {
if (selectedChangeLists != null && selectedChangeLists.length > 0) {
presentation.setEnabled(selectedChangeLists.length == 1 && !ContainerUtil.isEmpty(selectedChangeLists[0].getChanges()));
}
else {
presentation.setEnabled (selectedChanges != null && selectedChanges.length > 0);
}
}
if (presentation.isEnabled() && selectedChanges != null) {
final ChangeListManager changeListManager = ChangeListManager.getInstance(vcsContext.getProject());
for(Change c: selectedChanges) {
if (c.getFileStatus() == FileStatus.HIJACKED && changeListManager.getChangeList(c) == null) {
presentation.setEnabled(false);
break;
}
}
}
}
}
示例2: 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);
}
}
示例3: update
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
protected void update(@NotNull Presentation presentation, @NotNull Project project,
@NotNull Editor editor, @NotNull PsiFile file, @NotNull DataContext dataContext, @Nullable String actionPlace) {
// avoid evaluating isValidFor several times unnecessary
CodeInsightActionHandler handler = getValidHandler(editor, file);
presentation.setEnabled(handler != null);
if (handler instanceof ContextAwareActionHandler && !ActionPlaces.isMainMenuOrActionSearch(actionPlace)) {
presentation.setVisible(((ContextAwareActionHandler)handler).isAvailableForQuickList(editor, file, dataContext));
}
if (presentation.isVisible() && handler instanceof PresentableCodeInsightActionHandler) {
((PresentableCodeInsightActionHandler)handler).update(editor, file, presentation);
}
}
示例4: 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);
}
}
示例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 activity = configuration.getActivity();
String label = getActivityLabel(activity, true);
presentation.setText(label);
}
if (visible != presentation.isVisible()) {
presentation.setVisible(visible);
}
}
示例6: updatePresentation
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
private void updatePresentation(Presentation presentation) {
Configuration configuration = myRenderContext.getConfiguration();
boolean visible = configuration != null;
if (visible) {
String label = getDeviceLabel(configuration.getDevice(), true);
presentation.setText(label);
}
if (visible != presentation.isVisible()) {
presentation.setVisible(visible);
}
}
示例7: 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);
}
}
示例8: 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);
}
}
示例9: update
import com.intellij.openapi.actionSystem.Presentation; //导入方法依赖的package包/类
@Override
protected void update(VcsContext vcsContext, Presentation presentation) {
Project project = vcsContext.getProject();
if (project != null) {
final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
final boolean underVcs = vcsManager.hasActiveVcss();
if (! underVcs) {
presentation.setVisible(false);
return;
}
String actionName = getCompleteActionName(vcsContext);
if (myActionInfo.showOptions(project) || OptionsDialog.shiftIsPressed(vcsContext.getModifiers())) {
actionName += "...";
}
presentation.setText(actionName);
presentation.setVisible(true);
presentation.setEnabled(true);
if (supportingVcsesAreEmpty(vcsManager, myActionInfo)) {
presentation.setVisible(myAlwaysVisible);
presentation.setEnabled(false);
return;
}
if (filterRootsBeforeAction()) {
FilePath[] roots = filterRoots(myScopeInfo.getRoots(vcsContext, myActionInfo), vcsContext);
if (roots.length == 0) {
presentation.setVisible(myAlwaysVisible);
presentation.setEnabled(false);
return;
}
}
if (presentation.isVisible() && presentation.isEnabled() &&
vcsManager.isBackgroundVcsOperationRunning()) {
presentation.setEnabled(false);
}
} else {
presentation.setVisible(false);
presentation.setEnabled(false);
}
}