~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to ide/projectimport/bluej/javahelp/org/netbeans/bluej/docs/bluej-editor-quickref.html

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<!--       
 
3
 *     Copyright ļæ½ 2006 Sun Microsystems, Inc. All rights reserved.
 
4
 *     Use is subject to license terms.
 
5
 *
 
6
-->
 
7
<html>
 
8
    <head>
 
9
        <title>Source Editor Tips</title>
 
10
        <link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css"></TITLE>
 
11
    </head>
 
12
 
 
13
    <body>
 
14
 
 
15
        <h2>Source Editor Tips</h2>
 
16
 
 
17
        <p>The following table shows how to accomplish some common tasks 
 
18
and gives you some tips for working in the IDE's Source Editor.</p>
 
19
 
 
20
        <table border="1" cellpadding="5" cellspacing="0" summary="The left column lists the
 
21
            task name. The right column lists the steps to perform.">
 
22
            <tr valign="top"> 
 
23
                <th scope="col" align="left">To perform this task</th>
 
24
                <th scope="col" align="left">Follow these steps</th>
 
25
 
 
26
            </tr>
 
27
            <tr valign="top"> 
 
28
                <td>Handle the automatic insertion of quotation marks, parentheses, and so on.</td>
 
29
 
 
30
                <td> 
 
