m_RemoveButton.setEnabled(false);
m_RemoveButton.setToolTipText("Remove selected attributes.");
m_RemoveButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Remove r = new Remove();
int [] selected = m_AttPanel.getSelectedAttributes();
if (selected.length == 0) {
return;
}
if (selected.length == m_Instances.numAttributes()) {
// Pop up an error optionpane
JOptionPane.showMessageDialog(PreprocessPanel.this,
"Can't remove all attributes from data!\n",
"Remove Attributes",
JOptionPane.ERROR_MESSAGE);
m_Log.logMessage("Can't remove all attributes from data!");
m_Log.statusMessage("Problem removing attributes");
return;
}
r.setAttributeIndicesArray(selected);
applyFilter(r);
} catch (Exception ex) {
if (m_Log instanceof TaskLogger) {
((TaskLogger)m_Log).taskFinished();
}