Eclipse plug-in development

Source: Internet
Author: User
Eclipse plug-in development-general Linux technology-Linux programming and kernel information. The following is a detailed description. I have been working on eclipse plug-in development for the project for a few weeks. There are not many materials in this field, and I often find myself overwhelmed, it takes half a day to find a function.

I have never figured out how to obtain resources in the project path from the plug-in. I have also found some methods, but I have crossed the river by feeling the stones and I have taken a step, today, I saw a buddy summary on the Internet. If you attempt to access the workspace resources, you should use the ResourcesPlugin class. If you attempt to access the Eclipse install directory resources, you should use the Platform class.

I hope to provide some reference for myself.

I want to delete the suse that I just installed for two days. I want to switch back to kubuntu and it is tempted by the features of KDE4.

I have been thinking about how to get the current project, because I am working on a function similar to the editor, and finally found that I can get the project IProject in this way,

IEditorInput input = editor. getEditorInput ();
If (input instanceof IFileEditorInput ){
IFile file = (IFileEditorInput) input). getFile ();
IProject = file. getProject ();
}

Use IProject project = ResourcesPlugin. getWorkspace (). getRoot (). getProject (); after testing for half a day, I found that there has been a problem, and later I realized that Root is the Root of the workspace. It does not know which project you operate... getProject does not seem to return the expected value.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.