Eclipse plug-in Development Note 5: getting information from other plug-ins

Source: Internet
Author: User

How do Eclipse plug-ins share data? Today I encountered this problem. Because I want to access the deploy directory of eclipseme, Which is configurable.

 

There are two possibilities: one is to put the data to be shared by the plug-in one location, the other is to get the data from the specified location, and the other is to provide some interfaces for the plug-in, allow access by other plug-ins. Eclipse is the second method.

 

Iworkspace Space = resourcesplugin. getworkspace () is used most. This sentence actually implies access to the org. Eclipse. Core. Resource plug-in. Each generated plug-in project's plug-in. xml file contains dependency in org. Eclipse. Core. runtime and org. Eclipse. Core. Resources.

 

Add dependency on eclipseme in denpendency, and then directly access the methods allowed to access eclipseme.

 

Generally, it is a static access method. For plug-in developers, static method access should also be set for information that needs to be provided for external access. No one wants to build a new object to access the existing data, this is also unreasonable.

 

This method also facilitates the use of plug-ins. If I'm not sure which plug-ins a plug-in depends on, you can simply look at plugin. xml.

 

 

Related Article

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.