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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:45:48+00:00 2026-06-10T00:45:48+00:00

I have developed a simple plugin to generate some routine code. This plugin has

  • 0

I have developed a simple plugin to generate some routine code. This plugin has a contribution to a popup menu of Package Explorer. It is working as intended when running from the development environment (Launch as Eclipse application from Eclipse RCP) — an appropriate menu item appears in the menu, and its invocation does what is expected.

However, I’m having a hard time deploying it into a different Eclipse instance.

The developed plugin was exported with Export Wizard, which produced a separate jar file. This jar file has been placed into the dropings directory of another Eclipse installation (newly unpackaged). When this Eclipse instance launches, the popup menu of Package Explorer does not contain the contributed menu item. The information from Eclipse Installation Details shows that the plugin is present on the Plug-Ins tab, and the Configuration tab has it listed as tg.companion (1.0.0.201208132302) "Companion Object Generator" [Starting].

What am I missing? Why the contributed menu item does not show up?

Thanx.


The locationURI for the menu contribution is popup:org.eclipse.jdt.ui.PackageExplorer, the value for property allPopups is true.

The plugin is unsigned.


Here’s the plugin files that might shed some light.

Plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="true"
            locationURI="popup:org.eclipse.jdt.ui.PackageExplorer">
         <command
               commandId="tg.companion.handler.generator"
               label="TG Create Companion Object"
               style="push"
               tooltip="Creates a companion object to the selected entity object, and provides DAO/RAO implementations">
         </command>
      </menuContribution>
   </extension>
   <extension point="org.eclipse.ui.commands">
      <command
            defaultHandler="tg.companion.handler.GenerateCompanionObjects"
            id="tg.companion.handler.generator"
            name="Generate Comanion">
      </command>
   </extension>
</plugin> 

MANIFEST.MF:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Companion Object Generator
Bundle-SymbolicName: tg.companion;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: tg.companion.Activator
Bundle-Vendor: TG
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime,
 org.eclipse.jdt.core;bundle-version="3.8.1",
 org.eclipse.core.resources;bundle-version="3.8.0",
 org.eclipse.core.expressions;bundle-version="3.4.400"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy

Command handler:

package tg.companion.handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;

public class GenerateCompanionObjects extends AbstractHandler implements IHandler {

    @Override
    public Object execute(final ExecutionEvent event) throws ExecutionException {
        final Shell shell = HandlerUtil.getActiveShell(event);
        final ISelection sel = HandlerUtil.getActiveMenuSelection(event);
        final IStructuredSelection selection = (IStructuredSelection) sel;

        final Object firstElement = selection.getFirstElement();
        if (firstElement instanceof ICompilationUnit) {
            createOutput(shell, (ICompilationUnit) firstElement);
        } else {
            MessageDialog.openWarning(shell, "Companion Object Generation Warning", "Please select an entity object for generating a corresponding companion.");
        }
        return null;
    }

    private void createOutput(final Shell shell, final ICompilationUnit cu) {
         // does code generation work using Java Model
    }

}
  • 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-10T00:45:50+00:00Added an answer on June 10, 2026 at 12:45 am

    Finally, the problem has been solved!

    After careful review of the project structure it was identified that build.properties file (for some reason) did not have plugin.xml checked. As the result, plugin.xml was not included into the produced by the export wizard jar file.

    Once the build.properties files has been amended to include plugin.xml, the resulting jar file had it included and deployed without any issues.

    Interestingly, the plugin export wizard did not even warn about the exclusion of plugin.xml, which I would personally have expected.

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

Sidebar

Related Questions

I have developed a simple VST plugin. The plugin has an internal buffer with
I have developed a simple Jekyll plugin, to generate the categories pages. IT works
I have developed a simple library in Ruby and need to use this in
I have developed sample api as jar file. This jar file contains the code
I have developed on simple plugin in Joomla 1.6 I stuck at : How
I have a simple plugin system in a piece of code I have written.
I have developed a simple application using SDK(Android: 3.2[API-13]) for, to display Google banners.
I have developed a simple location aware iPhone application which is functionally working very
I am new to rails and have developed a simple rails application on my
On Windows 7, VB.NET Express, I have developed a simple Forms application. I don't

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.