本文整理汇总了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;
}
示例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));
}
}
};
}
示例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);
}
});
}
}
示例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);
}
示例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(";");
}
}
示例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);
}
示例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();
}
示例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;
}
示例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));
}
示例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"));
}
示例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"));
}
示例12: configureServlets
import com.google.gerrit.extensions.webui.WebUiPlugin; //导入依赖的package包/类
@Override
protected void configureServlets() {
DynamicSet.bind(binder(), WebUiPlugin.class)
.toInstance(new JavaScriptPlugin("wip.js"));
}