com.intellij.ide.projectView
Class PresentationData

java.lang.Object
  extended by com.intellij.ide.projectView.PresentationData
All Implemented Interfaces:
ItemPresentation

public class PresentationData
extends java.lang.Object
implements ItemPresentation

Default implementation of the ItemPresentation interface.


Constructor Summary
PresentationData()
          Creates an instance with no parameters specified.
PresentationData(java.lang.String presentableText, java.lang.String locationString, javax.swing.Icon openIcon, javax.swing.Icon closedIcon, TextAttributesKey attributesKey)
          Creates an instance with the specified parameters.
 
Method Summary
 javax.swing.Icon getIcon(boolean open)
          Returns the icon representing the object.
 java.lang.String getLocationString()
          Returns the location of the object (for example, the package of a class).
 java.lang.String getPresentableText()
          Returns the name of the object to be presented in most renderers across the program.
 TextAttributesKey getTextAttributesKey()
          Returns the text attributes for rendering the item text.
 void setAttributesKey(TextAttributesKey attributesKey)
          Sets the attributes for rendering the item text.
 void setClosedIcon(javax.swing.Icon closedIcon)
          Sets the icon shown for the node when it is collapsed in a tree, or when it is displayed in a non-tree view.
 void setIcons(javax.swing.Icon icon)
          Sets both the open and closed icons of the node to the specified icon.
 void setLocationString(java.lang.String locationString)
          Sets the location of the object (for example, the package of a class).
 void setOpenIcon(javax.swing.Icon openIcon)
          Sets the icon shown for the node when it is expanded in the tree.
 void setPresentableText(java.lang.String presentableText)
          Sets the name of the object to be presented in most renderers across the program.
 void updateFrom(ItemPresentation presentation)
          Copies the presentation parameters from the specified presentation instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PresentationData

public PresentationData(java.lang.String presentableText,
                        java.lang.String locationString,
                        javax.swing.Icon openIcon,
                        javax.swing.Icon closedIcon,
                        TextAttributesKey attributesKey)
Creates an instance with the specified parameters.

Parameters:
presentableText - the name of the object to be presented in most renderers across the program.
locationString - the location of the object (for example, the package of a class). The location string is used by some renderers and usually displayed as grayed text next to the item name.
openIcon - the icon shown for the node when it is expanded in the tree.
closedIcon - the icon shown for the node when it is collapsed in a tree, or when it is displayed in a non-tree view.
attributesKey - the attributes for rendering the item text.

PresentationData

public PresentationData()
Creates an instance with no parameters specified.

Method Detail

getIcon

public javax.swing.Icon getIcon(boolean open)
Description copied from interface: ItemPresentation
Returns the icon representing the object.

Specified by:
getIcon in interface ItemPresentation
Parameters:
open - only meaningful when used in a tree renderers. false is passed when icon for other renderers is required.
Returns:
the icon instance, or null if no icon should be shown.

getLocationString

public java.lang.String getLocationString()
Description copied from interface: ItemPresentation
Returns the location of the object (for example, the package of a class). The location string is used by some renderers and usually displayed as grayed text next to the item name.

Specified by:
getLocationString in interface ItemPresentation
Returns:
the location description, or null if none is applicable.

getPresentableText

public java.lang.String getPresentableText()
Description copied from interface: ItemPresentation
Returns the name of the object to be presented in most renderers across the program.

Specified by:
getPresentableText in interface ItemPresentation
Returns:
the object name.

setClosedIcon

public void setClosedIcon(javax.swing.Icon closedIcon)
Sets the icon shown for the node when it is collapsed in a tree, or when it is displayed in a non-tree view.

Parameters:
closedIcon - the closed icon for the node.
See Also:
setIcons(javax.swing.Icon)

setLocationString

public void setLocationString(java.lang.String locationString)
Sets the location of the object (for example, the package of a class). The location string is used by some renderers and usually displayed as grayed text next to the item name.

Parameters:
locationString - the location of the object.

setOpenIcon

public void setOpenIcon(javax.swing.Icon openIcon)
Sets the icon shown for the node when it is expanded in the tree.

Parameters:
openIcon - the open icon for the node.
See Also:
setIcons(javax.swing.Icon)

setPresentableText

public void setPresentableText(java.lang.String presentableText)
Sets the name of the object to be presented in most renderers across the program.

Parameters:
presentableText - the name of the object.

setIcons

public void setIcons(javax.swing.Icon icon)
Sets both the open and closed icons of the node to the specified icon.

Parameters:
icon - the icon for the node.
See Also:
setOpenIcon(javax.swing.Icon), setClosedIcon(javax.swing.Icon)

updateFrom

public void updateFrom(ItemPresentation presentation)
Copies the presentation parameters from the specified presentation instance.

Parameters:
presentation - the instance to copy the parameters from.

getTextAttributesKey

public TextAttributesKey getTextAttributesKey()
Description copied from interface: ItemPresentation
Returns the text attributes for rendering the item text.

Specified by:
getTextAttributesKey in interface ItemPresentation
Returns:
the text attributrs, or null if default text attributes should be used

setAttributesKey

public void setAttributesKey(TextAttributesKey attributesKey)
Sets the attributes for rendering the item text.

Parameters:
attributesKey - the attributes for rendering the item text.