de.smartics.maven.issues.bugzilla
Class ReportHelper

Package class diagram package ReportHelper
java.lang.Object
  extended by de.smartics.maven.issues.bugzilla.ReportHelper

public final class ReportHelper
     
     
extends Object

Provides helper methods for reports.

Author:
Robert Reiner

Field Summary
static Map<String,String> PERSON_NAME_TO_EMAIL
          An enumeration of Bugzilla attributes referring to person names (keys) and the corresponding eMail attribute (value).
 
Method Summary
static String getAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute root, org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute name)
          Returns the attribute value for the given attribute key.
static String getAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute root, String key)
          Returns the attribute value for the given attribute key.
static String getLabel(ResourceBundle bundle, String attributeKey)
          Returns the label for the given attribute.
static String getLabel(ResourceBundle bundle, String subcategory, String attributeKey)
          Returns the label for the given attribute.
static String getLabel(ResourceBundle bundle, String subcategory, String attributeKey, Object... arguments)
          Returns the label for the given attribute.
static void renderLink(Sink sink, String url, String label)
          Renders a link.
static void renderTableCell(Sink sink, String label)
          Renders a table cell with the given label as content.
static void renderTableCell(Sink sink, org.eclipse.mylyn.tasks.core.data.TaskAttribute root, org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute attribute)
          Renders a table cell with the given label as content.
static void renderTableCell(Sink sink, org.eclipse.mylyn.tasks.core.data.TaskAttribute root, String attributeKey)
          Renders a table cell with the given label as content.
static void renderTableCellWithLink(Sink sink, String url, String label)
          Renders a table cell containing a link with the given label and URL.
static void renderTableCellWithMailto(Sink sink, org.eclipse.mylyn.tasks.core.data.TaskAttribute root, String nameKey, String eMailKey)
          Renders a table cell with a mailto link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSON_NAME_TO_EMAIL

public static final Map<String,String> PERSON_NAME_TO_EMAIL
An enumeration of Bugzilla attributes referring to person names (keys) and the corresponding eMail attribute (value).

Method Detail

getAttribute

public static String getAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute root,
                                  org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute name)
Returns the attribute value for the given attribute key.

Parameters:
root - the root attribute to fetch the requested attribute from.
name - the name of the attribute whose value is requested.
Returns:
the value of the attribute or null if the value is not set.

getAttribute

public static String getAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute root,
                                  String key)
Returns the attribute value for the given attribute key.

Parameters:
root - the root attribute to fetch the requested attribute from.
key - the key of the attribute whose value is requested.
Returns:
the value of the attribute or null if the value is not set.

getLabel

public static String getLabel(ResourceBundle bundle,
                              String attributeKey)
Returns the label for the given attribute.

Parameters:
bundle - the bundle to fetch the label from.
attributeKey - the key to the attribute that is normalized via Utils.normalizeKey(String).
Returns:
the label for the given key or the key, if no label is defined.

getLabel

public static String getLabel(ResourceBundle bundle,
                              String subcategory,
                              String attributeKey)
Returns the label for the given attribute.

Parameters:
bundle - the bundle to fetch the label from.
attributeKey - the key to the attribute that is normalized via Utils.normalizeKey(String).
subcategory - the subcategory of the label. May be structured by dots.
Returns:
the label for the given key or the key, if no label is defined.

getLabel

public static String getLabel(ResourceBundle bundle,
                              String subcategory,
                              String attributeKey,
                              Object... arguments)
Returns the label for the given attribute.

Parameters:
bundle - the bundle to fetch the label from.
attributeKey - the key to the attribute that is normalized via Utils.normalizeKey(String).
subcategory - the subcategory of the pattern to construct the label. May be structured by dots.
arguments - applied to the pattern found by the key. May be null or empty in which case the pattern is the label to be returned without substitution.
Returns:
the label for the given key or the key, if no label is defined.

renderTableCellWithLink

public static void renderTableCellWithLink(Sink sink,
                                           String url,
                                           String label)
Renders a table cell containing a link with the given label and URL.

Parameters:
sink - the sink to write to.
url - the URL the link points to.
label - the label of the link.

renderLink

public static void renderLink(Sink sink,
                              String url,
                              String label)
Renders a link.

Parameters:
sink - the sink to write to.
url - the URL the link points to.
label - the label of the link.

renderTableCell

public static void renderTableCell(Sink sink,
                                   org.eclipse.mylyn.tasks.core.data.TaskAttribute root,
                                   org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute attribute)
Renders a table cell with the given label as content.

Parameters:
sink - the sink to write to.
root - the root attribute to fetch the given attribute from.
attribute - the attribute whose value is to be rendered.

renderTableCell

public static void renderTableCell(Sink sink,
                                   org.eclipse.mylyn.tasks.core.data.TaskAttribute root,
                                   String attributeKey)
Renders a table cell with the given label as content.

Parameters:
sink - the sink to write to.
root - the root attribute to fetch the given attributeKey from.
attributeKey - the key to the attribute whose value is to be rendered.

renderTableCell

public static void renderTableCell(Sink sink,
                                   String label)
Renders a table cell with the given label as content.

Parameters:
sink - the sink to write to.
label - the content of the cell.

renderTableCellWithMailto

public static void renderTableCellWithMailto(Sink sink,
                                             org.eclipse.mylyn.tasks.core.data.TaskAttribute root,
                                             String nameKey,
                                             String eMailKey)
Renders a table cell with a mailto link.

Parameters:
sink - the sink to write to.
root - the root attribute to fetch the values for name and eMail.
nameKey - the key to the value of the name attribute.
eMailKey - the key to the value of the eMail attribute.


Copyright © 2008-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.