menu.setEnabled(false);
return menu;
}
Object o = getObjectForNode(node);
Plugin currentPlugin = null;
if(o instanceof Plugin) {
currentPlugin = (Plugin)o;
}
for (InternalPluginProxyIf internalProxy : InternalPluginProxyList.getInstance().getAvailableProxys()) {
if (internalProxy instanceof ProgramReceiveIf) {
final ProgramReceiveIf receiveProxy = (ProgramReceiveIf) internalProxy;
if(receiveProxy.canReceiveProgramsWithTarget() && o != internalProxy) {
final ProgramReceiveTarget target = receiveProxy.getProgramReceiveTargets()[0];
JMenuItem item = new JMenuItem(target.getTargetName());
item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);
item.setIcon(internalProxy.getIcon());
menu.add(item);
item.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
Program[] programs = collectProgramsFromNode(node);
if ((programs != null) &&(programs.length > 0)) {
receiveProxy.receivePrograms(programs, target);
}
}
});
}
}
}
PluginProxy[] plugins = PluginProxyManager.getInstance().getActivatedPlugins();
for (final PluginProxy plugin : plugins) {
if ((plugin.canReceiveProgramsWithTarget())
&& plugin.getProgramReceiveTargets() != null
&& plugin.getProgramReceiveTargets().length > 0) {
if ((currentPlugin == null) || (!currentPlugin.getId().equals(plugin.getId()))) {
ProgramReceiveTarget[] targets = plugin.getProgramReceiveTargets();
if (!plugin.canReceiveProgramsWithTarget()) {
JMenuItem item = new JMenuItem(plugin.getInfo().getName());
item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);