A summary of common tips for eclipse

Source: Internet
Author: User
Tags log4j

Original:

http://hbkh2000.iteye.com/blog/434155



I always use the mouse operation, some features a lot of points to the mouse, Eclipse hotkey are what.

Hotkeys are one of the most common techniques in eclipse. The three combination hotkeys I use most often in eclipse programming are:

1.alt+/Code hints function, programming preferred hotkey familiar with Delphi programming colleagues often change it to ctrl+space

2.ctrl+shift+f code layout in order to be you write the program code more clearly, you can try to use the hotkey

3.ctrl+shift+o the contents of your import section and will clean out the extra import items

More hotkeys can be viewed in Window->preferences->general->keys

two. Some code or comment appears in almost every class, I want to use convenient method to generate automatically, what should I do?

In Eclipse, you can customize the template and just enter the name of the template to help you generate your predefined template code.

Individual annotations, log4j recorders, and so on can be customized to allow Eclipse to help you generate the code you need.

The Eclipse custom template is set up in Window->preferences->java->editor->templates.

three. I want to change the eclipse default font size and color, what should I do?

If you use a 19-inch large LCD screen, you might as well turn the Eclipse default number 10th to protect your eyes.

Or you dislike eclipse. The default color settings are not good-looking.

Then you can look at window->preferences->appearance->colors and fonts.

four. I accidentally closed a view window, how to let it show again.

Encounter this problem, you can look here window->show view

Five. I suspect Eclispe the default table layout is inconvenient, how to switch the layout of the workbench.

Eclispe offers a lot of workbench layouts to facilitate the development of different types of projects, in Eclipse, which is called perspective (perspective).

You can toggle the perspective of the Window->open perspective.

Six. Eclipse can be expanded through plug-ins, I found a useful plug-in, how to install it.

The easiest way to do this is to download the plugin and extract it into the Eclipse->plugins directory, as well as the Eclipse->features directory (if there is features).

If you provide a way to install the network, you can use the Help->software updates->find and install, the page appears to click Next->new Remote site, fill in the name of your plugin

Say and URL then follow the prompts to install it.

There is another way is to first download the plugin program to the local, and the network installation process is similar, not to say more, online related information is also more.

Seven. My project can not be automatically compiled, what's going on.

In this case, you may have a fatal error in your project, and the first thing to do is to rule out and compile. I have code cleanliness, usually seeing the red fork and all kinds of Eclipse's mentioning

show, [wiki] feel [/wiki] uncomfortable, first rule out then quickly.

In addition, eclipse defaults to be compiled automatically after you modify the program, and if you can't compile automatically, you can see if the Project->build automatically option is selected.

If you want to recompile the whole project, you can use Project->clean.

Eclipse is not automatically loaded if you copy certain files into the Eclipse's Engineering folder in the file system. If you want to edit these files in the Eclipse environment, please work

Right-click->refresh.

Eight. Pakage explore is one of the most commonly used views, and what are the tips for using it?

1.pakage explore in the project too much, old influence my editor other works, I should do.

The most convenient way is to click the right button to delete, the next page prompts you to delete only the project or even the project content files and folders together delete, the default is to delete the project only. Don't worry, bold.

Delete, the contents of the file system will not be deleted, and so you want to use the project, you can import again.

Another method is to right-click->close Project, after the operation, the project icon becomes a storage box appearance. When you want to use the project again, you can

Right-click->open Project.

2. The content of the project is too many, some content I do not need to edit, need to hide, what should I do.

Click the inverted triangle on the top of Pakage explore to click the Filters option in the Drop-down menu, and then tick the content you don't want to display, or enter a file in the text box that you don't want to display.

Type of suffix, such as: *.jar.

3. My pakage explore shows how the package structure is different from others.

Pakage Explore provides two different views for the display of the package structure, flat and hierarchical, and you can click the inverted triangle on pakage explore, and then click Dropdown

Pakage presentation in the menu to toggle.

Nine. How to import the export in Eclipse.

1. I have an Eclipse project, how do I get it into the eclipse development environment.

Right-click the Pakage explore blank, import->general->existing projects into workspace, and then select the path to your Eclipse project and import it.

2. I want to compile some Java files and make a jar package, what should I do.

In Pakage Explore, select the Java file you want to compile, and then right-click, Export->java->jar file, the next few pages according to your specific requirements for the choice of options,

