当前位置: 首页>>代码示例>>Java>>正文


Java AdjustComponentWhenShown类代码示例

本文整理汇总了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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:SelectRepositoryAndShowLogAction.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:ChangesBrowserDialog.java


注:本文中的com.intellij.util.ui.AdjustComponentWhenShown类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。