Class DefaultFloatPolicy
java.lang.Object
org.flexdock.docking.floating.policy.FloatPolicy.NullFloatPolicy
org.flexdock.docking.floating.policy.DefaultFloatPolicy
- All Implemented Interfaces:
FloatPolicy
This class provides an implementation of the
FloatPolicy interface to
provide default behavior for the framework. It blocks floating operations for
Dockables without any frame drag sources, for already floating
Dockables that cannot be reparented within a new dialog, or if global
floating support has been disabled.- Author:
- Christopher Butler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.flexdock.docking.floating.policy.FloatPolicy
FloatPolicy.NullFloatPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultFloatPolicyReturns a singleton instance ofDefaultFloatPolicy.booleanChecks the previousDockingPortfor the specifiedDockingEventand returnsfalseif it is in a floating dialog and contains less than twoDockables.booleanisFloatingAllowed(Dockable dockable) Blocks floating support (returns false) ifdockableisnull, ifFloatPolicyManager.isGlobalFloatingEnabled()returnsfalse, or if there are no entries within theSetreturned bydockable.getFrameDragSources().
-
Constructor Details
-
DefaultFloatPolicy
public DefaultFloatPolicy()
-
-
Method Details
-
getInstance
Returns a singleton instance ofDefaultFloatPolicy.- Returns:
- a singleton instance of
DefaultFloatPolicy.
-
isFloatDropAllowed
Checks the previousDockingPortfor the specifiedDockingEventand returnsfalseif it is in a floating dialog and contains less than twoDockables. A floating dialog may contain multipleDockables, each of which may be dragged out of the current dialog to float in their own dialog. However, if a floating dialog only contains a singleDockable, it makes no sense to remove theDockableonly to float it within another dialog. This situation is caught by this method and the docking operation is blocked.- Specified by:
isFloatDropAllowedin interfaceFloatPolicy- Overrides:
isFloatDropAllowedin classFloatPolicy.NullFloatPolicy- Parameters:
evt- theDockingEventto be checked for drop-to-float support- Returns:
falseif theDockingEventis attempting to float an already floatingDockablewith no otherDockablesin its current dialog;trueotherwise.- See Also:
-
isFloatingAllowed
Blocks floating support (returns false) ifdockableisnull, ifFloatPolicyManager.isGlobalFloatingEnabled()returnsfalse, or if there are no entries within theSetreturned bydockable.getFrameDragSources(). Otherwise, this method returnstrue.- Specified by:
isFloatingAllowedin interfaceFloatPolicy- Overrides:
isFloatingAllowedin classFloatPolicy.NullFloatPolicy- Parameters:
dockable- theDockableto be checked for floating support- Returns:
falseif floating is blocked for the specifiedDockable;trueotherwise.- See Also:
-