How to use eclipse with tips

Source: Internet
Author: User
Tags comments prev try catch

The use of 1,eclipse operation;

Create work space;

Create a project;

Create a package;

Creates a main function, and outputs a statement at the console;

Create an interface;

Automatic generation of accessors (set (), Get () method)

Try catch surround statement;

ALT +/hint;

Ctrl +/quick fix;

Ctrl + D deletes the current line;

Project import, export;

Edit related shortcut keys

Eclipse is very powerful in its editing capabilities, and can greatly improve development efficiency by mastering the Eclipse shortcut key features. The following are some of the key shortcuts in eclipse that are related to editing.

1. "Alt+/"

This shortcut for the user to edit a good helper, can provide users with the content of the auxiliary, do not remember the whole method and attribute name, when the name of not all the class, method and attributes, more experience the "alt+/" shortcut keys bring benefits.

2. "Ctrl+o"

Displays an outline of methods and properties in a class that quickly locates the methods and properties of a class and is useful when looking for bugs.

3. "Ctrl+/"

Quickly add comments that enable you to quickly annotate or uncomment the row or selected line of the cursor, and you may need to annotate something or uncomment it while you are debugging, so now you don't need a duplicate comment for each line.

4. "Ctrl+d"

Delete the current row, which is also one of the author's favorite, do not have to delete a row and the deletion of the key so many times.

5. "Ctrl+m"

Window maximization and restore, when the user in the window to operate, always feel the current window small (especially when writing code), now good, try "ctrl+m" shortcut keys.

View and position shortcut keys

In the program, quickly locate the location of the code, quickly find where the bug is, it is very difficult, Eclipse provides a powerful lookup function, you can use the following shortcut keys to help complete the search positioning work.

1. "Ctrl+k", "Ctrl++shift+k"

Find the selection quickly down and up, and you will no longer need to click the Find dialog box with your mouse.

2. "Ctrl+shift+t"

Find the Java class file found in the workspace (Workspace) build path, and do not suffer for a class that cannot be found, and you can use "*". "The wildcard character.

3. "Ctrl+shift+r"

As with "Ctrl+shift+t", Find all the files (including Java files) in the workspace (Workspace), or you can use wildcard characters.

4. "Ctrl+shift+g"

Find references to classes, methods, and properties. This is a very useful shortcut, such as modifying the code that references a method, and you can quickly locate all references to this method by using the "ctrl+shift+g" shortcut key.

5. "Ctrl+shift+o"

Quickly generate import, when copying a program from the Internet, do not know how to import into the called class, try "ctrl+shift+o" shortcut keys, there will be surprises.

6. "Ctrl+shift+f"

Format code, writing format specification code is a compulsory course for every programmer, when you see a piece of code very uncomfortable, select and press the "ctrl+shift+f" shortcut key to format this code, if not selected code is the default format of the current file (Java file).

7. "Alt+shift+w"

Find the path in the project where the current file is located, and you can quickly locate the browser view, which is useful when you want to find the package where a file resides (especially in larger projects).

8. "Ctrl+l"

Navigates to a row in the current editor and is also valid for non-Java files.

9. "Alt+←", "alt+→"

Back history and forward history are useful for tracking code, and users may have looked up several related places, but may not be able to remember the order in which they are located.

10. "F3"

A quick way to locate a class, method, and property of the cursor position.

11. "F4"

Displays the inheritance relationship of the class and opens the Class inheritance view.

debugging shortcut keys

Some of the following shortcut keys for running debugging are available in eclipse.

1. "Ctrl+shift+b": a breakpoint that sets a breakpoint or cancels the setting on the current line.

2. "F11": Debug the Last execution of the program.

3. "Ctrl+f11": Run the last program executed.

4. "F5": Trace to the method, when the program executes to a method, you can press the "F5" key to trace to the method.

5. "F6": Step to execute the procedure.

6. "F7": After executing the method, return to the last statement that called this method.

7. "F8": Continue execution to the next breakpoint or program end.

Frequently used editor shortcut keys

Often text editors provide shortcuts for editing, and you can use them for text editing in Eclipse.

1. "Ctrl + C": Copy.

2. "Ctrl+x": Cut.

3. "Ctrl + V": Paste.

4. "Ctrl+s": Save the file.

