Hi Beni,
I saw that in 1.1.1p4 you increased the focus transfer time.
I tried it myself in 1.1.0 and the result was that sometimes the
focus was transferred back and forth between the main window and an external window.
I can also reproduce it in 1.1.1p5a:
- run tutorial.common.guide.MultipleDockables with eclipse theme
- put 4 on top of 3
3a. pull one of them outside of the main window
or
3b. drag 3 and 4 outside, put them on one stack, pull one of them into the main window
You may need to repeat it a few times (3a, 3b, 3a, 3b, … ).
The important part is that the two dockables are together on a stack and one of them goes
out of the main window (or goes back into the main window).
The focus is rapidly changed between the main window and the external window - flickering effect.
I was thinking of a different solution to the focus problem.
Instead of making sure that the focus is transferred from the tab/min|max|ext button to the content of the dockable,
maybe it’s better to make sure the the tabs and buttons never get focus in the first place?
For example JInternalFrame has BasicInternalFrameTitlePane which contains max, min, close buttons.
Those buttons are NoFocusButtons - normal JButtons with disabled focus.
private class NoFocusButton extends JButton {
private String uiKey;
public NoFocusButton(String uiKey, String opacityKey) {
setFocusPainted(false);
setMargin(new Insets(0,0,0,0));
this.uiKey = uiKey;
Object opacity = UIManager.get(opacityKey);
if (opacity instanceof Boolean) {
setOpaque(((Boolean)opacity).booleanValue());
}
}
public boolean isFocusTraversable() { return false; }
public void requestFocus() {};
public AccessibleContext getAccessibleContext() {
AccessibleContext ac = super.getAccessibleContext();
if (uiKey != null) {
ac.setAccessibleName(UIManager.getString(uiKey));
uiKey = null;
}
return ac;
}
};
kind regards,
Maciej Modelski