-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP of documenting the Dockable interface. Attempting to better learn…
… Writerside and its special feature set.
- Loading branch information
1 parent
cc07cf4
commit 688ee51
Showing
6 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,84 @@ | ||
# Dockable Interface | ||
|
||
Start typing here... | ||
The `Dockable` interface is required to be implemented by the application on any component it wishes to dock. | ||
Typically, this interface is implemented by a class that extends from `JPanel`. | ||
|
||
The `Dockable` interface has a minimum subset of methods that must be implemented by the application and a set of methods that are optional. | ||
These optional methods provide extra customization points for the application per dockable. | ||
|
||
<warning> | ||
The return values for the `Dockable` interface methods should be constant after the creation of the dockable component. | ||
Certain methods can be dynamic and the framework provides methods to update their values within the framework. Any method that doesn't specify such | ||
a method can lead to unexpected behavior if changed after the dockable component is created. | ||
|
||
Generally, if you wish to modify the return values after creating the dockable component, do so while the dockable is not docked. This can be checked with <b>Docking.isDocked</b>. | ||
</warning> | ||
|
||
## Mandatory Methods | ||
|
||
These two methods do not provide default implementations in the interface and must be implemented by the application. | ||
|
||
### getPersistentID | ||
|
||
`getPersistentID` provides a unique ID that the framework can use to refer to the dockable. This is the main piece of information that the application | ||
and the framework share in order to refer to specific dockables. | ||
|
||
### getTabText | ||
|
||
`getTabText` provides the text that should be displayed on a tab when this dockable is in a `JTabbedPane`. | ||
|
||
<note>If the text displayed on the tab ever changes, the application must call <b>Docking.updateTabText</b> with the dockables persistentID to force the framework to update the text. This should be done anytime the text is changed, just in case the dockable is displaying in a JTabbedPane</note> | ||
|
||
## Optional Methods | ||
|
||
All the following methods are provided to the application with a default. This means the application only needs to implement the methods | ||
if it wishes to change the default. | ||
|
||
### getType | ||
|
||
<!-- This one is a bit weird and complicated. It's really just a hack, and we should add something better. --> | ||
|
||
### getTabTooltip | ||
|
||
### getIcon | ||
|
||
Used by the framework to get the icon for the dockable to use in a `JTabbedPane` tab. | ||
|
||
### isFloatingAllowed | ||
|
||
Allows the application to specify whether a dockable can be dragged out of its current window and floated on its own as a new window. | ||
|
||
### isLimitedToRoot | ||
<procedure title="isLimitedToRoot" id="isLimitedToRoot"> | ||
<p>Before adding something, create it.</p> | ||
<step>Do this.</step> | ||
<step>Do that.</step> | ||
<p>Default value is <code>false</code></p> | ||
</procedure> | ||
Allows the application to limit the dockable to the window it was initially docked in. | ||
|
||
### getStyle | ||
|
||
### getPinningStyle | ||
|
||
to be renamed | ||
|
||
### isClosable | ||
|
||
### isPinningAllowed | ||
|
||
### isMinMaxAllowed | ||
|
||
### isWrappableInScrollpane | ||
|
||
### getHasMoreOptions | ||
|
||
### getTabPosition | ||
|
||
### addMoreOptions | ||
|
||
### createHeaderUI | ||
|
||
### updateProperties | ||
|
||
<!-- todo: should updateProperties be mandatory? it'll probably be easy to forget if you start adding properties to dockables --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dockable Properties | ||
|
||
Start typing here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# Persistence | ||
|
||
Start typing here... | ||
defaults to off | ||
|
||
turn on with setPersist | ||
|
||
setPersistFile to customize what file the framework persists to | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters