• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WebUiPlugin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gerrit.extensions.webui.WebUiPlugin的典型用法代码示例。如果您正苦于以下问题:Java WebUiPlugin类的具体用法?Java WebUiPlugin怎么用?Java WebUiPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WebUiPlugin类属于com.google.gerrit.extensions.webui包,在下文中一共展示了WebUiPlugin类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPluginInfo

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
private PluginConfigInfo getPluginInfo() {
  PluginConfigInfo info = new PluginConfigInfo();
  info.hasAvatars = toBoolean(avatar.get() != null);
  info.jsResourcePaths = new ArrayList<>();
  info.htmlResourcePaths = new ArrayList<>();
  for (WebUiPlugin u : plugins) {
    String path =
        String.format("plugins/%s/%s", u.getPluginName(), u.getJavaScriptResourcePath());
    if (path.endsWith(".html")) {
      info.htmlResourcePaths.add(path);
    } else {
      info.jsResourcePaths.add(path);
    }
  }
  return info;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:17,代码来源:GetServerInfo.java


示例2: makeSystemModule

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
private Module makeSystemModule() {
  return new AbstractModule() {
    @Override
    protected void configure() {
      for (Class<?> clazz : sysSingletons) {
        bind(clazz).in(Scopes.SINGLETON);
      }
      for (Map.Entry<TypeLiteral<?>, Class<?>> e : sysListen.entries()) {
        @SuppressWarnings("unchecked")
        TypeLiteral<Object> type = (TypeLiteral<Object>) e.getKey();

        @SuppressWarnings("unchecked")
        Class<Object> impl = (Class<Object>) e.getValue();

        Annotation n = calculateBindAnnotation(impl);
        bind(type).annotatedWith(n).to(impl);
      }
      if (initJs != null) {
        DynamicSet.bind(binder(), WebUiPlugin.class).toInstance(new JavaScriptPlugin(initJs));
      }
    }
  };
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:24,代码来源:AutoRegisterModules.java


示例3: configure

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Override
protected void configure() {
  if (enableUI) {
    DynamicSet.bind(binder(), TopMenu.class)
      .to(ReviewersTopMenu.class);
    DynamicSet.bind(binder(), WebUiPlugin.class)
      .toInstance(new GwtPlugin("reviewers"));
  }

  DynamicSet.bind(binder(), EventListener.class)
      .to(ChangeEventListener.class);
  factory(DefaultReviewers.Factory.class);
  factory(ReviewersConfig.Factory.class);

  if (enableREST) {
    install(new RestApiModule() {
      @Override
      protected void configure() {
        get(PROJECT_KIND, "reviewers").to(GetReviewers.class);
        put(PROJECT_KIND, "reviewers").to(PutReviewers.class);
        get(PROJECT_KIND, "suggest_reviewers").to(SuggestProjectReviewers.class);
      }
    });
  }
}
 
开发者ID:davido,项目名称:gerrit-reviewers-plugin,代码行数:26,代码来源:Module.java


示例4: configureServlets

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Override
protected void configureServlets() {
    // Gerrit-CI project-specific settings page
    DynamicSet.bind(binder(), WebUiPlugin.class).toInstance(new GwtPlugin("projects"));

    /*
     * Jenkins jobs REST API
     * This regex is intended to match /jobs/${projectName}.
     */
    serveRegex("/jobs/[^\\/]+$").with(JobsServlet.class);
    serve("/settings").with(ConfigServlet.class);
}
 
开发者ID:palantir,项目名称:gerrit-ci,代码行数:13,代码来源:HttpModule.java


示例5: plugins

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
private void plugins(StringWriter w) {
  List<String> urls = new ArrayList<>();
  for (WebUiPlugin u : plugins) {
    urls.add(String.format("plugins/%s/%s", u.getPluginName(), u.getJavaScriptResourcePath()));
  }
  if (!urls.isEmpty()) {
    w.write(HPD_ID + ".plugins=");
    json(urls, w);
    w.write(";");
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:HostPageServlet.java


示例6: httpDynamicSetsOf

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
private Map<TypeLiteral<?>, DynamicSet<?>> httpDynamicSetsOf(Injector i) {
  // Copy binding of DynamicSet<WebUiPlugin> from sysInjector to HTTP.
  // This supports older plugins that bound a plugin in the HttpModule.
  TypeLiteral<WebUiPlugin> key = TypeLiteral.get(WebUiPlugin.class);
  DynamicSet<?> web = sysSets.get(key);
  checkNotNull(web, "DynamicSet<WebUiPlugin> exists in sysInjector");

  Map<TypeLiteral<?>, DynamicSet<?>> m = new HashMap<>(dynamicSetsOf(i));
  m.put(key, web);
  return Collections.unmodifiableMap(m);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:PluginGuiceEnvironment.java


示例7: HostPageServlet

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Inject
HostPageServlet(
    Provider<CurrentUser> cu,
    SitePaths sp,
    ThemeFactory themeFactory,
    ServletContext servletContext,
    DynamicSet<WebUiPlugin> webUiPlugins,
    DynamicSet<MessageOfTheDay> motd,
    @GerritServerConfig Config cfg,
    SiteStaticDirectoryServlet ss,
    NotesMigration migration,
    GetDiffPreferences diffPref)
    throws IOException, ServletException {
  currentUser = cu;
  plugins = webUiPlugins;
  messages = motd;
  signedOutTheme = themeFactory.getSignedOutTheme();
  signedInTheme = themeFactory.getSignedInTheme();
  site = sp;
  refreshHeaderFooter = cfg.getBoolean("site", "refreshHeaderFooter", true);
  staticServlet = ss;
  isNoteDbEnabled = migration.readChanges();
  pluginsLoadTimeout = getPluginsLoadTimeout(cfg);
  canLoadInIFrame = cfg.getBoolean("gerrit", "canLoadInIFrame", false);
  getDiff = diffPref;

  String pageName = "HostPage.html";
  template = HtmlDomUtil.parseFile(getClass(), pageName);
  if (template == null) {
    throw new FileNotFoundException("No " + pageName + " in webapp");
  }

  if (HtmlDomUtil.find(template, "gerrit_module") == null) {
    throw new ServletException("No gerrit_module in " + pageName);
  }
  if (HtmlDomUtil.find(template, HPD_ID) == null) {
    throw new ServletException("No " + HPD_ID + " in " + pageName);
  }

  String src = "gerrit_ui/gerrit_ui.nocache.js";
  try (InputStream in = servletContext.getResourceAsStream("/" + src)) {
    if (in != null) {
      Hasher md = Hashing.murmur3_128().newHasher();
      byte[] buf = new byte[1024];
      int n;
      while ((n = in.read(buf)) > 0) {
        md.putBytes(buf, 0, n);
      }
      src += "?content=" + md.hash().toString();
    } else {
      log.debug("No " + src + " in webapp root; keeping noncache.js URL");
    }
  } catch (IOException e) {
    throw new IOException("Failed reading " + src, e);
  }

  noCacheName = src;
  page = new Page();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:60,代码来源:HostPageServlet.java


示例8: GetServerInfo

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Inject
public GetServerInfo(
    @GerritServerConfig Config config,
    AccountVisibilityProvider accountVisibilityProvider,
    AuthConfig authConfig,
    Realm realm,
    DynamicMap<DownloadScheme> downloadSchemes,
    DynamicMap<DownloadCommand> downloadCommands,
    DynamicMap<CloneCommand> cloneCommands,
    DynamicSet<WebUiPlugin> webUiPlugins,
    AllowedFormats archiveFormats,
    AllProjectsName allProjectsName,
    AllUsersName allUsersName,
    @AnonymousCowardName String anonymousCowardName,
    DynamicItem<AvatarProvider> avatar,
    @EnableSignedPush boolean enableSignedPush,
    QueryDocumentationExecutor docSearcher,
    NotesMigration migration,
    ProjectCache projectCache,
    AgreementJson agreementJson,
    GerritOptions gerritOptions,
    ChangeIndexCollection indexes,
    SitePaths sitePaths) {
  this.config = config;
  this.accountVisibilityProvider = accountVisibilityProvider;
  this.authConfig = authConfig;
  this.realm = realm;
  this.downloadSchemes = downloadSchemes;
  this.downloadCommands = downloadCommands;
  this.cloneCommands = cloneCommands;
  this.plugins = webUiPlugins;
  this.archiveFormats = archiveFormats;
  this.allProjectsName = allProjectsName;
  this.allUsersName = allUsersName;
  this.anonymousCowardName = anonymousCowardName;
  this.avatar = avatar;
  this.enableSignedPush = enableSignedPush;
  this.docSearcher = docSearcher;
  this.migration = migration;
  this.projectCache = projectCache;
  this.agreementJson = agreementJson;
  this.gerritOptions = gerritOptions;
  this.indexes = indexes;
  this.sitePaths = sitePaths;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:46,代码来源:GetServerInfo.java


示例9: configure

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Override
protected void configure() {
  bind(String.class).annotatedWith(PluginName.class).toInstance(pluginName);
  DynamicSet.bind(binder(), WebUiPlugin.class).toInstance(new JavaScriptPlugin(fileName));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:6,代码来源:JsPlugin.java


示例10: configureServlets

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Override
protected void configureServlets() {
  DynamicSet.bind(binder(), WebUiPlugin.class)
    .toInstance(new JavaScriptPlugin("trigger-revision.js"));
}
 
开发者ID:rinrinne,项目名称:gerrit-change-trigger,代码行数:6,代码来源:HttpModule.java


示例11: configureServlets

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Override
protected void configureServlets() {
  DynamicSet.bind(binder(), WebUiPlugin.class).toInstance(
      new JavaScriptPlugin("retrigger-me.js"));
}
 
开发者ID:dluksza,项目名称:gerrit-retriggerme,代码行数:6,代码来源:HttpModule.java


示例12: configureServlets

import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Override
protected void configureServlets() {
  DynamicSet.bind(binder(), WebUiPlugin.class)
      .toInstance(new JavaScriptPlugin("wip.js"));
}
 
开发者ID:davido,项目名称:gerrit-wip-plugin,代码行数:6,代码来源:HttpModule.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Snapshot类代码示例发布时间:2022-05-23
下一篇:
Java C2BConverter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap