use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class TabSheetLoader method createComponent.
@Override
public void createComponent() {
resultComponent = (TabSheet) factory.createComponent(TabSheet.NAME);
loadId(resultComponent, element);
// noinspection unchecked
List<Element> tabElements = element.elements("tab");
for (Element tabElement : tabElements) {
final String name = tabElement.attributeValue("id");
boolean lazy = Boolean.parseBoolean(tabElement.attributeValue("lazy"));
ComponentLoader tabComponentLoader = getLoader(tabElement, TabComponentLoader.class);
TabSheet.Tab tab;
if (lazy) {
tab = resultComponent.addLazyTab(name, tabElement, tabComponentLoader);
} else {
tabComponentLoader.createComponent();
Component tabComponent = tabComponentLoader.getResultComponent();
tab = resultComponent.addTab(name, tabComponent);
pendingLoadComponents.add(tabComponentLoader);
}
pendingLoadTabs.put(tabElement, tab);
}
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebWindow method removeAll.
@Override
public void removeAll() {
getContainer().removeAllComponents();
for (Component childComponent : ownComponents) {
if (childComponent.getId() != null) {
allComponents.remove(childComponent.getId());
}
}
Component[] childComponents = ownComponents.toArray(new Component[ownComponents.size()]);
ownComponents.clear();
for (Component ownComponent : childComponents) {
ownComponent.setParent(null);
}
}
use of com.haulmont.cuba.gui.components.Component in project documentation by cuba-platform.
the class ProductEdit method postInit.
@Override
protected void postInit() {
super.postInit();
Component box = componentsFactory.createComponent(VBoxLayout.class);
Layout vBox = (Layout) WebComponentsHelper.unwrap(box);
SliderServerComponent slider = new SliderServerComponent();
slider.setValue(new double[] { getItem().getMinDiscount(), getItem().getMaxDiscount() });
slider.setMinValue(0);
slider.setMaxValue(100);
slider.setWidth("240px");
slider.setListener(newValue -> {
getItem().setMinDiscount(newValue[0]);
getItem().setMaxDiscount(newValue[1]);
});
vBox.addComponent(slider);
fieldGroup.getFieldNN("slider").setComponent(box);
}
Aggregations