protected SettingsClient getSettingsClient() { if (settingsClient == null) { settingsClient = AppBeans.get(SettingsClient.NAME); } return settingsClient; }
/** * Creates an action with the given id. * @param target component containing this action */ public static RefreshAction create(ListComponent target, String id) { return AppBeans.getPrototype("cuba_RefreshAction", target, id); }
/** * Checks if attribute access enabled (if SetupAttributeAccessHandlers exist) */ public boolean isAttributeAccessEnabled() { Map<String, SetupAttributeAccessHandler> handlers = AppBeans.getAll(SetupAttributeAccessHandler.class); return handlers != null && !handlers.isEmpty(); }
/** * Creates an action with default id. * @param target component containing this action * @param openType how to open the editor screen */ public static CreateAction create(ListComponent target, WindowManager.OpenType openType) { return AppBeans.getPrototype("cuba_CreateAction", target, openType); }
protected Collection<PredefinedDateInterval> getPredefinedDateIntervals() { List<PredefinedDateInterval> intervals = new ArrayList<>(AppBeans.getAll(PredefinedDateInterval.class).values()); intervals.sort(new AnnotationAwareOrderComparator()); return intervals; }
/** * Creates an action with default id. Autocommit is set to true. * @param target component containing this action */ public static RemoveAction create(ListComponent target) { return AppBeans.getPrototype("cuba_RemoveAction", target); }
protected List<HttpRequestFilter> getHttpRequestFilterBeans() { Map<String, HttpRequestFilter> beanFilters = AppBeans.getAll(HttpRequestFilter.class); List<HttpRequestFilter> availableFilters = new ArrayList<>(beanFilters.values()); AnnotationAwareOrderComparator.sort(availableFilters); return availableFilters; }
/** * Creates an action with the given id. * @param target component containing this action * @param autocommit whether to commit datasource immediately * @param id action's identifier */ public static RemoveAction create(ListComponent target, boolean autocommit, String id) { return AppBeans.getPrototype("cuba_RemoveAction", target, autocommit, id); }
@Nullable protected PredefinedDateInterval getIntervalByName(String name) { Optional<PredefinedDateInterval> result = AppBeans.getAll(PredefinedDateInterval.class).values() .stream() .filter(interval -> name.equals(interval.getName())) .findFirst(); return (result.isPresent()) ? result.get() : null; }
/** * Creates an action with the given id. * @param target component containing this action * @param autocommit whether to commit datasource immediately * @param confirm whether to show the confirmation dialog to user * @param id action's name */ public static ExcludeAction create(ListComponent target, boolean autocommit, boolean confirm, String id) { return AppBeans.getPrototype("cuba_ExcludeAction", target, autocommit, confirm, id); }
protected EncryptionModule getEncryptionModule(String hashMethod) { Map<String, EncryptionModule> encryptionModules = AppBeans.getAll(EncryptionModule.class); for (EncryptionModule module : encryptionModules.values()) { if (Objects.equals(hashMethod, module.getHashMethod())) { return module; } } throw new UnsupportedHashMethodException(); } }
/** * Creates an action with default id. * @param target component containing this action * @param display ExportDisplay implementation */ public static ExcelAction create(ListComponent target, ExportDisplay display) { return AppBeans.getPrototype("cuba_ExcelAction", target, display); }
/** * Get special meta property path object for dynamic attribute by code */ @Nullable public static MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, String attributeCode) { return AppBeans.get(DynamicAttributesTools.NAME, DynamicAttributesTools.class) .getMetaPropertyPath(metaClass, attributeCode); }
@Override public UI createInstance(UICreateEvent event) { return AppBeans.getPrototype(AppUI.NAME); } }
@Override public String getLocCaption() { if (Strings.isNullOrEmpty(caption)) { Messages messages = AppBeans.get(Messages.class); return messages.getMainMessage("filter.ftsCondition.caption"); } else { MessageTools messageTools = AppBeans.get(MessageTools.class); return messageTools.loadString(messagesPack, caption); } }