4740 |
05 Feb 09 |
nicklas |
1 |
/** |
4740 |
05 Feb 09 |
nicklas |
$Id$ |
4740 |
05 Feb 09 |
nicklas |
3 |
|
4740 |
05 Feb 09 |
nicklas |
Copyright (C) 2008 Nicklas Nordborg |
4740 |
05 Feb 09 |
nicklas |
5 |
|
4740 |
05 Feb 09 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
4740 |
05 Feb 09 |
nicklas |
Available at http://base.thep.lu.se/ |
4740 |
05 Feb 09 |
nicklas |
8 |
|
4740 |
05 Feb 09 |
nicklas |
BASE is free software; you can redistribute it and/or |
4740 |
05 Feb 09 |
nicklas |
modify it under the terms of the GNU General Public License |
4740 |
05 Feb 09 |
nicklas |
as published by the Free Software Foundation; either version 3 |
4740 |
05 Feb 09 |
nicklas |
of the License, or (at your option) any later version. |
4740 |
05 Feb 09 |
nicklas |
13 |
|
4740 |
05 Feb 09 |
nicklas |
BASE is distributed in the hope that it will be useful, |
4740 |
05 Feb 09 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4740 |
05 Feb 09 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4740 |
05 Feb 09 |
nicklas |
GNU General Public License for more details. |
4740 |
05 Feb 09 |
nicklas |
18 |
|
4740 |
05 Feb 09 |
nicklas |
You should have received a copy of the GNU General Public License |
4740 |
05 Feb 09 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4740 |
05 Feb 09 |
nicklas |
21 |
*/ |
4740 |
05 Feb 09 |
nicklas |
22 |
package net.sf.basedb.util.overview.node; |
4740 |
05 Feb 09 |
nicklas |
23 |
|
4740 |
05 Feb 09 |
nicklas |
24 |
import net.sf.basedb.core.BasicItem; |
4740 |
05 Feb 09 |
nicklas |
25 |
import net.sf.basedb.util.overview.Node; |
4740 |
05 Feb 09 |
nicklas |
26 |
|
4740 |
05 Feb 09 |
nicklas |
27 |
/** |
4740 |
05 Feb 09 |
nicklas |
A name generator is an object that can create the name and |
4740 |
05 Feb 09 |
nicklas |
title for a node when given the item that should be attached |
4740 |
05 Feb 09 |
nicklas |
to the node. The name and title are used to create the |
4740 |
05 Feb 09 |
nicklas |
new node: {@link Node#Node(String, String, Node, BasicItem, ChildNodeDirection)}. |
4740 |
05 Feb 09 |
nicklas |
32 |
|
4740 |
05 Feb 09 |
nicklas |
@author Nicklas |
4740 |
05 Feb 09 |
nicklas |
@version 2.10 |
4740 |
05 Feb 09 |
nicklas |
@base.modified $Date$ |
4740 |
05 Feb 09 |
nicklas |
36 |
*/ |
4740 |
05 Feb 09 |
nicklas |
37 |
public interface NodeNameGenerator<I> |
4740 |
05 Feb 09 |
nicklas |
38 |
{ |
4740 |
05 Feb 09 |
nicklas |
39 |
|
4768 |
18 Feb 09 |
nicklas |
40 |
/** |
4768 |
18 Feb 09 |
nicklas |
Generate a name for a node when the item is missing. |
4768 |
18 Feb 09 |
nicklas |
@param parentNode The parent node |
4768 |
18 Feb 09 |
nicklas |
@return A name for the node |
4768 |
18 Feb 09 |
nicklas |
44 |
*/ |
4740 |
05 Feb 09 |
nicklas |
45 |
public String getMissingNodeName(Node parentNode); |
4768 |
18 Feb 09 |
nicklas |
46 |
|
4768 |
18 Feb 09 |
nicklas |
47 |
/** |
4768 |
18 Feb 09 |
nicklas |
Generate a title for a node when the item is missing. |
4768 |
18 Feb 09 |
nicklas |
@param parentNode The parent node |
4768 |
18 Feb 09 |
nicklas |
@return A title for the node |
4768 |
18 Feb 09 |
nicklas |
51 |
*/ |
4740 |
05 Feb 09 |
nicklas |
52 |
public String getMissingNodeTitle(Node parentNode); |
4768 |
18 Feb 09 |
nicklas |
53 |
|
4768 |
18 Feb 09 |
nicklas |
54 |
/** |
4768 |
18 Feb 09 |
nicklas |
Generate a name for a node when the item exists, but |
4768 |
18 Feb 09 |
nicklas |
the current user doesn't have permission to access read |
4768 |
18 Feb 09 |
nicklas |
the item. |
4768 |
18 Feb 09 |
nicklas |
@param parentNode The parent node |
4768 |
18 Feb 09 |
nicklas |
@return A name for the node |
4768 |
18 Feb 09 |
nicklas |
60 |
*/ |
4740 |
05 Feb 09 |
nicklas |
61 |
public String getDeniedNodeName(Node parentNode); |
4768 |
18 Feb 09 |
nicklas |
62 |
|
4768 |
18 Feb 09 |
nicklas |
63 |
/** |
4768 |
18 Feb 09 |
nicklas |
Generate a title for a node when the item exists, but |
4768 |
18 Feb 09 |
nicklas |
the current user doesn't have permission to access read |
4768 |
18 Feb 09 |
nicklas |
the item. |
4768 |
18 Feb 09 |
nicklas |
@param parentNode The parent node |
4768 |
18 Feb 09 |
nicklas |
@return A name for the node |
4768 |
18 Feb 09 |
nicklas |
69 |
*/ |
4740 |
05 Feb 09 |
nicklas |
70 |
public String getDeniedNodeTitle(Node parentNode); |
4740 |
05 Feb 09 |
nicklas |
71 |
|
4740 |
05 Feb 09 |
nicklas |
72 |
/** |
4740 |
05 Feb 09 |
nicklas |
Generate a name for the new node that is about to be |
4740 |
05 Feb 09 |
nicklas |
created. |
4768 |
18 Feb 09 |
nicklas |
@param item The item that is attached to the node (never null) |
4740 |
05 Feb 09 |
nicklas |
@param parentNode The parent node of the new node |
4740 |
05 Feb 09 |
nicklas |
@return A name for the node |
4740 |
05 Feb 09 |
nicklas |
78 |
*/ |
4740 |
05 Feb 09 |
nicklas |
79 |
public String getNodeName(I item, Node parentNode); |
4740 |
05 Feb 09 |
nicklas |
80 |
|
4740 |
05 Feb 09 |
nicklas |
81 |
/** |
4740 |
05 Feb 09 |
nicklas |
Generate a title for the new node that is about to be |
4740 |
05 Feb 09 |
nicklas |
created. |
4768 |
18 Feb 09 |
nicklas |
@param item The item that is attached to the node (never null) |
4740 |
05 Feb 09 |
nicklas |
@param parentNode The parent node of the new node |
4740 |
05 Feb 09 |
nicklas |
@return A title for the node |
4740 |
05 Feb 09 |
nicklas |
87 |
*/ |
4740 |
05 Feb 09 |
nicklas |
88 |
public String getNodeTitle(I item, Node parentNode); |
4740 |
05 Feb 09 |
nicklas |
89 |
|
4740 |
05 Feb 09 |
nicklas |
90 |
} |