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


Java Fragment类代码示例

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


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

示例1: newAddReplyContainer

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private WebMarkupContainer newAddReplyContainer() {
	WebMarkupContainer addReplyContainer = new Fragment("addReply", "addReplyFrag", this) {

		@Override
		protected void onConfigure() {
			super.onConfigure();
			setVisible(SecurityUtils.getUser() != null);
		}
		
	};
	addReplyContainer.setOutputMarkupId(true);
	addReplyContainer.add(new AjaxLink<Void>("reply") {

		@Override
		public void onClick(AjaxRequestTarget target) {
			onAddReply(target, false, null);
		}
		
	});
	return addReplyContainer;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:22,代码来源:CodeCommentPanel.java

示例2: 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

示例3: newSinceChangesRow

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private Component newSinceChangesRow(String id, Date sinceDate) {
	WebMarkupContainer row = new WebMarkupContainer(id);
	row.setOutputMarkupId(true);
	row.add(AttributeAppender.append("class", " non-discussion"));
	
	WebMarkupContainer avatarColumn = new WebMarkupContainer("avatar");
	avatarColumn.add(new WebMarkupContainer("avatar"));
	row.add(avatarColumn);
	
	WebMarkupContainer contentColumn = new Fragment("content", "sinceChangesRowContentFrag", this);
	contentColumn.add(new SinceChangesLink("sinceChanges", requestModel, sinceDate));
	row.add(contentColumn);
	
	row.add(AttributeAppender.append("class", "since-changes"));
	
	return row;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:18,代码来源:RequestOverviewPage.java

示例4: newAdditionalActions

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
@Override
public WebMarkupContainer newAdditionalActions(String id) {
	WebMarkupContainer actions = new Fragment(id, "actionsFrag", this);
	if (!symbols.isEmpty()) {
		actions.add(new CheckBox("outline", Model.of(isOutlineVisibleInitially())).add(new OnChangeAjaxBehavior() {

			@Override
			protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
				super.updateAjaxAttributes(attributes);
				attributes.setMethod(Method.POST);
			}

			@Override
			protected void onUpdate(AjaxRequestTarget target) {
				toggleOutline(target);
			}
			
		}));
	} else {
		actions.add(new WebMarkupContainer("outline").setVisible(false));
	}
	return actions;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:24,代码来源:SourceViewPanel.java

示例5: UserModalPage

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

    super();

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

    fragment = new Fragment("userModalFrag", "userModalEditFrag", this);
    fragment.setOutputMarkupId(true);
    add(fragment);
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:20,代码来源:UserModalPage.java

示例6: FieldPanel

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
public FieldPanel(
        final String id,
        final String name,
        final IModel<T> model,
        final boolean active) {

    super(id, model);

    this.id = id;
    this.name = name;
    this.active = active;

    final Fragment fragment =
            new Fragment("required", "notRequiredFragment", this);

    add(fragment);

    setOutputMarkupId(true);
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:20,代码来源:FieldPanel.java

示例7: resolveResource

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
protected String resolveResource(String src) {
	// if it's an absolute path, return it:
	if (src.startsWith("/") || src.startsWith("http://") || src.startsWith("https://"))
		return (src);

	// use the parent container class to resolve the resource reference
	Component parent = getParent();
	if (parent instanceof Fragment) {
		// must check for fragment, otherwise we end up in Wicket namespace
		parent = parent.getParent();
	}		
	if (parent != null) {
		ResourceReference resRef = new ResourceReference(parent.getClass(), src, false);
		return (urlFor(resRef).toString());
	}

	return (src);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:19,代码来源:ObjectContainer.java

示例8: 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

示例9: onStatusChanged

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private void onStatusChanged(AjaxRequestTarget target, Fragment fragment, CodeCommentStatusChange statusChange) {
	WebMarkupContainer activityContainer = newActivityContainer(activitiesView.newChildId(), statusChange);
	activitiesView.add(activityContainer);

	String script = String.format("$('#%s .add-reply').before('<div id=\"%s\"></div>');", 
			CodeCommentPanel.this.getMarkupId(), activityContainer.getMarkupId());
	target.prependJavaScript(script);
	target.add(activityContainer);

	WebMarkupContainer addReplyContainer = newAddReplyContainer();
	fragment.replaceWith(addReplyContainer);
	target.add(addReplyContainer);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:14,代码来源:CodeCommentPanel.java

示例10: onReplyAdded

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
private void onReplyAdded(AjaxRequestTarget target, Fragment fragment, @Nullable CodeCommentReply reply) {
	if (reply != null) {
		WebMarkupContainer activityContainer = newActivityContainer(activitiesView.newChildId(), reply);
		activitiesView.add(activityContainer);

		String script = String.format("$('#%s .add-reply').before('<div id=\"%s\"></div>');", 
				CodeCommentPanel.this.getMarkupId(), activityContainer.getMarkupId());
		target.prependJavaScript(script);
		target.add(activityContainer);
	}
	
	WebMarkupContainer addReplyContainer = newAddReplyContainer();
	fragment.replaceWith(addReplyContainer);
	target.add(addReplyContainer);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:16,代码来源:CodeCommentPanel.java

示例11: 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

示例12: onInitialize

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
@Override
protected void onInitialize() {
	super.onInitialize();
	
	String title = exception.getClass().getSimpleName();
	String suffixToRemove = "Exception";
	if (title.endsWith(suffixToRemove))
		title = title.substring(0, title.length()-suffixToRemove.length());
	
	title = WordUtils.capitalizeFully(WordUtils.uncamel(title));
	
	WebMarkupContainer container = new WebMarkupContainer("error");
	container.setOutputMarkupId(true);
	add(container);
	
	container.add(new Label("title", title));
	container.add(new Label("description", exception.getMessage()));
	
	container.add(new ViewStateAwarePageLink<Void>("dashboard", ProjectListPage.class));
	
	container.add(new AjaxLink<Void>("showDetail") {

		@Override
		public void onClick(AjaxRequestTarget target) {
			Fragment fragment = new Fragment("detail", "detailFrag", ExpectedExceptionPage.this);
			fragment.add(new MultilineLabel("body", Strings.toString(exception)));				
			container.replace(fragment);
			target.add(container);
			setVisible(false);
		}

	});
	container.add(new WebMarkupContainer("detail"));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:35,代码来源:ExpectedExceptionPage.java

示例13: 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

示例14: onEvent

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
@Override
public void onEvent(final IEvent<?> event) {
    super.onEvent(event);

    if (event.getPayload() instanceof TreeNodeClickUpdate) {

        final TreeNodeClickUpdate update =
                (TreeNodeClickUpdate) event.getPayload();

        this.selectedNode =
                restClient.readRole(update.getSelectedNodeId());

        fragment = new Fragment("rolePanel", (update.getSelectedNodeId()
                != 0
                ? "roleViewPanel" : "rootPanel"), this);

        if (update.getSelectedNodeId() != 0) {

            roleTabPanel =
                    new RoleTabPanel("nodeViewPanel",
                    this.selectedNode, window, callerPageRef);
            roleTabPanel.setOutputMarkupId(true);
            fragment.addOrReplace(roleTabPanel);
        } else {
            actionLink =
                    new TreeActionLinkPanel("actionLink",
                    update.getSelectedNodeId(),
                    new CompoundPropertyModel(this.selectedNode),
                    window, callerPageRef);
            actionLink.setOutputMarkupId(true);
            fragment.addOrReplace(actionLink);
        }

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

示例15: ActionLinksPanel

import org.apache.wicket.markup.html.panel.Fragment; //导入依赖的package包/类
public ActionLinksPanel(final String componentId, final IModel<?> model) {
    super(componentId, model);

    super.add(new Fragment("panelClaim", "emptyFragment", this));
    super.add(new Fragment("panelCreate", "emptyFragment", this));
    super.add(new Fragment("panelEdit", "emptyFragment", this));
    super.add(new Fragment("panelTemplate", "emptyFragment", this));
    super.add(new Fragment("panelSearch", "emptyFragment", this));
    super.add(new Fragment("panelDelete", "emptyFragment", this));
    super.add(new Fragment("panelExecute", "emptyFragment", this));
    super.add(new Fragment("panelDryRun", "emptyFragment", this));
    super.add(new Fragment("panelExport", "emptyFragment", this));
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:14,代码来源:ActionLinksPanel.java


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