1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
String handel;
Document doc;
int pos = textzone.viewToModel(e.getPoint());
elem = textzone.getStyledDocument().getCharacterElement(pos);
as = elem.getAttributes();
int posdepart = pos;
if(StyleConstants.getBidiLevel(as) != 20)
{
//return ;
}
for(; StyleConstants.getBidiLevel(as) == 20; as = textzone.getStyledDocument().getCharacterElement(posdepart).getAttributes())
{
posdepart--;
}
handel = null;
doc = textzone.getDocument();
try
{
//System.out.println(posdepart);
handel = doc.getText(0, doc.getLength()).substring(posdepart, doc.getText(0, doc.getLength()).indexOf(" ", posdepart+1));
}
catch(BadLocationException ex) {}
if(handel == null)
{
// ici je veut ré-exécuté la methode
}
handel = handel.replaceAll(">", "").trim();
hyperlinkReceiver.popupInfos(handel, e);
textzone.setCursor(new Cursor(12));
//ici aussi bloquage ou execution
if(StyleConstants.getBidiLevel(as) == 21 || StyleConstants.getBidiLevel(as) == 22)
{
textzone.setCursor(new Cursor(12));
} else
{
//hyperlinkReceiver.hidePopupInfos();
textzone.setCursor(new Cursor(0));
} |
Partager