5. "Ctrl+z": withdrawn.

6. "Ctrl+y": Repeat.

7. "Ctrl+f": Find.

Other shortcut keys

There are a number of shortcuts in eclipse that you can't enumerate, you can find how to use them by helping documents, and there are several common shortcuts below.

1. "Ctrl+f6": Switch to the next editor.

2. "Ctrl+shift+f6": Switch to the previous editor.

3. "CTRL+F7": Switch to the next view.

4. "CTRL+SHIFT+F7": Switch to the previous view.

5. "Ctrl+f8": Switch to the next perspective.

6. "Ctrl+shift+f8": Switch to previous perspective.

There are many shortcuts in eclipse that you can use to help you find all the shortcuts, but it is not possible to master all the shortcuts, and if you take the time to familiarize yourself with the shortcuts listed in this section,

--------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------

1 keys to the most important shortcuts

Code Assistant: Ctrl+space (Simplified Chinese operating system is alt+/)

Quick FIX: Ctrl+1

Word Complement: alt+/

Open external Java document: SHIFT+F2

Display Search dialog box: ctrl+h

Fast Outline:ctrl+o

Open resource: Ctrl+shift+r

Open type: ctrl+shift+t

Show refactoring menu: Alt+shift+t

Position of previous/next cursor: alt+left/right

Prev/Next Member (Member object or member function): Ctrl+shift+up/down

Select the closed element: Alt+shift+up/down/left/right

Delete Row: Ctrl+d

Inserts a row on the current line: Ctrl+shift+enter

Inserts a row below the current line: Shift+enter

Move selected rows up and down: alt+up/down

Organization Import: Ctrl+shift+o

2 positioning

2.1 In-line positioning

End/beginning of line: End/home

Previous/Last Word: ctrl+right/left

2.2 Positioning within the file

Jump to a line: ctrl+l

Up and down scrolling screen: Ctrl+up/down

Prev/Next Member (Member object or member function): Ctrl+shift+up/down

Fast Outline:ctrl+o

2.3 Cross-file positioning

Open statement: F3

Open resource: Ctrl+shift+r

Open type: ctrl+shift+t

To search for a selected element's declaration in workspace: ctrl+g

Search for selected text in workspace: ctrl+alt+g

To search for a reference to a selected element in workspace: ctrl+shift+g

Open Call Hierarchy: Ctrl+alt+h

Quick hierarchies: ctrl+t

Regret: Ctrl+z

2.4 Other

Previous/Next cursor position: alt+left/right

Previous Edit location: Ctrl+q

3 Check

3.1 Lines selected

Select to end of Line/beginning of: Shift+end/home

Select the last/next word: ctrl+shift+left/right

3.2 File selected

Select the closed element: Alt+shift+up

Revert to previous check: Alt+shift+down

Select the next/previous element: Alt+shift+right/left

4 positioning/checking/operation at the same time

Delete Row: Ctrl+d

Delete Next/previous word: ctrl+delete/backspace

Delete to end of line: Ctrl+shift+delete

Inserts a row on the current line: Ctrl+shift+enter

Inserts a row below the current line: Shift+enter

Move selected rows up and down: alt+up/down

Copy selected row: Ctrl+alt+up/down

5 other code-editing class shortcuts

Save: Ctrl+s

Save All: Ctrl+shift+s

Next hit item (after search): Ctrl +.

Note: ctrl+/

Add Import: Ctrl+shift+m

Show shortcut keys help: Ctrl+shift+l

into large/lowercase: ctrl+shift+x/y

6 refactoring

Show refactoring menu: Alt+shift+t

Refactoring-changing method signatures: Alt+shift+c

Refactoring-Moving: alt+shift+v

Refactoring-Renaming: alt+shift+r

7 Editor, view, pivot chart switching

Next Editor: Ctrl+f6

Next view: Ctrl+f7

Next perspective: Ctrl+f8

Maximize Current View or editor: Ctrl+m

Activate Editor: F12

8 Debug

F5:step into (Debug)

F6:step over (Debug)

F7:step return (Debug)

F8:resume (Debug)

F11:debug previous application (Debug)

9 up/down/right/left type shortcut keys

Ctrl

Previous/Last Word: ctrl+right/left

Up and down scrolling screen: Ctrl+up/down

Alt

