Let's go on to the blog, "Play with Eclipse development tools (i)".
three eclipse basic usage
(1) using Eclipse to create Java projects, packages, classes
Creating a project, package, and class is a holistic process that is inseparable from the Eclipse development tools, used in the past by using Notepad.
words, you have to know the classes in eclipse must exist in the project, The class recommendation is placed in a package.
Create a new project:
Create a new class under a new project while creating the package at the same time:
Results after a successful creation:
(2) Create a file using Eclipse creation
use eclipse creation to create text-based files, including but not limited to: TXT, XML, properties (typically attribute files), and so on.
Create a text file called User.txt under the demo project:
Within the Com.sina.demo package, create an XML file named Demo.xml:
Under demo, create a new folder named Config, one of the CONFIG. Properties File:
(3) introduction to the editor
Editors (editor) can associate different types of files to different types of editors; opening the appropriate editor in the workbench when double-clicking a file ; if
without the corresponding internal editor, the external editor opens, and on Windows, it can be used as an OLE The document opens the embedded editor.
The asterisk in the Editor's tab (tab) indicates that the file is not saved:
(4) run the Mian () method
When you save a Java file, the project is automatically built, and the Java class is automatically programmed into a class file that is stored in the specified folder (typically bin or classes).
You can run the main () method directly with the related operation, and the results will appear in the console.
command-line arguments vs. virtual machine parameters
Command-line arguments can pass an external string to the parameters of the main () method in the program
The virtual machine parameter can set the memory size, garbage collector, and some ancillary information that the JRE uses when it starts. We did not make an example here.
(5) Manage project source code
you can store source code using multiple source folder, It is appropriate to separate the function code from the test code.
(6) Create a working set
Working set: You can manage multiple related Java projects together.
The projects we create later can select the working set directly:
Four interface settings (1) Eclipse interface Basic Settings Set line number
In the left-most column of the editor, right-click the drop-down list and select Show line numbers to hide it.
Open a new window
Select Window on the menu bar and select the first option New window to create a new Java window.
resizing the editor
This is based on how much your code and debugging can be resized.
editor splitting and cloning
Window->editor select up and down, left and right, and clone an editor, we'll just look at one of the results for the split between left and right columns:
Hide and display toolbars
The operation is hidden: window->hide Toolbar, the operation shows: Window->show Toolbar, this is nothing to demonstrate.
(2) Vista (perperctive)
Vista defines the initial set and layout of the view in the Workbench window.
Related actions:
Toggle View
Switch to debug view: Window->perperctive->open Preperctive->debug
Close the vista
Should be used infrequently, here are two operations:
Window->perperctive->close perperctive
Window->perperctive->close All Perperctive
Custom View
Window->perperctive->customize perperctive
Save View
this need to look at the personal habits of our developers, if they want to have a fixed editor configuration, can be saved down, the next Times to continue
You can use your own custom editor configuration.
Window->perperctive->save perperctive
resetting the vista
This we may often use, once we have closed some of the necessary views, want to open, do not want to reopen one, we can restore
To the original view.
Window->perperctive->reset perperctive
(3) Views (view)
Views provide the editor and navigation to various resources in the workbench. Views can have their own menus and toolbars.
Related actions: Show, hide, drag position, these actions we will be able to.
Window->show View
General Views:
two console Views (for Socket network programming):
Play to Eclipse development tools (ii)