Java Code Examples for org.apache.wicket.markup.ComponentTag#put()

The following examples show how to use org.apache.wicket.markup.ComponentTag#put() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FooterPanel.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
public FooterPanel(String id) {
	super(id);
	
	ExternalLink link = new ExternalLink("home", ReleaseInfo.getHome()) {
           protected void onComponentTag(ComponentTag componentTag) {
               super.onComponentTag(componentTag);
               componentTag.put("target", "_blank");
           }
       };
	link.add(new Label("company", ReleaseInfo.getCompany()));
	add(link);
	
	Label version = new Label("version", getVersion());
	version.add(new SimpleTooltipBehavior(getBuildDate()));
	add(version);		
}
 
Example 2
Source File: FieldInstanceDateTimeField.java    From ontopia with Apache License 2.0 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
  tag.setName("input");
  tag.put("type", "text");
  tag.put("size", cols);
  super.onComponentTag(tag);
}
 
Example 3
Source File: SimpleLink.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
	tag.setName("a");  
	tag.put("href", url);
       tag.put("class", "link");
       if (openUrlInNewWindow) {
		tag.put("target", "_blank");
	}
}
 
Example 4
Source File: ProfileThumbnail.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@Override
protected void onComponentTag(final ComponentTag tag) {
    super.onComponentTag(tag);
    checkComponentTag(tag, "a");

    final String userUuid = this.getDefaultModelObjectAsString();

    // image url, cached for a minute
    final String imageUrl = "/direct/profile/" + userUuid + "/image/thumb" + "?t="
            + TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis());

    // output image
    tag.put("style", "background-image:url(" + imageUrl + ")");
}
 
Example 5
Source File: StatusUtils.java    From syncope with Apache License 2.0 5 votes vote down vote up
public static Label getLabel(final String componentId, final String alt, final String title, final String clazz) {
    return new Label(componentId, StringUtils.EMPTY) {

        private static final long serialVersionUID = 4755868673082976208L;

        @Override
        protected void onComponentTag(final ComponentTag tag) {
            super.onComponentTag(tag);
            tag.put("alt", alt);
            tag.put("title", title);
            tag.put("class", clazz);
        }
    };
}
 
Example 6
Source File: BootstrapTemporalDatepicker.java    From pm-wicket-utils with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
	super.onComponentTag(tag);
	
	if(dateField!=null){
		tag.put("data-date-format", dateField.getTextFormat().toLowerCase());
	}
}
 
Example 7
Source File: ProfileThumbnail.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@Override
protected void onComponentTag(final ComponentTag tag) {
    super.onComponentTag(tag);
    checkComponentTag(tag, "a");

    final String userUuid = this.getDefaultModelObjectAsString();

    // image url, cached for a minute
    final String imageUrl = "/direct/profile/" + userUuid + "/image/thumb" + "?t="
            + TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis());

    // output image
    tag.put("style", "background-image:url(" + imageUrl + ")");
}
 
Example 8
Source File: FieldInstanceDateField.java    From ontopia with Apache License 2.0 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
  tag.setName("input");
  tag.put("type", "text");
  tag.put("size", cols);
  super.onComponentTag(tag);
}
 
Example 9
Source File: FieldInstanceNumberField.java    From ontopia with Apache License 2.0 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
  tag.setName("input");
  tag.put("type", "text");
  tag.put("size", cols);
  super.onComponentTag(tag);
}
 
Example 10
Source File: ContextMenuPanel.java    From ontopia with Apache License 2.0 5 votes vote down vote up
public ContextMenuPanel(String id, final String menuId) {
  super(id);
  WebMarkupContainer container = new WebMarkupContainer("contextMenu") {      
    @Override
    protected void onComponentTag(ComponentTag tag) {
      tag.put("id", "m" + menuId);
      super.onComponentTag(tag);
    }      
  };
  add(container);    
  container.add(createListView("menu", "menuitem"));
}
 
