本文整理汇总了Java中org.apache.wicket.markup.html.basic.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于org.apache.wicket.markup.html.basic包,在下文中一共展示了Label类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newSuggestionItem
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
private Component newSuggestionItem(String itemId, InputCompletion suggestion) {
WebMarkupContainer item = new WebMarkupContainer(itemId);
WebMarkupContainer link = new WebMarkupContainer("link");
Range matchRange = suggestion.getMatchRange();
String label = suggestion.getLabel();
if (matchRange != null) {
String prefix = StringEscapeUtils.escapeHtml4(label.substring(0, matchRange.getFrom()));
String suffix = StringEscapeUtils.escapeHtml4(label.substring(matchRange.getTo()));
String matched = StringEscapeUtils.escapeHtml4(label.substring(matchRange.getFrom(), matchRange.getTo()));
link.add(new Label("label", prefix + "<b>" + matched + "</b>" + suffix).setEscapeModelStrings(false));
} else {
link.add(new Label("label", label));
}
item.add(link);
if (suggestion.getDescription() != null)
item.add(new Label("description", suggestion.getDescription()));
else
item.add(new Label("description").setVisible(false));
item.add(AttributeAppender.append("data-content", suggestion.complete(inputStatus).getContent()));
item.add(AttributeAppender.append("data-caret", suggestion.getCaret()));
item.setOutputMarkupId(true);
return item;
}
示例2: populateItem
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void populateItem(Item<Var> item) {
String name = item.getModel().getObject().getName();
item.add(new AjaxLink("show") {
@Override
public void onClick(AjaxRequestTarget target) {
selectedName = name;
Component headerPanel = getPage().get(BasePage.STICKY_HEADER_ID);
VarModel varModel = new VarModel(model.getSessionId(), name);
VarPanel varPanel = new VarPanel(BasePage.STICKY_HEADER_ID, varModel, VarsRefreshingView.this);
headerPanel = headerPanel.replaceWith(varPanel);
target.add(headerPanel);
Component varsPanel = getPage().get(BasePage.LEFT_NAV_ID);
target.add(varsPanel);
}
}.add(new Label("name", name)));
String type = item.getModel().getObject().getValue().getTypeAsShortString();
item.add(new Label("type", type));
if (name.equals(selectedName)) {
item.add(new AttributeModifier("class", "success"));
}
}
示例3: FeaturePage
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
public FeaturePage(String sessionId) {
replace(new Label(HEADER_ID, ""));
replace(new FeaturePanel(CONTENT_ID, sessionId));
replace(new VarsPanel(LEFT_NAV_ID, sessionId));
add(new WebSocketBehavior() {
@Override
protected void onConnect(ConnectedMessage message) {
KarateSession session = service.getSession(sessionId);
webSocketSessionId = message.getSessionId();
webSocketClientKey = message.getKey();
WebSocketLogAppender appender = session.getAppender();
appender.setTarget(FeaturePage.this);
logger.debug("websocket client connected, session: {}", message.getSessionId());
}
});
}
示例4: DocumentationIndexPage
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
public DocumentationIndexPage() {
Harvester harvester = new Harvester();
@SuppressWarnings({ "unchecked", "rawtypes" })
ListView listview = new ListView("listview", harvester.getWorkspaces()) {
/**
*
*/
private static final long serialVersionUID = 2974513833506276491L;
protected void populateItem(ListItem item) {
WorkspaceDoc wi = (WorkspaceDoc) item.getModelObject();
BookmarkablePageLink link = new BookmarkablePageLink("link", WorkspacePage.class);
link.setParameter("workspaceName", wi.getName());
link.add(new Label("workspaceName", wi.getName()));
item.add(link);
}
};
add(listview);
ExtensionInfo info = new ExtensionInfo();
add(new Label("documentorVersion", info.getVersion()));
add(new Label("documentorGitVersion", info.getGitVersion()));
add(new Label("readme", info.getReadme()));
}
示例5: onInitialize
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new ListView<PropertyContext<Serializable>>("properties", propertyContexts) {
@Override
protected void populateItem(ListItem<PropertyContext<Serializable>> item) {
PropertyContext<Serializable> propertyContext = item.getModelObject();
Method propertyGetter = propertyContext.getPropertyGetter();
Label nameLabel = new Label("name", EditableUtils.getName(propertyGetter));
item.add(nameLabel);
OmitName omitName = propertyGetter.getAnnotation(OmitName.class);
if (omitName != null && omitName.value() != OmitName.Place.EDITOR) {
nameLabel.setVisible(false);
item.add(AttributeAppender.append("class", "name-omitted"));
}
Serializable bean = (Serializable) ReflectionBeanViewer.this.getDefaultModelObject();
Serializable propertyValue = (Serializable) propertyContext.getPropertyValue(bean);
item.add(propertyContext.renderForView("value", Model.of(propertyValue)));
}
});
}
示例6: onInitialize
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new UserLink("author", author));
if (committer.getEmailAddress().equals(author.getEmailAddress())
&& committer.getName().equals(author.getName())) {
add(new WebMarkupContainer("committer").setVisible(false));
} else {
add(new UserLink("committer", committer));
}
if (withDate)
add(new Label("date", DateUtils.formatAge(committer.getWhen())));
else
add(new WebMarkupContainer("date").setVisible(false));
}
示例7: onInitialize
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new Label("renamedTitle", change.getOldBlobIdent().path)
.setVisible(change.getType() == ChangeType.RENAME));
add(new Label("title", change.getPath()));
String modeChange;
if (change.getOldBlobIdent().mode != null && change.getNewBlobIdent().mode != null
&& !change.getOldBlobIdent().mode.equals(change.getNewBlobIdent().mode)) {
modeChange = Integer.toString(change.getOldBlobIdent().mode, 8)
+ " <i class='fa fa-long-arrow-right'></i> "
+ Integer.toString(change.getNewBlobIdent().mode, 8);
} else {
modeChange = null;
}
add(new Label("modeChange", modeChange).setEscapeModelStrings(false));
}
示例8: onInitialize
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
PullRequestReference reference = getModelObject();
User userForDisplay = User.getForDisplay(reference.getUser(), reference.getUserName());
add(new AvatarLink("avatar", userForDisplay));
add(new UserLink("name", userForDisplay));
add(new Label("age", DateUtils.formatAge(reference.getDate())));
ViewStateAwarePageLink<Void> link = new ViewStateAwarePageLink<Void>("link",
RequestOverviewPage.class, RequestOverviewPage.paramsOf(reference.getReferencedBy()));
link.add(new Label("number", "#" + reference.getReferencedBy().getNumber()));
link.add(new Label("title", reference.getReferencedBy().getTitle()));
add(link);
add(new RequestStatusPanel("status", new AbstractReadOnlyModel<PullRequest>() {
@Override
public PullRequest getObject() {
return ReferencedPanel.this.getModelObject().getReferencedBy();
}
}));
}
示例9: onInitialize
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new UserLink("user", User.getForDisplay(getComment().getUser(), getComment().getUserName())));
add(new Label("age", DateUtils.formatAge(getComment().getDate())));
add(new SinceChangesLink("changes", new AbstractReadOnlyModel<PullRequest>() {
@Override
public PullRequest getObject() {
return getComment().getRequest();
}
}, getComment().getDate()));
add(newViewer());
setOutputMarkupId(true);
}
示例10: onInitialize
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new ResourceLink<Void>("download", new ServerLogResourceReference()));
List<String> lines = ServerLogResource.readServerLog();
String content;
if (lines.size() > MAX_DISPLAY_LINES) {
add(new Label("warning", "Too many log entries, displaying recent " + MAX_DISPLAY_LINES));
content = Joiner.on("\n").join(lines.subList(lines.size()-MAX_DISPLAY_LINES, lines.size()));
} else {
add(new WebMarkupContainer("warning").setVisible(false));
content = Joiner.on("\n").join(lines);
}
add(new Label("logContent", content));
}
示例11: onInitialize
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new Label("title", initStage.getMessage()));
if (!initStage.getManualConfigs().isEmpty()) {
List<ManualConfigStep> configSteps = new ArrayList<ManualConfigStep>();
for (ManualConfig each: initStage.getManualConfigs())
configSteps.add(new ManualConfigStep(each));
add(new Wizard("wizard", configSteps) {
@Override
protected void finished() {
WebSession.get().logout();
User root = GitPlex.getInstance(UserManager.class).getRoot();
SecurityUtils.getSubject().runAs(root.getPrincipals());
throw new RestartResponseException(DashboardPage.class);
}
});
} else {
add(new WebMarkupContainer("wizard").setVisible(false));
}
}
示例12: createHeader
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
private void createHeader() {
ExternalLink topLink = UrlUtil.getTopLink("top");
add(topLink);
Link<Void> reloadLink = new BookmarkablePageLink<Void>("refresh",
LocationViewPage.class, LocationUtil.getParameters(current));
add(reloadLink);
Label categoryLabel = new Label("category", Model.of(LocationRenderer.getLocationType(current)));
add(categoryLabel);
String buildingCode = LocationRenderer.getBuildingCode(current);
if (buildingCode != null) {
buildingCode = "Building Code: " + buildingCode;
}
Label addressLabel = new Label("buildingCode", Model.of(buildingCode));
add(addressLabel);
String popName = LocationRenderer.getPopName(current);
if (popName != null) {
popName = "POP Name: " + popName;
}
Label popNameLabel = new Label("popName", Model.of(popName));
add(popNameLabel);
}
示例13: createAddLocationLink
import org.apache.wicket.markup.html.basic.Label; //导入依赖的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);
}
示例14: createNodeLink
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
public static Link<Void> createNodeLink(final String id, final PortDto port) {
final PageParameters param;
final String nodeName;
if (port != null) {
param = NodeUtil.getParameters(port.getNode());
nodeName = port.getNode().getName();
} else {
param = null;
nodeName = null;
}
BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(id, SimpleNodeDetailPage.class, param);
link.setEnabled(port != null);
Label label = new Label("nodeName", nodeName);
link.add(label);
return link;
}
示例15: createMenu
import org.apache.wicket.markup.html.basic.Label; //导入依赖的package包/类
protected Component createMenu(String id) {
final WebMarkupContainer menu = new WebMarkupContainer(id);
menu.add(new ListView<DropdownMenuItem>("menuItem", getModel()) {
@Override
protected void populateItem(ListItem<DropdownMenuItem> item) {
final DropdownMenuItem itemObject = item.getModelObject();
//link that forms the menu item's action
item.add(itemObject.getLink("link")
//link label defined by the menu item object
.add(new Label("label", itemObject.getLabel()))
//icon with icon class defined by the menu item object
.add(new WebMarkupContainer("icon")
.add(new AttributeModifier("class", itemObject.getIconClass())))
);
}
});
return menu;
}