assertNull(detector.detectHyperlinks(textViewer, new Region(255, 1), false));
IRegion region = new Region(1052, 1);
IHyperlink[] hyperlinks = detector.detectHyperlinks(textViewer, region, false);
assertEquals(hyperlinks.length, 2);
final IHyperlink wicketHyperlink = hyperlinks[0];
final IHyperlink componentHyperlink = hyperlinks[1];
assertEquals("WicketHyperlink for wicket:id \"content\" to html file", wicketHyperlink.toString());
assertEquals("Open html file and jump to wicket:id \"content\"", wicketHyperlink.getHyperlinkText());
assertEquals(
"WicketComponentHyperlink for wicket Component ModalPanel2 to L/testproject/src/main/java/org/qwickie/test/project/refactor/ModalPanel2.html",
componentHyperlink.toString());
assertEquals("Open \"ModalPanel2.html\"", componentHyperlink.getHyperlinkText());
try {
activePage.closeAllEditors(false);
IDE.openEditor(activePage, file);
} catch (PartInitException e) {
}
wicketHyperlink.open();
IEditorPart activeEditor = activePage.getActiveEditor();
assertTrue(activeEditor.getEditorInput() instanceof FileEditorInput);
FileEditorInput input = (FileEditorInput) activeEditor.getEditorInput();
assertEquals("/testproject/src/main/java/org/qwickie/test/project/refactor/RefPage.html", input.getFile().getFullPath().toPortableString());
activePage.closeAllEditors(false);
componentHyperlink.open();
activeEditor = activePage.getActiveEditor();
assertTrue(activeEditor.getEditorInput() instanceof FileEditorInput);
input = (FileEditorInput) activeEditor.getEditorInput();
assertEquals("/testproject/src/main/java/org/qwickie/test/project/refactor/ModalPanel2.html", input.getFile().getFullPath().toPortableString());
activePage.closeAllEditors(false);