Search in sources :

Example 36 with ClientConfig

use of com.haulmont.cuba.client.ClientConfig in project cuba by cuba-platform.

the class ViewAction method setConfiguration.

@Inject
protected void setConfiguration(Configuration configuration) {
    ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);
    setShortcut(clientConfig.getTableViewShortcut());
}
Also used : ClientConfig(com.haulmont.cuba.client.ClientConfig) Inject(javax.inject.Inject)

Example 37 with ClientConfig

use of com.haulmont.cuba.client.ClientConfig in project cuba by cuba-platform.

the class ExcludeAction method setConfiguration.

@Inject
protected void setConfiguration(Configuration configuration) {
    ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);
    setShortcut(clientConfig.getTableRemoveShortcut());
}
Also used : ClientConfig(com.haulmont.cuba.client.ClientConfig) Inject(javax.inject.Inject)

Example 38 with ClientConfig

use of com.haulmont.cuba.client.ClientConfig in project cuba by cuba-platform.

the class WebAppWorkArea method createCloseShortcut.

protected ShortcutListener createCloseShortcut(RootWindow topLevelWindow) {
    Configuration configuration = beanLocator.get(Configuration.NAME);
    ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);
    String closeShortcut = clientConfig.getCloseShortcut();
    KeyCombination combination = KeyCombination.create(closeShortcut);
    return new ShortcutListenerDelegate("onClose", combination.getKey().getCode(), KeyCombination.Modifier.codes(combination.getModifiers())).withHandler((sender, target) -> closeWindowByShortcut(topLevelWindow));
}
Also used : Configuration(com.haulmont.cuba.core.global.Configuration) ShortcutListenerDelegate(com.haulmont.cuba.web.gui.components.util.ShortcutListenerDelegate) ClientConfig(com.haulmont.cuba.client.ClientConfig)

Example 39 with ClientConfig

use of com.haulmont.cuba.client.ClientConfig in project cuba by cuba-platform.

the class WebAppWorkArea method createNextWindowTabShortcut.

protected ShortcutListener createNextWindowTabShortcut(RootWindow topLevelWindow) {
    Configuration configuration = beanLocator.get(Configuration.NAME);
    ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);
    String nextTabShortcut = clientConfig.getNextTabShortcut();
    KeyCombination combination = KeyCombination.create(nextTabShortcut);
    return new ShortcutListenerDelegate("onNextTab", combination.getKey().getCode(), KeyCombination.Modifier.codes(combination.getModifiers())).withHandler((sender, target) -> {
        TabSheetBehaviour tabSheet = getTabbedWindowContainer().getTabSheetBehaviour();
        if (tabSheet != null && !hasModalWindow() && tabSheet.getComponentCount() > 1) {
            com.vaadin.ui.Component selectedTabComponent = tabSheet.getSelectedTab();
            String tabId = tabSheet.getTab(selectedTabComponent);
            int tabPosition = tabSheet.getTabPosition(tabId);
            int newTabPosition = (tabPosition + 1) % tabSheet.getComponentCount();
            String newTabId = tabSheet.getTab(newTabPosition);
            tabSheet.setSelectedTab(newTabId);
            moveFocus(tabSheet, newTabId);
        }
    });
}
Also used : Configuration(com.haulmont.cuba.core.global.Configuration) ShortcutListenerDelegate(com.haulmont.cuba.web.gui.components.util.ShortcutListenerDelegate) ClientConfig(com.haulmont.cuba.client.ClientConfig) Component(com.vaadin.ui.Component)

Example 40 with ClientConfig

use of com.haulmont.cuba.client.ClientConfig in project cuba by cuba-platform.

the class WebSearchPickerField method afterPropertiesSet.

@Override
public void afterPropertiesSet() {
    super.afterPropertiesSet();
    Configuration configuration = beanLocator.get(Configuration.NAME, Configuration.class);
    ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);
    setPageLength(clientConfig.getLookupFieldPageLength());
}
Also used : Configuration(com.haulmont.cuba.core.global.Configuration) ClientConfig(com.haulmont.cuba.client.ClientConfig)

Aggregations

ClientConfig (com.haulmont.cuba.client.ClientConfig)40 Configuration (com.haulmont.cuba.core.global.Configuration)14 Messages (com.haulmont.cuba.core.global.Messages)6 Inject (javax.inject.Inject)6 Icons (com.haulmont.cuba.gui.icons.Icons)5 Element (org.dom4j.Element)5 com.haulmont.cuba.gui.components (com.haulmont.cuba.gui.components)3 AbstractAction (com.haulmont.cuba.gui.components.AbstractAction)3 Component (com.haulmont.cuba.gui.components.Component)3 ShortcutListenerDelegate (com.haulmont.cuba.web.gui.components.util.ShortcutListenerDelegate)3 EventRouter (com.haulmont.bali.events.EventRouter)2 Preconditions (com.haulmont.bali.util.Preconditions)2 Preconditions.checkNotNullArgument (com.haulmont.bali.util.Preconditions.checkNotNullArgument)2 MetaClass (com.haulmont.chile.core.model.MetaClass)2 Entity (com.haulmont.cuba.core.entity.Entity)2 AppBeans (com.haulmont.cuba.core.global.AppBeans)2 TopLevelFrame (com.haulmont.cuba.desktop.TopLevelFrame)2 com.haulmont.cuba.gui (com.haulmont.cuba.gui)2 LayoutAnalyzer (com.haulmont.cuba.gui.app.core.dev.LayoutAnalyzer)2 Action (com.haulmont.cuba.gui.components.Action)2