Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I find brackets match in eclipse

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
how can I find where I miss closing or opening brackets in eclipse?
something more visual then what I have with my mouse over
do I need plug in or there is somekind of building option?
 
Dianne Doss
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Eclipse are you using?
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ObjectWeb Lomboz for JavaEE Development
Version: 3.1.2
 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just place a curser near the opening bracket and you will see a gray outline to the matching closing bracket.
Other option is just double click on the opening bracket and your code will be selected upto the closing bracket.
 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is from a "Tip of the Week" I authored for our developers:

How do I find a matching brace for a code block? ´┐Ż Eclipse offer several mechanisms for finding the matching brace for an if / for / do-while / while / try-catch code block. For all of these, you must place your cursor immediately after the opening or closing brace that you wish to find the matching brace for. If you place your cursor before the opening or closing brace, the instructions that follow will not work!

The first way to find a matching brace is to place your cursor after an opening or closing brace then double-click. The Java editor will highlight all of the lines between the opening and closing braces.

The second way is to place your cursor after an opening or closing brace then press Ctrl+Shift+P or, alternately, select Navigate >> Go To >> Matching Bracket from the menu bar. The Java editor will reposition the cursor to immediately after the matching closing or opening brace. This mechanism allows you to toggle the position of the cursor between the opening and closing braces of a code block.

The third way requires configuration of your Preferences. Select Window >> Preferences´┐Ż >> Java >> Editor. Select Highlight matching brackets. Optionally, you may select Matching brackets highlight from the Appearance color options and click on Color to choose a highlight color. It recommended that you change the color because the default (gray) is difficult to see. Click Apply then OK.

Once configured, place your cursor after an opening or closing brace. The Java editor will draw a box around the matching closing or opening brace in the color you selected. Note that, if both code block braces are not visible in the Java editor at the same time, you must use the scroll bar to find the matching closing or opening brace.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic