hudson.model.Item.getFullDisplayName()方法的使用及代码示例

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

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

Item.getFullDisplayName介绍

[英]Works like #getDisplayName() but return the full path that includes all the display names of the ancestors.
[中]与#getDisplayName()类似,但返回包含祖先的所有显示名称的完整路径。

代码示例

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

public static String encodeTo(Item item) {
  return encodeTo(item,item.getFullDisplayName());
}

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

public static String getRelativeNameFrom(@CheckForNull Item p, @CheckForNull ItemGroup g, boolean useDisplayName) {
  if (p == null) return null;
  if (g == null) return useDisplayName ? p.getFullDisplayName() : p.getFullName();
  String separationString = useDisplayName ? " » " : "/";

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

new Object[]{job.getFullDisplayName(), veto}
);
return;
  System.arraycopy(additionalActions, 0, queueActions, 1, additionalActions.length);
  if (p.scheduleBuild2(p.getQuietPeriod(), queueActions) != null) {
    LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Triggering "+name);
  } else {
    LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Job is already in the queue");

代码示例来源:origin: org.jenkins-ci.plugins/git

/**
   * {@inheritDoc}
   */
  @Override
  public void writeBody(PrintWriter w) {
    w.println("Scheduled polling of " + project.getFullDisplayName());
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/git

/**
   * {@inheritDoc}
   */
  @Override
  public void writeBody(PrintWriter w) {
    w.println("Scheduled " + project.getFullDisplayName());
  }
}

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

/**
   * {@inheritDoc}
   */
  @Override
  public void writeBody(PrintWriter w) {
    w.println("Scheduled " + project.getFullDisplayName());
  }
}

代码示例来源:origin: jenkinsci/pipeline-maven-plugin

@Override
  public String modelHyperlinkNoteEncodeTo(@Nullable Item item) {
    return item == null ? "#null#" : item.getFullDisplayName();
  }
}

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

/**
   * {@inheritDoc}
   */
  @Override
  public void writeBody(PrintWriter w) {
    w.println("Scheduled polling of " + project.getFullDisplayName());
  }
}

代码示例来源:origin: jenkinsci/pipeline-maven-plugin

@Nonnull
  @Override
  public String modelHyperlinkNoteEncodeTo(@Nullable Item item) {
    return item == null ? "#null#" : item.getFullDisplayName();
  }
}

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

public static String encodeTo(Item item) {
  return encodeTo(item,item.getFullDisplayName());
}

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

