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


Java Fragment.add方法代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.panel.Fragment.add方法的典型用法代码示例。如果您正苦于以下问题:Java Fragment.add方法的具体用法?Java Fragment.add怎么用?Java Fragment.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.markup.html.panel.Fragment的用法示例。


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

示例1: newAcceptedFrag

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
private Fragment newAcceptedFrag() {
	Fragment fragment = new Fragment("status", "mergedFrag", this);
	fragment.add(new BranchLink("sourceBranch", getPullRequest().getSource(), null));
	fragment.add(new BranchLink("targetBranch", getPullRequest().getTarget(), null));
	fragment.add(new Link<Void>("swapBranches") {

		@Override
		public void onClick() {
			setResponsePage(
					NewRequestPage.class, 
					paramsOf(getProject(), getPullRequest().getSource(), getPullRequest().getTarget()));
		}
		
	});
	return fragment;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:17,代码来源:NewRequestPage.java

示例2: UserModalPage

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
public UserModalPage(
        final ModalWindow window,
        final UserTO userTO,
        final Mode mode) {

    super();

    this.callerPageRef = null;
    this.window = window;
    this.mode = mode;
    this.userTO = userTO;
    this.resetPassword = false;

    fragment = new Fragment("userModalFrag", "userModalResultFrag", this);
    fragment.setOutputMarkupId(true);
    add(fragment);

    final UserManagementResultPanel result = new UserManagementResultPanel(
            "userModalPageResult", window, mode, userTO);
    result.setOutputMarkupId(true);

    fragment.add(result);
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:24,代码来源:UserModalPage.java

示例3: addDataView

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
private void addDataView(String id, final String className, IDataProvider<ArtifactBean> dataProvider) {
	// Data view
	final DataView<ArtifactBean> artifactDataView = new ArtifactBeanDataView("dataView", dataProvider);
	dataViews.add(artifactDataView);
	
	// Fragment
	Fragment fragment = new Fragment(id, "dataViewFragment", this) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onConfigure() {
			super.onConfigure();
			setVisible(artifactDataView.getDataProvider().size() != 0);
		}
	};
	fragment.add(new Label("title", new ResourceModel("artifact.follow.pom." + id)),
				artifactDataView);
	add(fragment);
}
 
开发者ID:openwide-java,项目名称:artifact-listener,代码行数:20,代码来源:ArtifactPomSearchResultsPanel.java

示例4: newFragment

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
private Fragment newFragment(String message, boolean warning) {
	Fragment fragment = new Fragment(CONTENT_ID, "noDiffFrag", this);
	fragment.add(new BlobDiffTitle("title", change));
	if (warning)
		fragment.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", "fa fa-warning")));
	else
		fragment.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", "fa fa-info-circle")));
	fragment.add(new Label("message", message));
	return fragment;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:BlobDiffPanel.java

示例5: RoleSummaryPanel

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
public RoleSummaryPanel(final String id,
        final ModalWindow window, final PageReference callerPageRef) {

    super(id);

    this.callerPageRef = callerPageRef;
    this.window = window;

    fragment = new Fragment("rolePanel",
            this.selectedNode == null
            ? "fakerootFrag" : (this.selectedNode.getId() != 0
            ? "roleViewPanel" : "rootPanel"), this);

    if (this.selectedNode != null) {
        if (this.selectedNode.getId() != 0) {
            roleTabPanel =
                    new RoleTabPanel("nodeViewPanel",
                    selectedNode, window, callerPageRef);
            roleTabPanel.setOutputMarkupId(true);
            fragment.add(roleTabPanel);
        } else {
            actionLink =
                    new TreeActionLinkPanel("actionLink",
                    this.selectedNode.getId(),
                    new CompoundPropertyModel(this.selectedNode),
                    window, callerPageRef);
            fragment.add(actionLink);
        }
    }

    add(fragment);
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:33,代码来源:RoleSummaryPanel.java

示例6: getSubjectFragment

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
@Override
Fragment getSubjectFragment() {
	Fragment f = new Fragment(COMP_ID, "subject", this);
	Room room = getBean(RoomDao.class).get(rec.getRoomId());
	f.add(new OmTextLabel("prefix", getString("template.recording.expiring.subj.prefix", locale))
			, new OmTextLabel("room", room == null ? null : getString("template.recording.expiring.subj.room", locale, room.getName())).setVisible(room != null)
			);
	return f;
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:10,代码来源:RecordingExpiringTemplate.java

示例7: getSubjectFragment

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
@Override
Fragment getSubjectFragment() {
	Fragment f = new Fragment(COMP_ID, "subject", this);
	f.add(new OmTextLabel("prefix", getPrefix())
			, new OmTextLabel("title", a.getTitle())
			, new OmTextLabel("start", format(a.getStart(), SHORT))
			, new DashOmTextLabel("dash")
			, new OmTextLabel("end", format(a.getEnd(), SHORT))
			);
	return f;
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:12,代码来源:AppointmentTemplate.java

示例8: tokenInvalidated

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
@Override
public void tokenInvalidated() {
    Fragment error = new Fragment("fragment", "error", this);
    error.add(
            new Label("message", new StringResourceModel(
                            "label.error", this, null, new Object[]{getToken()})
            ).setEscapeModelStrings(false)
    );
    addOrReplace(error);
    confirmed = false;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:12,代码来源:ConfirmRegistrationPage.java

示例9: tokenInvalidated

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
@Override
public void tokenInvalidated() {
	Fragment error = new Fragment("fragment", "error", this);
	error.add(
		new Label("message", new StringResourceModel(
				"label.error", this, null, new Object[] {getToken()})
			).setEscapeModelStrings(false)
		);
	addOrReplace(error);
	confirmed = false;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:12,代码来源:CancelRegistrationPage.java

示例10: addRequiredLabel

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
public AbstractFieldPanel<T> addRequiredLabel() {
    if (!isRequired()) {
        setRequired(true);
    }

    final Fragment fragment = new Fragment("required", "requiredFragment", this);
    fragment.add(new Label("requiredLabel", "*"));
    replace(fragment);

    this.isRequiredLabelAdded = true;

    return this;
}
 
开发者ID:apache,项目名称:syncope,代码行数:14,代码来源:AbstractFieldPanel.java

示例11: getLocationFragment

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
private Fragment getLocationFragment(final TopologyNode node, final PageReference pageRef) {
    Fragment fragment = new Fragment("actions", "locationActions", this);

    AjaxLink<String> create = new IndicatingAjaxLink<String>("create") {

        private static final long serialVersionUID = 3776750333491622263L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            final ConnInstanceTO modelObject = new ConnInstanceTO();
            modelObject.setLocation(node.getKey());

            final IModel<ConnInstanceTO> model = new CompoundPropertyModel<>(modelObject);
            modal.setFormModel(model);

            target.add(modal.setContent(new ConnectorWizardBuilder(modelObject, pageRef).
                    build(BaseModal.CONTENT_ID, AjaxWizard.Mode.CREATE)));

            modal.header(new Model<>(MessageFormat.format(getString("connector.new"), node.getKey())));
            modal.show(true);
        }

        @Override
        public String getAjaxIndicatorMarkupId() {
            return Constants.VEIL_INDICATOR_MARKUP_ID;
        }

    };
    fragment.add(create);
    MetaDataRoleAuthorizationStrategy.authorize(create, RENDER, StandardEntitlement.CONNECTOR_CREATE);

    return fragment;
}
 
开发者ID:apache,项目名称:syncope,代码行数:34,代码来源:TopologyTogglePanel.java

示例12: getMergeInstructions

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
protected Component getMergeInstructions(UserModel user, RepositoryModel repository, String markupId, String infoKey) {
	Fragment cmd = new Fragment(markupId, "commandlineMergeFragment", this);
	cmd.add(new Label("instructions", MessageFormat.format(getString(infoKey), ticket.mergeTo)));

	// git instructions
	cmd.add(new Label("mergeStep1", MessageFormat.format(getString("gb.stepN"), 1)));
	cmd.add(new Label("mergeStep2", MessageFormat.format(getString("gb.stepN"), 2)));
	cmd.add(new Label("mergeStep3", MessageFormat.format(getString("gb.stepN"), 3)));

	String ticketBranch = Repository.shortenRefName(PatchsetCommand.getTicketBranch(ticket.number));
	String reviewBranch = PatchsetCommand.getReviewBranch(ticket.number);

	String step1 = MessageFormat.format("git checkout -b {0} {1}", reviewBranch, ticket.mergeTo);
	String step2 = MessageFormat.format("git pull origin {0}", ticketBranch);
	String step3 = MessageFormat.format("git checkout {0}\ngit merge {1}\ngit push origin {0}\ngit branch -d {1}", ticket.mergeTo, reviewBranch);

	cmd.add(new Label("mergePreStep1", step1));
	cmd.add(new Label("mergePreStep2", step2));
	cmd.add(new Label("mergePreStep3", step3));

	cmd.add(createCopyFragment("mergeCopyStep1", step1.replace("\n", " && ")));
	cmd.add(createCopyFragment("mergeCopyStep2", step2.replace("\n", " && ")));
	cmd.add(createCopyFragment("mergeCopyStep3", step3.replace("\n", " && ")));

	// pt instructions
	String ptStep = MessageFormat.format("pt pull {0,number,0}", ticket.number);
	cmd.add(new Label("ptMergeStep", ptStep));
	cmd.add(createCopyFragment("ptMergeCopyStep", step1.replace("\n", " && ")));
	return cmd;
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:31,代码来源:TicketPage.java

示例13: newSubmenu

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
/**
 * Creates a submenu. This is not actually submenu because we're using an older Twitter Bootstrap which is pre-submenu.
 * 
 * @param wicketId
 * @param submenuTitle
 * @param menuItems
 * @return a submenu fragment
 */
private Fragment newSubmenu(String wicketId, String submenuTitle, List<MenuItem> menuItems) {
	Fragment submenu = new Fragment(wicketId, "submenuFragment", this);
	submenu.add(new Label("submenuTitle", submenuTitle).setRenderBodyOnly(true));
	ListDataProvider<MenuItem> menuItemsDp = new ListDataProvider<MenuItem>(menuItems);
	DataView<MenuItem> submenuItems = new DataView<MenuItem>("submenuItem", menuItemsDp) {
		private static final long serialVersionUID = 1L;

		@Override
		public void populateItem(final Item<MenuItem> menuItem) {
			final MenuItem item = menuItem.getModelObject();
			String name = item.toString();
			try {
				// try to lookup translation
				name = getString(name);
			} catch (Exception e) {
			}
			if (item instanceof PageLinkMenuItem) {
				// link to another Wicket page
				PageLinkMenuItem pageLink = (PageLinkMenuItem) item;
				menuItem.add(new LinkPanel("submenuLink", null, null, name, pageLink.getPageClass(), pageLink.getPageParameters(), false)
						.setRenderBodyOnly(true));
			} else if (item instanceof ExternalLinkMenuItem) {
				// link to a specified href
				ExternalLinkMenuItem extLink = (ExternalLinkMenuItem) item;
				menuItem.add(new LinkPanel("submenuLink", null, name, extLink.getHref(), extLink.openInNewWindow()).setRenderBodyOnly(true));
			} else if (item instanceof MenuDivider) {
				// divider
				menuItem.add(new Label("submenuLink").setRenderBodyOnly(true));
				WicketUtils.setCssClass(menuItem, "divider");
			}
		}
	};
	submenu.add(submenuItems);
	submenu.setRenderBodyOnly(true);
	return submenu;
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:45,代码来源:RootPage.java

示例14: addToolbarButton

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
protected void addToolbarButton(String wicketId, String iconClass, String label, String url) {
	Fragment button = new Fragment(wicketId, "toolbarLinkFragment", this);
	Label icon = new Label("icon");
	WicketUtils.setCssClass(icon, iconClass);
	button.add(icon);
	button.add(new Label("label", label));
	button.add(new SimpleAttributeModifier("href", url));
	add(button);
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:10,代码来源:RepositoryPage.java

示例15: createPersonPanel

import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
protected Component createPersonPanel(String wicketId, PersonIdent identity,
		Constants.SearchType searchType) {
	String name = identity == null ? "" : identity.getName();
	String address = identity == null ? "" : identity.getEmailAddress();
	name = StringUtils.removeNewlines(name);
	address = StringUtils.removeNewlines(address);
	boolean showEmail = app().settings().getBoolean(Keys.web.showEmailAddresses, false);
	if (!showEmail || StringUtils.isEmpty(name) || StringUtils.isEmpty(address)) {
		String value = name;
		if (StringUtils.isEmpty(value)) {
			if (showEmail) {
				value = address;
			} else {
				value = getString("gb.missingUsername");
			}
		}
		Fragment partial = new Fragment(wicketId, "partialPersonIdent", this);
		LinkPanel link = new LinkPanel("personName", "list", value, GitSearchPage.class,
				WicketUtils.newSearchParameter(repositoryName, objectId, value, searchType));
		setPersonSearchTooltip(link, value, searchType);
		partial.add(link);
		return partial;
	} else {
		Fragment fullPerson = new Fragment(wicketId, "fullPersonIdent", this);
		LinkPanel nameLink = new LinkPanel("personName", "list", name, GitSearchPage.class,
				WicketUtils.newSearchParameter(repositoryName, objectId, name, searchType));
		setPersonSearchTooltip(nameLink, name, searchType);
		fullPerson.add(nameLink);

		LinkPanel addressLink = new LinkPanel("personAddress", "hidden-phone list", "<" + address + ">",
				GitSearchPage.class, WicketUtils.newSearchParameter(repositoryName, objectId,
						address, searchType));
		setPersonSearchTooltip(addressLink, address, searchType);
		fullPerson.add(addressLink);
		return fullPerson;
	}
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:38,代码来源:RepositoryPage.java


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