Package net.sf.basedb.util.overview.node
Class NameableNameGenerator<I extends Nameable>
java.lang.Object
net.sf.basedb.util.overview.node.NameableNameGenerator<I>
- All Implemented Interfaces:
NodeNameGenerator<I>
- Direct Known Subclasses:
BioPlateNameGenerator
,ExtractNameGenerator
public class NameableNameGenerator<I extends Nameable>
extends Object
implements NodeNameGenerator<I>
Name generator implementation for
Nameable
items. The name and title can each have two variants,
depending on the node type of the parent node.
If the parent node is a folder-type node, the name
is generated as prefix.item-id
and the
title is the name of the item, eg. Nameable.getName()
.
If the parent node is an item-type node, the name is only the namePrefix and the title is the title prefix combined with the name of the item.
- Version:
- 2.10
- Author:
- Nicklas
- Last modified
- $Date: 2011-06-08 15:00:33 +0200 (on, 08 jun 2011) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNameableNameGenerator
(String namePrefix, String titlePrefix) Create a new name generator. -
Method Summary
Modifier and TypeMethodDescriptiongetDeniedNodeName
(Node parentNode) Generate a name for a node when the item exists, but the current user doesn't have permission to access read the item.getDeniedNodeTitle
(Node parentNode) Generate a title for a node when the item exists, but the current user doesn't have permission to access read the item.getMissingNodeName
(Node parentNode) Generate a name for a node when the item is missing.getMissingNodeTitle
(Node parentNode) Generate a title for a node when the item is missing.getNodeName
(I item, Node parentNode) Generate a name for the new node that is about to be created.getNodeTitle
(I item, Node parentNode) Generate a title for the new node that is about to be created.
-
Field Details
-
namePrefix
-
titlePrefix
-
-
Constructor Details
-
NameableNameGenerator
Create a new name generator.- Parameters:
namePrefix
- The prefix to use in node namestitlePrefix
- The prefix to use in node titles
-
-
Method Details
-
getNodeName
Description copied from interface:NodeNameGenerator
Generate a name for the new node that is about to be created.- Specified by:
getNodeName
in interfaceNodeNameGenerator<I extends Nameable>
- Parameters:
item
- The item that is attached to the node (never null)parentNode
- The parent node of the new node- Returns:
- A name for the node
-
getNodeTitle
Description copied from interface:NodeNameGenerator
Generate a title for the new node that is about to be created.- Specified by:
getNodeTitle
in interfaceNodeNameGenerator<I extends Nameable>
- Parameters:
item
- The item that is attached to the node (never null)parentNode
- The parent node of the new node- Returns:
- A title for the node
-
getDeniedNodeName
Description copied from interface:NodeNameGenerator
Generate a name for a node when the item exists, but the current user doesn't have permission to access read the item.- Specified by:
getDeniedNodeName
in interfaceNodeNameGenerator<I extends Nameable>
- Parameters:
parentNode
- The parent node- Returns:
- A name for the node
-
getDeniedNodeTitle
Description copied from interface:NodeNameGenerator
Generate a title for a node when the item exists, but the current user doesn't have permission to access read the item.- Specified by:
getDeniedNodeTitle
in interfaceNodeNameGenerator<I extends Nameable>
- Parameters:
parentNode
- The parent node- Returns:
- A name for the node
-
getMissingNodeName
Description copied from interface:NodeNameGenerator
Generate a name for a node when the item is missing.- Specified by:
getMissingNodeName
in interfaceNodeNameGenerator<I extends Nameable>
- Parameters:
parentNode
- The parent node- Returns:
- A name for the node
-
getMissingNodeTitle
Description copied from interface:NodeNameGenerator
Generate a title for a node when the item is missing.- Specified by:
getMissingNodeTitle
in interfaceNodeNameGenerator<I extends Nameable>
- Parameters:
parentNode
- The parent node- Returns:
- A title for the node
-