use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebSideMenu method setSidePanelToggleButton.
@Override
public void setSidePanelToggleButton(Button toggleButton) {
if (this.toggleButton != null) {
toggleButton.setAction(null);
}
if (toggleButton != null) {
AbstractAction toggleAction = new AbstractAction("toggleSideMenu") {
@Override
public void actionPerform(Component component) {
toggleSidePanel();
}
};
toggleAction.setCaption(toggleButton.getCaption());
toggleAction.setIcon(toggleButton.getIcon());
toggleAction.setDescription(toggleButton.getDescription());
toggleAction.setEnabled(toggleButton.isEnabled());
toggleAction.setVisible(toggleButton.isVisible());
toggleButton.setAction(toggleAction);
}
this.toggleButton = toggleButton;
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebGridLayout 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 WebHtmlBoxLayout 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 documentation by cuba-platform.
the class Users method init.
@Override
public void init(Map<String, Object> params) {
Map<String, Locale> locales = configuration.getConfig(GlobalConfig.class).getAvailableLocales();
Map<String, Object> options = new TreeMap<>();
for (Map.Entry<String, Locale> entry : locales.entrySet()) {
options.put(entry.getKey(), messages.getTools().localeToString(entry.getValue()));
}
DataGrid.Column column = usersGrid.addGeneratedColumn("language", new DataGrid.ColumnGenerator<User, Component>() {
@Override
public Component getValue(DataGrid.ColumnGeneratorEvent<User> event) {
LookupField component = componentsFactory.createComponent(LookupField.class);
component.setOptionsMap(options);
component.setWidth("100%");
User user = event.getItem();
component.setValue(user.getLanguage());
component.addValueChangeListener(e -> user.setLanguage((String) e.getValue()));
return component;
}
@Override
public Class<Component> getType() {
return Component.class;
}
});
column.setRenderer(new WebComponentRenderer());
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class DesktopButtonsPanel method setFocusableForAllButtons.
public void setFocusableForAllButtons(boolean focusable) {
for (Component button : getComponents()) {
JComponent jButton = DesktopComponentsHelper.unwrap(button);
if (button instanceof DesktopButton) {
((DesktopButton) button).setShouldBeFocused(focusable);
}
jButton.setFocusable(focusable);
}
}
Aggregations