jenkins.model.Jenkins.getWidgets()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(174)

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

Jenkins.getWidgets介绍

[英]Gets the Widgets registered on this object.

Plugins who wish to contribute boxes on the side panel can add widgets by getWidgets().add(new MyWidget()) from Plugin#start().
[中]获取在此对象上注册的小部件。
希望在侧面板上添加框的插件可以通过getWidgets()添加小部件。从插件#start()添加(新的MyWidget()。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Gets the {@link Widget}s registered on this object.
 *
 * <p>
 * For now, this just returns the widgets registered to Hudson.
 */
public List<Widget> getWidgets() {
  return Collections.unmodifiableList(Jenkins.getInstance().getWidgets());
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Gets the {@link Widget}s registered on this object.
 *
 * <p>
 * For now, this just returns the widgets registered to Hudson.
 */
public List<Widget> getWidgets() {
  return Collections.unmodifiableList(Jenkins.getInstance().getWidgets());
}

代码示例来源:origin: awslabs/ec2-spot-jenkins-plugin

@Override protected void doRun() throws Exception {

    // Trigger reprovisioning as well
    Jenkins.getActiveInstance().unlabeledNodeProvisioner.suggestReviewNow();

    final List<FleetStateStats> stats = new ArrayList<FleetStateStats>();
    for(final Cloud cloud : Jenkins.getActiveInstance().clouds) {
      if (!(cloud instanceof EC2FleetCloud))
        continue;

      // Update the cluster states
      final EC2FleetCloud fleetCloud =(EC2FleetCloud) cloud;
      LOGGER.log(Level.FINE, "Checking cloud: " + fleetCloud.getLabelString() );
      stats.add(fleetCloud.updateStatus());
    }

    for (final Widget w : Jenkins.getInstance().getWidgets()) {
      if (!(w instanceof FleetStatusWidget))
        continue;

      ((FleetStatusWidget)w).setStatusList(stats);
    }
  }
}

相关文章

Jenkins类方法