From 233091ff908299b9367aa00af67662aeab7fdb59 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Wed, 14 Dec 2011 01:14:48 +0400 Subject: [PATCH] Don't show Xml Actions group in any context --- .../src/META-INF/XmlActions.xml | 2 +- .../intellij/xml/actions/XmlActionsGroup.java | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 xml/impl/src/com/intellij/xml/actions/XmlActionsGroup.java diff --git a/platform/platform-resources/src/META-INF/XmlActions.xml b/platform/platform-resources/src/META-INF/XmlActions.xml index bec7f4d3634e..68831eccf560 100644 --- a/platform/platform-resources/src/META-INF/XmlActions.xml +++ b/platform/platform-resources/src/META-INF/XmlActions.xml @@ -1,7 +1,7 @@ - + diff --git a/xml/impl/src/com/intellij/xml/actions/XmlActionsGroup.java b/xml/impl/src/com/intellij/xml/actions/XmlActionsGroup.java new file mode 100644 index 000000000000..69823f396609 --- /dev/null +++ b/xml/impl/src/com/intellij/xml/actions/XmlActionsGroup.java @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2011 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.xml.actions; + +import com.intellij.openapi.actionSystem.ActionGroupUtil; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.DefaultActionGroup; + +/** + * @author Konstantin Bulenkov + */ +public class XmlActionsGroup extends DefaultActionGroup { + public XmlActionsGroup() { + super(); + getTemplatePresentation().setText("XML Actions"); + } + + @Override + public void update(AnActionEvent e) { + e.getPresentation().setVisible(!ActionGroupUtil.isGroupEmpty(this, e)); + } +}