1 11 12 package org.eclipse.ant.internal.ui; 13 14 import org.eclipse.ant.internal.ui.editor.text.XMLTextHover; 15 import org.eclipse.jface.text.IRegion; 16 import org.eclipse.jface.text.ITextDoubleClickStrategy; 17 import org.eclipse.jface.text.ITextViewer; 18 19 public class AntDoubleClickStrategy implements ITextDoubleClickStrategy { 20 21 24 public void doubleClicked(ITextViewer textViewer) { 25 int offset= textViewer.getSelectedRange().x; 26 27 if (offset < 0) { 28 return; 29 } 30 IRegion region= XMLTextHover.getRegion(textViewer, offset); 31 if (region != null) { 32 textViewer.setSelectedRange(region.getOffset(), region.getLength()); 33 } 34 } 35 } | Popular Tags |