本文整理匯總了Java中org.apache.wicket.markup.html.link.Link.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.setEnabled方法的具體用法?Java Link.setEnabled怎麽用?Java Link.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.link.Link
的用法示例。
在下文中一共展示了Link.setEnabled方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createAddLocationLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
private void createAddLocationLink() {
Link<Void> link = new Link<Void>("addLocation") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
LocationAddPage page = new LocationAddPage(LocationViewPage.this, current);
setResponsePage(page);
}
};
if (LocationUtil.isTrash(current)) {
link.setEnabled(false);
link.setVisible(false);
}
LocationType type = LocationType.getByCaption(LocationRenderer.getLocationType(current));
if (LocationType.RACK.equals(type)) {
link.add(new Label("label", ""));
} else {
link.add(new Label("label", "Add child location"));
}
add(link);
}
示例2: createEditLocationLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
private void createEditLocationLink() {
Link<Void> link = new Link<Void>("editLocation") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
LocationEditPage page = new LocationEditPage(LocationViewPage.this, current);
setResponsePage(page);
}
};
if (!LocationUtil.isEditable(current)) {
link.setEnabled(false);
link.setVisible(false);
}
add(link);
}
示例3: createDeleteLocationLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
private void createDeleteLocationLink() {
Link<Void> link = new Link<Void>("deleteLocation") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
LocationDeletePage page = new LocationDeletePage(LocationViewPage.this, current);
setResponsePage(page);
}
};
if (!LocationUtil.isEditable(current)) {
link.setEnabled(false);
link.setVisible(false);
}
add(link);
}
示例4: createAddNodeLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的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);
}
示例5: createLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
private Link<Void> createLink(String id, PortDto port) {
PageParameters param = NodeUtil.getNodeParameters(port);
Link<Void> link = new BookmarkablePageLink<Void>(id, SimpleNodeDetailPage.class, param);
link.setEnabled(port != null);
link.add(new Label("nodeName", new Model<String>(NodeUtil.getNodeName(port))));
return link;
}
示例6: TransactionExecutionResultPage
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的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);
}
}
示例7: createPwEditLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的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;
}
示例8: addNewPseudoWireLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
private void addNewPseudoWireLink(final String id, final PseudowireStringIdPoolDto pool) {
Link<Void> newPseudoWire = new Link<Void>(id) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setResponsePage(new PseudoWireCreationPage(PseudoWirePoolDetailPage.this, pool));
}
};
long remains = pool.getTotalNumberOfIds() - (long) pool.getUsers().size();
newPseudoWire.setEnabled(remains > 0);
add(newPseudoWire);
}
示例9: createVlanEditLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的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;
}
示例10: newDetailsLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
protected AbstractLink newDetailsLink(String id, SkosConcept skosConcept) {
Link link = new Link(id) {
@Override
public void onClick() {
}
};
link.setEnabled(false);
return link;
}
示例11: VrfListPage
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的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);
}
}
示例12: LinkEditPage
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
public LinkEditPage(WebPage backPage, PortDto basePort) {
try {
this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
if (backPage == null) {
throw new IllegalArgumentException();
}
this.backPage = backPage;
if (basePort == null) {
throw new IllegalArgumentException();
}
basePort.renew();
this.basePort = basePort;
this.l2Neighbor = NodeUtil.getLayer2Neighbor(basePort);
this.model = new NeighborModel(basePort);
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 baseLabel = new Label("baseName", new PropertyModel<String>(this.model, "baseName"));
add(baseLabel);
Label nodeLabel1 = new Label("node", new PropertyModel<String>(this.model, "hereNodeName"));
add(nodeLabel1);
Label ifNameLabel1 = new Label("ifName", new PropertyModel<String>(this.model, "hereIfName"));
add(ifNameLabel1);
BookmarkablePageLink<Void> neighborLink =
new BookmarkablePageLink<Void>("neighborNode",
SimpleNodeDetailPage.class,
NodeUtil.getNodeParameters(this.model.getThere()));
add(neighborLink);
Label nodeLabel2 = new Label("nodeName", new PropertyModel<String>(this.model, "thereNodeName"));
neighborLink.add(nodeLabel2);
Label ifNameLabel2 = new Label("neighborIfName", new PropertyModel<String>(this.model, "thereIfName"));
add(ifNameLabel2);
linkL2Node = createLink("layer2NeighborNode", l2Neighbor);
add(linkL2Node);
Label linkL2Label = new Label("layer2NeighborIfName", new PropertyModel<String>(this, "l2NeighborIfName"));
add(linkL2Label);
Link<Void> editLayer2 = createEditor("createLink", basePort, l2Neighbor);
editLayer2.setEnabled(l2Neighbor == null);
editLayer2.setVisible(l2Neighbor == null);
add(editLayer2);
Link<Void> deleteLayer2 = createDeleteButton("deleteLink", false, basePort);
deleteLayer2.setEnabled(l2Neighbor != null);
deleteLayer2.setVisible(l2Neighbor != null);
add(deleteLayer2);
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例13: disableLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
/**
* Disable a page nav link (PRFL-468)
*/
protected void disableLink(final Link<Void> l) {
l.add(new AttributeAppender("class", new Model<String>("current"), " "));
l.setEnabled(false);
}
示例14: disableLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
/**
* Helper to disable a link. Add the Sakai class 'current'.
*/
protected void disableLink(Link<Void> l) {
l.add(new AttributeAppender("class", new Model<String>("current"), " "));
l.setRenderBodyOnly(true);
l.setEnabled(false);
}
示例15: disableLink
import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
/**
* Helper to disable a link. Add the Sakai class 'current'.
*/
protected void disableLink(final Link<Void> l) {
l.add(new AttributeAppender("class", new Model<String>("current"), " "));
l.replace(new Label("screenreaderlabel", getString("link.screenreader.tabselected")));
l.setEnabled(false);
}