List of usage examples for org.apache.wicket Component add
public Component add(final Behavior... behaviors)
From source file:org.odlabs.wiquery.ui.themes.ThemeUiHelper.java
License:Open Source License
/** * Method to display your composant as an icon * /*from w ww . j a v a 2 s . c o m*/ * @param component * Wicket component * @param iconEnum * Icon to display */ public static void iconComponent(Component component, IconEnum iconEnum) { component.add(AttributeModifier.append("class", "ui-icon " + iconEnum.getCssClass())); }
From source file:org.odlabs.wiquery.ui.themes.ThemeUiHelper.java
License:Open Source License
/** * Method to display your composant as an icon * /*from w ww .ja v a 2s . c o m*/ * @param component * Wicket component * @param icon * Icon to display */ public static void iconComponent(Component component, UiIcon icon) { component.add(AttributeModifier.append("class", "ui-icon " + icon.getCssClass())); }
From source file:org.odlabs.wiquery.ui.themes.ThemeUiHelper.java
License:Open Source License
/** * Method to display a component as an overlay * /* w w w.j av a 2 s . c om*/ * @param component * Wicket component */ public static void overlayComponent(Component component) { component.add( AttributeModifier.append("class", "ui-overlay ui-widget-overlay ui-widget-shadow ui-corner-all")); }
From source file:org.odlabs.wiquery.ui.themes.ThemeUiHelper.java
License:Open Source License
/** * Method to display a component as a title * /*from w w w. j a v a 2s.co m*/ * @param component * Wicket component */ public static void titleComponent(Component component) { component.add(AttributeModifier.append("class", "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")); }
From source file:org.odlabs.wiquery.ui.themes.ThemeUiHelper.java
License:Open Source License
/** * Styles the given {@link Component} as a jQuery UI header. *//*w w w.j a v a 2s . c o m*/ public static void headerComponent(Component component) { component.add(AttributeModifier.append("class", "ui-widget-header")); }
From source file:org.odlabs.wiquery.ui.themes.ThemeUiHelper.java
License:Open Source License
/** * Styles the given {@link Component} as a jQuery UI shadow. *///ww w . j a v a 2 s .c o m public static void shadowComponent(Component component) { component.add(AttributeModifier.append("class", "ui-widget-shadow")); }
From source file:org.onexus.ui.authentication.persona.GuestPanel.java
License:Apache License
public GuestPanel(String id, Style style) { super(id);/*from w w w. j a v a 2 s. co m*/ this.style = style; Component signInImage = createSignInButton("signInImage"); signInImage.add(new VerifyBehavior() { private static final long serialVersionUID = 1L; @Override protected void onSuccess(AjaxRequestTarget target) { GuestPanel.this.onSuccess(target); } @Override protected void onFailure(AjaxRequestTarget target, String failureReason) { GuestPanel.this.onFailure(target, failureReason); } }); add(signInImage); }
From source file:org.onexus.website.api.pages.search.figures.LinksBox.java
License:Apache License
private Component newFieldsBox(String componentId, String labelField, IEntity entity, boolean active) { Component box; if (status.getType().getTemplate() == null || status.getType().getTemplate().isEmpty()) { box = new FieldsPanel(componentId, labelField, entity); } else {//from w w w.jav a 2 s.co m box = new Label(componentId, replaceEntityValues(status.getType().getTemplate(), entity)) .setEscapeModelStrings(false); } if (active) { box.add(new AttributeAppender("class", " active")); } box.setMarkupId(entity.getId()); return box; }
From source file:org.opensingular.form.wicket.feedback.SValidationFeedbackPanel.java
License:Apache License
protected Component newMessageDisplayComponent(String id, IModel<IValidationError> error) { final Component component = new Label(id, $m.map(error, IValidationError::getMessage)); component.setEscapeModelStrings(SValidationFeedbackPanel.this.getEscapeModelStrings()); component.add($b.classAppender($m.map(error, this::getCSSClass))); final Label label = (Label) component; if (error instanceof SFeedbackMessage) { final SFeedbackMessage bfm = (SFeedbackMessage) error; final SInstance instance = bfm.getInstanceModel().getObject(); final SInstance parentContext = WicketFormUtils.resolveInstance(getFence().getMainContainer()) .orElse(null);/* w ww . ja va 2 s .c o m*/ final Optional<Component> reporter = WicketFormUtils.findChildByInstance(getFence().getMainContainer(), instance); final String labelPath = StringUtils.defaultString( reporter.map(it -> WicketFormUtils.generateTitlePath(getFence().getMainContainer(), parentContext, it, instance)).orElse(null), SFormUtil.generatePath(instance, it -> Objects.equals(it, parentContext))); label.setDefaultModelObject(labelPath + " : " + bfm.getMessage()); } return component; }
From source file:org.opensingular.form.wicket.IWicketComponentMapper.java
License:Apache License
default void adjustJSEvents(Component comp) { comp.add(new SingularEventsHandlers(ADD_TEXT_FIELD_HANDLERS)); }