Java Code Examples for org.apache.wicket.Component#getString()

The following examples show how to use org.apache.wicket.Component#getString() . These examples are extracted from open source projects. 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
/**
 * 
 * @param parentComponent Needed for call parentComponent.getString(String) for i18n.
 * @param componentId
 * @param taskTree
 * @param selectMode
 * @param node
 * @return
 */
public static ConsumptionBarPanel getConsumptionBarPanel(final Component parentComponent, final String componentId,
    final TaskTree taskTree, final boolean selectMode, final TaskNode node)
{
  Integer maxHours = null;
  Integer taskId = null;
  boolean finished = false;
  if (node != null) {
    maxHours = node.getTask().getMaxHours();
    taskId = node.getTaskId();
    finished = node.isFinished();
  }
  final BigDecimal maxDays;
  if (maxHours != null && maxHours.intValue() == 0) {
    maxDays = null;
  } else {
    maxDays = NumberHelper.setDefaultScale(taskTree.getPersonDays(node));
  }
  BigDecimal usage = (node != null) ? new BigDecimal(node.getDuration(taskTree, true)).divide(DateHelper.SECONDS_PER_WORKING_DAY, 2,
      BigDecimal.ROUND_HALF_UP) : BigDecimal.ZERO;
  usage = NumberHelper.setDefaultScale(usage);
  final ConsumptionBarPanel panel = new ConsumptionBarPanel(componentId, usage, maxDays, taskId, finished,
      parentComponent.getString("projectmanagement.personDays.short"), selectMode == false);
  return panel;
}
 
Example 2
private static String getString(final Component parent, final String label, final boolean translate)
{
  if (translate == false || label == null) {
    return label;
  }
  return parent.getString(label);
}
 
Example 3
Source Project: openmeetings   File: VoteDialog.java    License: Apache License 2.0 4 votes vote down vote up
static String getName(Component c, User u) {
	return u == null ? "" : (getUserId().equals(u.getId()) ? c.getString("1411") : u.getFirstname() + " " + u.getLastname());
}
 
Example 4
/**
 * For displaying the modified search string for lucene, e. g. "modified searchstring: micromata*"
 * @param component Needed for {@link Component#getString(String)}.
 * @param searchString
 * @return
 */
public static String getModifiedSearchExpressionLabel(final Component component, final String searchString)
{
  return component.getString("search.lucene.expression") + " " + StringEscapeUtils.escapeHtml(BaseDao.modifySearchString(searchString));
}