org.pm4j.core.pm.impl.title
Class PmTitleProviderValuebased

java.lang.Object
  extended by org.pm4j.core.pm.impl.title.PmTitleProviderValuebased
All Implemented Interfaces:
PmTitleProvider<PmObject>

public class PmTitleProviderValuebased
extends java.lang.Object
implements PmTitleProvider<PmObject>

Provides title values that are defined in Java code.

Useful for single language and prototype applications.

But in parallel it also allows to find resource based strings using the findLocalization methods.

Author:
olaf boede

Constructor Summary
PmTitleProviderValuebased(java.lang.String value, java.lang.String tooltip, java.lang.String icon)
           
 
Method Summary
 boolean canSetTitle(PmObject item)
          Indicates if it is allowed to call the #setTitle(Object, Object, String) method for the given item.
 java.lang.String getIconPath(PmObject item)
           
 java.lang.String getShortTitle(PmObject item)
           
 java.lang.String getTitle(PmObject item)
           
 java.lang.String getToolTip(PmObject item)
           
 void setTitle(PmObject item, java.lang.String titleString)
          An interface for 'in place editing' of node titles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmTitleProviderValuebased

public PmTitleProviderValuebased(java.lang.String value,
                                 java.lang.String tooltip,
                                 java.lang.String icon)
Method Detail

canSetTitle

public boolean canSetTitle(PmObject item)
Description copied from interface: PmTitleProvider
Indicates if it is allowed to call the #setTitle(Object, Object, String) method for the given item.

Specified by:
canSetTitle in interface PmTitleProvider<PmObject>
Returns:
true when it is allowed to call #setTitle(Object, Object, String).

getIconPath

public java.lang.String getIconPath(PmObject item)
Specified by:
getIconPath in interface PmTitleProvider<PmObject>
Parameters:
item - The item to get a icon name for.
Returns:
A icon string or null when there is no icon for the given item.

getShortTitle

public java.lang.String getShortTitle(PmObject item)
Specified by:
getShortTitle in interface PmTitleProvider<PmObject>
Parameters:
item - An item to get the undecorated title for.
Returns:
The undecorated title string for the given item.
See Also:
PmTitledObject#getPmShortTitle()

getTitle

public java.lang.String getTitle(PmObject item)
Specified by:
getTitle in interface PmTitleProvider<PmObject>
Parameters:
item - An item to get a title for.
Returns:
The title string for the given item.

getToolTip

public java.lang.String getToolTip(PmObject item)
Specified by:
getToolTip in interface PmTitleProvider<PmObject>
Parameters:
item - The item to get a tooltip for.
Returns:
A tooltip string or null when there is no tooltip for the given item.

setTitle

public void setTitle(PmObject item,
                     java.lang.String titleString)
Description copied from interface: PmTitleProvider
An interface for 'in place editing' of node titles.

That might be a useful feature for title string editors of tree views where a user can simply click on a title and change it.

Specified by:
setTitle in interface PmTitleProvider<PmObject>