Search in sources :

Example 1 with FieldUpdater

use of com.google.gwt.cell.client.FieldUpdater in project che by eclipse.

the class ResetFilesViewImpl method initColumns.

/** Initialize the columns of the grid. */
private void initColumns() {
    indexFiles = new CellTable<IndexFile>();
    // Create files column:
    Column<IndexFile, String> filesColumn = new Column<IndexFile, String>(new TextCell()) {

        @Override
        public String getValue(IndexFile file) {
            return file.getPath();
        }
    };
    // Create column with checkboxes:
    Column<IndexFile, Boolean> checkColumn = new Column<IndexFile, Boolean>(new CheckboxCell(false, true)) {

        @Override
        public Boolean getValue(IndexFile file) {
            return !file.isIndexed();
        }
    };
    // Create bean value updater:
    FieldUpdater<IndexFile, Boolean> checkFieldUpdater = new FieldUpdater<IndexFile, Boolean>() {

        @Override
        public void update(int index, IndexFile file, Boolean value) {
            file.setIndexed(!value);
        }
    };
    checkColumn.setFieldUpdater(checkFieldUpdater);
    filesColumn.setHorizontalAlignment(ALIGN_LEFT);
    indexFiles.addColumn(checkColumn, new SafeHtml() {

        @Override
        public String asString() {
            return "&nbsp;";
        }
    });
    indexFiles.setColumnWidth(checkColumn, 1, Style.Unit.PCT);
    indexFiles.addColumn(filesColumn, FILES);
    indexFiles.setColumnWidth(filesColumn, 35, Style.Unit.PCT);
    indexFiles.addStyleName(resources.gitCSS().cells());
}
Also used : FieldUpdater(com.google.gwt.cell.client.FieldUpdater) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) IndexFile(org.eclipse.che.api.git.shared.IndexFile) TextCell(com.google.gwt.cell.client.TextCell) Column(com.google.gwt.user.cellview.client.Column) CheckboxCell(com.google.gwt.cell.client.CheckboxCell)

Example 2 with FieldUpdater

use of com.google.gwt.cell.client.FieldUpdater in project perun by CESNET.

the class JsonUtils method addCustomCellColumn.

/**
	 * Returns a column with Object as value which is rendered by custom Cell
	 *
	 * @param <R> the row type
	 * @param cell the cell used to render the column
	 * @param fieldUpdater Field updater - on click action
	 */
public static <R> Column<R, R> addCustomCellColumn(Cell<R> cell, final FieldUpdater<R, String> fieldUpdater) {
    Column<R, R> column = new Column<R, R>(cell) {

        @Override
        public R getValue(R object) {
            return object;
        }

        @Override
        public String getCellStyleNames(Cell.Context context, R object) {
            if (fieldUpdater != null) {
                return super.getCellStyleNames(context, object) + " pointer";
            } else {
                return super.getCellStyleNames(context, object);
            }
        }
    };
    if (fieldUpdater != null) {
        FieldUpdater<R, R> tableFieldUpdater2 = new FieldUpdater<R, R>() {

            public void update(int index, R object, R value) {
                GeneralObject go = (GeneralObject) value;
                fieldUpdater.update(index, object, go.getName());
            }
        };
        column.setFieldUpdater(tableFieldUpdater2);
    }
    return column;
}
Also used : FieldUpdater(com.google.gwt.cell.client.FieldUpdater) Column(com.google.gwt.user.cellview.client.Column) GeneralObject(cz.metacentrum.perun.webgui.model.GeneralObject)

Example 3 with FieldUpdater

use of com.google.gwt.cell.client.FieldUpdater in project perun by CESNET.

the class GetAttributesDefinition method getTable.

/**
	 * Returns table widget with attributes definitions
	 *
	 * @return table widget
	 */
