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

  • Home
  • SEARCH
  • 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 8086433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:26:38+00:00 2026-06-05T18:26:38+00:00

I want to create a Google Closure Compiler plugin for Eclipse. I already have

  • 0

I want to create a Google Closure Compiler plugin for Eclipse. I already have a popup menu entry to compile a JavaScript file to its minified version. But it would be more than helpful if every time you save a *.js that minified version would be generated automatically. I read/heard about natures and builders, extension points and IResourceChangeListener. But I did not manage to figure out what I should use and especially how to get it to work.

Is there a working example of a plugin that does “the same kind of thing” so I can work from that or a tutorial to write such?

With the answer below I searched for projects that use the IResourceChangeListener and came up with this code:

Manifest: http://codepaste.net/3yahwe

plugin.xml: http://codepaste.net/qek3rw

Activator: http://codepaste.net/s7xowm

DummyStartup: http://codepaste.net/rkub82

MinifiedJavascriptUpdater: http://codepaste.net/koweuh

There in the MinifiedJavascriptUpdater.java which holds the code for the IResourceChangeListener the resourceChanged() function is never reached.

  • 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-05T18:26:40+00:00Added an answer on June 5, 2026 at 6:26 pm

    Answer from here http://www.eclipse.org/forums/index.php/t/362425/

    Solution is to get the code into the activator and get rid of the MinifiedJavascriptUpdater:

    package closure_compiler_save;
    
    import org.eclipse.ui.plugin.AbstractUIPlugin;
    import org.osgi.framework.BundleContext;
    
    /**
     * The activator class controls the plug-in life cycle
     */
    public class Activator extends AbstractUIPlugin {
    
        // The plug-in ID
        public static final String PLUGIN_ID = "closure-compiler-save"; //$NON-NLS-1$
    
        // The shared instance
        private static Activator plugin;
    
        /**
         * The constructor
         */
        public Activator() {
        } //gets here
    
        @Override
        public void start(BundleContext context) throws Exception {
            super.start(context);
            Activator.plugin = this;
    
            ResourcesPlugin.getWorkspace().addResourceChangeListener(new IResourceChangeListener() {
                public void resourceChanged(IResourceChangeEvent event) {
                    System.out.println("Something changed!");
                }
            });
        }
    
        @Override
        public void stop(BundleContext context) throws Exception {
            Activator.plugin = null;
            super.stop(context);
        }
    
        /**
         * Returns the shared instance
         *
         * @return the shared instance
         */
        public static Activator getDefault() {
            return plugin;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use the google closure compiler on the javascript source we're using.
Hi have an array of cities and want to create a google map using
i have a unique challenge. i want to create a google analytics filter for
I want to create a store locator with Google Maps. I have a database
I have the following string: http://www.google.ie/ .I want to create a string www.google.ie How
I want to create a web site using google maps, php, mysql and javascript
I want to create a Google Docs document from within Haskell, so basically I
I want to create Contact on Google Apps. I am Using this API And
I want to create Task in Google Calendar using Google Calendar API.Using C#. Looking
I want to create an overlay on top of Google Maps that displays different

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.