Example 11
Source File: SubscriptionStatusLink.java    From onedev with MIT License 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
	super.onComponentTag(tag);
	String classes = tag.getAttribute("class");
	if (classes == null)
		classes = "";
	if (isSubscribed()) {
		tag.put("class", classes + " subscription-status subscribed");
		tag.put("title", "Subscribed. Click to unsubscribe");
	} else {
		tag.put("class", classes + " subscription-status unsubscribed");
		tag.put("title", "Unsubscribed. Click to subscribe");
	}
}
 
Example 12
Source File: BootstrapDateTimePicker.java    From pm-wicket-utils with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) 
{
	super.onComponentTag(tag);
	
	if(dateField!=null) {
		
		tag.put("data-date-format", dateField.getTextFormat().toLowerCase());
	}
}
 
Example 13
Source File: ProjectAvatar.java    From onedev with MIT License 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
	super.onComponentTag(tag);
	
	tag.setName("img");
	tag.append("class", "project-avatar", " ");
	tag.put("src", url);
}
 
Example 14
Source File: ProfileThumbnail.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@Override
protected void onComponentTag(final ComponentTag tag) {
    super.onComponentTag(tag);
    checkComponentTag(tag, "a");

    final String userUuid = this.getDefaultModelObjectAsString();

    // image url, cached for a minute
    final String imageUrl = "/direct/profile/" + userUuid + "/image/thumb" + "?t="
            + TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis());

    // output image
    tag.put("style", "background-image:url(" + imageUrl + ")");
}
 
Example 15
Source File: StylableSelectOptions.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
	if(style != null && !"null".equals(style)) {
		tag.put("style", style);
	}
	super.onComponentTag(tag);
}
 
Example 16
Source File: FolderPanel.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
@Override
public void onComponentTag(Component component, ComponentTag tag) {
	tag.put(ATTR_CLASS, getItemStyle());
}
 
Example 17
Source File: ActionablePageLink.java    From onedev with MIT License 4 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
	super.onComponentTag(tag);
	tag.put("href", RequestCycle.get().urlFor(pageClass, params));
}
 
Example 18
Source File: AjaxIndicator.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public void onComponentTag(ComponentTag tag) {
	super.onComponentTag(tag);
	tag.put("src", RequestCycle.get().urlFor(AbstractDefaultAjaxBehavior.INDICATOR, null));
}
 
Example 19
Source File: FilterPanel.java    From Orienteer with Apache License 2.0 4 votes vote down vote up
@Override
protected void onComponentTag(ComponentTag tag) {
    super.onComponentTag(tag);
    tag.remove("href");
    tag.put("href", "#" + tabId);
}
 
Example 20
Source File: AlertWidget.java    From syncope with Apache License 2.0 4 votes vote down vote up
public AlertWidget(final String id) {
    super(id);
    this.latestAlerts = getLatestAlerts();

    setOutputMarkupId(true);

    final LoadableDetachableModel<Integer> size = new LoadableDetachableModel<Integer>() {

        private static final long serialVersionUID = 7474274077691068779L;

        @Override
        protected Integer load() {
            return getLatestAlertsSize();
        }
    };

    add(getIcon("icon"));

    linkAlertsNumber = new Label("alerts", size) {

        private static final long serialVersionUID = 4755868673082976208L;

        @Override
        protected void onComponentTag(final ComponentTag tag) {
            super.onComponentTag(tag);
            if (Integer.parseInt(getDefaultModelObject().toString()) > 0) {
                tag.put("class", "badge badge-warning navbar-badge");
            } else {
                tag.put("class", "badge badge-success navbar-badge");
            }
        }
    };
    add(linkAlertsNumber.setOutputMarkupId(true));

    headerAlertsNumber = new Label("number", size);
    headerAlertsNumber.setOutputMarkupId(true);
    add(headerAlertsNumber);

    add(getEventsLink("alertsLink"));

    latestAlertsList = new WebMarkupContainer("latestAlertsList");
    latestAlertsList.setOutputMarkupId(true);
    add(latestAlertsList);
}