Changes between Version 13 and Version 14 of ConfiguringIDE
- Timestamp:
- 07/20/2016 11:15:06 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ConfiguringIDE
v13 v14 7 7 ''' ''Please note'' ''': All settings on this page are recommendations and show my personal preferences. If something does not work for you or you disagree with it please feel free to ignore the corresponding chapters. After all your settings are as right and wrong as mine are. 8 8 9 == Settings for Text Editors == 9 == Preference based configurations == 10 11 === Settings for Text Editors === 10 12 The following settings apply to all text editors include Java and XML editors. To change these settings open the IDE preferences and go to ''General'' > ''Editors'' > ''Text Editors'': 11 13 … … 16 18 [[Image(configuration_texteditor.png)]] 17 19 18 == Typing in Java==20 === Typing in Java === 19 21 The following settings can be found in the preferences in ''Java'' > ''Editor'' > ''Typing''. 20 22 … … 24 26 [[Image(configuration_typing.png)]] 25 27 26 == Highlighting of brackets==28 === Highlighting of brackets === 27 29 It is useful to see where the current code block starts and ends. In the Eclipse preference under ''Java'' > ''Editor'' you can change the '''Bracket highlighting''' to '''Eclosing brackets'''. Now the enclosing () or {} will be highlighted when placing the cursor. 28 30 29 31 [[Image(configuration_javaeditor.png)]] 30 32 31 == Link the editors with the Package Explorer view==32 Sometimes it is hard to find out where the file you have opened in an editor is physically located (e.g. which project, which package, which folder). Linking editors and ''Package Explorer'' make sure that the file from the current active editor is always selected in the ''Package Explorer''. To enable or disable this feature click the link button in the ''Package Explorer'': 33 == Code formatter == 34 By default Eclipse follows the Java code style. But some people find the arrangement of brackets, new lines and so on not easy to read. In that case you can create your own code formatter using the preference page ''Java'' > ''Code Style'' > ''Formatter'' 33 35 34 [[Image(configuration_ link.png)]]36 [[Image(configuration_formatter.png)]] 35 37 36 == Save Actions == 38 * '''New ...''' create a new named code formatter 39 * '''Edit ...''' make changes to the selected formatter, as part of the following dialog you have the option to save the settings to a file by using the '''Export...''' button. 40 * '''Import...''' import the formatter settings from a file that has been exported before. This is very convenient if a new workspace is create 41 42 The options to customize an own formatter are very diverse and will not be described here. The system is self-explanatory. However an example formatter is attached to this article (attachment:formatter.zip). 43 44 === Save Actions === 37 45 Eclipse IDE has the option to cleanup your Java code when saving a file. The settings can be found in the preferences on the page ''Java'' > ''Editor'' > ''Save Actions''. 38 46 … … 47 55 [[Image(configuration_save.png)]] 48 56 49 == Type filter==57 === Type filter === 50 58 When using SWT or JFace controls it often happens that Eclipse can not automatically fix the imports since it does not know if java.awt.Button or org.eclipse.swt.widgets.Button is the right import. If you are not working with AWT or SWING in the workspace it is a good idea to filter their classes out, so that only SWT imports are left. This can be configured in the preferences on the page ''Java'' > ''Appearance'' > ''Type Filters'': 51 59 … … 55 63 [[Image(configuration_filter.png)]] 56 64 57 == Autocompletion configuration==65 === Autocompletion configuration === 58 66 When writing a method in Java autocompletion can be used to complete the method. But sometimes the start is not right and instead of ''x.something'' you write ''x.anything''. When you go back to the dot and trigger the autocompletion (''CTRL+Space'' in Windows) you can now select the right method but will end up with ''x.somethinganything'' or ''x.something()anything'' because Eclipse inserted the method rather than overwrite. When using autocompletion Java will by default add the names of the method arguments as placeholders to be replaced with the right variables. However it is also possible to let Eclipse guess the best option and autofill the arguments with the corresponding variables. If that happens often you want to change this behavior in preferences on page ''Java'' > ''Editor'' > ''Content Assist'': 59 67 * '''Completion overwrites''' will fix the mentioned behavior. … … 64 72 ''' ''Please Note'' ''': The guessing of the parameters does not free you from careful checking that the arguments are correct. Even if Eclipse gets it right in 90+ % of all cases. 65 73 66 == Hungarian notation and this.==74 === Hungarian notation and this. === 67 75 If you prefer a certain prefix or suffix scheme for naming your variable you can configure this in the preferences on page ''Java'' > ''Code Style''. You can also configure Eclipse to use the ''this.'' qualifier when generating code involving member variables: 68 76 * '''Conventions for variable names''' tables allows to customize prefix and suffix for variables … … 71 79 [[Image(configuration_stype.png)]] 72 80 73 == Show Breadcrumb == 81 == Other configurations == 82 83 === Show Breadcrumb === 74 84 Another way to keep track of the location of the current file is to enable the breadcrumb feature on top of the Java editor. To enable right click in the Java editor (any file) and select '''Show in Breadcrumb'''. Any Java editor will have this feature now. To disable it right click on a breadcrumb and choose '''Hide Breadcrumb'''. 75 85 76 86 [[Image(breadcrumb.png)]] 77 87 78 == Package presentation==88 === Package presentation === 79 89 By default Eclipse will present each Java package in the ''Package Explorer'' as an entry under ''src'' with its full package name. If the package hierarchy is very deep this can become confusing and space consuming. In this case it may be helpful to present the packages as a tree rather than a list. The following image illustrate the difference: 80 90 … … 85 95 [[Image(compare_package_menu.png)]] 86 96 87 == Working sets==97 === Working sets === 88 98 If an application consists of multiple projects that are present in the workspace it is easily overwhelming and hard to keep track of the current working environment. Eclipse working sets allow to hide certain elements from the ''Package Explorer'' reducing the visible elements to a desired set of projects. This is useful if you are working on a single or a few projects right now. Since the other projects are not deleted but just hidden they can still be used for compiling and deploying but will not crowd up the ''Package Explorer''. 89 99 90 === Creating a Working set===100 ==== Creating a Working set ==== 91 101 * To create a working set select the menu of the ''Package Explorer'' (represented as a little triangle left of the minimize button) and choose '''Select Working Set...''' 92 102 … … 105 115 [[Image(workingset4.png)]] 106 116 107 === Changing the working set===117 ==== Changing the working set ==== 108 118 * To switch between the working sets open the menu of the ''Package Explorer'' (represented as a little triangle left of the minimize button) and choose '''Select Working Set...''' 109 119 … … 120 130 [[Image(workingset6.png)]] 121 131 122 == Code formatter==123 By default Eclipse follows the Java code style. But some people find the arrangement of brackets, new lines and so on not easy to read. In that case you can create your own code formatter using the preference page ''Java'' > ''Code Style'' > ''Formatter'' 132 === Link the editors with the Package Explorer view === 133 Sometimes it is hard to find out where the file you have opened in an editor is physically located (e.g. which project, which package, which folder). Linking editors and ''Package Explorer'' make sure that the file from the current active editor is always selected in the ''Package Explorer''. To enable or disable this feature click the link button in the ''Package Explorer'': 124 134 125 [[Image(configuration_ formatter.png)]]135 [[Image(configuration_link.png)]] 126 136 127 * '''New ...''' create a new named code formatter128 * '''Edit ...''' make changes to the selected formatter, as part of the following dialog you have the option to save the settings to a file by using the '''Export...''' button.129 * '''Import...''' import the formatter settings from a file that has been exported before. This is very convenient if a new workspace is create130 131 The options to customize an own formatter are very diverse and will not be described here. The system is self-explanatory. However an example formatter is attached to this article (attachment:formatter.zip).