git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit '919bbc354cd2555eb0955be0ef2dcf338047d022'
[fanfix.git]
/
ui
/
BreadCrumbsBar.java
diff --git
a/ui/BreadCrumbsBar.java
b/ui/BreadCrumbsBar.java
index ed20f92916d6809106bedd430c08b9da1de1526a..ed7e0bb0f9012d710ea113c9064117ec09c0759a 100644
(file)
--- a/
ui/BreadCrumbsBar.java
+++ b/
ui/BreadCrumbsBar.java
@@
-3,7
+3,6
@@
package be.nikiroo.utils.ui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.Dimension;
-import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
@@
-40,12
+39,13
@@
public class BreadCrumbsBar<T> extends ListenerPanel {
}
}
});
}
}
});
-
+
this.add(button, BorderLayout.CENTER);
}
this.add(button, BorderLayout.CENTER);
}
- if (!node.getChildren().isEmpty()) {
- // TODO (see things with icons included in viewer)
+ if ((node.isRoot() && node.getChildren().isEmpty())
+ || !node.getChildren().isEmpty()) {
+ // TODO allow an image or ">", viewer
down = new JToggleButton(">");
final JPopupMenu popup = new JPopupMenu();
down = new JToggleButton(">");
final JPopupMenu popup = new JPopupMenu();
@@
-113,6
+113,8
@@
public class BreadCrumbsBar<T> extends ListenerPanel {
}
});
}
});
+ setSelectedNode(new DataNode<T>(null, null));
+
new SwingWorker<DataNode<T>, Void>() {
@Override
protected DataNode<T> doInBackground() throws Exception {
new SwingWorker<DataNode<T>, Void>() {
@Override
protected DataNode<T> doInBackground() throws Exception {
@@
-123,7
+125,10
@@
public class BreadCrumbsBar<T> extends ListenerPanel {
@Override
protected void done() {
try {
@Override
protected void done() {
try {
- node = get();
+ DataNode<T> node = get();
+
+ setSelectedNode(null);
+ BreadCrumbsBar.this.node = node;
addCrumb(node);
// TODO: option?
addCrumb(node);
// TODO: option?
@@
-152,7
+157,7
@@
public class BreadCrumbsBar<T> extends ListenerPanel {
if (vertical) {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
} else {
if (vertical) {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
} else {
- this.setLayout(new
FlowLayout(Flow
Layout.LEADING));
+ this.setLayout(new
WrapLayout(Wrap
Layout.LEADING));
}
for (BreadCrumb crumb : crumbs) {
}
for (BreadCrumb crumb : crumbs) {