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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:58:46+00:00 2026-06-04T09:58:46+00:00

In my Eclipse plugin, I need to use a file from package explorer. I

  • 0

In my Eclipse plugin, I need to use a file from package explorer. I click on a file with right mouse button and select “View” (my plugin name). So, how can I reach this file path in my plugin project?

http://i49.tinypic.com/2j29ifs.png

I have this:

public class ViewHandler extends AbstractHandler {
...
 public Object execute(ExecutionEvent event) throws ExecutionException { 
 ...
 ...
        URI uri = null;
        try {
            test();
            uri = URI.createURI("../models/task.cm");
            Resource resource = resourceSet
                    .getResource(uri, true);
            Model model = (Model) resource.getContents().get(0);
            ModelExtractor showModel = new ModelExtractor(model);
            showModel.run();
        } catch (Exception e) {
            System.out.print(e);
        }

        return null;
    }
}

And I need to replace this line:
uri = URI.createURI("../models/task.cm");

with relative path to file.

Or if you have some good tuto.

  • 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-04T09:58:47+00:00Added an answer on June 4, 2026 at 9:58 am

    In your Command Handler (I hope, you are using the Command Framework, not JFace Actions) you could check for the currently selected element, and then use the resulting IFile for parsing.

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

Sidebar

Related Questions

I need an Eclipse Plugin run shell scripts under Linux. I have a beautiful
I m doing an eclipse plugin project to create an IDE. I need to
I am developing a plugin for eclipse. In this plugin I need to be
It's not clear to me if the Eclipse plugin completely replaces the need to
How do I start to develop a plugin for Eclipse? I need a tool
I need to add Plugin support to a Java Swing App (like in Eclipse).
I have Fedora 11 (x86 64) installed with Eclipse. I need a Maven plugin,
From my Eclipse plugin, I want to execute a command and show the results
I have a need to have a config.xml file in my Eclipse project, and
I'm using Eclipse 3.6 (Helios) with the latest Clear Case plugin from Source Forge

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.