java.lang.Object
org.proto4j.swing.AbstractEntry<G>
- Type Parameters:
 G- the GUI's type
- All Implemented Interfaces:
 Entry<G>
public abstract class AbstractEntry<G> extends java.lang.Object implements Entry<G>
This class provides basic operations for the 
Entry.
 
 It comes with two important methods: linkAction(Object) and
 start(Object...). Their implementation is standardized, so there
 is no need for external implementation.
- 
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractEntry(java.lang.Class<G> type)Create a newAbstractEntryobject. - 
Method Summary
Modifier and Type Method Description protected voidaddListener(java.lang.Object listener, AnnotationContext<ActionHandler> ctx)abstract <E extends java.util.EventListener>
EcreateListener(java.lang.Class<E> cls, java.lang.Object ls, java.lang.Object parent)A simple delegation method to provide theEventListenerobject.java.lang.Class<G>getType()voidlinkAction(java.lang.Object src)Searches for theActionHandlerannotation and tries to link the given EventListener to the specified target.<T extends java.util.EventListener>
booleanlinkAction(java.lang.String fieldName, java.lang.Class<T> cls, T listener)Tries to link the given EventListener to the specified target.voidstart(java.lang.Object... args)Searches for theEntryPointannotation and executes the method with it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.proto4j.swing.Entry
getDeclaredField, getDeclaredField, getDeclaredFields, getGUI, getNestedGUI, getNestedGUI, getNestedGUIs, putField, putNestedGUI, setGUI 
- 
Constructor Details
- 
AbstractEntry
Create a newAbstractEntryobject.- Parameters:
 type- the GUI's type
 
 - 
 - 
Method Details
- 
createListener
public abstract <E extends java.util.EventListener> E createListener(java.lang.Class<E> cls, java.lang.Object ls, java.lang.Object parent)A simple delegation method to provide theEventListenerobject.- Type Parameters:
 E- the event listener type- Parameters:
 cls- theEventListenerclassls- the listener object - currently either directly theEventListeneror aMethodthat should be casted to theEventListener.parent- the declaring object- Returns:
 - the 
EventListenerinstance 
 - 
getType
 - 
start
public void start(java.lang.Object... args) throws java.lang.NullPointerExceptionSearches for theEntryPointannotation and executes the method with it. - 
linkAction
public void linkAction(java.lang.Object src)Searches for theActionHandlerannotation and tries to link the given EventListener to the specified target.- Specified by:
 linkActionin interfaceEntry<G>- Parameters:
 src- the event listener object
 - 
linkAction
public <T extends java.util.EventListener> boolean linkAction(java.lang.String fieldName, java.lang.Class<T> cls, T listener)Description copied from interface:EntryTries to link the given EventListener to the specified target.- Specified by:
 linkActionin interfaceEntry<G>- Type Parameters:
 T- the listener type- Parameters:
 fieldName- the target field namecls- the listener base classlistener- the event listener object- Returns:
 trueif the listener has been added successfully
 - 
addListener
 
 -