本文整理匯總了Java中org.apache.wicket.Application.exists方法的典型用法代碼示例。如果您正苦於以下問題:Java Application.exists方法的具體用法?Java Application.exists怎麽用?Java Application.exists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.Application
的用法示例。
在下文中一共展示了Application.exists方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLimit
import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
* Determines a limit to use for HTML diff output.
*
* @param key
* to use to read the value from the GitBlit settings, if available.
* @param minimum
* minimum value to enforce
* @param maximum
* maximum (and default) value to enforce
* @return the limit
*/
private int getLimit(String key, int minimum, int maximum) {
if (Application.exists()) {
Application application = Application.get();
if (application instanceof GitBlitWebApp) {
GitBlitWebApp webApp = (GitBlitWebApp) application;
int configValue = webApp.settings().getInteger(key, maximum);
if (configValue < minimum) {
return minimum;
} else if (configValue < maximum) {
return configValue;
}
}
}
return maximum;
}
示例2: setupContext
import org.apache.wicket.Application; //導入方法依賴的package包/類
protected void setupContext(Application application, Session session) {
if (!Application.exists() && application != null) {
ThreadContext.setApplication(application);
}
if (!Session.exists() && session != null) {
ThreadContext.setSession(session);
}
}
示例3: getUserIfAvailable
import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public SUser getUserIfAvailable() {
String username = null;
if (Application.exists() && SingularSession.exists()) {
username = SingularSession.get().getUsername();
}
if (username != null) {
return actorDAO.retrieveByUserCod(username);
} else {
return null;
}
}
示例4: getDependencies
import org.apache.wicket.Application; //導入方法依賴的package包/類
@Override
public Iterable<? extends HeaderItem> getDependencies() {
final ResourceReference backingLibraryReference;
if (Application.exists()) {
backingLibraryReference = Application.get().getJavaScriptLibrarySettings().getJQueryReference();
} else {
backingLibraryReference = JQueryResourceReference.get();
}
return Arrays.asList(CssHeaderItem.forReference(BOOTSTRAP_CSS), JavaScriptHeaderItem.forReference(backingLibraryReference));
}
示例5: getUrlProvider
import org.apache.wicket.Application; //導入方法依賴的package包/類
protected UrlProvider getUrlProvider() {
if (Application.exists()) {
return UQasar.get().getUrlProvider();
} else {
return null;
}
}
示例6: getHomepageLink
import org.apache.wicket.Application; //導入方法依賴的package包/類
private String getHomepageLink() {
if (Application.exists()) {
return UQasar.get().getHomePageUrl();
} else {
return getBaseURL();
}
}
示例7: getLogoLink
import org.apache.wicket.Application; //導入方法依賴的package包/類
private String getLogoLink() {
if (Application.exists()) {
return UQasar.get().getHomePageUrl() + "/assets/img/uqasar-logo.png";
} else {
return getAssetURL("assets/img/uqasar-logo.png");
}
}
示例8: lookupApplication
import org.apache.wicket.Application; //導入方法依賴的package包/類
protected static <T extends OrientDbWebApplication> T lookupApplication(Class<T> appClass)
{
Application app = Application.exists()?Application.get():null;
if(app!=null && appClass.isInstance(app)) return (T)app;
else
{
for(String appKey: Application.getApplicationKeys())
{
app = Application.get(appKey);
if(appClass.isInstance(app)) return (T)app;
}
}
return null;
}
示例9: setupContext
import org.apache.wicket.Application; //導入方法依賴的package包/類
protected void setupContext(Application application, Session session) {
if (!Application.exists() && application != null) {
ThreadContext.setApplication(application);
}
if (!Session.exists() && session != null) {
ThreadContext.setSession(session);
}
}
示例10: getSettings
import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
* Returns settings of application, that belongs to current thread.
*
* @return settings of application in current thread
* @throws IllegalStateException if there isn't any application in current thread
*/
public static LeafletSettings getSettings() {
// get settings for application in current thread
if (Application.exists()) {
Application app = Application.get();
return getSettings(app);
}
throw new IllegalStateException("Application was not found in current thread");
}
示例11: getMsg
import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
* Returns a localized message string, if there is a localization; otherwise the given default value.
*
* @param key
* message key for the message
* @param defaultValue
* to use if no localization for the message can be found
* @return the possibly localized message
*/
private String getMsg(String key, String defaultValue) {
if (Application.exists()) {
Localizer localizer = Application.get().getResourceSettings().getLocalizer();
if (localizer != null) {
// Use getStringIgnoreSettings because we don't want exceptions here if the key is missing!
return localizer.getStringIgnoreSettings(key, null, null, defaultValue);
}
}
return defaultValue;
}
示例12: settings
import org.apache.wicket.Application; //導入方法依賴的package包/類
/**
* returns the {@link ClientSideLoggingSettings} which are assigned to current application
*
* @return assigned {@link ClientSideLoggingSettings}
*/
public static IClientSideLoggingSettings settings() {
if (Application.exists()) {
return settings(Application.get());
}
throw new IllegalStateException("there is no active application assigned to this thread.");
}
示例13: doFilter
import org.apache.wicket.Application; //導入方法依賴的package包/類
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException
{
// Sollte eigentlich immer NULL ergeben, aber man weiss nie ...
final Application previousOne = (Application.exists() == true) ? Application.get() : null;
org.apache.wicket.ThreadContext.setApplication(this.application);
try {
chain.doFilter(request, response);
} finally {
if (previousOne != null) {
org.apache.wicket.ThreadContext.setApplication(previousOne);
} else {
org.apache.wicket.ThreadContext.setApplication(null);
}
}
}