item.setFont(item.getFont().deriveFont(Font.BOLD));
}
popupMenu.add(item);
final PluginAccess webPlugin = PluginManagerImpl.getInstance()
.getActivatedPluginForId("java.webplugin.WebPlugin");
if (webPlugin != null && webPlugin.canReceiveProgramsWithTarget()) {
ProgramReceiveTarget[] targets = webPlugin
.getProgramReceiveTargets();
if (targets != null && targets.length > 0) {
final JMenu subMenu = new JMenu(webPlugin.getInfo().getName());
subMenu.setIcon(webPlugin.getMarkIcon());
popupMenu.add(subMenu);
for (final ProgramReceiveTarget target : targets) {
item = new JMenuItem(target.toString());
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
searchWebPlugin(searchText, target);
}
});
if (value.endsWith(target.getTargetId())) {
item.setFont(item.getFont().deriveFont(Font.BOLD));
}
subMenu.add(item);
}
}
}
popupMenu.addSeparator();
popupMenu.add(addFavoriteMenuItem(searchText, actorFavorite));
popupMenu.addSeparator();
}
JMenu subMenu = ContextMenuManager.getInstance()
.createContextMenuItems(ProgramInfoProxy.getInstance(), mProgram,
true);
subMenu.setText(Localizer.getLocalization(Localizer.I18N_PROGRAM));
popupMenu.add(subMenu);
return popupMenu;
}
private void handleEvent(MouseEvent e, boolean popupEvent) {
JEditorPane editor = (JEditorPane) e.getSource();
Point pt = new Point(e.getX(), e.getY());
int pos = editor.viewToModel(pt);
if (pos >= 0) {
String link = getLink(pos, editor);
if (link != null
&& link.startsWith(ProgramTextCreator.TVBROWSER_URL_PROTOCOL)) {
final String searchText = link
.substring(ProgramTextCreator.TVBROWSER_URL_PROTOCOL.length());
if (popupEvent) {
JPopupMenu popupMenu = getPopupMenu(searchText, true);
popupMenu.show(e.getComponent(), e.getX(), e.getY());
} else {
String value = ProgramInfo.getInstance().getSettings()
.getActorSearch();
boolean found = false;
if (value.contains("#_#_#")) {
String[] keys = value.split("#_#_#");
PluginAccess webPlugin = PluginManagerImpl.getInstance()
.getActivatedPluginForId(keys[0]);
if (webPlugin != null
&& webPlugin.canReceiveProgramsWithTarget()) {
ProgramReceiveTarget[] targets = webPlugin
.getProgramReceiveTargets();
if (targets != null) {
for (ProgramReceiveTarget target : targets) {