A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse.xml.ui / src / net / sourceforge / phpeclipse / xml / ui / internal / text / TagDoubleClickStrategy.java
index 696b909..3e70d8f 100644 (file)
@@ -8,7 +8,7 @@
  * Contributors:
  *     Igor Malinin - initial contribution
  *
- * $Id: TagDoubleClickStrategy.java,v 1.2 2005-05-06 00:55:41 stefanbjarni Exp $
+ * $Id: TagDoubleClickStrategy.java,v 1.3 2006-10-21 23:14:13 pombredanne Exp $
  */
 
 package net.sourceforge.phpeclipse.xml.ui.internal.text;
@@ -20,7 +20,6 @@ import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.ITypedRegion;
 
-
 /**
  * 
  * 
@@ -30,44 +29,44 @@ public class TagDoubleClickStrategy extends TextDoubleClickStrategy {
        /*
         * @see org.eclipse.jface.text.ITextDoubleClickStrategy#doubleClicked(ITextViewer)
         */
-       public void doubleClicked( ITextViewer viewer ) {
+       public void doubleClicked(ITextViewer viewer) {
                int offset = viewer.getSelectedRange().x;
-               if ( offset < 0 ) {
+               if (offset < 0) {
                        return;
                }
 
                try {
                        IDocument document = viewer.getDocument();
 
-                       ITypedRegion region = document.getPartition( offset );
+                       ITypedRegion region = document.getPartition(offset);
 
                        int start = region.getOffset();
 
-                       if ( offset == start && document.getChar(offset) == '<' ) {
-                               region = document.getPartition( offset );
+                       if (offset == start && document.getChar(offset) == '<') {
+                               region = document.getPartition(offset);
                                offset = region.getOffset() + region.getLength();
 
-                               if ( document.getChar(offset - 1) != '>' ) {
-                                       while ( true ) {
-                                               if ( offset >= document.getLength() ) {
+                               if (document.getChar(offset - 1) != '>') {
+                                       while (true) {
+                                               if (offset >= document.getLength()) {
                                                        break;
                                                }
 
-                                               region = document.getPartition( offset );
+                                               region = document.getPartition(offset);
                                                offset = region.getOffset() + region.getLength();
 
-                                               if ( XMLPartitionScanner.XML_ATTRIBUTE
-                                                               .equals(region.getType()) ) {
+                                               if (XMLPartitionScanner.XML_ATTRIBUTE.equals(region
+                                                               .getType())) {
                                                        continue;
                                                }
 
-                                               if ( XMLPartitionScanner.XML_TAG
-                                                               .equals(region.getType()) ) {
-                                                       if ( document.getChar(region.getOffset()) == '<' ) {
+                                               if (XMLPartitionScanner.XML_TAG
+                                                               .equals(region.getType())) {
+                                                       if (document.getChar(region.getOffset()) == '<') {
                                                                break;
                                                        }
 
-                                                       if ( document.getChar(offset - 1) == '>' ) {
+                                                       if (document.getChar(offset - 1) == '>') {
                                                                break;
                                                        }
 
@@ -79,33 +78,33 @@ public class TagDoubleClickStrategy extends TextDoubleClickStrategy {
                                        }
                                }
 
-                               viewer.setSelectedRange( start, offset - start );
+                               viewer.setSelectedRange(start, offset - start);
                                return;
                        }
 
                        int end = start + region.getLength();
 
-                       if ( offset == end - 1 && document.getChar(offset) == '>' ) {
-                               region = document.getPartition( offset );
+                       if (offset == end - 1 && document.getChar(offset) == '>') {
+                               region = document.getPartition(offset);
                                offset = region.getOffset();
 
-                               if ( document.getChar(offset) != '<' ) {
-                                       while ( true ) {
-                                               if ( offset <= 0 ) {
+                               if (document.getChar(offset) != '<') {
+                                       while (true) {
+                                               if (offset <= 0) {
                                                        break;
                                                }
 
-                                               region = document.getPartition( offset - 1 );
+                                               region = document.getPartition(offset - 1);
                                                offset = region.getOffset();
 
-                                               if ( XMLPartitionScanner.XML_ATTRIBUTE
-                                                               .equals(region.getType()) ) {
+                                               if (XMLPartitionScanner.XML_ATTRIBUTE.equals(region
+                                                               .getType())) {
                                                        continue;
                                                }
 
-                                               if ( XMLPartitionScanner.XML_TAG
-                                                               .equals(region.getType()) ) {
-                                                       if ( document.getChar(offset) == '<' ) {
+                                               if (XMLPartitionScanner.XML_TAG
+                                                               .equals(region.getType())) {
+                                                       if (document.getChar(offset) == '<') {
                                                                break;
                                                        }
 
@@ -117,11 +116,12 @@ public class TagDoubleClickStrategy extends TextDoubleClickStrategy {
                                        }
                                }
 
-                               viewer.setSelectedRange( offset, end - offset );
+                               viewer.setSelectedRange(offset, end - offset);
                                return;
                        }
 
-                       super.doubleClicked( viewer );
-               } catch ( BadLocationException e ) {}
+                       super.doubleClicked(viewer);
+               } catch (BadLocationException e) {
+               }
        }
 }