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


Java AjaxLink.add方法代码示例

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


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

示例1: initButtons

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
protected void initButtons(ListItem<T> item, WebMarkupContainer parent) {
        WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP); {
	        buttonGroup.setOutputMarkupId(true);
	
	        AjaxLink remove = new AjaxLink(ID_REMOVE) {
	
	            @Override
	            public void onClick(AjaxRequestTarget target) {
	                removeValuePerformed(target, item.getModelObject());
	            }
	        };
	        
	        remove.add(new VisibleEnableBehaviour() {
	
	            @Override
	            public boolean isVisible() {
	                return isRemoveButtonVisible();
	            }
	        });
	        buttonGroup.add(remove);
        }

        parent.add(buttonGroup);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:25,代码来源:MultiValueChoosePanel.java

示例2: initLayout

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initLayout(IModel<String> model, IModel<String> titleModel) {
    AjaxLink link = new AjaxLink(ID_LINK) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            onClickPerformed(target);
        }
    };

    Label image = new Label(ID_IMAGE);
    image.add(AttributeModifier.replace("class", model));
    if (titleModel != null) {
        image.add(AttributeModifier.replace("title", titleModel));
    }
    link.add(image);
    link.setOutputMarkupId(true);
    add(link);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:LinkIconPanel.java

示例3: createCapabilityButton

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void createCapabilityButton(String id) {
	AjaxLink<Boolean> button = new AjaxLink<Boolean>(id, new PropertyModel<Boolean>(getModel(), id)) {

		@Override
		public void onClick(AjaxRequestTarget target) {
			// TODO:
		}

	};

	button.add(new AttributeModifier("class",
			button.getModelObject() ? "btn btn-app btn-resource-capability bg-light-blue"
					: "btn btn-app btn-resource-capability bg-gray text-light-blue"));

	button.add(new Label("label", new ResourceModel("CapabilitiesType." + id)));

	add(button);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:CapabilitiesPanel.java

示例4: create

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
@Override
public AjaxLink<T> create(String wicketId, final IModel<T> parameter) {
	AjaxLink<T> link = new AjaxLink<T>(wicketId, parameter) {
		private static final long serialVersionUID = 1L;
		@Override
		protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
			super.updateAjaxAttributes(attributes);
			action.updateAjaxAttributes(attributes, parameter);
		}
		@Override
		public void onClick(AjaxRequestTarget target) {
			action.execute(target, parameter);
		}
	};
	
	link.add(
			action.getActionAvailableCondition(parameter).thenShowInternal()
	);
	
	return link;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:22,代码来源:ActionColumnAjaxActionFactory.java

示例5: getModuleNameLink

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
/**
 * Returns a link that redirects to the module info
 *
 * @param componentId ID to assign to the link
 * @param moduleId    ID of module to display
 * @return Module redirection link
 */
private AjaxLink getModuleNameLink(String componentId, final String moduleId) {
    AjaxLink link = new AjaxLink<String>(componentId, Model.of(moduleId)) {

        @Override
        public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
            replaceComponentTagBody(markupStream, openTag, moduleId);
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            PageParameters pageParameters = new PageParameters();
            pageParameters.set(BUILD_NAME, build.getName());
            pageParameters.set(BUILD_NUMBER, build.getNumber());
            pageParameters.set(BUILD_STARTED, build.getStarted());
            pageParameters.set(MODULE_ID, moduleId);
            setResponsePage(BuildBrowserRootPage.class, pageParameters);
        }
    };
    link.add(new CssClass("item-link"));
    return link;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:29,代码来源:PublishedModulesTabPanel.java

示例6: initButtons

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
protected void initButtons(ListItem<T> item, WebMarkupContainer parent) {
        WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP); {
	        buttonGroup.setOutputMarkupId(true);

	        AjaxLink remove = new AjaxLink(ID_REMOVE) {

	            @Override
	            public void onClick(AjaxRequestTarget target) {
	                removeValuePerformed(target, item.getModelObject());
	            }
	        };

	        remove.add(new VisibleEnableBehaviour() {

	            @Override
	            public boolean isVisible() {
	                return isRemoveButtonVisible();
	            }
	        });
	        buttonGroup.add(remove);
        }

        parent.add(buttonGroup);
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:25,代码来源:MultiValueChoosePanel.java

示例7: LinkPanel

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
public LinkPanel(String id, IModel<String> label) {
    super(id);

    AjaxLink link = new AjaxLink(ID_LINK) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            LinkPanel.this.onClick(target);
        }
    };
    link.add(new Label(ID_LABEL, label));
    link.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return LinkPanel.this.isEnabled();
        }
    });
    add(link);
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:21,代码来源:LinkPanel.java

