|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pushingpixels.flamingo.api.bcb.BreadcrumbBarCallBack<java.lang.String>
org.pushingpixels.flamingo.api.bcb.core.BreadcrumbMultiSvnSelector.PathCallback
protected class BreadcrumbMultiSvnSelector.PathCallback
SVN-specific implementation of the BreadcrumbBarCallBack
.
This is tricky. Unlike other implementations that connect in the setup
method, this implementation connects when the first path selection is
done. The code in
BasicBreadcrumbBar.PopupAction.actionPerformed(ActionEvent) adds two
items - the selected SVN repository and the matching choices. The first
addition requires connecting to the selected repository, which is done
off EDT (using SwingWorker
). The second addition must wait until
the connection has been established since otherwise the repository is not
yet available. In order to make the second addition wait, we use a
CountDownLatch
.
It is CountDownLatch.countDown()
in the
SwingWorker.done()
that wraps the connection. The
BreadcrumbBarCallBack.getPathChoices(java.util.List)
and
BreadcrumbBarCallBack.getLeafs(java.util.List)
call
CountDownLatch.await()
on the same latch that blocks until the
connection is done. Since both these methods should be wrapped off EDT in
a separate SwingWorker
, this doesn't block the UI.
Field Summary | |
---|---|
protected java.util.List<BreadcrumbMultiSvnSelector.SvnRepositoryInfo> |
repositories
Information on all the configured SVN repositories. |
Fields inherited from class org.pushingpixels.flamingo.api.bcb.BreadcrumbBarCallBack |
---|
throwsExceptions |
Constructor Summary | |
---|---|
BreadcrumbMultiSvnSelector.PathCallback(BreadcrumbMultiSvnSelector.SvnRepositoryInfo... repoList)
Creates a new callback. |
Method Summary | |
---|---|
void |
addSvnRepositoryInfo(BreadcrumbMultiSvnSelector.SvnRepositoryInfo repositoryInfo)
Adds information on a new SVN repository. |
java.io.InputStream |
getLeafContent(java.lang.String leaf)
Returns the input stream with the leaf content. |
java.util.List<StringValuePair<java.lang.String>> |
getLeafs(java.util.List<BreadcrumbItem<java.lang.String>> path)
Returns the choice element that corresponds to the specified path. |
java.util.List<StringValuePair<java.lang.String>> |
getPathChoices(java.util.List<BreadcrumbItem<java.lang.String>> path)
Returns the choice element that corresponds to the specified path. |
void |
setup()
Sets up the callback. |
Methods inherited from class org.pushingpixels.flamingo.api.bcb.BreadcrumbBarCallBack |
---|
setThrowsExceptions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<BreadcrumbMultiSvnSelector.SvnRepositoryInfo> repositories
Constructor Detail |
---|
public BreadcrumbMultiSvnSelector.PathCallback(BreadcrumbMultiSvnSelector.SvnRepositoryInfo... repoList)
repoList
- List of all SVN repositories.Method Detail |
---|
public void addSvnRepositoryInfo(BreadcrumbMultiSvnSelector.SvnRepositoryInfo repositoryInfo)
repositoryInfo
- public void setup()
BreadcrumbBarCallBack
setup
in class BreadcrumbBarCallBack<java.lang.String>
public java.util.List<StringValuePair<java.lang.String>> getPathChoices(java.util.List<BreadcrumbItem<java.lang.String>> path) throws BreadcrumbBarException
BreadcrumbBarCallBack
null
should be returned. If path is
null
, the "root" elements should be returned
getPathChoices
in class BreadcrumbBarCallBack<java.lang.String>
path
- Breadcrumb bar path.
BreadcrumbBarException
- Runtime exception that wraps the cause. Is thrown only when
BreadcrumbBarCallBack.setThrowsExceptions(boolean)
has been called with
true
parameter.public java.util.List<StringValuePair<java.lang.String>> getLeafs(java.util.List<BreadcrumbItem<java.lang.String>> path) throws BreadcrumbBarException
BreadcrumbBarCallBack
null
should be returned. If path is
null
, the "root" elements should be returned
getLeafs
in class BreadcrumbBarCallBack<java.lang.String>
path
- Breadcrumb bar path.
BreadcrumbBarException
- Runtime exception that wraps the cause. Is thrown only when
BreadcrumbBarCallBack.setThrowsExceptions(boolean)
has been called with
true
parameter.public java.io.InputStream getLeafContent(java.lang.String leaf) throws BreadcrumbBarException
BreadcrumbBarCallBack
null
if this is not applicable.
getLeafContent
in class BreadcrumbBarCallBack<java.lang.String>
leaf
- Leaf.
null
if
this is not applicable.
BreadcrumbBarException
- Runtime exception that wraps the cause. Is thrown only when
BreadcrumbBarCallBack.setThrowsExceptions(boolean)
has been called with
true
parameter.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |