public void actionPerformed(ActionEvent e) {
int[] rows = getTable().getSelectedRows();
for (int i = 0; i < rows.length; i++) {
Equipamento eq = (Equipamento) getTable().getValueAt(rows[i],
-1);
// Atualiza equipamento
eq = EquipamentoDataServices.getEquipamento(eq.getId());
if (eq.isClosed()) {
EquipamentoDataServices.openStation(eq);
refresh();
}
}
openButton.setEnabled(false);
downMonitorButton.setEnabled(false);
}
};
openButton.setAction(actionOpen);
openButton.setToolTipText("Libera equipamento");
addToolBarButton(openButton);
openButton.setEnabled(false);
Action actionClose = new AbstractAction("", IconFactory
.createEquipamentoBlock16()) {
private static final long serialVersionUID = 4680946165447301273L;
public void actionPerformed(ActionEvent e) {
int[] rows = getTable().getSelectedRows();
for (int i = 0; i < rows.length; i++) {
Equipamento eq = (Equipamento) getTable().getValueAt(rows[i],
-1);
// Atualiza equipamento
eq = EquipamentoDataServices.getEquipamento(eq.getId());
if (eq.isOpened()) {
EquipamentoDataServices.closeStation(eq);
refresh();
}
}
openButton.setEnabled(false);
closeButton.setEnabled(false);
downMonitorButton.setEnabled(false);
}
};
closeButton.setAction(actionClose);
closeButton.setToolTipText("Bloqueia equipamento");
addToolBarButton(closeButton);
closeButton.setEnabled(false);
Action actionMonitorDown = new AbstractAction("", IconFactory
.createDown16()) {
private static final long serialVersionUID = -489877560767758884L;
public void actionPerformed(ActionEvent e) {
int[] rows = getTable().getSelectedRows();
for (int i = 0; i < rows.length; i++) {
Equipamento eq = (Equipamento) getTable().getValueAt(rows[i],-1);
// Atualiza equipamento
eq = EquipamentoDataServices.getEquipamento(eq.getId());
if (eq.isOpened()) {
EquipamentoDataServices.downMonitor(eq);
refresh();
}
}
openButton.setEnabled(false);