本文整理汇总了Java中org.apache.wicket.markup.html.WebPage类的典型用法代码示例。如果您正苦于以下问题:Java WebPage类的具体用法?Java WebPage怎么用?Java WebPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebPage类属于org.apache.wicket.markup.html包,在下文中一共展示了WebPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAddNodeLink
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
private void createAddNodeLink() {
final WebPage page;
if (LocationUtil.isNodeAssignable(current)) {
page = new NodeEditPage(LocationViewPage.this, null, current);
} else {
page = null;
}
Link<Void> link = new Link<Void>("addNode") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setResponsePage(page);
}
};
boolean editable = LocationUtil.isNodeAssignable(current);
link.setEnabled(editable);
link.setVisible(editable);
add(link);
}
示例2: VportEditPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public VportEditPage(final WebPage backPage) {
try {
AAAWebUtil.checkAAA(this, OPERATION_NAME);
this.backPage = backPage;
Link<Void> backLink = new Link<Void>("back") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setResponsePage(getBackPage());
}
};
add(backLink);
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例3: getIpAddress
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public static String getIpAddress(WebPage page) {
if (page == null) {
return "null-page";
}
Request request = page.getRequest();
if (request instanceof WebRequest) {
WebRequest webreq = (WebRequest) request;
return webreq.getHttpServletRequest().getRemoteAddr();
}
return null;
}
示例4: TransactionExecutionResultPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public TransactionExecutionResultPage(final CustomTransaction transaction) {
try {
AAAWebUtil.checkAAA(this, OPERATION_NAME);
add(UrlUtil.getTopLink("top"));
Label titleLabel = new Label("title", transaction.getTitle());
add(titleLabel);
Label headLabel = new Label("head", transaction.getHead());
add(headLabel);
final String msg;
final WebPage nextPage;
if (transaction.isSuccess()) {
msg = transaction.getSuccessResultMessage();
nextPage = transaction.getForwardPage();
} else {
msg = transaction.getFailResultMessage();
nextPage = transaction.getBackPage();
}
Label messageLabel = new Label("resultMessage", msg);
add(messageLabel);
Link<Void> backLink = new Link<Void>("back") {
private static final long serialVersionUID = 1L;
public void onClick() {
setResponsePage(nextPage);
}
};
backLink.setEnabled(nextPage != null);
backLink.setVisible(nextPage != null);
add(backLink);
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例5: createPwEditLink
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public static Link<Void> createPwEditLink(final String id, final WebPage backPage, final PseudowireDto pw) {
Link<Void> link = new Link<Void>(id) {
private static final long serialVersionUID = 1L;
public void onClick() {
PseudoWireEditPage page = new PseudoWireEditPage(backPage, pw);
setResponsePage(page);
}
};
link.setEnabled(pw != null);
return link;
}
示例6: VplsListPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public VplsListPage(WebPage backPage, PageParameters param) {
this.backPage = backPage;
try {
long prev = System.currentTimeMillis();
this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
long time = System.currentTimeMillis();
PerfLog.info(prev, time, "build header component");
prev = time;
String nodeName = param.getString(KEY_NODE_NAME);
String vplsId = param.getString(KEY_VPLS_ID);
this.vplsModel = new VplsModel(nodeName, vplsId);
time = System.currentTimeMillis();
PerfLog.info(prev, time, "build portsModel");
prev = time;
VplsIfPanel vplsIfPanel = new VplsIfPanel("vplsIfPanel", null, vplsModel, editorName);
add(vplsIfPanel);
Link<Void> editLink = new Link<Void>("back") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setResponsePage(getBackPage());
}
};
add(editLink);
time = System.currentTimeMillis();
PerfLog.info(prev, time, "NodeDetailPage() - end");
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例7: createNeighborEditLink
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public static Link<Void> createNeighborEditLink(final WebPage backPage, final String id, final PortDto basePort) {
Link<Void> link = new Link<Void>(id) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
LinkEditPage page = new LinkEditPage(backPage, basePort);
setResponsePage(page);
}
};
return link;
}
示例8: createVlanEditLink
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public static Link<Void> createVlanEditLink(final String id, final WebPage backPage, final VlanDto vlan) {
Link<Void> link = new Link<Void>(id) {
private static final long serialVersionUID = 1L;
public void onClick() {
throw new IllegalStateException("not supported.");
}
};
link.setEnabled(vlan != null);
return link;
}
示例9: getHomePage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
@Override
public Class<? extends WebPage> getHomePage() {
return HomePage.class;
}
示例10: getHomePage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
/**
* @see org.apache.wicket.Application#getHomePage()
*/
@Override
public Class<? extends WebPage> getHomePage() {
return HomePage.class;
}
示例11: DiscoveryTypeEditPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public DiscoveryTypeEditPage(WebPage backPage, final FromToValueHolder fromToValueHolder, final List<FromToValueHolder> allHolders) {
this.backPage = backPage;
if (fromToValueHolder != null) {
this.from = fromToValueHolder.from;
this.to = fromToValueHolder.to;
}
Form<Void> form = new Form<Void>("edit");
add(form);
this.fromField = new TextField<String>("from", new PropertyModel<String>(this, "from"), String.class);
form.add(fromField);
this.toField = new TextField<String>("to", new PropertyModel<String>(this, "to"), String.class);
form.add(toField);
Button applyButton = new Button("apply") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
if (getFrom() == null || getFrom().equals("")) {
throw new IllegalArgumentException("From is mandatory.");
}
if (getTo() == null || getTo().equals("")) {
throw new IllegalArgumentException("To is mandatory.");
}
try {
FromToValueHolder newHolder = new FromToValueHolder();
newHolder.from = getFrom();
newHolder.to = getTo();
List<FromToValueHolder> holders = new ArrayList<FromToValueHolder>();
if (fromToValueHolder != null) {
for (FromToValueHolder hol : allHolders) {
if (hol.from.equals(fromToValueHolder.from) && hol.to.equals(fromToValueHolder.to)) {
holders.add(newHolder);
} else {
holders.add(hol);
}
}
} else {
holders.addAll(allHolders);
holders.add(newHolder);
}
MplsNmsDiffConfiguration con = MplsNmsDiffConfiguration.getInstance();
con.setDiscoveryTypeMappings(holders);
con.saveConfiguration();
con.reloadConfiguration();
ConfigUtil.getInstance().reload();
getBackPage().modelChanged();
PageUtil.setModelChanged(getBackPage());
setResponsePage(getBackPage());
} catch (Exception e) {
e.printStackTrace();
throw ExceptionUtils.throwAsRuntime(e);
}
}
};
form.add(applyButton);
Button backButton = new Button("back") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
setResponsePage(getBackPage());
}
};
form.add(backButton);
}
示例12: getBackPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public WebPage getBackPage() {
return backPage;
}
示例13: getBackPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public WebPage getBackPage() {
return this.backPage;
}
示例14: VrfListPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public VrfListPage(WebPage backPage, PageParameters param) {
this.backPage = backPage;
try {
long prev = System.currentTimeMillis();
this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
long time = System.currentTimeMillis();
PerfLog.info(prev, time, "build header component");
prev = time;
String nodeName = param.getString(KEY_NODE_NAME);
String VrfId = param.getString(KEY_Vrf_ID);
this.VrfModel = new VrfModel(nodeName, VrfId);
time = System.currentTimeMillis();
PerfLog.info(prev, time, "build vrf Model");
prev = time;
VrfIfPanel VrfIfPanel = new VrfIfPanel("vrfIfPanel", null, VrfModel, editorName);
add(VrfIfPanel);
Link<Void> editLink = new Link<Void>("back") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
if (getBackPage() == null) {
return;
}
setResponsePage(getBackPage());
}
};
editLink.setEnabled(getBackPage() != null);
add(editLink);
time = System.currentTimeMillis();
PerfLog.info(prev, time, "VrfListPage() - end");
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例15: CustomerInfoEditPage
import org.apache.wicket.markup.html.WebPage; //导入依赖的package包/类
public CustomerInfoEditPage(WebPage backPage, CustomerInfoDto user) {
try {
this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
if (backPage == null) {
throw new IllegalArgumentException();
}
if (user != null) {
user.renew();
}
this.backPage = backPage;
this.user = user;
String nameCaption = null;
CustomerInfoRenderer renderer = new CustomerInfoRenderer(this.user);
this.name = renderer.getName();
if (this.user == null) {
nameCaption = "New Customer";
} else {
nameCaption = this.name;
}
this.companyID = renderer.getCompanyID();
this.active = renderer.isActive();
this.portalUser = renderer.getPortalUser();
this.portalPassword = renderer.getPortalPass();
Link<Void> backLink = new Link<Void>("back") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setResponsePage(getBackPage());
}
};
add(backLink);
add(new FeedbackPanel("feedback"));
Label userNameLabel = new Label("customerInfo", nameCaption);
add(userNameLabel);
Form<Void> form = new Form<Void>("form") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
processUpdate();
PageUtil.setModelChanged(getBackPage());
setResponsePage(getBackPage());
}
};
add(form);
TextField<String> nameField = new TextField<String>("name",
new PropertyModel<String>(this, "name"), String.class);
nameField.setEnabled(this.name.isEmpty());
form.add(nameField);
TextField<String> companyIDField = new TextField<String>("companyID",
new PropertyModel<String>(this, "companyID"), String.class);
form.add(companyIDField);
CheckBox activeBox = new CheckBox("active", new PropertyModel<Boolean>(this, "active"));
form.add(activeBox);
TextField<String> portalUserField = new TextField<String>("portalUser",
new PropertyModel<String>(this, "portalUser"), String.class);
form.add(portalUserField);
TextField<String> portalPasswordField = new TextField<String>("portalPassword",
new PropertyModel<String>(this, "portalPassword"), String.class);
form.add(portalPasswordField);
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}