Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6119243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:31:48+00:00 2026-05-23T15:31:48+00:00

I have several plugins where commands need to be disabled when the user isn’t

  • 0

I have several plugins where commands need to be disabled when the user isn’t logged in. This is done via an ISourceProvider. In one plugin.xml I have:

<extension
     point="org.eclipse.ui.menus">
  <menuContribution
        allPopups="false"
        locationURI="menu:org.eclipse.ui.main.menu">
     <menu
           id="menus.arm"
           label="%menu.label"
           mnemonic="%menu.mnemonic">
        <command
              commandId="ru.focusmedia.odp.arm.commands.login"
              style="push">
           <visibleWhen
                 checkEnabled="false">
              <with
                    variable="arm.variables.loggedIn">
                 <equals
                       value="false">
                 </equals>
              </with>
           </visibleWhen>
        </command>
        <command
              commandId="ru.focusmedia.odp.arm.commands.logout"
              style="push">
           <visibleWhen
                 checkEnabled="false">
              <with
                    variable="arm.variables.loggedIn">
                 <equals
                       value="true">
                 </equals>
              </with>
           </visibleWhen>
        </command>
        <command
              commandId="org.eclipse.ui.file.exit"
              label="%command.label"
              style="push"
              tooltip="%command.tooltip">
        </command>
     </menu>
     <menu
           id="menus.help"
           label="%menu.label.0"
           mnemonic="%menu.mnemonic.0">
        <command
              commandId="org.eclipse.ui.help.aboutAction"
              label="%command.label.0"
              style="push"
              tooltip="%command.tooltip.0">
        </command>
     </menu>
  </menuContribution>
</extension>
<extension
     point="org.eclipse.ui.commands">
  <command
        defaultHandler="ru.focusmedia.odp.arm.login.LogoutHandler"
        id="ru.focusmedia.odp.arm.commands.logout"
        name="%command.name.logout">
  </command>
  <command
        defaultHandler="ru.focusmedia.odp.arm.login.LoginHandler"
        id="ru.focusmedia.odp.arm.commands.login"
        name="%command.name.login">
  </command>
</extension>
<extension
     point="org.eclipse.ui.services">
  <sourceProvider
        provider="ru.focusmedia.odp.arm.login.LoginStateSourceProvider">
     <variable
           name="arm.variables.loggedIn"
           priorityLevel="workbench">
     </variable>
  </sourceProvider>
</extension>

This works fine; the correct command is visible all the time. In another plugin, which depends on this one, I have

<extension
     point="org.eclipse.ui.commands">
  <command
        defaultHandler="ru.focusmedia.odp.arm.alarms.RequestMoreAlarmsHandler"
        id="arm.alarms.commands.request_more_alarms"
        name="Request more alarms">
  </command>
</extension>
<extension
     point="org.eclipse.ui.handlers">
  <handler
        class="ru.focusmedia.odp.arm.alarms.RequestMoreAlarmsHandler"
        commandId="arm.alarms.commands.request_more_alarms">
     <enabledWhen>
        <with
              variable="arm.variables.loggedIn">
           <equals
                 value="true">
           </equals>
        </with>
     </enabledWhen>
  </handler>
</extension>
<extension
     point="org.eclipse.ui.menus">
  <menuContribution
        allPopups="false"
        locationURI="toolbar:arm.views.alarms">
     <command
           commandId="arm.alarms.commands.request_more_alarms"
           style="push">
     </command>
  </menuContribution>
</extension>

And this command is disabled all the time. What’s going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:31:49+00:00Added an answer on May 23, 2026 at 3:31 pm

    There is a conflict between handler definitions in <command defaultHandler=... and <handler .... After removing the defaultHandler attribute, it works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we have a application, which loads several plugins (audio/videocodec related). All plugins except one
I have downloaded several new plugins which come with a help file. None of
We have an svn project that also has several plugins in vendor/plugins - all
I have a product consisting of several plugins that I want to build. The
We have a main application that loads several plugins that have their own individual
I have several classes in a project which need to only be in certain
I have been looking at this for several days now with no success. I
On my local machine I have several plugins, and on the server I have
I'm currently using GEdit with several plugins to do Ruby on Rails development. One
I'm developing a dynamic website using jQuery and I have found several jQuery plugins

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.