public CellTable<AttributeDefinition> getTable() {
    retrieveData();
    // Table data provider.
    dataProvider = new ListDataProvider<AttributeDefinition>(list);
    // Cell table
    table = new PerunTable<AttributeDefinition>(list);
    // Connect the table to the data provider.
    dataProvider.addDataDisplay(table);
    // Sorting
    ListHandler<AttributeDefinition> columnSortHandler = new ListHandler<AttributeDefinition>(dataProvider.getList());
    table.addColumnSortHandler(columnSortHandler);
    // table selection
    table.setSelectionModel(selectionModel, DefaultSelectionEventManager.<AttributeDefinition>createCheckboxManager());
    // set empty content & loader
    table.setEmptyTableWidget(loaderImage);
    loaderImage.setEmptyResultMessage("No attribute defined in Perun.");
    // checkbox column column
    if (checkable) {
        table.addCheckBoxColumn();
    }
    // ID COLUMN
    table.addIdColumn("Attr ID", tableFieldUpdater, 100);
    // FRIENDLY NAME COLUMN
    final Column<AttributeDefinition, AttributeDefinition> friendlyNameColumn = JsonUtils.addColumn(new PerunAttributeFriendlyNameCell((tableFieldUpdater != null) ? "customClickableTextCell" : ""), new JsonUtils.GetValue<AttributeDefinition, AttributeDefinition>() {

        public AttributeDefinition getValue(AttributeDefinition object) {
            return object;
        }
    }, (tableFieldUpdater != null) ? new FieldUpdater<AttributeDefinition, AttributeDefinition>() {

        @Override
        public void update(int index, AttributeDefinition object, AttributeDefinition value) {
            // pass field updater to original one
            if (tableFieldUpdater != null)
                tableFieldUpdater.update(index, object, value.getFriendlyName());
        }
    } : null);
    // ENTITY COLUMN
    final Column<AttributeDefinition, String> entityColumn = JsonUtils.addColumn(new JsonUtils.GetValue<AttributeDefinition, String>() {

        public String getValue(AttributeDefinition object) {
            return object.getEntity();
        }
    }, tableFieldUpdater);
    // DEFINITION COLUMN
    final Column<AttributeDefinition, String> definitionColumn = JsonUtils.addColumn(new JsonUtils.GetValue<AttributeDefinition, String>() {

        public String getValue(AttributeDefinition object) {
            return object.getDefinition();
        }
    }, tableFieldUpdater);
    // TYPE COLUMN
    final Column<AttributeDefinition, String> typeColumn = JsonUtils.addColumn(new JsonUtils.GetValue<AttributeDefinition, String>() {

        public String getValue(AttributeDefinition object) {
            if (object.getType() != null) {
                return object.getType().substring(object.getType().lastIndexOf(".") + 1);
            }
            return "";
        }
    }, tableFieldUpdater);
    // DESCRIPTION COLUMN
    final Column<AttributeDefinition, String> descriptionColumn = new Column<AttributeDefinition, String>(new TextInputCell()) {

        public String getValue(AttributeDefinition attrDef) {
            if (attrDef.getDescription() == null) {
                return "";
            } else {
                return attrDef.getDescription();
            }
        }
    };
    descriptionColumn.setFieldUpdater(new FieldUpdater<AttributeDefinition, String>() {

        @Override
        public void update(int i, final AttributeDefinition attributeDefinition, final String s) {
            attributeDefinition.setDescription(s.trim());
            selectionModel.setSelected(attributeDefinition, true);
        }
    });
    // DISPLAY NAME COLUMN
    final Column<AttributeDefinition, String> displayNameColumn = new Column<AttributeDefinition, String>(new TextInputCell()) {

        public String getValue(AttributeDefinition attrDef) {
            return attrDef.getDisplayName();
        }
    };
    displayNameColumn.setFieldUpdater(new FieldUpdater<AttributeDefinition, String>() {

        @Override
        public void update(int i, final AttributeDefinition attributeDefinition, final String s) {
            attributeDefinition.setDisplayName(s.trim());
            selectionModel.setSelected(attributeDefinition, true);
        }
    });
    friendlyNameColumn.setSortable(true);
    columnSortHandler.setComparator(friendlyNameColumn, new Comparator<AttributeDefinition>() {

        public int compare(AttributeDefinition o1, AttributeDefinition o2) {
            return o1.getFriendlyName().compareToIgnoreCase(o2.getFriendlyName());
        }
    });
    entityColumn.setSortable(true);
    columnSortHandler.setComparator(entityColumn, new Comparator<AttributeDefinition>() {

        public int compare(AttributeDefinition o1, AttributeDefinition o2) {
            return o1.getEntity().compareToIgnoreCase(o2.getEntity());
        }
    });
    definitionColumn.setSortable(true);
    columnSortHandler.setComparator(definitionColumn, new Comparator<AttributeDefinition>() {

        public int compare(AttributeDefinition o1, AttributeDefinition o2) {
            return o1.getDefinition().compareToIgnoreCase(o2.getDefinition());
        }
    });
    typeColumn.setSortable(true);
    columnSortHandler.setComparator(typeColumn, new Comparator<AttributeDefinition>() {

        public int compare(AttributeDefinition o1, AttributeDefinition o2) {
            return o1.getType().compareToIgnoreCase(o2.getType());
        }
    });
    // Add the column sort handler.
    table.setColumnWidth(friendlyNameColumn, 250.0, Unit.PX);
    table.setColumnWidth(entityColumn, 100.0, Unit.PX);
    table.setColumnWidth(definitionColumn, 100.0, Unit.PX);
    table.setColumnWidth(typeColumn, 100.0, Unit.PX);
    // Add the columns.
    table.addColumn(friendlyNameColumn, "Name");
    // attributesTable.addColumn(namespaceColumn, "Namespace");
    table.addColumn(entityColumn, "Entity");
    table.addColumn(definitionColumn, "Definition");
    table.addColumn(typeColumn, "Type");
    if (editable) {
        table.addColumn(displayNameColumn, "Display name");
        table.addColumn(descriptionColumn, "Description");
    }
    return table;
}
Also used : ListHandler(com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler) FieldUpdater(com.google.gwt.cell.client.FieldUpdater) TextInputCell(com.google.gwt.cell.client.TextInputCell) AttributeDefinition(cz.metacentrum.perun.webgui.model.AttributeDefinition) PerunAttributeFriendlyNameCell(cz.metacentrum.perun.webgui.widgets.cells.PerunAttributeFriendlyNameCell) Column(com.google.gwt.user.cellview.client.Column)