Position of previous/next cursor: alt+left/right

Move selected rows up and down: alt+up/down

Shift

Select the previous/next character: Shift+left/right

Select the previous line/next line (starting at the current cursor position): Shift+up/down

Ctrl+shift

Prev/Next Member (Member object or member function): Ctrl+shift+up/down

Select the last/next word: ctrl+shift+left/right

Alt+shift

Select the closed element: Alt+shift+up

Revert to previous check: Alt+shift+down

Select the next/previous element: Alt+shift+right/left

Copy selected row: Ctrl+alt+up/down

Ctrl+alt

Copy selected row: Ctrl+alt+up/down

Class F shortcut keys

F2: Show hints/renames

F3: Open the declaration of the selected element

F4: Open the Type inheritance structure of the selected element

F5: Refreshing

F5:step into (Debug)

F6:step over (Debug)

F7:step return (Debug)

F8:resume (Debug)

F11:debug previous application (Debug)

F12: Activating editor

================================================================

================================================================

MyEclipse use tips and shortcuts 2008-01-23 09:22eclipse itself quickly, but with the MyEclipse, the memory is crazy, and speed is slow, then how to let Eclipse drag myeclipse crazy. Here's a tip: canceling automatic validation

Validation have a bunch of, what XML, JSP, JSF, JS, etc., we do not need all to automatically check, just need the time will be hand-check, speed immediately improve several grades.

Cancellation Method: Windows-->perferences-->myeclipse-->validation

All except the check boxes below manual, all of them are not selected

Manual Verification Method:

On the file you want to verify, right-click-->myeclipse-->run validation

Automatic layout of program code: CTRL+SHIFT+F, will automatically format the code layout, very convenient

Quick Execution Program: Ctrl + F11 The first time it executes, it asks you to execute the mode, set it up, and as soon as you press the hotkey, it executes quickly.

ctrl+shift+/Plus segment Annotation/**/

ctrl+shift+/Cancel Segment Annotation/**/

ctrl+/Plus line comments or uncomment

Categories required for automatic import: Ctrl+shift+m Ctrl+shift+o It's like using Ctrl+shift+o.

Press new Remote Site,name to fill in svn, url fill http://subclipse.tigris.org/update, until next to Finished

MyEclipse shortcut keys

(1) Ctrl+m the size of the toggle window

(2) Ctrl+q jumps to the last editorial office

(3) F2 when the mouse is placed in a marker Tooltip when pressed F2 the mouse to move away when the Tooltip will also show that shows Tooltip Description.

F3 jumps to the place where the declaration or definition is made.

F5 Step into the function inside.

F6 Single Step debugging does not enter the function inside, if installed PowerWord 2006 will be "Take word switch" shortcut keys to change to other.

The F7 is returned to the call from within the function.

F8 always executes to the next breakpoint.

(4) ctrl+pg~ for XML file is switch code and Diagram window

(5) Ctrl+alt+i look at the information about the variables in the Java file

(6) Ctrl+pgup for the Code window is to open the "Show List" Drop-down box, which shows the recently opened file in the dropdown box

(7) ctrl+/is the//~ annotation in the Code window.

ctrl+shift+/is the/*~*/annotation in the Code window, which is the <!--~--> in the JSP file window.

(8) Alt+shift+o (or click on the Toggle Mark Occurrences button in the toolbar) when you click on a tag to make this mark in the other parts of this page highlighted yellow, and the window on the right side of the box will appear white squares, click this box will jump to this mark.

(9) Right-click on the left border of the window that adds a breakpoint to the location of the show line numbers can be added.

(a) ctrl+i format-activated element format active Elements.

Ctrl+shift+f formatted file format document.

(one) Ctrl+s save the current file.

Ctrl+shift+s Save all unsaved files.

Ctrl+shift+m (Put the cursor on the class name of the package you want to import) is a plus import statement.

The Ctrl+shift+o effect is that the import statement is missing and the extra import statement is deleted.

Ctrl+space prompts you to type content Assist, change the shortcut keys for Chinese (Simplified) Ime-ime/nonlme toggle in the Input method (for switching English and other text) to something else.

Ctrl+shift+space hint information is the context information.

(14) Double-click the left border of the window to add a breakpoint.

(ctrl+d) Delete when moving forward

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.