From c1387ed316d0f1107b57a31ab311cf160ab4ea99 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 28 Dec 2015 12:29:55 +0100 Subject: [PATCH] Removed weird hack for refreshing table cells --- .../ui/ContributedLibraryTableCellEditor.java | 27 +----------------- .../ContributedPlatformTableCellEditor.java | 28 ++----------------- 2 files changed, 3 insertions(+), 52 deletions(-) diff --git a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java index bb838c513..b2f00c423 100644 --- a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java +++ b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java @@ -33,8 +33,6 @@ import static processing.app.I18n.tr; import java.awt.Color; import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.Collections; import java.util.LinkedList; import java.util.List; @@ -42,7 +40,6 @@ import java.util.stream.Collectors; import javax.swing.JComboBox; import javax.swing.JTable; -import javax.swing.Timer; import cc.arduino.contributions.DownloadableContributionVersionComparator; import cc.arduino.contributions.VersionComparator; @@ -142,39 +139,17 @@ public class ContributedLibraryTableCellEditor extends InstallerTableCell { return editorCell.panel; } - private final Timer enabler = new Timer(100, new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - enable(true); - enabler.stop(); - } - }); - @Override public void setEnabled(boolean enabled) { - enable(false); - if (enabled) { - enabler.start(); - } else { - enabler.stop(); - } + editorCell.installButton.setEnabled(enabled); editorCell.buttonsPanel.setVisible(enabled); editorCell.inactiveButtonsPanel.setVisible(!enabled); } - public void enable(boolean enabled) { - editorCell.installButton.setEnabled(enabled); - } - public void setStatus(String status) { editorCell.statusLabel.setText(status); } - public void invalidate() { - editorCell.panel.invalidate(); - } - - protected void onRemove(ContributedLibrary selected) { // Empty } diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellEditor.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellEditor.java index 4c245c7d8..047399806 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellEditor.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellEditor.java @@ -33,14 +33,11 @@ import static processing.app.I18n.tr; import java.awt.Color; import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.Collections; import java.util.LinkedList; import java.util.stream.Collectors; import javax.swing.JTable; -import javax.swing.Timer; import cc.arduino.contributions.DownloadableContributionVersionComparator; import cc.arduino.contributions.VersionComparator; @@ -139,39 +136,18 @@ public class ContributedPlatformTableCellEditor extends InstallerTableCell { return editorCell.panel; } - private final Timer enabler = new Timer(100, new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - enable(true); - enabler.stop(); - } - }); - @Override public void setEnabled(boolean enabled) { - enable(false); - if (enabled) { - enabler.start(); - } else { - enabler.stop(); - } + editorCell.installButton.setEnabled(enabled); + editorCell.removeButton.setEnabled(enabled); editorCell.buttonsPanel.setVisible(enabled); editorCell.inactiveButtonsPanel.setVisible(!enabled); } - public void enable(boolean enabled) { - editorCell.installButton.setEnabled(enabled); - editorCell.removeButton.setEnabled(enabled); - } - public void setStatus(String status) { editorCell.statusLabel.setText(status); } - public void invalidate() { - editorCell.panel.invalidate(); - } - protected void onRemove(ContributedPlatform contributedPlatform) { // Empty }