本文整理汇总了Java中com.intellij.util.ui.AdjustComponentWhenShown类的典型用法代码示例。如果您正苦于以下问题:Java AdjustComponentWhenShown类的具体用法?Java AdjustComponentWhenShown怎么用?Java AdjustComponentWhenShown使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AdjustComponentWhenShown类属于com.intellij.util.ui包,在下文中一共展示了AdjustComponentWhenShown类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MyDialog
import com.intellij.util.ui.AdjustComponentWhenShown; //导入依赖的package包/类
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();
}
示例2: initDialog
import com.intellij.util.ui.AdjustComponentWhenShown; //导入依赖的package包/类
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);
}
}