org.openide.util.Utilities.attachInitJob()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(77)

本文整理了Java中org.openide.util.Utilities.attachInitJob()方法的一些代码示例,展示了Utilities.attachInitJob()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.attachInitJob()方法的具体详情如下:
包路径:org.openide.util.Utilities
类名称:Utilities
方法名:attachInitJob

Utilities.attachInitJob介绍

[英]Attaches asynchronous init job to given component. AsyncGUIJob#construct() will be called after first paint, when paint event arrives. Later, AsyncGUIJob#finished()will be called according to the rules of the AsyncGUIJob interface. Useful for components that have slower initialization phase, component can benefit from more responsive behaviour during init.
[中]将异步初始化作业附加到给定组件。AsyncGUIJob#construct()将在第一次绘制之后调用,即绘制事件到达时。稍后,将根据AsyncGUIJob接口的规则调用AsyncGUIJob#finished()。对于初始化阶段较慢的组件非常有用,组件可以在初始化期间受益于更灵敏的行为。

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-wizards

public OptionsPanel0(final WizardDescriptor setting, final NewOptionsIterator.DataModel data) {
  super(setting);
  this.data = data;
  initComponents();
  initAccessibility();
  putClientProperty("NewFileWizard_Title",// NOI18N
      NbBundle.getMessage(OptionsPanel0.class,"LBL_OptionsWizardTitle")); // NOI18N
  primaryPanelCombo.setModel(UIUtil.createComboWaitModel());
  Utilities.attachInitJob(primaryPanelCombo, new AsyncGUIJob() {
    ComboBoxModel model;
    @Override public void construct() {
      model = new DefaultComboBoxModel(getPrimaryIdsFromLayer());
    }
    @Override public void finished() {
      primaryPanelCombo.setModel(model);
    }
  });
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-wizards

private void setupCombo() {
  final Cursor currentCursor = getCursor();
  setCursor(Utilities.createProgressCursor(this));
  Utilities.attachInitJob(comMode, new AsyncGUIJob() {
    Set<String> modes;
    @Override
    public void construct() {
      try {
        modes = DesignSupport.existingModes(data);
      } catch (IOException exc) {
        Logger.getLogger(BasicSettingsPanel.class.getName()).log(Level.INFO, null, exc);
      }
    }
    @Override
    public void finished() {
      comMode.setModel(new DefaultComboBoxModel(modes != null ? modes.toArray(new String[modes.size()]) : DEFAULT_MODES));
      setComModeSelectedItem();
      windowPosChanged(null);
      setCursor(currentCursor);
      loadedComboBox = true;
      checkValidity();
    }
  });
}

代码示例来源:origin: AlexFalappa/nb-springboot

Utilities.attachInitJob(panels[0].getComponent(), (AsyncGUIJob) panels[0].getComponent());

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

card.show (browserPanel, "noBrowser"); // NOI18N
Utilities.attachInitJob(this, this);

相关文章

微信公众号

最新文章

更多