Example 4 with FieldUpdater

use of com.google.gwt.cell.client.FieldUpdater in project perun by CESNET.

the class GroupResourceRequiredAttributesTabItem method draw.

public Widget draw() {
    titleWidget.setText(Utils.getStrippedStringWithEllipsis(group.getName()) + ": settings for " + Utils.getStrippedStringWithEllipsis(resource.getName()));
    if (JsonUtils.isExtendedInfoVisible()) {
        columnId = 3;
    } else {
        columnId = 2;
    }
    final VerticalPanel mainTab = new VerticalPanel();
    mainTab.setSize("100%", "100%");
    TabMenu menu = new TabMenu();
    final Label facilityId = new Label();
    JsonCallbackEvents events = new JsonCallbackEvents() {

        public void onFinished(JavaScriptObject jso) {
            Facility fac = (Facility) jso;
            facilityId.setText(String.valueOf(fac.getId()));
        }
    };
    GetFacility facility = new GetFacility(resourceId, events);
    facility.retrieveData();
    mainTab.add(new HTML("<hr size=\"2px\" />"));
    // set attributes type to group_resource
    final Map<String, Integer> ids = new HashMap<String, Integer>();
    ids.put("resourceToGetServicesFrom", resourceId);
    ids.put("group", groupId);
    // gets all required group attributes for specified group and resource
    final GetResourceRequiredAttributesV2 reqAttrs = new GetResourceRequiredAttributesV2(ids);
    final CellTable<Attribute> reqAttrsTable = reqAttrs.getTable();
    reqAttrsTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
    // get all required group_resource attributes too
    ids.put("resource", resourceId);
    reqAttrs.setIds(ids);
    reqAttrs.retrieveData();
    final ListBoxWithObjects<RichMember> listBox = new ListBoxWithObjects<RichMember>();
    listBox.setTitle(WidgetTranslation.INSTANCE.selectingMember());
    // local event fills the listBox
    JsonCallbackEvents localEvents = new JsonCallbackEvents() {

        public void onFinished(JavaScriptObject jso) {
            ArrayList<RichMember> mems = JsonUtils.jsoAsList(jso);
            mems = new TableSorter<RichMember>().sortByName(mems);
            listBox.addNotSelectedOption();
            for (int i = 0; i < mems.size(); i++) {
                listBox.addItem(mems.get(i));
            }
            listBox.addAllOption();
        }
    };
    final GetGroupRichMembers getGroupRichMembers = new GetGroupRichMembers(groupId, localEvents);
    getGroupRichMembers.retrieveData();
    reqAttrsTable.addStyleName("perun-table");
    final ScrollPanel sp = new ScrollPanel(reqAttrsTable);
    sp.addStyleName("perun-tableScrollPanel");
    // store for column with values
    final Column<Attribute, ?> columnStore = reqAttrsTable.getColumn(columnId);
    listBox.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent event) {
            int selectedIndex = listBox.getSelectedIndex();
            // no member selected
            if (selectedIndex == 0) {
                // offer just group and group resource attributes
                reqAttrs.clearTable();
                ids.clear();
                ids.put("resourceToGetServicesFrom", resourceId);
                // get groups attributes
                ids.put("group", groupId);
                reqAttrs.setIds(ids);
                reqAttrs.retrieveData();
                // get group_resource attributes
                ids.put("resource", resourceId);
                reqAttrs.setIds(ids);
                reqAttrs.retrieveData();
                reqAttrs.sortTable();
            // some member is selected
            } else {
                reqAttrs.clearTable();
                ids.clear();
                ids.put("resourceToGetServicesFrom", resourceId);
                // get member, member-resource, user, user-facility  attributes
                ids.put("member", listBox.getSelectedObject().getId());
                ids.put("resource", resourceId);
                // to get user, user-facility attrs
                ids.put("workWithUserAttributes", 1);
                reqAttrs.setIds(ids);
                reqAttrs.retrieveData();
                // all members are selected
                if (selectedIndex == 1) {
                    // remove value column
                    reqAttrsTable.removeColumn(columnId);
                    // create own value column
                    // Value column
                    Column<Attribute, Attribute> valueColumn = JsonUtils.addColumn(new PerunAttributeValueCell(), "Value", new JsonUtils.GetValue<Attribute, Attribute>() {

                        public Attribute getValue(Attribute attribute) {
                            attribute.setValueAsJso(null);
                            return attribute;
                        }
                    }, new FieldUpdater<Attribute, Attribute>() {

                        public void update(int index, Attribute object, Attribute value) {
                            object = value;
                            reqAttrsTable.getSelectionModel().setSelected(object, object.isAttributeValid());
                        }
                    });
                    // add to table
                    reqAttrsTable.insertColumn(columnId, valueColumn, "Value");
                } else {
                    // member selected
                    // return original column
                    reqAttrsTable.removeColumn(columnId);
                    reqAttrsTable.insertColumn(columnId, columnStore, "Value");
                }
            }
        }
    });
    CustomButton saveChangesButton = TabMenu.getPredefinedButton(ButtonType.SAVE, ButtonTranslation.INSTANCE.saveChangesInAttributes(), new ClickHandler() {

        public void onClick(ClickEvent event) {
            ArrayList<Attribute> list = reqAttrs.getTableSelectedList();
            if (UiElements.cantSaveEmptyListDialogBox(list)) {
                // send lists
                ArrayList<Attribute> groupList = new ArrayList<Attribute>();
                ArrayList<Attribute> groupResourceList = new ArrayList<Attribute>();
                ArrayList<Attribute> memberList = new ArrayList<Attribute>();
                ArrayList<Attribute> memberResourceList = new ArrayList<Attribute>();
                ArrayList<Attribute> userList = new ArrayList<Attribute>();
                ArrayList<Attribute> userFacilityList = new ArrayList<Attribute>();
                SetAttributes request = new SetAttributes();
                int selectedIndex = listBox.getSelectedIndex();
                // if all selected
                if (selectedIndex == 1) {
                    // TODO - USE NEW CONFIRM DESIGN
                    if (!Window.confirm("Same values for selected attributes will be set to all members in group." + "\n\nDo you want to continue ?")) {
                        return;
                    }
                }
                // get different attributes
                for (Attribute attr : list) {
                    if (attr.getNamespace().contains("urn:perun:group:")) {
                        groupList.add(attr);
                    } else if (attr.getNamespace().contains("urn:perun:group_resource:")) {
                        groupResourceList.add(attr);
                    } else if (attr.getNamespace().contains("urn:perun:member:")) {
                        memberList.add(attr);
                    } else if (attr.getNamespace().contains("urn:perun:member_resource:")) {
                        memberResourceList.add(attr);
                    } else if (attr.getNamespace().contains("urn:perun:user:")) {
                        userList.add(attr);
                    } else if (attr.getNamespace().contains("urn:perun:user_facility:")) {
                        userFacilityList.add(attr);
                    }
                }
                // if not empty, send request
                if (!(groupList.isEmpty())) {
                    ids.clear();
                    ids.put("group", groupId);
                    request.setAttributes(ids, groupList);
                }
                if (!(groupResourceList.isEmpty())) {
                    ids.clear();
                    ids.put("group", groupId);
                    ids.put("resource", resourceId);
                    request.setAttributes(ids, groupResourceList);
                }
                if (!(memberList.isEmpty())) {
                    if (selectedIndex == 1) {
                        // for all members
                        for (int i = 0; i < listBox.getItemCount(); i++) {
                            ids.clear();
                            ids.put("member", (listBox.getObjectAt(i)).getId());
                            request.setAttributes(ids, memberList);
                        }
                    } else {
                        // for one member
                        ids.clear();
                        ids.put("member", listBox.getSelectedObject().getId());
                        request.setAttributes(ids, memberList);
                    }
                }
                if (!(memberResourceList.isEmpty())) {
                    if (selectedIndex == 1) {
                        // for all members
                        for (int i = 0; i < listBox.getItemCount(); i++) {
                            ids.clear();
                            ids.put("resource", resourceId);
                            ids.put("member", (listBox.getObjectAt(i)).getId());
                            request.setAttributes(ids, memberResourceList);
                        }
                    } else {
                        // for one member
                        ids.clear();
                        ids.put("resource", resourceId);
                        ids.put("member", listBox.getSelectedObject().getId());
                        request.setAttributes(ids, memberResourceList);
                    }
                }
                if (!(userList.isEmpty())) {
                    if (selectedIndex == 1) {
                        // for all members
                        for (int i = 0; i < listBox.getItemCount(); i++) {
                            ids.clear();
                            ids.put("user", (listBox.getObjectAt(i)).getUser().getId());
                            request.setAttributes(ids, userList);
                        }
                    } else {
                        // for one member
                        ids.clear();
                        ids.put("user", listBox.getSelectedObject().getUser().getId());
                        request.setAttributes(ids, userList);
                    }
                }
                if (!(userFacilityList.isEmpty())) {
                    if (selectedIndex == 1) {
                        // for all members
                        for (int i = 0; i < listBox.getItemCount(); i++) {
                            ids.clear();
                            ids.put("user", listBox.getObjectAt(i).getUser().getId());
                            ids.put("facility", Integer.parseInt(facilityId.getText()));
                            request.setAttributes(ids, userFacilityList);
                        }
                    } else {
                        // for one member
                        ids.clear();
                        ids.put("user", listBox.getSelectedObject().getUser().getId());
                        ids.put("facility", Integer.parseInt(facilityId.getText()));
                        request.setAttributes(ids, userFacilityList);
                    }
                }
                reqAttrs.clearTableSelectedSet();
            }
        }
    });
    menu.addWidget(UiElements.getRefreshButton(this));
    menu.addWidget(saveChangesButton);
    if (!session.isGroupAdmin(groupId) && !session.isVoAdmin(group.getVoId()))
        saveChangesButton.setEnabled(false);
    menu.addWidget(new HTML("<strong>Group members:</strong>"));
    menu.addWidget(listBox);
    // table content
    session.getUiElements().resizePerunTable(sp, 350, this);
    mainTab.add(menu);
    mainTab.add(sp);
    mainTab.setCellHeight(sp, "100%");
    mainTab.setCellHeight(menu, "30px");
    this.contentWidget.setWidget(mainTab);
    return getWidget();
}
Also used : JsonCallbackEvents(cz.metacentrum.perun.webgui.json.JsonCallbackEvents) HashMap(java.util.HashMap) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ArrayList(java.util.ArrayList) SetAttributes(cz.metacentrum.perun.webgui.json.attributesManager.SetAttributes) ListBoxWithObjects(cz.metacentrum.perun.webgui.widgets.ListBoxWithObjects) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Column(com.google.gwt.user.cellview.client.Column) CustomButton(cz.metacentrum.perun.webgui.widgets.CustomButton) GetFacility(cz.metacentrum.perun.webgui.json.resourcesManager.GetFacility) PerunAttributeValueCell(cz.metacentrum.perun.webgui.widgets.cells.PerunAttributeValueCell) FieldUpdater(com.google.gwt.cell.client.FieldUpdater) TabMenu(cz.metacentrum.perun.webgui.widgets.TabMenu) GetResourceRequiredAttributesV2(cz.metacentrum.perun.webgui.json.attributesManager.GetResourceRequiredAttributesV2) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) JavaScriptObject(com.google.gwt.core.client.JavaScriptObject) GetFacility(cz.metacentrum.perun.webgui.json.resourcesManager.GetFacility) GetGroupRichMembers(cz.metacentrum.perun.webgui.json.groupsManager.GetGroupRichMembers)

