About eclipse plugin development (1)

Source: Internet
Author: User

I have been developing a plug-in for the eclipse platform recently. Many Java class libraries are born, and the design parttion is also very confused. I always want to use it, but every time I use it, it is ugly. A brain always writes a lot of code and a lot of classes. During this period, most of them cannot be tested. When I think that the framework has been set up, I find that there are as many bugs as the code. Then I felt that the mode was not used correctly, and I spent a lot of time refactor. Unfortunately, the code after refactor is still so ugly. I should try agile software development, or should we continue to use this development method that we think we can cope with in the short term?

It may be much better if someone brings it together, but can't they have the ability to learn independently? It is still necessary to strengthen the training of the system's thinking ability, and there must be layers of work. However, it seems that I have only realized the shortcomings and I have not used them when I encounter things. In the future, calm down and analyze the situation.

 

Recently, I learned some knowledge about the eclipse platform:

(1) This is a very difficult problem. When I encountered it today, I was so stupid that I thought it was something I could not do. When debugging eclipse Plugin in Linux, eclipse suddenly went on strike and a warning "cannot connect to VM. socket close" pops up ". There are many people on the Internet who have not solved the problem, but some of them must have solved it, or I will not solve it either.

In Linux, add "127.0.0.1 localhost" to the hosts file in etc. In Windows, check firewall settings so that javaw can access the network. Because socket is used for eclipse debugging.

(2) three methods of tableview (inherited from structuredviewer:

Setinput (Object input)

Set the data object to be displayed in tableview

Setcontentprovider (icontentprovider contentprovider)

Sets how to resolve the content to be displayed in tableview to the object [] type.

Setlabelprovider (ibaselabelprovider labelprovider)

Sets how to parse the item (Object indicating a row of data) to be displayed in tableview into a string based on the specified column and display it in Cell
These three functions are closely related. First, input is the data to be displayed, which is also the method in the contentprovider object.

Public object [] getelements (Object parent)

. In this way, the input is decomposed into arrays in getelements. Each element of the array is the source of the values of each row in the table and is also a member function of the labelprovider object.

Public String getcolumntext (object element, int columnindex)

. Therefore, we can determine the string displayed by a cell in the table based on columnindex and element.

 

To put it bluntly, I have been developing eclipse plugin for so long, and now I am afraid to determine the relationship between these three functions...

 

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.