use of com.haulmont.cuba.gui.app.core.dev.LayoutTip in project cuba by cuba-platform.
the class WebLayoutAnalyzerContextMenuProvider method initContextMenu.
@Override
public void initContextMenu(Window window, Component contextMenuTarget) {
ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);
if (clientConfig.getLayoutAnalyzerEnabled()) {
ContextMenu contextMenu = new ContextMenu(contextMenuTarget.unwrap(AbstractComponent.class), true);
MenuItem menuItem = contextMenu.addItem(messages.getMainMessage("actions.analyzeLayout"), c -> {
LayoutAnalyzer analyzer = new LayoutAnalyzer();
List<LayoutTip> tipsList = analyzer.analyze(window);
if (tipsList.isEmpty()) {
window.showNotification("No layout problems found", Frame.NotificationType.HUMANIZED);
} else {
window.openWindow("layoutAnalyzer", WindowManager.OpenType.DIALOG, ParamsMap.of("tipsList", tipsList));
}
});
menuItem.setStyleName("c-cm-item");
}
}
use of com.haulmont.cuba.gui.app.core.dev.LayoutTip in project cuba by cuba-platform.
the class MainTabSheetActionHandler method analyzeLayout.
protected void analyzeLayout(Object target) {
Window window = findWindow((Layout) target);
if (window != null) {
LayoutAnalyzer analyzer = new LayoutAnalyzer();
List<LayoutTip> tipsList = analyzer.analyze(window);
if (tipsList.isEmpty()) {
window.showNotification("No layout problems found", Frame.NotificationType.HUMANIZED);
} else {
window.openWindow("layoutAnalyzer", WindowManager.OpenType.DIALOG, ParamsMap.of("tipsList", tipsList));
}
}
}
Aggregations