1 11 package org.eclipse.ui.internal.console; 12 13 import org.eclipse.jface.text.BadPositionCategoryException; 14 import org.eclipse.jface.text.DefaultPositionUpdater; 15 import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition; 16 17 22 public class HyperlinkUpdater extends DefaultPositionUpdater { 23 24 27 public HyperlinkUpdater() { 28 super(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); 29 } 30 35 protected boolean notDeleted() { 36 37 int positionEnd = fPosition.offset + fPosition.length - 1; 38 int editEnd = fOffset + fLength - 1; 39 if ((fOffset <= fPosition.offset && (editEnd > fPosition.offset)) || 40 (fOffset < positionEnd && (editEnd > positionEnd)) || 41 (fOffset >= fPosition.offset && fOffset <= positionEnd) || 42 (editEnd >= fPosition.offset && editEnd <= positionEnd)) { 43 44 fPosition.delete(); 45 46 try { 47 fDocument.removePosition(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY, fPosition); 48 } catch (BadPositionCategoryException x) { 49 } 50 51 return false; 52 } 53 54 return true; 55 } 56 } 57 | Popular Tags |