use of org.jowidgets.api.controller.IShowingStateListener in project jo-client-platform by jo-source.
the class DocumentBeanFormPluginImpl method addBrowserAttribute.
private void addBrowserAttribute(final IContainer container, final IAttribute<?> attribute, final IBeanFormControlFactory controlFactory) {
container.setLayout(new MigLayoutDescriptor("wrap", "0[grow, 0::]0", "0[]0[grow, 0::]0"));
final String propertyName = attribute.getPropertyName();
@SuppressWarnings("unchecked") final IInputControl<IDocument> inputField = (IInputControl<IDocument>) container.add(controlFactory.createControl(propertyName), "growx, w 0::");
final IBrowser browser = container.add(BrowserBPF.browser(), MigLayoutFactory.GROWING_CELL_CONSTRAINTS);
container.addShowingStateListener(new IShowingStateListener() {
@Override
public void showingStateChanged(final boolean isShowing) {
if (isShowing) {
setUrl(container, browser, inputField);
}
}
});
inputField.addInputListener(new IInputListener() {
@Override
public void inputChanged() {
setUrl(container, browser, inputField);
}
});
}
Aggregations