Example 5 with FieldUpdater

use of com.google.gwt.cell.client.FieldUpdater in project perun by CESNET.

the class GroupResourcesTabItem method draw.

public Widget draw() {
    // set title
    titleWidget.setText(Utils.getStrippedStringWithEllipsis(group.getName()) + ": " + "resources");
    // main panel
    VerticalPanel vp = new VerticalPanel();
    vp.setSize("100%", "100%");
    // HORIZONTAL MENU
    TabMenu menu = new TabMenu();
    menu.addWidget(UiElements.getRefreshButton(this));
    // get VO resources
    final GetAssignedRichResources resources = new GetAssignedRichResources(groupId, PerunEntity.GROUP);
    if (!session.isGroupAdmin(groupId) && !session.isVoAdmin(group.getVoId()))
        resources.setCheckable(false);
    // custom events for viewResource
    final JsonCallbackEvents events = JsonCallbackEvents.refreshTableEvents(resources);
    final CustomButton removeButton = TabMenu.getPredefinedButton(ButtonType.REMOVE, ButtonTranslation.INSTANCE.removeGroupFromSelectedResources());
    // add / remove resource from group can be done by vo / perun admin only.
    if (session.isVoAdmin(group.getVoId())) {
        menu.addWidget(TabMenu.getPredefinedButton(ButtonType.ADD, true, ButtonTranslation.INSTANCE.assignGroupToResources(), new ClickHandler() {

            public void onClick(ClickEvent event) {
                session.getTabManager().addTabToCurrentTab(new AssignGroupTabItem(group, resources.getList()), true);
            }
        }));
        removeButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                final ArrayList<RichResource> toRemove = resources.getTableSelectedList();
                String text = "Following resources will be removed from group and it's members won't have access to them anymore.";
                UiElements.showDeleteConfirm(toRemove, text, new ClickHandler() {

                    @Override
                    public void onClick(ClickEvent clickEvent) {
                        RemoveGroupFromResources request = new RemoveGroupFromResources(JsonCallbackEvents.disableButtonEvents(removeButton, events));
                        request.removeGroupFromResources(group, toRemove);
                    }
                });
            }
        });
        menu.addWidget(removeButton);
    }
    // filter box
    menu.addFilterWidget(new ExtendedSuggestBox(resources.getOracle()), new PerunSearchEvent() {

        public void searchFor(String text) {
            resources.filterTable(text);
        }
    }, ButtonTranslation.INSTANCE.filterResources());
    // add menu to the main panel
    vp.add(menu);
    vp.setCellHeight(menu, "30px");
    CellTable<RichResource> table;
    // perun / vo admin can set attributes
    if (session.isVoAdmin(group.getVoId()) || session.isVoObserver(group.getVoId())) {
        table = resources.getTable(new FieldUpdater<RichResource, String>() {

            public void update(int index, RichResource object, String value) {
                session.getTabManager().addTab(new ResourceDetailTabItem(object, 0));
            }
        });
    } else {
        table = resources.getTable();
    }
    removeButton.setEnabled(false);
    if (session.isGroupAdmin(groupId) || session.isVoAdmin(group.getVoId()))
        JsonUtils.addTableManagedButton(resources, table, removeButton);
    table.addStyleName("perun-table");
    table.setWidth("100%");
    ScrollPanel sp = new ScrollPanel(table);
    sp.addStyleName("perun-tableScrollPanel");
    vp.add(sp);
    session.getUiElements().resizePerunTable(sp, 350, this);
    this.contentWidget.setWidget(vp);
    return getWidget();
}
Also used : JsonCallbackEvents(cz.metacentrum.perun.webgui.json.JsonCallbackEvents) FieldUpdater(com.google.gwt.cell.client.FieldUpdater) RichResource(cz.metacentrum.perun.webgui.model.RichResource) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ArrayList(java.util.ArrayList) RemoveGroupFromResources(cz.metacentrum.perun.webgui.json.resourcesManager.RemoveGroupFromResources) TabMenu(cz.metacentrum.perun.webgui.widgets.TabMenu) GetAssignedRichResources(cz.metacentrum.perun.webgui.json.resourcesManager.GetAssignedRichResources) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) CustomButton(cz.metacentrum.perun.webgui.widgets.CustomButton) ExtendedSuggestBox(cz.metacentrum.perun.webgui.widgets.ExtendedSuggestBox) ResourceDetailTabItem(cz.metacentrum.perun.webgui.tabs.resourcestabs.ResourceDetailTabItem)

Aggregations

FieldUpdater (com.google.gwt.cell.client.FieldUpdater)28 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)19 ArrayList (java.util.ArrayList)19 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)17 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)17 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)17 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)16 User (cz.metacentrum.perun.webgui.model.User)15 UserDetailTabItem (cz.metacentrum.perun.webgui.tabs.userstabs.UserDetailTabItem)15 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)10 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)8 Column (com.google.gwt.user.cellview.client.Column)6 FindCompleteRichUsers (cz.metacentrum.perun.webgui.json.usersManager.FindCompleteRichUsers)6 ExtendedTextBox (cz.metacentrum.perun.webgui.widgets.ExtendedTextBox)6 RemoveAdmin (cz.metacentrum.perun.webgui.json.authzResolver.RemoveAdmin)5 AddAdmin (cz.metacentrum.perun.webgui.json.authzResolver.AddAdmin)4 ExtendedSuggestBox (cz.metacentrum.perun.webgui.widgets.ExtendedSuggestBox)4 CheckboxCell (com.google.gwt.cell.client.CheckboxCell)2 ListHandler (com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler)2 ScrollPanel (com.google.gwt.user.client.ui.ScrollPanel)2