if (!Page.areSameTitle(text, page.getTitle())) {
String newLink = PageElementInternalLink.createInternalLink(text, page.getTitle());
addItem(
popup, null, GT._("Reverse to {0}", newLink), true,
new RevertLinkAction(page.getTitle(), text, element, textPane), null);
}
// Redirect page
} else if (page.isRedirect()) {
String title = page.getRedirectTitle();
addItem(
popup, null, GT._("&Link to {0}", title), false,
new ReplaceLinkAction(page.getTitle(), title, text, element, textPane, false));
addItem(
popup, null, GT._("&Replace with {0}", title), false,
new ReplaceLinkAction(page.getTitle(), title, text, element, textPane, true));
if (!Page.areSameTitle(text, page.getTitle())) {
String newLink = PageElementInternalLink.createInternalLink(text, page.getTitle());
addItem(
popup, null, GT._("Reverse to {0}", newLink), true,
new RevertLinkAction(page.getTitle(), text, element, textPane));
}
// Missing page
} else if (Boolean.FALSE.equals(page.isExisting())) {
if (!Page.areSameTitle(text, page.getTitle())) {
String newLink = PageElementInternalLink.createInternalLink(text, page.getTitle());
addItem(
popup, null, GT._("Reverse to {0}", newLink), true,
new RevertLinkAction(page.getTitle(), text, element, textPane));
}
}
}