站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.0.0

InplaceEditor.Factory (NetBeans Explorer API) - NetBeans API Javadoc 5.0.0

 

org.openide.explorer.propertysheet
Interface InplaceEditor.Factory

Enclosing interface:
InplaceEditor

public static interface InplaceEditor.Factory

A factory for inplace editor instances. A module may provide a property editor which provides a custom inplace editor for any properties of the type it edits. This is accomplished as follows:

A note about using InplaceEditor instances to render properties: If a custom property editor is, as is encouraged, using an instance of its InplaceEditor to paint the value rendered in table cells, this method must not return the instance being used for rendering - that instance may be reconfigured at any time with a different value in order to paint another cell on the property sheet.


Method Summary
 InplaceEditor getInplaceEditor()
          Fetch or create an inplace editor instance.
 

Method Detail

getInplaceEditor

public InplaceEditor getInplaceEditor()
Fetch or create an inplace editor instance. The system guarantees that there will never be more than one open inplace editor at a time, so it is safe to return the same static instance repeatedly from this method - when the editor is opened, it will be configured for the property it is editing. The optimal approach to implementing this method is to create the editor on the first call, and maintain a reference to it using a static field, so a single instance may be shared, but hold the reference to it using java.lang.ref.WeakReference or java.lang.ref.SoftReference, so that the instance may be garbage collected if it is no longer needed.

Returns:
An inplace editor instance

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.