@Override
  public void run() {
    for (Item job : Jenkins.getInstance().getAllItems(Item.class)) {
      GitHubPushTrigger trigger = triggerFrom(job, GitHubPushTrigger.class);
      if (trigger != null) {
        String fullDisplayName = job.getFullDisplayName();
        LOGGER.debug("Considering to poke {}", fullDisplayName);
        if (GitHubRepositoryNameContributor.parseAssociatedNames(job)
            .contains(changedRepository)) {
          LOGGER.info("Poked {}", fullDisplayName);
          trigger.onPost(GitHubTriggerEvent.create()
              .withTimestamp(event.getTimestamp())
              .withOrigin(event.getOrigin())
              .withTriggeredByUser(pusherName)
              .build()
          );
        } else {
          LOGGER.debug("Skipped {} because it doesn't have a matching repository.",
              fullDisplayName);
        }
      }
    }
  }
});

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * Returns the full display name of the {@link #getContext()}.
 *
 * @return the full display name of the {@link #getContext()}.
 */
public String getContextFullDisplayName() {
  String n;
  if (context instanceof Item) {
    n = ((Item) context).getFullDisplayName();
  } else if (context instanceof Jenkins) {
    n = context.getDisplayName();
  } else if (context instanceof ItemGroup) {
    n = ((ItemGroup) context).getFullDisplayName();
  } else if (context instanceof User) {
    n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName());
  } else {
    // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
    n = Jenkins.getActiveInstance().getFullDisplayName();
  }
  return n;
}

代码示例来源:origin: org.jenkins-ci.plugins/cloudbees-folder

public void observe(Item item) {
  if (item instanceof Folder) {
    // only interested in non-folders in order to prevent double counting
    return;
  }
  HealthReport report = getHealthReport(item);
  if (report != null && (worst == null || report.getScore() < worst.getScore())) {
    worst = new HealthReport(report.getScore(), report.getIconUrl(),
        Messages._Folder_HealthWrap(item.getFullDisplayName(),
            report.getLocalizableDescription()));
  }
}

代码示例来源:origin: jenkinsci/cloudbees-folder-plugin

public void observe(Item item) {
  if (item instanceof Folder) {
    // only interested in non-folders in order to prevent double counting
    return;
  }
  HealthReport report = getHealthReport(item);
  if (report != null && (worst == null || report.getScore() < worst.getScore())) {
    worst = new HealthReport(report.getScore(), report.getIconUrl(),
        Messages._Folder_HealthWrap(item.getFullDisplayName(),
            report.getLocalizableDescription()));
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default
 * implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from
 * {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative
 * {@link #getContext()} that is outside of the normal tree then that implementation is responsible for
 * overriding this method to produce the correct display name.
 *
 * @return the display name.
 * @since 2.0
 */
public final String getContextDisplayName() {
  ModelObject context = getContext();
  if (context instanceof Item) {
    return ((Item) context).getFullDisplayName();
  } else if (context instanceof Jenkins) {
    return ((Jenkins) context).getDisplayName();
  } else if (context instanceof ItemGroup) {
    return ((ItemGroup) context).getFullDisplayName();
  } else if (context instanceof User) {
    return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName());
  } else {
    return context.getDisplayName();
  }
}

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

/**
 * Returns the full display name of the {@link #getContext()}.
 *
 * @return the full display name of the {@link #getContext()}.
 */
public String getContextFullDisplayName() {
  String n;
  if (context instanceof Item) {
    n = ((Item) context).getFullDisplayName();
  } else if (context instanceof Jenkins) {
    n = context.getDisplayName();
  } else if (context instanceof ItemGroup) {
    n = ((ItemGroup) context).getFullDisplayName();
  } else if (context instanceof User) {
    n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName());
  } else {
    // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
    n = Jenkins.getActiveInstance().getFullDisplayName();
  }
  return n;
}

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

/**
 * Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default
 * implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from
 * {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative
 * {@link #getContext()} that is outside of the normal tree then that implementation is responsible for
 * overriding this method to produce the correct display name.
 *
 * @return the display name.
 * @since 2.0
 */
public final String getContextDisplayName() {
  ModelObject context = getContext();
  if (context instanceof Item) {
    return ((Item) context).getFullDisplayName();
  } else if (context instanceof Jenkins) {
    return ((Jenkins) context).getDisplayName();
  } else if (context instanceof ItemGroup) {
    return ((ItemGroup) context).getFullDisplayName();
  } else if (context instanceof User) {
    return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName());
  } else {
    return context.getDisplayName();
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * Returns the {@link Item#getFullDisplayName()} or nearest approximation.
 *
 * @return the {@link Item#getFullDisplayName()} or nearest approximation.
 */
public final String getFullDisplayName() {
  String n;
  ModelObject context = getStore().getContext();
  if (context instanceof Item) {
    n = ((Item) context).getFullDisplayName();
  } else if (context instanceof ItemGroup) {
    n = ((ItemGroup) context).getFullDisplayName();
  } else if (context instanceof User) {
    n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName());
  } else {
    // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
    n = Jenkins.getActiveInstance().getFullDisplayName();
  }
  if (n.length() == 0) {
    return getDisplayName();
  } else {
    return n + " \u00BB " + getDisplayName();
  }
}

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

/**
 * Returns the {@link Item#getFullDisplayName()} or nearest approximation.
 *
 * @return the {@link Item#getFullDisplayName()} or nearest approximation.
 */
public final String getFullDisplayName() {
  String n;
  ModelObject context = getStore().getContext();
  if (context instanceof Item) {
    n = ((Item) context).getFullDisplayName();
  } else if (context instanceof ItemGroup) {
    n = ((ItemGroup) context).getFullDisplayName();
  } else if (context instanceof User) {
    n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName());
  } else {
    // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline
    n = Jenkins.getActiveInstance().getFullDisplayName();
  }
  if (n.length() == 0) {
    return getDisplayName();
  } else {
    return n + " \u00BB " + getDisplayName();
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

@CheckForNull
private static FormValidation checkForDuplicates(String value, ModelObject context, ModelObject object) {
  CredentialsMatcher withId = CredentialsMatchers.withId(value);
  for (CredentialsStore store : CredentialsProvider.lookupStores(object)) {
    if (!store.hasPermission(CredentialsProvider.VIEW)) {
      continue;
    }
    ModelObject storeContext = store.getContext();
    for (Domain domain : store.getDomains()) {
      for (Credentials match : CredentialsMatchers.filter(store.getCredentials(domain), withId)) {
        if (storeContext == context) {
          return FormValidation.error("This ID is already in use");
        } else {
          CredentialsScope scope = match.getScope();
          if (scope != null && !scope.isVisible(context)) {
            // scope is not exported to child contexts
            continue;
          }
          return FormValidation.warning("The ID ‘%s’ is already in use in %s", value,
              storeContext instanceof Item
                  ? ((Item) storeContext).getFullDisplayName()
                  : storeContext.getDisplayName());
        }
      }
    }
  }
  return null;
}

相关文章