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 7872961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:22:20+00:00 2026-06-03T02:22:20+00:00

I am new to Eclipse plugin development and am trying to disable the command

  • 0

I am new to Eclipse plugin development and am trying to disable the command handler of a menu item if the active workbench window is not a .js or .html file.

I found code to disable it when it is not a text editor as follows:

<activeWhen>
    <with variable="activeEditorId">
       <equals value="org.eclipse.ui.DefaultTextEditor"/>
    </with>
</activeWhen>

I want the similar functionality for javascript and html editors.

  • 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-06-03T02:22:22+00:00Added an answer on June 3, 2026 at 2:22 am

    This can be done by using definitions as follows:

    <extension point="org.eclipse.core.expressions.definitions">
            <definition id="example.definitions.sampleDefinition">
              <adapt type="org.eclipse.core.resources.IResource">
                <or>
                    <test property="org.eclipse.core.resources.name"
                             value="*.html"/>
                     <test property="org.eclipse.core.resources.name"
                             value="*.js"/>
                </or>
               </adapt>
            </definition>
       </extension>
    

    And then we need to use this definition id in the tag of the corresponding command handler as follows:

    <enabledWhen>
            <with variable="activeEditorInput">
        <reference definitionId="example.definitions.sampleDefinition"/>
      </with>
    </enabledWhen>
    

    I am using this code. It’s working fine.

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

Sidebar

Related Questions

I am new to Eclipse Plugin development. I have already customized my main menu
I am fairly new with the blackberry eclipse plugin and I am trying to
I think the question says it all. I'm new to Eclipse plugin development, so
I'm new to eclipse plugin development, and I inherited some Eclipse plugin code and
Is there a plugin in eclipse that when you type 'new JavaClass' it will
I'm new to Java/Eclipse/Android, so this is probably an easy (if not stupid) question:
I am new to using Eclipse and CDT and have been trying to get
Caveat: I'm still struggling with proper MVC in Eclipse plugin development, so if you
My issue is regarding PhoneGap and Android development using the Eclipse Applaud plugin. I
Background: I've got a new eclipse installation and have installed the m2eclipse plugin. After

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.