hudson.model.AbstractProject.getDisplayName()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(153)

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

AbstractProject.getDisplayName介绍

暂无

代码示例

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

/**
 * Serves the workspace files.
 */
public DirectoryBrowserSupport doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  checkPermission(Item.WORKSPACE);
  FilePath ws = getSomeWorkspace();
  if ((ws == null) || (!ws.exists())) {
    // if there's no workspace, report a nice error message
    // Would be good if when asked for *plain*, do something else!
    // (E.g. return 404, or send empty doc.)
    // Not critical; client can just check if content type is not text/plain,
    // which also serves to detect old versions of Hudson.
    req.getView(this,"noWorkspace.jelly").forward(req,rsp);
    return null;
  } else {
    Computer c = ws.toComputer();
    String title;
    if (c == null) {
      title = Messages.AbstractProject_WorkspaceTitle(getDisplayName());
    } else {
      title = Messages.AbstractProject_WorkspaceTitleOnComputer(getDisplayName(), c.getDisplayName());
    }
    return new DirectoryBrowserSupport(this, ws, title, "folder.png", true);
  }
}

代码示例来源:origin: hudson/hudson-2.x

public Dimension getSize(AbstractProject p) {
    int w = fontMetrics.stringWidth(p.getDisplayName()) + MARGIN*2;
    return new Dimension(w, fontMetrics.getHeight() + MARGIN*2);
  }
}, Direction.LEFTRIGHT);

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public Dimension getSize(AbstractProject p) {
    int w = fontMetrics.stringWidth(p.getDisplayName()) + MARGIN*2;
    return new Dimension(w, fontMetrics.getHeight() + MARGIN*2);
  }
}, Direction.LEFTRIGHT);

代码示例来源:origin: org.jvnet.hudson.main/hudson-plugin-utils

public String getDisplayName() {
  return getDelegate().getDisplayName();
}

代码示例来源:origin: Diabol/delivery-pipeline-plugin

private String resolveTaskName(AbstractProject<?, ?> project, String name) {
  return (TokenUtils.stringIsNotEmpty(name) ? name : project.getDisplayName());
}

代码示例来源:origin: org.eclipse.hudson/hudson-plugin-utils