Until it's done, in general, the default option is OK.

3. The classes and methods in my Java file are commented in detail and I want to generate an API help document.

In Pakage explore, select your Java file, and then click on the right button, Export->java->javadoc, the next page according to your needs to select options, the general default can be

Up. However, the prerequisite for exporting Javadoc is that your comments need to be written according to Javadoc rules, the rules are very simple, interested to see the information in this area, there are more online

Of

There is an Eclipse project on 4.cvs, how can I import it into eclipse.

Right-click on Pakage explore blank, new->project->cvs->projects from cvs->create a new repository location, Complete the CVS server letter in the next page

and username password, and so on, and then the next step until completed.

10. Good at using Eclipse's automatic generation Code and code formatting features

Open a Java file, right-click on the->source, or click on the menu bar's Source menu item to see that eclipse offers a lot of code generation and formatting capabilities.

The most commonly used is to generate Pojo getter and setter, right key->source->generate getters and setters, select the field you want to generate getter or setter, ha, generated, is not

Very convenient.

11 How to run a section of Java code fast? With Scrapbook

Sometimes we want to write snippets of Java code temporarily, such as not knowing the current JVM system variables.

Should use SYSTEM.OUT.PRINTLN (System.getproperties ());

In Eclipse, you can create a new scrapbook to run this line of code without having to write a class class serious.

The steps are as follows:

New (CTRL + N)--> enter "Scrap", select Scrapbook page, and then generate a *.jpage, enter the above code, select, click on the toolbar "Execute selected Code" button can be run.

12 Click a method, the result jumps to the interface, how to easily find the specific implementation method.

When the cursor is on the method, with Ctrl+t, you can display the implementation class for this method. Select on the line.

Here's a summary of the 12 common techniques of eclipse that I hope will help you.



Original:

http://hi.baidu.com/beyond456/item/2f2519ef193883d1ea34c94a


Here's a summary of my most frequently used shortcuts in eclipse.
In fact, many of the articles listed eclipse shortcuts, but the disadvantage is too full, difficult to remember (many people even put ctrl+c,ctrl+v,ctrl+x these are listed, is not sick).
Here's a list of the things I use most often, or some of the more useful I've found.
All the tests were normal in eclipse3.2.2. If no special instructions are available in the Java Development environment JDT!
has made the following part of the desktop wallpaper time to practice, and strive to improve the efficiency of no mouse operation

Alt+↑/↓ move the current row or the selected row up or down one line
alt+←/→ Forward/Rewind history
ctrl+←/→ forward Backward a word (similar to the b,w in vim)
Alt+shift+↑/↓ Select Package Element
alt+shift+←/→ Select Top/Next element
Ctrl+shift+↑/↓ go to the top/next member (in the form of a method variable declaration, etc.)
ALT +-Show system menu, and right-click on editor,console tab
(See the above several I have to think of Street Fighter ...) →↓→ Fist hao~you~gei~~~~←↓→ fist a~du~gei~~~ (-___-| | |)

Ctrl+shift+o: Automatic import of required classes
Ctrl+alt+h: Open the call hierarchy, which is useful if you want to know the call entry for a method

The following three sets of shortcuts are similar: Press the immediately let go is to switch back and forth, long press to display a list for more choices
Ctrl+key
Ctrl+shift+key
Key=f6 Editor Tab
Key=f7 view (Search,console,problem, etc.)
Key=f8 Perspective (JAVA,DEBUG,CVS, etc.)

