当我从 left_group_table(List) 中选择 List5 时,应该从 middle_group_table(Contact) 中删除属于 List5 的所有项目。如果列表包含多个项目,则应删除联系人表中的所有项目。请在下面找到应用程序和代码片段的屏幕截图。提前致谢!
public static ArrayList<String> allEmailsFortheSelectedList = new ArrayList<String>();
HashMap<Integer, ArrayList<String>> allEmailsForALLSelectedList;
tableCursor.addMouseListener(new MouseListener() {
@Override
public void mouseUp(MouseEvent arg0) {
final int selectionIndex = left_group_table.getSelectionIndex();
if(left_group_table.getItem(selectionIndex).getChecked()) {
int tempCount = 0;
left_group_table.getItem(selectionIndex).setChecked(false);
TableItem[] items = middle_group_table.getItems();
if(allEmailsForALLSelectedList.containsKey(selectionIndex)) {
allEmailsForALLSelectedList.remove(selectionIndex);
}
Set<Entry<Integer, ArrayList<String>>> set = allEmailsForALLSelectedList.entrySet();
Iterator<Entry<Integer, ArrayList<String>>> itr = set.iterator();
while(itr.hasNext())
{
HashMap.Entry<Integer, ArrayList<String>> entry = itr.next();
for(int i=0; i< entry.getValue().size(); i++) {
new TableItem(middle_group_table, SWT.NONE);
items[tempCount].setText(1, entry.getValue().get(i));
tempCount++;
}
}
tempCount = items.length;
middle_group_table.setRedraw(true);
}
白衣染霜花
相关分类