Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » viewActions support of visibility element
viewActions support of visibility element [message #327748] Wed, 30 April 2008 11:21 Go to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

I'm using Eclipse 3.3.1.1 and am trying to implement the visibility element with org.eclipse.ui.viewActions. I get a warning message in the plug-in editor and it doesn't work when I execute. The same visibility element does work with org.eclipse.ui.popupMenus.

here's the error:
Element 'visibility' is not legal as a child of element 'viewContribution'

and the XML fragment
   <extension
         point="org.eclipse.ui.viewActions">
      <viewContribution
            id="myplugin.viewcontribution.debugalways"
            targetID="myplugin.ui.views.debug">
          <visibility>
         <and>
            <objectState
                  name="iscics"
                  value="true">
            </objectState>
            <objectState
                  name="isfile"
                  value="true">
            </objectState>
            </and>
         </visibility>
         <action
               class="myplugin.ui.actions.NewCopyAction"
               enablesFor="+"
               icon="icons/file_drawer.gif"
               id="myplugin.view.NewCopy"
               label="New Copy"
               menubarPath="additions"
               style="push"
               toolbarPath="additions"
               tooltip="Obtain New Copy of Program">             
         </action>
      </viewContribution>
   </extension>


I tried placing the visibility element in various elements of the extension but the results remain the same.

am I doing something wrong or is this a bug?
Re: viewActions support of visibility element [message #327773 is a reply to message #327748] Wed, 30 April 2008 23:26 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

viewActions doesn't support a visibility element (although as you
mentioned, popupMenus does). The Extension Point Description should
tell you what sub-elements are valid for this extension.

You can have some control over visibility using org.eclipse.ui.menus,
but that's commands and actions.

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: viewActions support of visibility element [message #327778 is a reply to message #327773] Thu, 01 May 2008 11:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

I did check the documentation before I posted this thread. Refer to E3.3 documentation here:
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/extension-points/org_eclipse_ui_v iewActions.html

Scroll down just past enablement and there is this text.
<html>
<!ELEMENT visibility (and | or | not | objectClass | objectState | pluginState | systemProperty)>
</html>
I guess this is a documentation bug. Visibility is also defined in org.eclipse.ui.actionSets and org.eclipse.ui.editorActions. I don't think these work either.
Re: viewActions support of visibility element [message #327779 is a reply to message #327778] Thu, 01 May 2008 13:07 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Charles Godwin wrote:
>
> Scroll down just past enablement and there is this text.
> <html>
> <!ELEMENT visibility (and | or | not | objectClass | objectState | pluginState | systemProperty)>
> </html>
> I guess this is a documentation bug. Visibility is also defined in org.eclipse.ui.actionSets and org.eclipse.ui.editorActions. I don't think these work either.

It's defined, but not used anywhere.

extension (viewContribution)
and
viewContribution (menu, action)

i.e. there's no where to put them.

I would guess that it's included there because it's defined in the
common action schema (there are things in there that are not used in all
of the action extension points, making them less common :-)

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:several features in one extension
Next Topic:Adding actions to a custom view
Goto Forum:
  


Current Time: Fri Aug 23 07:22:28 GMT 2024

Powered by FUDForum. Page generated in 0.03427 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top