當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。