CTRL+F3 the structure of the element in which the mouse focus is opened (Ctrl+o can only display the current file's structure)
Ctrl+t the inheritance of the element on which the mouse focus is opened
F4 Open Hierarchy (first select the file, do not need to open the file to see the method inside)

Ctrl+e Quickly opens Editor tab (it is extremely convenient to have the N multiple tab open at the same time!)
Ctrl+shift+t quickly open Java classes
Ctrl+shift+h quickly opens a Java class (displayed in a hierarchy that does not actually open a file)
Ctrl+shift+r quickly open resources (Pictures, xml,html, and other non-Java files)

Ctrl+shift+p Jump to matching bracket
Ctrl+q go to the previous edit location

Ctrl+l go to row
Ctrl+h Search

The location of the element where the Ctrl+shift+u focus appears in the file
declarations in the Ctrl+g workspace
Ctrl+shift+g references in the workspace

Add Import ctrl+shift+m
Organization Import Ctrl+shift+o

ALT+SHIFT+Q displays a floating menu of running related
ALT+SHIFT+X displays a view-related floating menu

F12 Activation Editor
Ctrl+j Incremental Lookup
Ctrl+shift+j Incremental Reverse Lookup

Text edit change to uppercase Ctrl+shift+x edit text
Change text edit to lowercase ctrl+shift+y edit text

---run related---
Single Step back to F7
Single Step Skip F6
Stepping into F5
Single Step hop into selection ctrl+f5
Debug Last Boot F11
Keep F8.
Stepping into Shift+f5 using filters
Add/Remove Breakpoints Ctrl+shift+b
Show Ctrl+d
Run the last boot ctrl+f11
Run To Row Ctrl+r
Execute Ctrl+u

---refactoring related---
scope function Shortcut keys
Global Undo Refactoring Alt+shift+z
Global Extraction Method Alt+shift+m
Global extract local variable alt+shift+l
Global inline Alt+shift+i
Global Mobile Alt+shift+v
Global Rename Alt+shift+r
Global Redo Alt+shift+y


Not too often.
------------
Ctrl+w Closes the current editor tab
Ctrl+shift+w Close All editor tabs

Ctrl+f4 off
Ctrl+shift+f4 all closed
Ctrl+shift+s Save All
(Recent work more than several are becoming more and more commonly used, less than two times the mouse, it is very convenient indeed)

F2 renaming (when the focus is on a Java file, it is equivalent to Alt+shift+r, which is a subset of the latter)
Alt+enter Display Properties

CTRL+F10 displays a menu (easy to set breakpoints, and so on), and the right key on the left ruler has the same effect.
SHIFT+F2 Open External Javadoc

Cond.


Original:

http://huangyuanmu.iteye.com/blog/487181


On the use of eclipse, usually some colleagues asked me, in fact, some things are small skills, know that after the programming will bring great convenience.

I always use the mouse operation, some features a lot of points to the mouse, eclipse have what hot keys.

The three combination hotkeys I use most often in eclipse programming are:

1.alt+/Code hints function, programming preferred hotkey familiar with Delphi programming colleagues often change it to ctrl+space

2.ctrl+shift+f code layout in order to be you write the program code more clearly, you can try to use the hotkey

3.ctrl+shift+o the contents of your import section and will clean out the extra import items

More hotkeys can be viewed in Window->preferences->general->keys

Two. Some code or comment appears in almost every class, I want to use convenient method to generate automatically, what should I do?

In Eclipse, you can customize the template and just enter the name of the template to help you generate your predefined template code.

Individual annotations, log4j recorders, and so on can be customized to allow Eclipse to help you generate the code you need.

Custom templates are set in Window->preferences->java->editor->templates.

Three. I want to change the eclipse default font size and color, what should I do?

If you use a 19-inch large LCD screen, then you might as well put the eclipse default of the 10th number of words, to protect your eyes (I wait for 14-inch screen can not this condition AH).

Or you dislike eclipse. The default color settings are not good-looking.

Then you can look at window->preferences->appearance->colors and fonts.

Four. I accidentally closed a view window, how to let it show again.

Encounter this problem, you can look here window->show view

Five. I suspect Eclispe the default table layout is inconvenient, how to switch the layout of the workbench.

Eclispe offers a lot of workbench layouts to facilitate the development of different types of projects, in Eclipse, which is called perspective (perspective).

You can toggle the perspective of the Window->open perspective.

Six. Eclipse can be expanded through plug-ins, I found a useful plug-in, how to install it.

The easiest way to do this is to download the plugin and extract it into the Eclipse->plugins directory, as well as the Eclipse->features directory (if there is features).

If you provide a way to install the network, you can use the Help->software updates->find and install, the page appears to click Next->new Remote site, fill in the name of your plugin

Say and URL then follow the prompts to install it.

There is another way is to first download the plugin program to the local, and the network installation process is similar, not to say more, online related information is also more.

Seven. My project can not be automatically compiled, what's going on.

In this case, you may have a fatal error in your project, and the first thing to do is to rule out and compile. I have code cleanliness, usually seeing the red fork and all kinds of Eclipse's mentioning

Show, all feel uncomfortable, first rule out then quickly.

In addition, eclipse defaults to be compiled automatically after you modify the program, and if you can't compile automatically, you can see if the Project->build automatically option is selected.

If you want to recompile the whole project, you can use Project->clean.

Eclipse is not automatically loaded if you copy certain files into the Eclipse's Engineering folder in the file system. If you want to edit these files in the Eclipse environment, please work

Right-click->refresh.

Eight. Pakage explore is one of the most commonly used views, and what are the tips for using it?

1.pakage explore in the project too much, old influence my editor other works, I should do.

The most convenient way is to click the right button to delete, the next page prompts you to delete only the project or even the project content files and folders together delete, the default is to delete the project only. Don't worry, bold.

Delete, the contents of the file system will not be deleted, and so you want to use the project, you can import again.

Another method is to right-click->close Project, after the operation, the project icon becomes a storage box appearance. When you want to use the project again, you can

Right-click->open Project.

2. The content of the project is too many, some content I do not need to edit, need to hide, what should I do.

Click the inverted triangle on the top of Pakage explore to click the Filters option in the Drop-down menu, and then tick the content you don't want to display, or enter a file in the text box that you don't want to display.

Type of suffix, such as: *.jar.

3. My pakage explore shows how the package structure is different from others.

Pakage Explore provides two different views for the display of the package structure, flat and hierarchical, and you can click the inverted triangle on pakage explore, and then click Dropdown

Pakage presentation in the menu to toggle.

Nine. How to import the export in Eclipse.

1. I have an Eclipse project, how do I get it into the eclipse development environment.

Right-click the Pakage explore blank, import->general->existing projects into workspace, and then select the path to your Eclipse project and import it.

2. I want to compile some Java files and make a jar package, what should I do.

In Pakage Explore, select the Java file you want to compile, and then right-click, Export->java->jar file, the next few pages according to your specific requirements for the choice of options,

Until it's done, in general, the default option is OK.

3. The classes and methods in my Java file are commented in detail and I want to generate an API help document.

In Pakage explore, select your Java file, and then click on the right button, Export->java->javadoc, the next page according to your needs to select options, the general default can be

Out. However, the prerequisite for exporting Javadoc is that your comments need to be written according to Javadoc rules, the rules are very simple, interested to see the information in this area, there are more online

Of

There is an Eclipse project on 4.cvs, how can I import it into eclipse.

Right-click on Pakage explore blank, new->project->cvs->projects from cvs->create a new repository location, Complete the CVS server letter in the next page

and username password, and so on, and then the next step until completed.

10. Good at using Eclipse's automatic generation Code and code formatting features

Open a Java file, right-click on the->source, or click on the menu bar's Source menu item to see that eclipse offers a lot of code generation and formatting capabilities.

The most commonly used is to generate Pojo getter and setter, right key->source->generate getters and setters, select the field you want to generate getter or setter, ha, generated, is not very convenient.

11. How to run a section of Java code quickly? With Scrapbook
Sometimes we want to write snippets of Java code temporarily, such as not knowing the current JVM system variables.
Should use SYSTEM.OUT.PRINTLN (System.getproperties ());
In Eclipse, you can create a new scrapbook to run this line of code without having to write a class class serious.
The steps are as follows:
New (CTRL + N)--> enter "Scrap", select Scrapbook page, and then generate a *.jpage, enter the above code, select, click on the toolbar "Execute selected Code" button can be run.

12. Click on a method, the results jumped to the interface, how to easily find the specific implementation method.
When the cursor is on the method, with Ctrl+t, you can display the implementation class for this method. Select on the line.

Eclipse Common Hotkeys

Global Find and replace Ctrl+f
Global Undo Ctrl+z
Global Replication Ctrl + C
Global clipping Ctrl+x
Global Quick Fix ctrl+1
All globally selected CTRL + A
Global Single Step Return F7
Global Single Step Skip F6
Global single Step hop into F5
Global Single Step Jump selection Ctrl+f5
Global debugging last started F11
Global Continue F8
Global Use filter Stepping Shift+f5
Global Add/Remove breakpoints Ctrl+shift+b
Global Display Ctrl+d
Global run last started Ctrl+f11
Global Run to row ctrl+r
Global Execution Ctrl+u

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.