本文整理汇总了Java中org.apache.wicket.Component类的典型用法代码示例。如果您正苦于以下问题:Java Component类的具体用法?Java Component怎么用?Java Component使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Component类属于org.apache.wicket包,在下文中一共展示了Component类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateItem
import org.apache.wicket.Component; //导入依赖的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"));
}
}
示例2: getBreadcrumbs
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
protected List<ComponentRenderer> getBreadcrumbs() {
List<ComponentRenderer> breadcrumbs = super.getBreadcrumbs();
breadcrumbs.add(new ComponentRenderer() {
@Override
public Component render(String componentId) {
return new ViewStateAwarePageLink<Void>(componentId, UserListPage.class) {
@Override
public IModel<?> getBody() {
return Model.of("Users");
}
};
}
});
return breadcrumbs;
}
示例3: getBreadcrumbs
import org.apache.wicket.Component; //导入依赖的package包/类
protected List<ComponentRenderer> getBreadcrumbs() {
List<ComponentRenderer> breadcrumbs = new ArrayList<>();
breadcrumbs.add(new ComponentRenderer() {
@Override
public Component render(String componentId) {
return new ViewStateAwarePageLink<Void>(componentId, DashboardPage.class) {
@Override
public IModel<?> getBody() {
return Model.of("Home");
}
};
}
});
return breadcrumbs;
}
示例4: getRenderer
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public PrioritizedComponentRenderer getRenderer(BlobRenderContext context) {
return new PrioritizedComponentRenderer() {
private static final long serialVersionUID = 1L;
@Override
public Component render(String componentId) {
return new FailsafeViewPanel(componentId, context);
}
@Override
public int getPriority() {
return Integer.MAX_VALUE;
}
};
}
示例5: newBlobContent
import org.apache.wicket.Component; //导入依赖的package包/类
private void newBlobContent(@Nullable AjaxRequestTarget target) {
PrioritizedComponentRenderer mostPrioritizedRenderer = null;
for (BlobRendererContribution contribution: GitPlex.getExtensions(BlobRendererContribution.class)) {
PrioritizedComponentRenderer renderer = contribution.getRenderer(this);
if (renderer != null) {
if (mostPrioritizedRenderer == null || mostPrioritizedRenderer.getPriority() > renderer.getPriority())
mostPrioritizedRenderer = renderer;
}
}
Component blobContent = Preconditions.checkNotNull(mostPrioritizedRenderer).render(BLOB_CONTENT_ID);
if (target != null) {
replace(blobContent);
target.add(blobContent);
} else {
add(blobContent);
}
}
示例6: getBreadcrumbs
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
protected List<ComponentRenderer> getBreadcrumbs() {
List<ComponentRenderer> breadcrumbs = super.getBreadcrumbs();
breadcrumbs.add(new ComponentRenderer() {
@Override
public Component render(String componentId) {
return new ViewStateAwarePageLink<Void>(componentId, GroupListPage.class) {
@Override
public IModel<?> getBody() {
return Model.of("Groups");
}
};
}
});
return breadcrumbs;
}
示例7: getPropertyEditorsAtRow
import org.apache.wicket.Component; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<PropertyEditor<Serializable>> getPropertyEditorsAtRow(int index) {
WebMarkupContainer table = (WebMarkupContainer) get("listEditor");
RepeatingView rows = (RepeatingView) table.get("elements");
int currentIndex = 0;
Iterator<Component> it = rows.iterator();
Component row = it.next();
while (currentIndex++ < index) {
row = it.next();
}
List<PropertyEditor<Serializable>> propertyEditors = new ArrayList<>();
RepeatingView columns = (RepeatingView) row.get("properties");
for (Component column: columns) {
propertyEditors.add((PropertyEditor<Serializable>) column.get("propertyEditor"));
}
return propertyEditors;
}
示例8: getRenderer
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public PrioritizedComponentRenderer getRenderer(BlobRenderContext context) {
if (context.getMode() == Mode.ADD && context.getNewPath() == null) {
return new PrioritizedComponentRenderer() {
private static final long serialVersionUID = 1L;
@Override
public Component render(String componentId) {
return new NoNameEditPanel(componentId, context);
}
@Override
public int getPriority() {
return 0;
}
};
} else {
return null;
}
}
示例9: getSourceAware
import org.apache.wicket.Component; //导入依赖的package包/类
@Nullable
private SourceAware getSourceAware(String path) {
return diffsView.visitChildren(new IVisitor<Component, SourceAware>() {
@SuppressWarnings("unchecked")
@Override
public void component(Component object, IVisit<SourceAware> visit) {
if (object instanceof ListItem) {
ListItem<BlobChange> item = (ListItem<BlobChange>) object;
if (item.getModelObject().getPaths().contains(path)) {
visit.stop((SourceAware) item.get(DIFF_ID));
} else {
visit.dontGoDeeper();
}
}
}
});
}
示例10: onClick
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void onClick(AjaxRequestTarget target) {
// if modal has not been created, or has been removed from page
// when the same page instance is refreshed
if (modal == null || modal.getParent() == null) {
modal = new ModalPanel(target) {
@Override
protected Component newContent(String id) {
return ModalLink.this.newContent(id, this);
}
@Override
protected void onClosed() {
super.onClosed();
modal = null;
}
};
}
}
示例11: onInitialize
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new DropdownLink("status") {
@Override
protected Component newContent(String id, FloatingPanel floating) {
return new VerificationDetailPanel(id, VerificationStatusPanel.this.getModel());
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
Collection<Verification> verifications = VerificationStatusPanel.this.getModelObject().values();
if (hasStatus(verifications, Status.ERROR)) {
tag.put("class", "verification-status error fa fa-warning");
tag.put("title", "Some verifications are in error, click for details");
} else if (hasStatus(verifications, Status.FAILURE)) {
tag.put("class", "verification-status failure fa fa-times");
tag.put("title", "Some verifications are failed, click for details");
} else if (hasStatus(verifications, Status.RUNNING)) {
tag.put("class", "verification-status running fa fa-circle");
tag.put("title", "Some verifications are running, click for details");
} else if (hasStatus(verifications, Status.SUCCESS)) {
tag.put("class", "verification-status success fa fa-check");
tag.put("title", "Verifications are successful, click for details");
}
}
});
setOutputMarkupPlaceholderTag(true);
}
示例12: VarPanel
import org.apache.wicket.Component; //导入依赖的package包/类
public VarPanel(String id, VarModel model, VarsRefreshingView varsView) {
super(id);
IModel<String> txtModel = new IModel<String>() {
@Override
public String getObject() {
return model.getObject().getValue().getAsString();
}
@Override
public void setObject(String object) {
}
@Override
public void detach() {}
};
add(new TextArea("value", txtModel));
String title = model.getObject().getName() + " - " + model.getObject().getValue().getType();
add(new Label("title", title));
add(new AjaxLink("close") {
@Override
public void onClick(AjaxRequestTarget target) {
varsView.setSelectedName(null);
Component headerPanel = VarPanel.this;
headerPanel = headerPanel.replaceWith(new Label(BasePage.STICKY_HEADER_ID, ""));
target.add(headerPanel);
Component varsPanel = varsView.getParent();
target.add(varsPanel);
}
});
}
示例13: renderHead
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
response.render(JavaScriptHeaderItem.forReference(new DropdownHoverResourceReference()));
String script = String.format("gitplex.server.dropdownhover.init('%s', %s, %s);",
getComponent().getMarkupId(true), hoverDelay, getCallbackFunction());
response.render(OnDomReadyHeaderItem.forScript(script));
}
示例14: onComponentTag
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void onComponentTag(Component component, ComponentTag tag) {
String original = tag.getAttribute("title");
super.onComponentTag(component, tag);
// hack here
String current = tag.getAttribute("title");
if (!Strings.isNullOrEmpty(original) && Strings.isNullOrEmpty(current)) {
tag.put("title", original);
}
}
示例15: renderHead
import org.apache.wicket.Component; //导入依赖的package包/类
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
String script = String.format("gitplex.server.setupCollapse('%s', '%s')", component.getMarkupId(), target.getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}