本文整理汇总了Java中org.apache.wicket.devutils.debugbar.DebugBar类的典型用法代码示例。如果您正苦于以下问题:Java DebugBar类的具体用法?Java DebugBar怎么用?Java DebugBar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DebugBar类属于org.apache.wicket.devutils.debugbar包,在下文中一共展示了DebugBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initDebugBarLayout
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
private void initDebugBarLayout() {
DebugBar debugPanel = new DebugBar(ID_DEBUG_PANEL);
add(debugPanel);
WebMarkupContainer debugBar = new WebMarkupContainer(ID_DEBUG_BAR);
debugBar.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
RuntimeConfigurationType runtime = getApplication().getConfigurationType();
return RuntimeConfigurationType.DEVELOPMENT.equals(runtime);
}
});
add(debugBar);
AjaxButton clearCache = new AjaxButton(ID_CLEAR_CACHE, createStringResource("PageBase.clearCssCache")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
clearLessJsCache(target);
}
};
debugBar.add(clearCache);
}
示例2: HomePage
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
public HomePage(final PageParameters parameters) {
super(parameters);
add(new DebugBar("debugBar"));
add(new Label("dbName", new PropertyModel<String>(this, "session.database.name")));
add(new Label("dbUrl", new PropertyModel<String>(this, "session.database.URL")));
add(new Label("dbUserName", new PropertyModel<String>(this, "session.database.user.name")));
add(new Label("signedIn", new PropertyModel<String>(this, "session.signedIn")));
add(new Label("signedInUser", new PropertyModel<String>(this, "session.user.name")));
// ((OrientDbWebSession)getSession()).getDatabase().getUser().
add(new SignInPanel("signInPanel"));
OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>("select from "+WicketApplication.CLASS_NAME);
List<IColumn<ODocument, String>> columns = new ArrayList<>();
columns.add(new DocumentPropertyColumn(Model.of(WicketApplication.PROP_NAME), WicketApplication.PROP_NAME, WicketApplication.PROP_NAME));
columns.add(new DocumentPropertyColumn(Model.of(WicketApplication.PROP_INT), WicketApplication.PROP_INT, WicketApplication.PROP_INT));
columns.add(new DocumentPropertyColumn(Model.of(WicketApplication.PROP_DATE), WicketApplication.PROP_DATE, WicketApplication.PROP_DATE));
DefaultDataTable<ODocument, String> table = new DefaultDataTable<>("table", columns, provider, 15);
add(table);
}
示例3: initDebugBarLayout
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
private void initDebugBarLayout() {
DebugBar debugPanel = new DebugBar(ID_DEBUG_PANEL);
add(debugPanel);
WebMarkupContainer debugBar = new WebMarkupContainer(ID_DEBUG_BAR);
debugBar.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
RuntimeConfigurationType runtime = getApplication().getConfigurationType();
return RuntimeConfigurationType.DEVELOPMENT.equals(runtime);
}
});
add(debugBar);
AjaxButton clearCache = new AjaxButton(ID_CLEAR_CACHE, createStringResource("PageBase.clearCssCache")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
clearLessJsCache(target);
}
};
debugBar.add(clearCache);
}
示例4: onInitialize
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new DebugBar("debug"));
add(new BookmarkablePageLink<WebPage>("home", HomePage.class));
add(new Menu("sample", SamplePage.class));
Menu menu = new Menu("usersMenu");
menu.add(new Menu("createUsers", CreateUserPage.class));
menu.add(new Menu("listUsers", ListUsersPage.class));
add(menu);
// change password
add(new BookmarkablePageLink<ChangePasswordPage>("user.change-password", ChangePasswordPage.class));
// logout link
add(new Link<Void>("user.logout") {
@Override
public void onClick() {
getSession().invalidate();
}
});
}
示例5: createPage
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
private void createPage() {
add(title = new Label("title", new LoadableDetachableModel<Object>() {
private static final long serialVersionUID = 1L;
@Override
protected Object load() {
return getPageTitleModel().getObject();
}
}));
title.setOutputMarkupId(true);
if (getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled()) {
add(new DebugBar("debug"));
} else {
add(new EmptyPanel("debug").setVisible(false));
}
add(createMenuItem("homeMenuItem", "home", HomePage.class));
add(createMenuItem("aboutMenuItem", "about", AboutPage.class));
add(selectRegistryPanel = new SelectRegistryPanel("selectRegistry"));
selectRegistryPanel.setOutputMarkupId(true);
add(new SignInPanel("authPanel"));
add(new SignOutPanel("signOut"));
}
示例6: BasePage
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
public BasePage(){
// Set Sakai Locale
ResourceLoader rl = new ResourceLoader();
getSession().setLocale(rl.getLocale());
TransparentWebMarkupContainer html = new TransparentWebMarkupContainer("html");
String locale = getSession().getLocale().toString();
html.add(AttributeModifier.replace("lang", locale));
html.add(AttributeModifier.replace("xml:lang", locale));
add(html);
add(new DebugBar("debug"));
}
示例7: CroquetPage
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
/**
* Initialize the instance.
*/
public CroquetPage() {
add(new DebugBar("croquetDebugBar") {
private static final long serialVersionUID = 9172081361782379034L;
@Override
public boolean isVisible() {
// in unit tests, this will be null
return wicketSettings == null ? false : wicketSettings.getWicketDebugToolbar();
}
});
}
示例8: initDebugBar
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
public static void initDebugBar(Application application)
{
if (application.getDebugSettings().isDevelopmentUtilitiesEnabled())
{
DebugBar.registerContributor(WicketConsoleDebugPanel.DEBUG_BAR_CONTRIB);
}
}
示例9: ForscherPage
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
public ForscherPage(IModel<?> model) {
super(model);
MenuPanel menuPanel = new MenuPanel("menu", getMenuItems());
LoginStatusBar loginBar = new LoginStatusBar("loginstatus", "TODO", null);
loginBar.setRenderBodyOnly(true);
menuPanel.setRenderBodyOnly(true);
// menuPanel.setVisible(false);
add(menuPanel);
add(loginBar);
add(new DebugBar("debug"));
}
示例10: initLayout
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
private void initLayout() {
Label title = new Label(ID_TITLE, createPageTitleModel());
title.setRenderBodyOnly(true);
add(title);
DebugBar debugPanel = new DebugBar(ID_DEBUG_PANEL);
add(debugPanel);
}
示例11: AWebPage
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
public AWebPage(final IModel<?> model) {
super(model);
if (ABaseWebApplication.get().getDelegate().getAuthenticationService() != null) {
//check remember me before anything else
final SignIn signIn = new SignIn();
signIn.setComponent(this);
signIn.checkRememberMe();
}
final HtmlTag htmlTag = newHtmlTag("html");
add(htmlTag);
//default title is the classname, though this can be changed by calling the setter afterwards
titleModel = Model.of(
Objects.toVisibleName(Strings.removeTrailing(getClass().getSimpleName(), Page.class.getSimpleName())));
final Label title = new Label("title", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getTitleModel().getObject();
}
});
add(title);
//need a separate container inside body to prevent it from rendering outside of the html tag
final WebMarkupContainer ajaxIndicatorAppenderContainer = new WebMarkupContainer(
"ajaxIndicatorAppenderContainer");
add(ajaxIndicatorAppenderContainer);
ajaxIndicatorAppender = newAjaxIndicatorAppender();
if (ajaxIndicatorAppender != null) {
ajaxIndicatorAppenderContainer.add(ajaxIndicatorAppender);
}
final Navbar navbar = newNavbar("navbar");
if (navbar != null) {
add(navbar);
} else {
add(new EmptyPanel("navbar").setVisible(false));
}
DebugBar debugBar = null;
if (getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled()) {
debugBar = newDebugBar("debugBar");
}
if (debugBar != null) {
add(debugBar);
} else {
add(new EmptyPanel("debugBar").setVisible(false));
}
add(newContainer("bodyContainer"));
final AFooter footer = newFooter("footer");
if (footer != null) {
footer.setContainerClass(getContainerClass());
add(footer);
} else {
add(new WebMarkupContainer("footer").setVisible(false));
}
}
示例12: newDebugBar
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
protected DebugBar newDebugBar(final String id) {
return new DebugBar(id);
}
示例13: init
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
@Override
protected void init() {
super.init();
// Configure general wicket application settings
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
getResourceSettings().setThrowExceptionOnMissingResource(false);
getMarkupSettings().setStripWicketTags(true);
getResourceSettings().getStringResourceLoaders().add(new SiteStatsStringResourceLoader());
getResourceSettings().getResourceFinders().add(new WebApplicationPath(getServletContext(), "html"));
getResourceSettings().setResourceStreamLocator(new SiteStatsResourceStreamLocator());
getDebugSettings().setAjaxDebugModeEnabled(debug);
// Home page
mountPage("/home", OverviewPage.class);
// On wicket session timeout, redirect to main page
getApplicationSettings().setPageExpiredErrorPage(OverviewPage.class);
getApplicationSettings().setAccessDeniedPage(OverviewPage.class);
// Debugging
debug = ServerConfigurationService.getBoolean("sitestats.debug", false);
if(debug) {
getDebugSettings().setComponentUseCheck(true);
getDebugSettings().setAjaxDebugModeEnabled(true);
getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(true);
getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(true);
getDebugSettings().setOutputComponentPath(true);
getDebugSettings().setOutputMarkupContainerClassName(true);
getDebugSettings().setDevelopmentUtilitiesEnabled(true);
getMarkupSettings().setStripWicketTags(false);
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_EXCEPTION_PAGE);
// register standard debug contributors so that just setting the sitestats.debug property is enough to turn these on
// otherwise, you have to turn wicket development mode on to get this populated due to the order methods are called
DebugBar.registerContributor(VersionDebugContributor.DEBUG_BAR_CONTRIB, this);
DebugBar.registerContributor(InspectorDebugPanel.DEBUG_BAR_CONTRIB, this);
DebugBar.registerContributor(SessionSizeDebugPanel.DEBUG_BAR_CONTRIB, this);
DebugBar.registerContributor(PageSizeDebugPanel.DEBUG_BAR_CONTRIB, this);
}
else
{
// Throw RuntimeDeceptions so they are caught by the Sakai ErrorReportHandler
getRequestCycleListeners().add(new AbstractRequestCycleListener()
{
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex)
{
if (ex instanceof RuntimeException)
{
throw (RuntimeException) ex;
}
return null;
}
});
}
// Encrypt URLs. This immediately sets up a session (note that things like CSS now becomes bound to the session)
getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory()); // Different key per user
final IRequestMapper cryptoMapper = new CryptoMapper(getRootRequestMapper(), this);
setRootRequestMapper(cryptoMapper);
}
示例14: HomePage
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
public HomePage(final PageParameters parameters) {
super(parameters);
add(new WicketConsolePanel("console"));
add(new DebugBar("debugBar"));
}
示例15: createComponent
import org.apache.wicket.devutils.debugbar.DebugBar; //导入依赖的package包/类
@Override
public Component createComponent(final String id, final DebugBar debugBar)
{
return new WicketConsoleDebugPanel(id);
}