当前位置: 首页>>代码示例>>Java>>正文


Java Page类代码示例

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


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

示例1: getUrlString

import org.apache.wicket.Page; //导入依赖的package包/类
@Override
public String getUrlString(Class<? extends Page> pageClass, QueryFacetsSelection selection, SolrDocument document) {
    final PageParameters params = new PageParameters();
    if (selection != null) {
        params.mergeWith(paramsConverter.toParameters(selection));
    }

    if (document != null) {
        params.add(VloWebAppParameters.DOCUMENT_ID, document.getFirstValue(FacetConstants.FIELD_ID));
    }

    final String style = Session.get().getStyle();
    if (style != null) {
        params.add(VloWebAppParameters.THEME, style);
    }

    final CharSequence url = RequestCycle.get().urlFor(pageClass, params);
    final String absoluteUrl = RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(url));
    return absoluteUrl;
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:21,代码来源:PermalinkServiceImpl.java

示例2: getExceptionMapperProvider

import org.apache.wicket.Page; //导入依赖的package包/类
@Override
public final IProvider<IExceptionMapper> getExceptionMapperProvider() {
	return new IProvider<IExceptionMapper>() {

		@Override
		public IExceptionMapper get() {
			return new DefaultExceptionMapper() {

				@Override
				protected IRequestHandler mapExpectedExceptions(Exception e, Application application) {
					Page errorPage = mapExceptions(e);
					if (errorPage != null) {
						return createPageRequestHandler(new PageProvider(errorPage));
					} else {
						return super.mapExpectedExceptions(e, application);
					}
				}
				
			};
		}
		
	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:24,代码来源:GitPlexWebApplication.java

示例3: getMessage

import org.apache.wicket.Page; //导入依赖的package包/类
private List<ErrorItem> getMessage(Throwable cause, Page page, String errorCode) {
    List<ErrorItem> items = new ArrayList<ErrorItem>();
    ErrorItem item1 = new ErrorItem("Symptom", "Your operation is failed with error.");
    items.add(item1);
    ErrorItem item2 = new ErrorItem("Cause", cause.getMessage());
    items.add(item2);
    if (cause instanceof InventoryException) {
        Throwable root = ExceptionUtils.getRootCause(cause);
        if (root != null || root != cause) {
            ErrorItem item3 = new ErrorItem("Root Cause", root.getMessage());
            items.add(item3);
        }
    }
    ErrorItem item4 = new ErrorItem("Action", "Please contact system administrator with additional information below.");
    item4.addLine(errorCode);
    items.add(item4);
    return items;
}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:19,代码来源:InventoryRequestCycle.java

示例4: getHomePage

import org.apache.wicket.Page; //导入依赖的package包/类
@Override
public Class<? extends Page> getHomePage() {
    Sql2o sql2o = Spring.getBean(Sql2o.class);
    try (Connection connection = sql2o.open()) {
        Query query = connection.createQuery("SELECT groovy.java_class FROM setting INNER JOIN page on setting.value = page.page_id INNER JOIN groovy on page.groovy_id = groovy.groovy_id where setting.name = 'home_page'");
        String javaClass = query.executeAndFetchFirst(String.class);
        if (Strings.isNullOrEmpty(javaClass)) {
            return DashboardPage.class;
        } else {
            GroovyClassLoader classLoader = Spring.getBean(GroovyClassLoader.class);
            try {
                return (Class<? extends Page>) classLoader.loadClass(javaClass);
            } catch (ClassNotFoundException | ClassCastException e) {
                return DashboardPage.class;
            }
        }
    }
}
 
开发者ID:PkayJava,项目名称:MBaaS,代码行数:19,代码来源:Application.java

示例5: setUp

import org.apache.wicket.Page; //导入依赖的package包/类
public void setUp() throws Exception{
    super.setUp();
    Persistor.useTestEnvironment();
    attributes.add(baseAttribute);
    attributes.add(depAttribute);
    AttributeTypeTree attributeTree = new AttributeTypeTree(attributes);
    eventType = new EapEventType("TestType", attributeTree);
    ArrayList<EapEventType> eventTypes = new ArrayList<>();
    eventTypes.add(eventType);
    EapEventType.save(eventTypes);
    tester = new WicketTester(new UNICORNApplication());
    tester.startPage(GeneratorPage.class);
    tester.startComponentInPage(new DependenciesPanel("dependenciesPanel" , new GeneratorPage()));
    // get form
    List<Form> list = new ArrayList<>();
    Page x = tester.getLastRenderedPage();
    for (Component form : x.visitChildren(Form.class)) {
        list.add((Form) form);
    }
    formPath = list.get(0).getPageRelativePath();
    listViewPath = formPath + ":dependenciesContainer:dependenciesListview";
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:23,代码来源:DependenciesPanelTest.java

示例6: getSignInPageClass

import org.apache.wicket.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected Class<? extends WebPage> getSignInPageClass() {
	if(classCandidates.getSignInPageCandidates().size() <= 0){
		throw new IllegalStateException("Couln't find sign in page - please annotated the sign in page with @" + WicketSignInPage.class.getName());
	}
	if(classCandidates.getSignInPageCandidates().size() > 1 ){
		String message = "Multiple sign in pages found - please annotated exactly one class with @" + WicketSignInPage.class.getName();
		message += "\n";
		for(WicketClassCandidate<Page> classCandidate : classCandidates.getHomePageCandidates()) {
			message += "\t" + classCandidate.getCandidate() + "\n";
		}
		throw new IllegalStateException(message);
	}
	
	Class<WebPage> candidateClass = classCandidates.getSignInPageCandidates().iterator().next().getCandidate();
	return candidateClass;
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:19,代码来源:WicketBootSecuredWebApplication.java

示例7: EditRolePage

import org.apache.wicket.Page; //导入依赖的package包/类
public EditRolePage(PageParameters parameters) {
    super(ListRolesPage.class, parameters);
     long roleId = parameters.get("id").toLong(-1L);
     final UIRole role  = roleService.getRole(roleId);
     setDefaultModel(new CompoundPropertyModel<UIRole>(role));
     Form form = new Form("form"){

        @Override
        protected void onSubmit() {
        roleService.updateRole(role);
        setResponsePage(ListRolesPage.class);
        }

     };
     add(form);
     form.add(new LabelValueRow<String>("role-name", new Model<String>(role.getRoleName()), "role.create.name"));
     form.add(new LabelTextFieldRow<String>(role, "principalName", "role.create.principal-name", true));
     form.add(new Button("form-submit"));
     form.add(new BookmarkablePageLink<Page>("form-cancel", ListRolesPage.class));
}
 
开发者ID:payneteasy,项目名称:superfly,代码行数:21,代码来源:EditRolePage.java

示例8: CloneGroupPage

import org.apache.wicket.Page; //导入依赖的package包/类
@SuppressWarnings("serial")
public CloneGroupPage(PageParameters param) {
    super(ListGroupsPage.class, param);

    final Long sourceId = param.get("sid").toLong();

    final UIGroup sourceGroup = groupService.getGroupById(sourceId);
    GroupModel groupModel = new GroupModel();

    Form<GroupModel> form = new Form<GroupModel>("form", new Model<GroupModel>(groupModel)) {
        @Override
        protected void onSubmit() {
            UICloneGroupRequest request = new UICloneGroupRequest();
            request.setNewGroupName(getModelObject().getName());
            request.setSourceGroupId(sourceGroup.getId());
            groupService.cloneGroup(request);
            setResponsePage(ListGroupsPage.class);
        }

    };
    add(form);

    form.add(new LabelValueRow<String>("source", new Model(sourceGroup.getLabel()), "group.clone.source"));
    form.add(new LabelTextFieldRow<String>(groupModel, "name", "group.clone.name", true));
    form.add(new BookmarkablePageLink<Page>("cancel", ListGroupsPage.class));
}
 
开发者ID:payneteasy,项目名称:superfly,代码行数:27,代码来源:CloneGroupPage.java

示例9: LinksTemplate

import org.apache.wicket.Page; //导入依赖的package包/类
public LinksTemplate(PageParameters parameters) {
	super(parameters);
	
	IModel<User> userModel = new GenericEntityModel<Long, User>(null);
	try {
		linkDescriptor(new Model<Class<Page>>(null), userModel).extract(parameters);
	} catch (LinkParameterValidationException ignored) {
		// Get around the parameter validation for the purpose of this test
	}
	
	add(new Label("title", getTitleModel()));
	
	Component linkToPage1 = LinkDescriptorBuilder.toPageInstance(this).validate(LinksPage1.class).build()
			.link("linkToThisPageInstanceOnlyIfPage1").hideIfInvalid();
	add(linkToPage1);
	
	add(LinkDescriptorBuilder.toPageInstance(this).validate(LinksTemplate.class).build().link("linkToThisPageInstance")
			.add(Condition.componentVisible(linkToPage1).thenHide()));
	
	add(new DynamicLinkTestPanel("linkTestPanel", userModel));
	
	add(new DynamicImageTestPanel("imageTestPanel"));
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:24,代码来源:LinksTemplate.java

示例10: EnterTopicPage

import org.apache.wicket.Page; //导入依赖的package包/类
public EnterTopicPage(PageParameters parameters) {
	super(parameters);
	
    Topic topic = new TopicModel<Topic>(parameters.getString("topicMapId"), parameters.getString("topicId")).getTopic();
    
    Class<? extends Page> pageClass;
    if (topic.isTopicType())
      pageClass = InstancesPage.class;
//    else if (topic.isAssociationType())
//      pageClass = InstancePage.class;
//    else if (topic.isOccurrenceType())
//      pageClass = InstancePage.class;
//    else if (topic.isNameType())
//      pageClass = InstancePage.class;
//    else if (topic.isRoleType())
//      pageClass = InstancePage.class;
    else
      pageClass = InstancePage.class;
    
    // redirect page
    PageParameters params = new PageParameters();
    params.add("topicMapId", topic.getTopicMap().getId());
    params.add("topicId", topic.getId());
    setResponsePage(pageClass, params);
    setRedirect(true);
  }
 
开发者ID:ontopia,项目名称:ontopia,代码行数:27,代码来源:EnterTopicPage.java

示例11: getValidPageInstance

import org.apache.wicket.Page; //导入依赖的package包/类
protected Page getValidPageInstance() throws LinkInvalidTargetRuntimeException {
	Page pageInstance = pageInstanceModel.getObject();
	if (pageInstance == null) {
		throw new LinkInvalidTargetRuntimeException("The target page instance was null");
	}
	
	Class<? extends Page> validPageClass = getValidExpectedPageClass(pageInstance);
	
	if (validPageClass == null) {
		throw new LinkInvalidTargetRuntimeException("The target page instance '" + pageInstance + "' had unexpected type :"
				+ " got " + pageInstance.getClass().getName() + ", "
				+ "expected one of " + Joiner.on(", ").join(Collections2.transform(expectedPageClassModels, GET_NAME_FROM_CLASS_MODEL_FUNCTION)));
	}
	
	if (! bypassPermissions) {
		if (!Session.get().getAuthorizationStrategy().isActionAuthorized(pageInstance, Page.RENDER)) {
			throw new LinkInvalidTargetRuntimeException("The rendering of the target page instance '" + pageInstance
					+ "' was not authorized.");
		}
	}
	
	return pageInstance;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:24,代码来源:CorePageInstanceLinkGenerator.java

示例12: newNavbar

import org.apache.wicket.Page; //导入依赖的package包/类
protected Navbar newNavbar(final String id) {
    final Navbar navbar = new Navbar(id) {

        @Override
        protected TransparentWebMarkupContainer newContainer(final String componentId) {
            final TransparentWebMarkupContainer container = super.newCollapseContainer(componentId);
            container.add(AttributeModifier.replace("class", getContainerClass()));
            return container;
        }

        @Override
        protected Class<? extends Page> getHomePage() {
            return getNavbarHomePage();
        }

    };
    navbar.setBrandName(Model.of("invesdwin-NoWicket"));
    navbar.setBrandImage(DEFAULT_LOGO, Model.of("logo"));

    addSignInOrSignOutPageToNavbar(navbar);

    return navbar;
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:24,代码来源:AWebPage.java

示例13: BuilderTargetFactories

import org.apache.wicket.Page; //导入依赖的package包/类
private BuilderTargetFactories(
		IBuilderLinkDescriptorFactory<TEarlyTarget, TEarlyTargetDefinitionLinkDescriptor>
				earlyTargetDefinitionLinkDescriptorFactory,
		IModel<? extends TEarlyTarget> earlyTargetDefinitionTargetModel,
		IBuilderLinkDescriptorFactory<
				Class<? extends Page>, TLateTargetDefinitionPageLinkDescriptor
				> lateTargetDefinitionPageLinkDescriptorFactory,
		IBuilderLinkDescriptorFactory<
				ResourceReference, TLateTargetDefinitionResourceLinkDescriptor
				> lateTargetDefinitionResourceLinkDescriptorFactory,
		IBuilderLinkDescriptorFactory<
				ResourceReference, TLateTargetDefinitionImageResourceLinkDescriptor
				> lateTargetDefinitionImageResourceLinkDescriptorFactory) {
	super();
	this.earlyTargetDefinitionLinkDescriptorFactory = earlyTargetDefinitionLinkDescriptorFactory;
	this.earlyTargetDefinitionTargetModel = earlyTargetDefinitionTargetModel;
	this.lateTargetDefinitionPageLinkDescriptorFactory = lateTargetDefinitionPageLinkDescriptorFactory;
	this.lateTargetDefinitionResourceLinkDescriptorFactory = lateTargetDefinitionResourceLinkDescriptorFactory;
	this.lateTargetDefinitionImageResourceLinkDescriptorFactory = lateTargetDefinitionImageResourceLinkDescriptorFactory;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:21,代码来源:BuilderTargetFactories.java

示例14: SignOutPage

import org.apache.wicket.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked") 
public SignOutPage(final PageParameters parameters) {
  add(new HeaderPanel("header"));    
  add(new FooterPanel("footer"));
  
  String page = parameters.getString(REDIRECTPAGE_PARAM); 
  Class<? extends Page> pageClass; 
  if (page != null) { 
    try { 
      pageClass = (Class<? extends Page>) Class.forName(page); 
    } catch (ClassNotFoundException e) { 
      throw new RuntimeException(e); 
    } 
  } else { 
    pageClass = getApplication().getHomePage(); 
  } 
  getSession().invalidate();    
  setResponsePage(pageClass);
  setRedirect(true);
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:21,代码来源:SignOutPage.java

示例15: initialiseWicketApplication

import org.apache.wicket.Page; //导入依赖的package包/类
private void initialiseWicketApplication() {

        // This initialises various statically stored values that Wicket uses,
        // most notably, Session and Application whose absence was causing NullPointerException during call to
        // org.hippoecm.frontend.editor.validator.plugins.AbstractCmsValidator.getTranslation(java.lang.String).
        new WicketTester(new WebApplication() {
            public Class<? extends Page> getHomePage() {
                return null;
            }
        });
    }
 
开发者ID:NHS-digital-website,项目名称:hippo,代码行数:12,代码来源:BlankAttachmentFieldValidatorTest.java


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