private MyDialog(Project project, final List<VirtualFile> virtualFiles) { super(project, true); myProject = project; myVirtualFiles = virtualFiles; myGitLog = new LogFactoryService(myProject, ServiceManager.getService(GitCommitsSequentially.class)).createComponent(false); myGitLog.rootsChanged(myVirtualFiles); Disposer.register(getDisposable(), myGitLog); new AdjustComponentWhenShown() { @Override protected boolean init() { myGitLog.setModalityState(ModalityState.current()); return true; } }.install(myGitLog.getVisualComponent()); setTitle("Git Log"); init(); }
private void initDialog(final Project project, final CommittedChangesTableModel changes, final Mode mode) { myProject = project; myChanges = changes; myMode = mode; setTitle(VcsBundle.message("dialog.title.changes.browser")); setCancelButtonText(CommonBundle.getCloseButtonText()); final ModalityState currentState = ModalityState.current(); if ((mode != Mode.Choose) && (ModalityState.NON_MODAL.equals(currentState))) { setModal(false); } myAppender = new AsynchConsumer<List<CommittedChangeList>>() { public void finished() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (ChangesBrowserDialog.this.isShowing()) { myCommittedChangesBrowser.stopLoading(); } } }); } public void consume(final List<CommittedChangeList> committedChangeLists) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (ChangesBrowserDialog.this.isShowing()) { final boolean selectFirst = (myChanges.getRowCount() == 0) && (!committedChangeLists.isEmpty()); myChanges.addRows(committedChangeLists); if (selectFirst) { myCommittedChangesBrowser.selectFirstIfAny(); } } } }); } }; init(); if (myInitRunnable != null) { new AdjustComponentWhenShown() { @Override protected boolean init() { myInitRunnable.consume(ChangesBrowserDialog.this); return true; } }.install(myCommittedChangesBrowser); } }