Orbital library

orbital.awt
Class CustomizerViewController

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by orbital.awt.CustomizerViewController
All Implemented Interfaces:
java.awt.event.MouseListener, java.util.EventListener

public class CustomizerViewController
extends java.awt.event.MouseAdapter
implements java.awt.event.MouseListener

This class is a CustomizerViewController that can be registered to a Bean and controls showing a Customizer on double-click.

A default customizer is used, if no Bean-specific customizer has been registered in the BeanInfo class, or no BeanInfo class is available at all. This default customizer is a fully-automatic generic bean customizer and already possesses most features of a good adjustment dialog for customization by the user. While for complex dialogs, it can even be extended by providing advanced information in a BeanInfo class, or by registering new PropertyEditors to the system.

Author:
André Platzer

Constructor Summary
CustomizerViewController(java.awt.Frame parent)
           
CustomizerViewController(java.awt.Frame parent, java.lang.String title)
           
 
Method Summary
static java.beans.Customizer customizerFor(java.lang.Class beanClass)
          Get the Customizer for a specific bean class.
 java.awt.Frame getParent()
           
 java.lang.String getTitle()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
static void setDefaultCustomizerFactory(Function newDefaultCustomizerFactory)
          Set the factory for default customizers.
 void setParent(java.awt.Frame p)
           
 void setTitle(java.lang.String title)
           
 void showCustomizer(java.awt.Component custom, java.lang.String displayName)
          Called to show a customization dialog containing the specified component with the specified display name.
 void showCustomizer(java.lang.Object bean)
           
 void showCustomizer(java.lang.Object bean, java.lang.String displayName)
          Call to show a dialog containing the customizer for a specific bean.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.MouseListener
mouseEntered, mouseExited, mousePressed, mouseReleased
 

Constructor Detail

CustomizerViewController

public CustomizerViewController(java.awt.Frame parent,
                                java.lang.String title)

CustomizerViewController

public CustomizerViewController(java.awt.Frame parent)
Method Detail

getParent

public java.awt.Frame getParent()

setParent

public void setParent(java.awt.Frame p)

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)

setDefaultCustomizerFactory

public static final void setDefaultCustomizerFactory(Function newDefaultCustomizerFactory)
Set the factory for default customizers. This factory is called with a beanClass (of type Class) for which it should instantiate a new default customizer. That customizer is used for beans that do not have a specified bean-specific customizer.


showCustomizer

public void showCustomizer(java.lang.Object bean,
                           java.lang.String displayName)
Call to show a dialog containing the customizer for a specific bean.

Will check to see if bean has a customizer specified in its BeanInfo. Otherwise, will use a default customizer.

Parameters:
bean - the bean to show a customizer for. Can also be a (short) array of beans.
displayName - the name to display for the bean, or null for autodetect.
See Also:
showCustomizer(Component, String), customizerFor(Class)

showCustomizer

public void showCustomizer(java.lang.Object bean)

showCustomizer

public void showCustomizer(java.awt.Component custom,
                           java.lang.String displayName)
Called to show a customization dialog containing the specified component with the specified display name. Simply displays a dialog, customizer properties and events must already have been set.


customizerFor

public static final java.beans.Customizer customizerFor(java.lang.Class beanClass)
                                                 throws java.beans.IntrospectionException
Get the Customizer for a specific bean class.

Will check to see if bean has a customizer specified in its BeanInfo. Otherwise, will use a default customizer.

Throws:
java.beans.IntrospectionException
See Also:
BeanDescriptor.getCustomizerClass(), DefaultCustomizer

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class java.awt.event.MouseAdapter

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.