@CalledInAwt @Override public void refresh() { ApplicationManager.getApplication().assertIsDispatchThread(); if (!Comparing.equal(myDetailsLoader.getCurrentlySelected(), myTicket)) { final Ticket copy = myTicket.copy(); myDetailsLoader.updateSelection(copy, false); myDetailsPanel.loading(); myDetailsPanel.layout(); } else { refreshPresentation(); } }
protected AbstractRefreshablePanel( final Project project, final String loadingTitle, final BackgroundTaskQueue queue) { myQueue = queue; myTicket = new Ticket(); myDetailsPanel = new DetailsPanel(); myDetailsPanel.loading(); myDetailsPanel.layout(); myDetailsLoader = new GenericDetailsLoader<Ticket, T>( new Consumer<Ticket>() { @Override public void consume(Ticket ticket) { myQueue.run(new Loader(project, loadingTitle, myTicket.copy())); } }, new PairConsumer<Ticket, T>() { @Override public void consume(Ticket ticket, T t) { acceptData(t); } }); }
@Override public JPanel getPanel() { return myDetailsPanel.getPanel(); }
@CalledInAwt private void acceptData(final T t) { final JPanel panel = dataToPresentation(t); myDetailsPanel.data(panel); myDetailsPanel.layout(); }