コード例 #1
0
  @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();
    }
  }
コード例 #2
0
  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);
              }
            });
  }
コード例 #3
0
 @Override
 public JPanel getPanel() {
   return myDetailsPanel.getPanel();
 }
コード例 #4
0
 @CalledInAwt
 private void acceptData(final T t) {
   final JPanel panel = dataToPresentation(t);
   myDetailsPanel.data(panel);
   myDetailsPanel.layout();
 }