Search in sources :

Example 1 with IBrowser

use of org.jowidgets.addons.widgets.browser.api.IBrowser 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);
        }
    });
}
Also used : IBrowser(org.jowidgets.addons.widgets.browser.api.IBrowser) IShowingStateListener(org.jowidgets.api.controller.IShowingStateListener) IInputControl(org.jowidgets.api.widgets.IInputControl) IInputListener(org.jowidgets.common.widgets.controller.IInputListener) MigLayoutDescriptor(org.jowidgets.common.widgets.layout.MigLayoutDescriptor) IDocument(org.jowidgets.cap.common.api.dto.IDocument)

Aggregations

IBrowser (org.jowidgets.addons.widgets.browser.api.IBrowser)1 IShowingStateListener (org.jowidgets.api.controller.IShowingStateListener)1 IInputControl (org.jowidgets.api.widgets.IInputControl)1 IDocument (org.jowidgets.cap.common.api.dto.IDocument)1 IInputListener (org.jowidgets.common.widgets.controller.IInputListener)1 MigLayoutDescriptor (org.jowidgets.common.widgets.layout.MigLayoutDescriptor)1