org.netbeans.modules.projectuiapi/1 1.51.1 8

org.netbeans.spi.project.ui.support
Class ProjectCustomizer.Category

java.lang.Object
  extended by org.netbeans.spi.project.ui.support.ProjectCustomizer.Category
Enclosing class:
ProjectCustomizer

public static final class ProjectCustomizer.Category
extends Object

Describes category of properties to be customized by given component


Method Summary
static ProjectCustomizer.Category create(String name, String displayName, Image icon, ProjectCustomizer.Category... subcategories)
          Factory method which creates new category description.
 String getDisplayName()
          Gets display name of given category.
 String getErrorMessage()
          Returns an error message for this category.
 Image getIcon()
          Gets icon of given category.
 String getName()
          Gets programmatic name of given category.
 ActionListener getOkButtonListener()
          Returns the action listener associated with this category that gets notified when OK button is pressed on the customizer.
 ActionListener getStoreListener()
          Returns the action listener that is executed outside of AWT EQ and is associated with this category that gets notified when OK button is pressed on the customizer.
 ProjectCustomizer.Category[] getSubcategories()
          Gets subcategories of given category.
 boolean isValid()
          Returns whether this category is valid or not.
 void setErrorMessage(String message)
          Set an errror message for this category which than may be shown in a project customizer.
 void setOkButtonListener(ActionListener okButtonListener)
          Set the action listener that will get notified when the changes in the customizer are to be applied.
 void setStoreListener(ActionListener listener)
          Set the action listener that will get notified when the changes in the customizer are to be applied.
 void setValid(boolean valid)
          Set a validity of this category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ProjectCustomizer.Category create(String name,
                                                String displayName,
                                                Image icon,
                                                ProjectCustomizer.Category... subcategories)
Factory method which creates new category description.

Parameters:
name - Programmatic name of the category
displayName - Name to be shown to the user
icon - Icon for given category. Will use default icon if null.
subcategories - Subcategories to be shown under given category. Category won't be expandable if null or empty array.
Returns:
a new category description

getName

public String getName()
Gets programmatic name of given category.

Returns:
Programmatic name of the category

getDisplayName

public String getDisplayName()
Gets display name of given category.

Returns:
Display name of the category

getIcon

public Image getIcon()
Gets icon of given category.

Returns:
Icon name of the category or null

getSubcategories

public ProjectCustomizer.Category[] getSubcategories()
Gets subcategories of given category.

Returns:
Subcategories of the category or null

getErrorMessage

public String getErrorMessage()
Returns an error message for this category.

Returns:
the error message (could be null)

isValid

public boolean isValid()
Returns whether this category is valid or not. See ProjectCustomizer.createCustomizerDialog(org.netbeans.spi.project.ui.support.ProjectCustomizer.Category[], org.netbeans.spi.project.ui.support.ProjectCustomizer.CategoryComponentProvider, java.lang.String, java.awt.event.ActionListener, org.openide.util.HelpCtx) for more details.

Returns:
whether this category is valid or not (true by default)

setValid

public void setValid(boolean valid)
Set a validity of this category. See ProjectCustomizer.createCustomizerDialog(org.netbeans.spi.project.ui.support.ProjectCustomizer.Category[], org.netbeans.spi.project.ui.support.ProjectCustomizer.CategoryComponentProvider, java.lang.String, java.awt.event.ActionListener, org.openide.util.HelpCtx) for more details.

Parameters:
valid - set whether this category is valid or not

setErrorMessage

public void setErrorMessage(String message)
Set an errror message for this category which than may be shown in a project customizer.

Parameters:
message - message for this category. To reset a message usually null or an empty string is passed. (similar to behaviour of JTextComponent.setText(String))

setOkButtonListener

public void setOkButtonListener(ActionListener okButtonListener)
Set the action listener that will get notified when the changes in the customizer are to be applied.

Parameters:
okButtonListener - ActionListener to notify
Since:
org.netbeans.modules.projectuiapi/1 1.20

getOkButtonListener

public ActionListener getOkButtonListener()
Returns the action listener associated with this category that gets notified when OK button is pressed on the customizer.

Returns:
instance of ActionListener or null if not set.
Since:
org.netbeans.modules.projectuiapi/1 1.20

setStoreListener

public void setStoreListener(ActionListener listener)
Set the action listener that will get notified when the changes in the customizer are to be applied. Listener is executed after OkButtonListener outside of AWT EventQueue. Usually to be used to save modified files on disk.

Parameters:
listener - ActionListener to notify
Since:
org.netbeans.modules.projectuiapi/1 1.25

getStoreListener

public ActionListener getStoreListener()
Returns the action listener that is executed outside of AWT EQ and is associated with this category that gets notified when OK button is pressed on the customizer.

Returns:
instance of ActionListener or null if not set.
Since:
org.netbeans.modules.projectuiapi/1 1.25

org.netbeans.modules.projectuiapi/1 1.51.1 8

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.