Package io.guise.framework.prototype
Class FrameMenuToolPrototypeProvisionStrategy
- java.lang.Object
-
- java.util.concurrent.locks.ReentrantReadWriteLock
-
- io.guise.framework.prototype.AbstractPrototypeProvisionStrategy
-
- io.guise.framework.prototype.AbstractCompositeComponentPrototypeProvisionStrategy
-
- io.guise.framework.prototype.AbstractMenuToolCompositeComponentPrototypeProvisionStrategy
-
- io.guise.framework.prototype.FrameMenuToolPrototypeProvisionStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.concurrent.locks.ReadWriteLock
public class FrameMenuToolPrototypeProvisionStrategy extends AbstractMenuToolCompositeComponentPrototypeProvisionStrategy
The default strategy for keeping track of prototype providers and working with provisioned prototypes, merging them into the current menu and/or a toolbar of a frame. When the prototype providers change provided prototypes, those provided prototypes are processed. This version monitors the parent composite component children and automatically uses top-level prototype providers added to or removed from the hierarchy. Prototype provisions are not processed initially; this strategy should be initialized after construction by callingAbstractPrototypeProvisionStrategy.processPrototypeProvisions()
. This class is thread safe based upon its exposed read and write locks.- Author:
- Garret Wilson
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FrameMenuToolPrototypeProvisionStrategy(Frame frame, PrototypeProvider... defaultPrototypeProviders)
Frame prototype providers constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Menu
getMenu()
protected Frame
getParentComponent()
protected Toolbar
getToolbar()
-
Methods inherited from class io.guise.framework.prototype.AbstractMenuToolCompositeComponentPrototypeProvisionStrategy
add, getLastComponents, processPrototypeProvisions, synchronizePrototypeProvisionMap
-
Methods inherited from class io.guise.framework.prototype.AbstractPrototypeProvisionStrategy
addPrototypeProvider, gatherPrototypeProvisions, getPrototypeProviders, processPrototypeProvisions, removePrototypeProvider
-
Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
getOwner, getQueuedReaderThreads, getQueuedThreads, getQueuedWriterThreads, getQueueLength, getReadHoldCount, getReadLockCount, getWaitingThreads, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, toString, writeLock
-
-
-
-
Constructor Detail
-
FrameMenuToolPrototypeProvisionStrategy
public FrameMenuToolPrototypeProvisionStrategy(Frame frame, PrototypeProvider... defaultPrototypeProviders)
Frame prototype providers constructor.- Parameters:
frame
- The composite component the top-level prototype provider children of which will be monitored.defaultPrototypeProviders
- The default prototype providers that will provide prototypes for processing, outside the children of the composite component parent.- Throws:
java.lang.NullPointerException
- if the given parent component, prototype providers, and/or one or more prototype provider isnull
.
-
-
Method Detail
-
getParentComponent
protected final Frame getParentComponent()
- Overrides:
getParentComponent
in classAbstractCompositeComponentPrototypeProvisionStrategy
- Returns:
- The composite component the top-level prototype provider children of which will be monitored.
-
getMenu
protected Menu getMenu()
- Specified by:
getMenu
in classAbstractMenuToolCompositeComponentPrototypeProvisionStrategy
- Returns:
- The menu being managed, or
null
if no menu is being managed.
-
getToolbar
protected Toolbar getToolbar()
- Specified by:
getToolbar
in classAbstractMenuToolCompositeComponentPrototypeProvisionStrategy
- Returns:
- The toolbar being managed, or
null
if no toolbar is being managed.
-
-