@Test public void testUpdateMonitoredGUI() { final AtomicInteger repaintCalls = new AtomicInteger(0); final AtomicInteger revalidateCalls = new AtomicInteger(0); InfoView infoView = new InfoView(comp, info) { private static final long serialVersionUID = 1L; public void repaint() { super.repaint(); repaintCalls.incrementAndGet(); } public void revalidate() { super.revalidate(); revalidateCalls.incrementAndGet(); } }; repaintCalls.set(0); revalidateCalls.set(0); infoView.updateMonitoredGUI(); Assert.assertEquals(repaintCalls.get(), 1); Assert.assertEquals(revalidateCalls.get(), 1); }
@Override public void updateMonitoredGUI() { String name = getManifestedComponent().getDisplayName(); if (displayName != null) { displayName.setText(name); } ActionListener[] originalListeners = owner.getActionListeners(); for (ActionListener listener: originalListeners) { owner.removeActionListener(listener); } owner.setSelectedItem(getManifestedComponent().getOwner()); for (ActionListener listener: originalListeners) { owner.addActionListener(listener); } addExtendedContent(); revalidate(); repaint(); }
InfoView extends View { @Override public void updateMonitoredGUI() { String name = getManifestedComponent().getDisplayName(); if (displayName != null) { displayName.setText(name); } ActionListener[] originalListeners = owner.getActionListeners(); for (ActionListener listener: originalListeners) { owner.removeActionListener(listener); } owner.setSelectedItem(getManifestedComponent().getOwner()); for (ActionListener listener: originalListeners) { owner.addActionListener(listener); } addExtendedContent(); revalidate(); repaint(); } }
InfoView extends View { @Override public void updateMonitoredGUI() { String name = getManifestedComponent().getDisplayName(); if (displayName != null) { displayName.setText(name); } ActionListener[] originalListeners = owner.getActionListeners(); for (ActionListener listener: originalListeners) { owner.removeActionListener(listener); } owner.setSelectedItem(getManifestedComponent().getOwner()); for (ActionListener listener: originalListeners) { owner.addActionListener(listener); } addExtendedContent(); revalidate(); repaint(); } InfoView();  InfoView(AbstractComponent ac, ViewInfo vi); }
InfoView extends View { @Override public void updateMonitoredGUI() { String name = getManifestedComponent().getDisplayName(); if (displayName != null) { displayName.setText(name); } ActionListener[] originalListeners = owner.getActionListeners(); for (ActionListener listener: originalListeners) { owner.removeActionListener(listener); } owner.setSelectedItem(getManifestedComponent().getOwner()); for (ActionListener listener: originalListeners) { owner.addActionListener(listener); } addExtendedContent(); revalidate(); repaint(); } InfoView();  InfoView(AbstractComponent ac, ViewInfo vi); @Override void updateMonitoredGUI(); @Override void updateMonitoredGUI(ReloadEvent event); @Override void updateMonitoredGUI(PropertyChangeEvent event); @SuppressWarnings("unchecked") // Java 7 compatibility @Override void enterLockedState(); @SuppressWarnings("unchecked") // Java 7 compatibility @Override void exitLockedState(); @Override void processDirtyState(); }
InfoView extends View { @Override public void updateMonitoredGUI() { String name = getManifestedComponent().getDisplayName(); if (displayName != null) { displayName.setText(name); } ActionListener[] originalListeners = owner.getActionListeners(); for (ActionListener listener: originalListeners) { owner.removeActionListener(listener); } owner.setSelectedItem(getManifestedComponent().getOwner()); for (ActionListener listener: originalListeners) { owner.addActionListener(listener); } addExtendedContent(); revalidate(); repaint(); } InfoView();  InfoView(AbstractComponent ac, ViewInfo vi); @Override void updateMonitoredGUI(); @Override void updateMonitoredGUI(ReloadEvent event); @Override void updateMonitoredGUI(PropertyChangeEvent event); @SuppressWarnings("unchecked") // Java 7 compatibility @Override void enterLockedState(); @SuppressWarnings("unchecked") // Java 7 compatibility @Override void exitLockedState(); @Override void processDirtyState();  }