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

The following examples show how to use org.apache.wicket.Component#getString() . 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: TaskListPage.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 
 * @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
Source File: FieldsetPanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
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 File: VoteDialog.java    From openmeetings with 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
Source File: AbstractListForm.java    From projectforge-webapp with GNU General Public License v3.0 2 votes vote down vote up
/**
 * 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));
}