當前位置: 首頁>>代碼示例>>Java>>正文


Java Application.exists方法代碼示例

本文整理匯總了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;
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:27,代碼來源:GitBlitDiffFormatter.java

示例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);
	}
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:9,代碼來源:SecurityContextAwareCallable.java

示例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;
    }

}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:16,代碼來源:SingularDefaultUserService.java

示例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));
}
 
開發者ID:nikfoundas,項目名稱:etcd-viewer,代碼行數:13,代碼來源:WebResources.java

示例5: getUrlProvider

import org.apache.wicket.Application; //導入方法依賴的package包/類
protected UrlProvider getUrlProvider() {
	if (Application.exists()) {
		return UQasar.get().getUrlProvider();
	} else {
		return null;
	}
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:8,代碼來源:UQasarMessage.java

示例6: getHomepageLink

import org.apache.wicket.Application; //導入方法依賴的package包/類
private String getHomepageLink() {
	if (Application.exists()) {
		return UQasar.get().getHomePageUrl();
	} else {
		return getBaseURL();
	}
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:8,代碼來源:UQasarMessage.java

示例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");
	}
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:8,代碼來源:UQasarMessage.java

示例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;
}
 
開發者ID:OrienteerBAP,項目名稱:wicket-orientdb,代碼行數:15,代碼來源:OrientDbWebApplication.java

示例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);
    }
}
 
開發者ID:Evolveum,項目名稱:midpoint,代碼行數:9,代碼來源:SecurityContextAwareCallable.java

示例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");
}
 
開發者ID:DrunkenPandaFans,項目名稱:wicket-leaflet,代碼行數:15,代碼來源:Leaflet.java

示例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;
}
 
開發者ID:tomaswolf,項目名稱:gerrit-gitblit-plugin,代碼行數:20,代碼來源:GitBlitDiffFormatter.java

示例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.");
}
 
開發者ID:l0rdn1kk0n,項目名稱:wicket-clientside-logging,代碼行數:13,代碼來源:ClientSideLogging.java

示例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);
    }
  }
}
 
開發者ID:micromata,項目名稱:projectforge-webapp,代碼行數:16,代碼來源:WicketApplicationFilter.java


注:本文中的org.apache.wicket.Application.exists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。