use of com.vaadin.ui.TreeGrid in project catma by forTEXT.
the class TagSelectionPanel method initComponents.
private void initComponents() {
setSizeFull();
tagsetGrid = TreeGridFactory.createDefaultTreeGrid();
tagsetGrid.setSizeFull();
tagsetGrid.addStyleNames("flat-undecorated-icon-buttonrenderer");
tagsetGrid.setSizeFull();
tagsetGrid.setSelectionMode(SelectionMode.SINGLE);
tagsetGrid.addStyleName(MaterialTheme.GRID_BORDERLESS);
Label tagsetsLabel = new Label("Tagsets");
tagsetGridComponent = new ActionGridComponent<TreeGrid<TagsetTreeItem>>(tagsetsLabel, tagsetGrid);
tagsetGridComponent.setSizeFull();
addComponent(tagsetGridComponent);
}
use of com.vaadin.ui.TreeGrid in project catma by forTEXT.
the class TagsView method initComponents.
private void initComponents() {
getHugeCardBar().setMoreOptionsButtonVisible(false);
HorizontalLayout content = new HorizontalLayout();
content.setSizeFull();
tagsetGrid = TreeGridFactory.createDefaultTreeGrid();
tagsetGrid.addStyleNames("flat-undecorated-icon-buttonrenderer");
tagsetGrid.setSizeFull();
tagsetGrid.setSelectionMode(SelectionMode.SINGLE);
tagsetGrid.addStyleName(MaterialTheme.GRID_BORDERLESS);
Label tagsetsLabel = new Label("Tagsets");
tagsetGridComponent = new ActionGridComponent<TreeGrid<TagsetTreeItem>>(tagsetsLabel, tagsetGrid);
resourcePanel = new TagResourcePanel(project, eventBus);
drawer = new SliderPanelBuilder(resourcePanel).mode(SliderMode.LEFT).expanded(false).build();
addComponent(content);
setExpandRatio(content, 1f);
content.addComponent(drawer);
content.addComponent(tagsetGridComponent);
content.setExpandRatio(tagsetGridComponent, 1f);
}
use of com.vaadin.ui.TreeGrid in project catma by forTEXT.
the class ResourcePermissionView method initComponents.
private void initComponents() {
HorizontalLayout content = new HorizontalLayout();
content.setSizeFull();
content.setMargin(new MarginInfo(true, false, true, true));
content.setSpacing(false);
setCaption("Resource permissions");
setWidth("85%");
setHeight("90%");
setModal(true);
permissionGrid = TreeGridFactory.createDefaultTreeGrid();
permissionGrid.setSizeFull();
permissionGrid.setRowHeight(45);
permissionGrid.setHeaderVisible(true);
permissionGrid.getEditor().setEnabled(true);
permissionGrid.getEditor().setBuffered(false);
permissionGridComponent = new ActionGridComponent<TreeGrid<Resource>>(new Label("Resource specific permissions"), permissionGrid);
permissionGridComponent.setSizeFull();
permissionGridComponent.setSelectionModeFixed(SelectionMode.SINGLE);
permissionGridComponent.getActionGridBar().setMargin(new MarginInfo(false, false, false, true));
permissionGridComponent.getActionGridBar().setMoreOptionsBtnVisible(false);
content.addComponent(permissionGridComponent);
content.setExpandRatio(permissionGridComponent, 1f);
HelpWindow helpWindow = new HelpWindow("Resource permissions", "<p>The resource permission matrix gives you an overview of the resource specific permissions for each team member.</p>" + "<p>By default it shows team members with changeable resource roles only. But you can add columns for all team members by using the show/hide columns menu in the upper right corner of the table</p>" + "<p>You can change resource specific roles only. Double click on a resource row to set a new resource specific role for a team member. To change Project roles go to the team section of the Project view.</p>" + "<p>Note that higher roles on the Project level cannot be overwritten by lower roles on the resource level. In fact it is not even possible to set lower roles in such cases.</p>");
Button btHelp = helpWindow.createHelpWindowButton();
content.addComponent(btHelp);
content.setComponentAlignment(btHelp, Alignment.TOP_RIGHT);
setContent(content);
}
use of com.vaadin.ui.TreeGrid in project catma by forTEXT.
the class ProjectView method initResourceContent.
/**
* initialize the resource part
* @return
*/
private Component initResourceContent() {
HorizontalFlexLayout resourceContent = new HorizontalFlexLayout();
documentGrid = TreeGridFactory.createDefaultTreeGrid();
documentGrid.addStyleNames(// $NON-NLS-1$
"flat-undecorated-icon-buttonrenderer");
documentGrid.setHeaderVisible(false);
documentGrid.setRowHeight(45);
documentGrid.addColumn(resource -> resource.getIcon(), new HtmlRenderer()).setWidth(100);
Function<Resource, String> buildNameFunction = (resource) -> {
StringBuilder sb = new StringBuilder().append(// $NON-NLS-1$
"<div class='documentsgrid__doc'> ").append(// $NON-NLS-1$
"<div class='documentsgrid__doc__title'> ").append(resource.getName()).append(// $NON-NLS-1$
"</div>");
if (resource.hasDetail()) {
sb.append(// $NON-NLS-1$
"<span class='documentsgrid__doc__author'> ").append(resource.getDetail()).append(// $NON-NLS-1$
"</span>");
}
// $NON-NLS-1$
sb.append("</div>");
return sb.toString();
};
documentGrid.addColumn(resource -> buildNameFunction.apply(resource), new HtmlRenderer()).setCaption("Name").setId(DocumentGridColumn.NAME.name()).setWidth(300);
documentGrid.addColumn(res -> res.getPermissionIcon(), new HtmlRenderer()).setCaption("Permission").setExpandRatio(1);
Label documentsAnnotations = new Label("Documents & Annotations");
documentGridComponent = new ActionGridComponent<TreeGrid<Resource>>(documentsAnnotations, documentGrid);
// $NON-NLS-1$
documentGridComponent.addStyleName("project-view-action-grid");
resourceContent.addComponent(documentGridComponent);
tagsetGrid = new Grid<>();
tagsetGrid.setHeaderVisible(false);
// $NON-NLS-1$
tagsetGrid.setWidth("400px");
tagsetGrid.addColumn(tagset -> VaadinIcons.TAGS.getHtml(), new HtmlRenderer()).setWidth(100);
tagsetGrid.addColumn(tagset -> tagset.getName()).setId(TagsetGridColumn.NAME.name()).setCaption("Name").setWidth(300);
Label tagsetsAnnotations = new Label("Tagsets");
tagsetGridComponent = new ActionGridComponent<Grid<TagsetDefinition>>(tagsetsAnnotations, tagsetGrid);
// $NON-NLS-1$
tagsetGridComponent.addStyleName("project-view-action-grid");
resourceContent.addComponent(tagsetGridComponent);
return resourceContent;
}
use of com.vaadin.ui.TreeGrid in project catma by forTEXT.
the class AnnotateResourcePanel method initComponents.
private void initComponents() {
addStyleName("annotate-resource-panel");
Label documentTreeLabel = new Label("Documents & Annotations");
documentTree = TreeGridFactory.createDefaultTreeGrid();
documentTree.addStyleNames("resource-grid", "flat-undecorated-icon-buttonrenderer");
ButtonRenderer<DocumentTreeItem> documentSelectionRenderer = new ButtonRenderer<DocumentTreeItem>(documentSelectionClick -> handleVisibilityClickEvent(documentSelectionClick));
documentSelectionRenderer.setHtmlContentAllowed(true);
Column<DocumentTreeItem, String> selectionColumn = documentTree.addColumn(documentTreeItem -> documentTreeItem.getSelectionIcon(), documentSelectionRenderer).setWidth(100);
documentTree.setHierarchyColumn(selectionColumn);
documentTree.addColumn(documentTreeItem -> documentTreeItem.getName()).setCaption("Name").setWidth(150);
documentTree.setHeight("250px");
documentTree.addColumn(documentTreeItem -> documentTreeItem.getPermissionIcon(), new HtmlRenderer()).setWidth(50);
documentTree.addColumn(documentTreeItem -> documentTreeItem.getIcon(), new HtmlRenderer()).setExpandRatio(1);
documentActionGridComponent = new ActionGridComponent<TreeGrid<DocumentTreeItem>>(documentTreeLabel, documentTree);
documentActionGridComponent.getActionGridBar().setMoreOptionsBtnVisible(false);
addComponent(documentActionGridComponent);
Label tagsetLabel = new Label("Tagsets");
tagsetGrid = new Grid<>();
tagsetGrid.addStyleNames("resource-grid", "flat-undecorated-icon-buttonrenderer", "no-focused-before-border");
tagsetGrid.setHeight("250px");
tagsetGrid.addColumn(tagset -> tagset.getName()).setCaption("Name").setWidth(150);
tagsetGrid.addColumn(tagset -> project.hasPermission(project.getRoleForTagset(tagset.getUuid()), RBACPermission.TAGSET_WRITE) ? VaadinIcons.UNLOCK.getHtml() : VaadinIcons.LOCK.getHtml(), new HtmlRenderer()).setWidth(50);
tagsetGrid.addColumn(tagset -> VaadinIcons.TAGS.getHtml(), new HtmlRenderer()).setExpandRatio(1);
tagsetActionGridComponent = new ActionGridComponent<Grid<TagsetDefinition>>(tagsetLabel, tagsetGrid);
tagsetActionGridComponent.setSelectionModeFixed(SelectionMode.MULTI);
tagsetActionGridComponent.getActionGridBar().setMoreOptionsBtnVisible(false);
tagsetActionGridComponent.getActionGridBar().setMargin(new MarginInfo(false, false, false, true));
addComponent(tagsetActionGridComponent);
}
Aggregations