use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebAbstractBox method addLayoutClickListener.
@Override
public void addLayoutClickListener(LayoutClickListener listener) {
getEventRouter().addListener(LayoutClickListener.class, listener);
if (layoutClickListener == null) {
layoutClickListener = event -> {
Component childComponent = findChildComponent(event.getChildComponent());
MouseEventDetails mouseEventDetails = WebWrapperUtils.toMouseEventDetails(event);
LayoutClickEvent layoutClickEvent = new LayoutClickEvent(this, childComponent, mouseEventDetails);
getEventRouter().fireEvent(LayoutClickListener.class, LayoutClickListener::layoutClick, layoutClickEvent);
};
component.addLayoutClickListener(layoutClickListener);
}
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebAbstractOrderedLayout method removeAll.
@Override
public void removeAll() {
component.removeAllComponents();
Component[] components = ownComponents.toArray(new Component[ownComponents.size()]);
ownComponents.clear();
for (Component childComponent : components) {
childComponent.setParent(null);
}
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebAbstractOrderedLayout method addLayoutClickListener.
@Override
public void addLayoutClickListener(LayoutClickListener listener) {
getEventRouter().addListener(LayoutClickListener.class, listener);
if (layoutClickListener == null) {
layoutClickListener = event -> {
Component childComponent = findChildComponent(this, event.getChildComponent());
MouseEventDetails mouseEventDetails = WebWrapperUtils.toMouseEventDetails(event);
LayoutClickEvent layoutClickEvent = new LayoutClickEvent(this, childComponent, mouseEventDetails);
getEventRouter().fireEvent(LayoutClickListener.class, LayoutClickListener::layoutClick, layoutClickEvent);
};
component.addLayoutClickListener(layoutClickListener);
}
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebAccordion method removeTab.
@Override
public void removeTab(String name) {
final Tab tab = tabs.get(name);
if (tab == null) {
throw new IllegalStateException(String.format("Can't find tab '%s'", name));
}
tabs.remove(name);
Component childComponent = tab.getComponent();
com.vaadin.ui.Component vComponent = WebComponentsHelper.unwrap(childComponent);
this.component.removeComponent(vComponent);
tabMapping.remove(vComponent);
childComponent.setParent(null);
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebAccordion method removeAllTabs.
@Override
public void removeAllTabs() {
tabMapping.clear();
component.removeAllComponents();
List<Tab> currentTabs = new ArrayList<>(tabs.values());
tabs.clear();
for (Tab tab : currentTabs) {
Component childComponent = tab.getComponent();
childComponent.setParent(null);
}
}
Aggregations