for (int j = listAllResources.getMaxSelectionIndex(); j >= listAllResources.getMinSelectionIndex(); j--)
{
if (listAllResources.isSelectedIndex(j))
{
String item = (String) listAllResources.getModel().getElementAt(j);
JDBAutoLabellerResources po = new JDBAutoLabellerResources(Common.selectedHostID, Common.sessionID);
po.create(jTextFieldType.getText(),comboBox4jGroup.getSelectedItem().toString() ,item);
}
}
populateListAssignedResources(jTextFieldType.getText(),comboBox4jGroup.getSelectedItem().toString(),"");
populateListAllResources();
jButtonUpdate.setEnabled(true);
}
}
});
jButtonAssignResource.setBounds(254, 283, 26, 24);
jDesktopPane1.add(jButtonAssignResource);
JButton4j jButtonUnAssignResource = new JButton4j(Common.icon_arrow_right);
jButtonUnAssignResource.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (listAssignedResources.getSelectedIndex() > -1)
{
for (int j = listAssignedResources.getMaxSelectionIndex(); j >= listAssignedResources.getMinSelectionIndex(); j--)
{
if (listAssignedResources.isSelectedIndex(j))
{
String item = (String) listAssignedResources.getModel().getElementAt(j);
JDBAutoLabellerResources po = new JDBAutoLabellerResources(Common.selectedHostID, Common.sessionID);
po.delete(jTextFieldType.getText(),comboBox4jGroup.getSelectedItem().toString(), item);
}
}
populateListAssignedResources(jTextFieldType.getText(),comboBox4jGroup.getSelectedItem().toString(),"");
populateListAllResources();
jButtonUpdate.setEnabled(true);