31
                    <p>When you type a character that typically is used in pairs (such 
 
32
                    as a quotation mark or a parenthesis, the IDE also automatically inserts 
 
33
                    the closing character (such as another quotation mark or the 
 
34
                    closing parenthesis). If you find this distracts your typing, 
 
35
                    you can simply type the closing characters as you would normally. 
 
36
                    The IDE will use the closing character that you type and delete the 
 
37
                    character that it inserted.</p>
 
38
                </td>
 
39
            </tr> 
 
40
            
 
41
            <tr valign="top"> 
 
42
                <td>Format code automatically with consistent indentation.</td>
 
43
 
 
44
                <td> 
 
45
                    <ul><li>Right-click in the Source Editor and choose Reformat Code. 
 
46
                    <p>If any text is selected, only 
 
47
                    that text will be reformatted. If no text is selected, then the whole file is reformatted.</p></li></ol>
 
48
                </td>
 
49
            </tr> 
 
50
 
 
51
            <tr valign="top"> 
 
52
                <td>Find the appropriate code element (class, method, or field) 
 
53
                and insert it into your code.</td>
 
54
 
 
55
                <td> 
 
56
                    <ol>
 
57
                    <li>When typing in the Source Editor, press Ctrl-Space to open 
 
58
                    the 
 
59
                    <a href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/editing/codecompletion/intro.html">code completion</a> box.</li>
 
60
                    </li>
 
61
                    <li>Scroll the list of code elements provided, select the one you 
 
62
                    want, and press Enter. </li></ol>
 
63
                </td>
 
64
            </tr>            
 
65
            
 
66
            <tr valign="top"> 
 
67
                <td>Insert a commonly used code snippet.</td>
 
68
                <td> 
 
69
 
 
70
                    <ul>
 
71
                        <li>Type the abbreviation for the code snippet and press Shift-Space.</li>
 
72
                    </ul>
 
73
                    <p>See <a href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/shortcuts/abbreviations-list.html">Code Template Abbreviations: Quick Reference</a>.</p>
 
74
                </td>
 
75
            </tr>
 
76
            <tr valign="top"> 
 
77
                <td>Quickly insert a word that you have already typed elsewhere.</td>
 
78
                <td> 
 
79
                    <ol>
 
80
                        <li>Type the beginning character of the word that you have 
 
81
                        previously typed.</li>
 
82
                        <li>Type Ctrl-K to insert the closest previous word that matches 
 
83
                        those beginning characters.</li>
 
84
                    </ol>
 
85
                    
 
86
                    <p>For example, consider the following code:
 
87
                    <pre>BufferedReader br = new BufferedReader(<i>...</i>)</pre>
 
88
                    <p>You can save yourself several keystrokes by doing the following:
 
89
                    <ol>
 
90
                        <li>Type 
 
91
                        <pre>BufferedReader br = new B</pre></li>
 
92
 
 
93
                        <li>Press Ctrl-K to insert <tt>ufferedReader</tt>
 
94
 
 
95
                        </li>
 
96
                    </ol>
 
97
                    <p>See <a href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/editing/wordmatch.html">Using the Word Match Feature</a> 
 
98
                    for more information.</p>
 
99
                </td>
 
100
            </tr>            
 
101
            <tr valign="top"> 
 
102
                <td>Go to the Java source for the identifier the insertion point is on.</td>
 
103
                <td> 
 
104
                    <ul><li>Press Alt-O, or choose 
 
105
                        Navigate &gt; Go to Source.
 
106
                    </li></ul>
 
107
                </td>
 
108
            </tr>
 
109
            <tr valign="top"> 
 
110
                <td>Go to a Java file via hyperlinks.</td>
 
111
                <td> 
 
112
                    <ul>
 
113
                        <li>Hold down the Ctrl key and, at the same time, move your mouse over and click a
 
114
                        Java identifier (package, class, method, variable).</li>
 
115
                    </ul>
 
116
 
 
117
                </td>
 
118
            </tr>
 
119
 
 
120
            <tr valign="top"> 
 
121
                <td>Go to a Java class.</td>
 
122
                <td> 
 
123
                    <ul><li>Choose Edit&nbsp; &gt; Go To Class or press Alt-Shift-O.
 
124
                    .
 
125
                    <p>
 
126
                    </p></li></ul>
 
127
                </td>
 
128
            </tr>
 
129
            <tr valign="top"> 
 
130
                <td>Jump to the declaration for the Java method or field the insertion point is on.</td>
 
131
                <td> 
 
132
                    <ul><li>Press Alt-G, or right-click and choose 
 
133
                        Go To  &gt; Declaration from 
 
134
                        the pop-up menu.
 
135
                    </li></ul>
 
136
                </td>
 
137
            </tr>
 
138
            <tr valign="top"> 
 
139
                <td>Go to a specific method or field in the currently displayed Java class.</td>
 
140
                <td> 
 
141
                    <ul>
 
142
                        <li>Double-click the method or field 
 
143
                        in the Navigator window.</li>
 
144
                    </ul>
 
145
                </td>
 
146
            </tr>
 
147
 
 
148
            <tr valign="top"> 
 
149
                <td>Jump back and forth among areas of code in which you 
 
150
                have been working.</td>
 
151
                <td> 
 
152
                    <ul>
 
153
                        <li>Use the Alt-K and Alt-L <a href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/editing/jumplist.html">jump list</a> 
 
154
                        keyboard shortcuts.</li>
 
155
                    </ul>
 
156
                </td>
 
157
            </tr>
 
158
            <tr valign="top"> 
 
159
                <td>Bookmark a line of code.</td>
 
160
                <td> 
 
161
                    <ul>
 
162
                        <li>Click anywhere in the line that you want to bookmark and press Ctrl-F2.
 
163
                        <p>Press F2 to cycle through your bookmarks.</p>
 
164
                        <p>Press Ctrl-F2 on a bookmarked line to remove the bookmark.</li>
 
165
                    </ul>
 
166
                </td>
 
167
            </tr>
 
168
            
 
169
            <tr valign="top"> 
 
170
                <td>Maximize the Source Editor.</td>
 
171
                <td> 
 
172
                    <p>Do one of the following:</p>
 
173
                    <ul>
 
174
                        <li>Double-click a file's tab in the Source Editor.
 
175
                        </li>
 
176
 
 
177
                        <li>Make sure that the Source Editor window has focus and then press Shift-Escape.</li>
 
178
                        <li>Choose Window&nbsp; &gt; Maximize.</li>
 
179
                    </ul>
 
180
                </td>
 
181
            </tr>
 
182
            <td>Revert a maximized Source Editor to its previous size.</td>
 
183
 
 
184
            <td> 
 
185
                <p>Do one of the following:</p>
 
186
                <ul>
 
187
                    <li>Double-click a file's tab in the Source Editor.</li>
 
188
                    <li>Press Shift-Escape.</li>
 
189
                    <li>Choose Window&nbsp; &gt; Restore.
 
190
                    </li>
 
191
 
 
192
                </ul>
 
193
            </td>
 
194
            </tr>
 
195
            <tr valign="top"> 
 
196
                <td>Display line numbers.</td>
 
197
                <td>Choose View
 
198
                    &gt; Show Line Numbers.
 
199
                </td>
 
200
            </tr>
 
201
 
 
202
            <tr valign="top"> 
 
203
                <td>View two files simultaneously.</td>
 
204
                <td> 
 
205
                    <ol><li>Open two or more files.</li>
 
206
                    <li>Click the tab of one of the files and drag it to the side of the window 
 
207
                    where you want the file to be 
 
208
                    placed. When a red preview box appears to show you where the window will be placed, 
 
209
                    release the mouse button to drop the window.
 
210
                    <p>The window can be split horizontally or vertically, depending on where you drag 
 
211
                    the tab.</li></ol>
 
212
                </td>
 
213
            </tr> 
 
214
            <tr valign="top"> 
 
215
                <td>Split the view of a single file.</td>
 
216
 
 
217
                <td> 
 
218
                    <ol>
 
219
                    <li>Right-click the document's tab in the Source Editor and choose 
 
220
                        Clone Document.
 
221
                    </li>
 
222
                    <li>Click the tab of the cloned document and drag it to the part of the window 
 
223
                    where you want the copy to be placed. </li></ol>
 
224
                </td>
 
225
            </tr>
 
226
 
 
227
            
 
228
 
 
229
 
 
230
            
 
231
        </table>
 
232
 
 
233
 
 
234
        <hr>
 
235
 
 
236
        <small><a href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/credits.html">Legal Notices</a></small> 
 
237
 
 
238
    </body>
 
239
</html>