public String getDisplayName() {
  return getDelegate().getDisplayName();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-plugin-utils

public String getDisplayName() {
  return getDelegate().getDisplayName();
}

代码示例来源:origin: jlewallen/jenkins-hipchat-plugin

private MessageBuilder startMessage() {
  message.append(build.getProject().getDisplayName());
  message.append(" - ");
  message.append(build.getDisplayName());
  message.append(" ");
  return this;
}

代码示例来源:origin: jenkinsci/instant-messaging-plugin

@SuppressWarnings("rawtypes")
@Override
public AbstractProject<?, ?> getJobByDisplayName(String displayName) {
  List<AbstractProject> allItems = Jenkins.getInstance().getAllItems(AbstractProject.class);
  for (AbstractProject job : allItems) {
    if (displayName.equals(job.getDisplayName())) {
      return job;
    }
  }
  return null;
}

代码示例来源:origin: etsy/jenkins-master-project

public void rebuild(AbstractProject project) throws ServletException {
 if (!getSubProjects().contains(project)) {
   throw new ServletException(
     "Not a sub-project of this master build: "
     + project.getDisplayName());
 }
 SubResult subResult = masterResult.getResult(project.getDisplayName());
 int rebuildNumber = subResult.getBuildNumbers().size();
 Cause cause = new MasterBuildCause(this, rebuildNumber);
 rebuild(project, cause);
}

代码示例来源:origin: org.hudsonci.plugins/instant-messaging

private String checkPermission(Sender sender, AbstractProject<?, ?> project) {
  if (!project.hasPermission(Item.BUILD)) {
    return sender.getNickname() + ": you're not allowed to build job " + project.getDisplayName() + "!";
  }
  return null;
}

代码示例来源:origin: jenkinsci/dingding-notifications-plugin

@Override
public void start() {
  String pic = "http://icon-park.com/imagefiles/loading7_gray.gif";
  String title = String.format("%s%s开始构建", build.getProject().getDisplayName(), build.getDisplayName());
  String content = String.format("项目[%s%s]开始构建", build.getProject().getDisplayName(), build.getDisplayName());
  String link = getBuildUrl();
  if (onStart) {
    logger.info("send link msg from " + listener.toString());
    sendLinkMessage(link, content, title, pic);
  }
}

代码示例来源:origin: jenkinsci/instant-messaging-plugin

private String checkPermission(Sender sender, AbstractProject<?, ?> project) {
  if (!project.hasPermission(Item.BUILD)) {
    return sender.getNickname() + ": you're not allowed to build job " + project.getDisplayName() + "!";
  }
  return null;
}

代码示例来源:origin: jenkinsci/dingding-notifications-plugin

@Override
public void abort() {
  String pic = "http://www.iconsdb.com/icons/preview/soylent-red/x-mark-3-xxl.png";
  String title = String.format("%s%s构建中断", build.getProject().getDisplayName(), build.getDisplayName());
  String content = String.format("项目[%s%s]构建中断, summary:%s, duration:%s", build.getProject().getDisplayName(), build.getDisplayName(), build.getBuildStatusSummary().message, build.getDurationString());
  String link = getBuildUrl();
  logger.info(link);
  if (onAbort) {
    logger.info("send link msg from " + listener.toString());
    sendLinkMessage(link, content, title, pic);
  }
}

代码示例来源:origin: jenkinsci/dingding-notifications-plugin

@Override
public void success() {
  String pic = "http://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/sign-check-icon.png";
  String title = String.format("%s%s构建成功", build.getProject().getDisplayName(), build.getDisplayName());
  String content = String.format("项目[%s%s]构建成功, summary:%s, duration:%s", build.getProject().getDisplayName(), build.getDisplayName(), build.getBuildStatusSummary().message, build.getDurationString());
  String link = getBuildUrl();
  logger.info(link);
  if (onSuccess) {
    logger.info("send link msg from " + listener.toString());
    sendLinkMessage(link, content, title, pic);
  }
}

代码示例来源:origin: jenkinsci/dingding-notifications-plugin

@Override
public void failed() {
  String pic = "http://www.iconsdb.com/icons/preview/soylent-red/x-mark-3-xxl.png";
  String title = String.format("%s%s构建失败", build.getProject().getDisplayName(), build.getDisplayName());
  String content = String.format("项目[%s%s]构建失败, summary:%s, duration:%s", build.getProject().getDisplayName(), build.getDisplayName(), build.getBuildStatusSummary().message, build.getDurationString());
  String link = getBuildUrl();
  logger.info(link);
  if (onFailed) {
    logger.info("send link msg from " + listener.toString());
    sendLinkMessage(link, content, title, pic);
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Serves the workspace files.
 */
public DirectoryBrowserSupport doWs(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
  checkPermission(AbstractProject.WORKSPACE);
  FilePath ws = getSomeWorkspace();
  if ((ws == null) || (!ws.exists())) {
    // if there's no workspace, report a nice error message
    rsp.setStatus(HttpServletResponse.SC_NOT_FOUND);
    req.getView(this, "noWorkspace.jelly").forward(req, rsp);
    return null;
  } else {
    return new DirectoryBrowserSupport(this, ws, getDisplayName() + " workspace", "folder.png", true);
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Serves the workspace files.
 */
public DirectoryBrowserSupport doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  checkPermission(AbstractProject.WORKSPACE);
  FilePath ws = getSomeWorkspace();
  if ((ws == null) || (!ws.exists())) {
    // if there's no workspace, report a nice error message
    rsp.setStatus(HttpServletResponse.SC_NOT_FOUND);
    req.getView(this,"noWorkspace.jelly").forward(req,rsp);
    return null;
  } else {
    return new DirectoryBrowserSupport(this, ws, getDisplayName()+" workspace", "folder.gif", true);
  }
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Serves the workspace files.
 */
public DirectoryBrowserSupport doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  checkPermission(AbstractProject.WORKSPACE);
  FilePath ws = getSomeWorkspace();
  if ((ws == null) || (!ws.exists())) {
    // if there's no workspace, report a nice error message
    rsp.setStatus(HttpServletResponse.SC_NOT_FOUND);
    req.getView(this,"noWorkspace.jelly").forward(req,rsp);
    return null;
  } else {
    return new DirectoryBrowserSupport(this, ws, getDisplayName()+" workspace", "folder.gif", true);
  }
}

代码示例来源:origin: Diabol/delivery-pipeline-plugin

private static String getUpstreamCauseString(Cause.UpstreamCause upstreamCause) {
  AbstractProject upstreamProject = JenkinsUtil.getInstance().getItem(upstreamCause.getUpstreamProject(),
      JenkinsUtil.getInstance(), AbstractProject.class);
  String causeString = "upstream project";
  if (upstreamProject != null) {
    causeString += " " + upstreamProject.getDisplayName();
    AbstractBuild upstreamBuild = upstreamProject.getBuildByNumber(upstreamCause.getUpstreamBuild());
    if (upstreamBuild != null) {
      causeString += " build " + upstreamBuild.getDisplayName();
    }
  }
  return causeString;
}

相关文章

微信公众号

最新文章

更多

AbstractProject类方法