if(tempIf.getId().compareTo(caller.getId()) != 0) {
list.add(tempIf);
}
}
mPluginItemList = new SelectableItemList(mResultPluginArr,
list.toArray(), disabledList.toArray());
} else {
mPluginItemList = new SelectableItemList(mResultPluginArr,
tempProgramReceiveIf, disabledList.toArray());
}
mPluginItemList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
int pos = 1;
layout.appendRow(RowSpec.decode("fill:default:grow"));
layout.appendRow(RowSpec.decode("3dlu"));
if (targetTable != null) {
JSplitPane splitPane = new JSplitPane();
splitPane.setLeftComponent(mPluginItemList);
final JPanel targetPanel = new JPanel();
targetPanel.setLayout(new BorderLayout());
// JScrollPane targetScrollPane = new JScrollPane(mTargetPanel);
// targetScrollPane.getVerticalScrollBar().setUnitIncrement(10);
mPluginItemList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
try {
if (!e.getValueIsAdjusting()) {
targetPanel.removeAll();
SelectableItem pluginItem = (SelectableItem) mPluginItemList
.getSelectedValue();
final ProgramReceiveIf plugin = (ProgramReceiveIf) pluginItem
.getItem();
mCurrentTargets = plugin.getProgramReceiveTargets();
if (mCurrentTargets != null) {
Arrays.sort(mCurrentTargets);
ArrayList<ProgramReceiveTarget> targets = mReceiveTargetTable
.get(plugin);
if (targets == null || !pluginItem.isSelected()) {
targets = new ArrayList<ProgramReceiveTarget>();
}
if (pluginItem.isSelected() && targets.isEmpty()) {
targets.add(mCurrentTargets[0]);
}
mReceiveTargetTable.put(plugin, targets);
final SelectableItemList targetList = new SelectableItemList(
targets.toArray(), mCurrentTargets, disabledReceiveTargets);
targetPanel.add(targetList, BorderLayout.CENTER);
targetList
.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent listEvent) {
if (!listEvent.getValueIsAdjusting()) {
SelectableItem currPluginItem = (SelectableItem) mPluginItemList
.getSelectedValue();
ProgramReceiveIf currPlugin = (ProgramReceiveIf) currPluginItem
.getItem();
Object[] sel = targetList.getSelection();
ArrayList<ProgramReceiveTarget> selTargets = new ArrayList<ProgramReceiveTarget>(
sel.length);
for (Object obj : sel) {
selTargets.add((ProgramReceiveTarget) obj);
}