示例8: initPrevious

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initPrevious() {
    WebMarkupContainer previous = new WebMarkupContainer(ID_PREVIOUS);
    previous.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isPreviousEnabled() ? "" : "disabled";
        }
    }));
    add(previous);
    AjaxLink previousLink = new AjaxLink(ID_PREVIOUS_LINK) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            previousPerformed(target);
        }
    };
    previousLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return isPreviousEnabled();
        }
    });
    previous.add(previousLink);
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:27,代码来源:NavigatorPanel.java

示例9: TwoValueLinkPanel

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
public TwoValueLinkPanel(String id, IModel<String> label, IModel<String> description) {
        super(id);

        AjaxLink link = new AjaxLink(ID_LINK) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                TwoValueLinkPanel.this.onClick(target);
            }

//            @Override
//            public String getBeforeDisabledLink() {
//                return null;
//            }
//
//            @Override
//            public String getAfterDisabledLink() {
//                return null;
//            }
        };
        link.add(new Label(ID_LABEL, label));
        link.add(new VisibleEnableBehaviour() {

            @Override
            public boolean isEnabled() {
                return TwoValueLinkPanel.this.isEnabled();
            }
        });
        add(link);
        add(new Label(ID_DESCRIPTION, description));
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:32,代码来源:TwoValueLinkPanel.java

示例10: LinkPanel

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
public LinkPanel(String id, IModel<String> labelModel) {
        super(id);

        AjaxLink<String> link = new AjaxLink<String>(ID_LINK) {
			private static final long serialVersionUID = 1L;

			@Override
            public void onClick(AjaxRequestTarget target) {
                LinkPanel.this.onClick(target);
            }

//            @Override
//            public String getBeforeDisabledLink() {
//                return null;
//            }
//
//            @Override
//            public String getAfterDisabledLink() {
//                return null;
//            }
        };
        link.add(new Label(ID_LABEL, labelModel));
        link.add(new VisibleEnableBehaviour() {
        	private static final long serialVersionUID = 1L;

            @Override
            public boolean isEnabled() {
                return LinkPanel.this.isEnabled();
            }
        });
        add(link);
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:33,代码来源:LinkPanel.java

示例11: initPrevious

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initPrevious() {
    WebMarkupContainer previous = new WebMarkupContainer(ID_PREVIOUS);
    previous.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isPreviousEnabled() ? "" : "disabled";
        }
    }));
    add(previous);
    AjaxLink previousLink = new AjaxLink(ID_PREVIOUS_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            previousPerformed(target);
        }
    };
    previousLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return isPreviousEnabled();
        }
    });
    previous.add(previousLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:32,代码来源:NavigatorPanel.java

示例12: initFirst

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initFirst() {
    WebMarkupContainer first = new WebMarkupContainer(ID_FIRST);
    first.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isFirstEnabled() ? "" : "disabled";
        }
    }));
    add(first);
    AjaxLink firstLink = new AjaxLink(ID_FIRST_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            firstPerformed(target);
        }
    };
    firstLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return BooleanUtils.isTrue(showPageListingModel.getObject()) && isFirstEnabled();
        }
    });
    first.add(firstLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:32,代码来源:NavigatorPanel.java

示例13: initNext

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initNext() {
    WebMarkupContainer next = new WebMarkupContainer(ID_NEXT);
    next.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isNextEnabled() ? "" : "disabled";
        }
    }));
    add(next);

    AjaxLink nextLink = new AjaxLink(ID_NEXT_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            nextPerformed(target);
        }
    };
    nextLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return isNextEnabled();
        }
    });
    next.add(nextLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:33,代码来源:NavigatorPanel.java

示例14: initLast

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initLast() {
    WebMarkupContainer last = new WebMarkupContainer(ID_LAST);
    last.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isLastEnabled() ? "" : "disabled";
        }
    }));
    add(last);

    AjaxLink lastLink = new AjaxLink(ID_LAST_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            lastPerformed(target);
        }
    };
    lastLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return BooleanUtils.isTrue(showPageListingModel.getObject()) && isLastEnabled();
        }
    });
    last.add(lastLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:33,代码来源:NavigatorPanel.java

示例15: initLayout

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
@Override
protected void initLayout() {
    Label title = new Label(ID_TITLE, new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return getDisplayName();
        }
    });
    add(title);

    final IModel<List<InlineMenuItem>> items = new Model((Serializable) createMenuItems());

    BootstrapLabel status = new BootstrapLabel(ID_STATUS, createStringResource("H3Header.label.error"),
            new Model(BootstrapLabel.State.DANGER));
    status.add(createFetchErrorVisibleBehaviour());
    add(status);
    AjaxLink showMore = new AjaxLink(ID_SHOW_MORE) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            onShowMorePerformed(target);
        }
    };
    showMore.add(createFetchErrorVisibleBehaviour());
    add(showMore);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:28,代码来源:H3Header.java


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