use of com.servoy.j2db.smart.SwingRuntimeWindow in project servoy-client by Servoy.
the class DataTextEditor method prepareForTextToolbarHandling.
private void prepareForTextToolbarHandling() {
addFocusListener(new FocusListener() {
public void focusLost(FocusEvent e) {
setTextToolBarComponent(null);
}
public void focusGained(FocusEvent e) {
if (eventExecutor.getValidationEnabled()) {
setTextToolBarComponent(enclosedComponent);
}
// else find mode...
}
});
addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) == HierarchyEvent.PARENT_CHANGED) {
// get the new text toolbar to be used
Container parent = getParent();
while (parent != null && !(parent instanceof MainPanel)) {
parent = parent.getParent();
}
if (parent instanceof MainPanel) {
parentWindow = (SwingRuntimeWindow) application.getRuntimeWindowManager().getWindow(((MainPanel) parent).getContainerName());
} else {
parentWindow = null;
}
}
}
});
}
Aggregations