Changeset 642 for org.cfeclipse.cfml/trunk/src/org/cfeclipse/cfml/editors/dnd/SelectionCursorListener.java
- Timestamp:
- 04/17/08 07:30:14 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
org.cfeclipse.cfml/trunk/src/org/cfeclipse/cfml/editors/dnd/SelectionCursorListener.java
r2 r642 289 289 } 290 290 291 291 public void mouseDoubleClick(MouseEvent e) { 292 //see comment below 293 } 294 /* 295 * 296 * Commented for now because denny is using doubleClick in MarkOccurrencesListener 297 * 292 298 /** 293 299 * Sent when a mouse button is pressed twice within the … … 297 303 * 298 304 * @see org.eclipse.swt.widgets.Display#getDoubleClickTime() 299 */ 305 *//* 300 306 public void mouseDoubleClick(MouseEvent e) { 301 307 … … 352 358 353 359 startpos = this.fViewer.getSelectedRange().x; 354 selectWord(startpos); 355 } 356 357 358 } 359 360 361 protected boolean selectWord(int caretPos) 362 { 360 selectWord(startpos, e); 361 } 362 363 364 } 365 366 367 protected boolean selectWord(int caretPos, MouseEvent e) { 363 368 364 369 IDocument doc = this.fViewer.getDocument(); 365 370 int startPos, endPos; 366 367 try 368 { 371 String normalWordChars = "-"; 372 String breakWordChars = "_"; 373 String wordChars = normalWordChars; 374 String altWordChars = "-."; 375 String shiftWordChars = "-_"; 376 try { 377 if ((e.stateMask == SWT.ALT || e.stateMask == SWT.SHIFT + SWT.ALT)) { 378 wordChars = wordChars + altWordChars; 379 } 380 if ((e.stateMask == SWT.SHIFT || e.stateMask == SWT.SHIFT + SWT.ALT)) { 381 wordChars = wordChars + shiftWordChars; 382 breakWordChars = ""; 383 } 384 369 385 int pos = caretPos; 370 386 char c; 371 387 372 while (pos >= 0) 373 { 388 while (pos >= 0) { 374 389 c = doc.getChar(pos); 375 if (!Character.isJavaIdentifierPart(c) && c != '-')390 if (breakWordChars.indexOf(c) >= 0 || !Character.isJavaIdentifierPart(c) && wordChars.indexOf(c) < 0) 376 391 break; 377 392 --pos; … … 383 398 int length = doc.getLength(); 384 399 385 while (pos < length) 386 { 400 while (pos < length) { 387 401 c = doc.getChar(pos); 388 if (!Character.isJavaIdentifierPart(c) && c != '-')402 if (breakWordChars.indexOf(c) >= 0 || !Character.isJavaIdentifierPart(c) && wordChars.indexOf(c) < 0) 389 403 break; 390 404 ++pos; … … 395 409 return true; 396 410 397 } 398 catch (BadLocationException x) 399 { 400 //? 411 } catch (BadLocationException x) { 412 // ? 401 413 } 402 414 403 415 return false; 404 416 } 417 405 418 406 419 private void selectRange(int startPos, int stopPos) … … 412 425 413 426 414 427 */ 415 428 416 429
