001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.ui.apps.projects;
029
030import org.opencms.file.CmsObject;
031import org.opencms.file.CmsProject;
032import org.opencms.main.CmsException;
033import org.opencms.main.CmsLog;
034import org.opencms.main.OpenCms;
035import org.opencms.ui.A_CmsUI;
036import org.opencms.ui.CmsCssIcon;
037import org.opencms.ui.CmsVaadinUtils;
038import org.opencms.ui.apps.A_CmsWorkplaceApp;
039import org.opencms.ui.apps.CmsAppWorkplaceUi;
040import org.opencms.ui.apps.Messages;
041import org.opencms.ui.components.CmsBasicDialog;
042import org.opencms.ui.components.CmsBasicDialog.DialogWidth;
043import org.opencms.ui.components.CmsConfirmationDialog;
044import org.opencms.ui.components.CmsErrorDialog;
045import org.opencms.ui.components.CmsResourceInfo;
046import org.opencms.ui.components.OpenCmsTheme;
047import org.opencms.ui.components.extensions.CmsGwtDialogExtension;
048import org.opencms.ui.contextmenu.CmsContextMenu;
049import org.opencms.ui.contextmenu.CmsMenuItemVisibilityMode;
050import org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry;
051import org.opencms.util.CmsStringUtil;
052import org.opencms.util.CmsUUID;
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import java.util.Locale;
058import java.util.Set;
059
060import org.apache.commons.logging.Log;
061
062import com.vaadin.v7.data.Item;
063import com.vaadin.v7.data.util.IndexedContainer;
064import com.vaadin.v7.data.util.filter.Or;
065import com.vaadin.v7.data.util.filter.SimpleStringFilter;
066import com.vaadin.v7.event.ItemClickEvent;
067import com.vaadin.v7.event.ItemClickEvent.ItemClickListener;
068import com.vaadin.server.Resource;
069import com.vaadin.shared.MouseEventDetails.MouseButton;
070import com.vaadin.v7.shared.ui.label.ContentMode;
071import com.vaadin.v7.ui.Label;
072import com.vaadin.v7.ui.Table;
073import com.vaadin.ui.UI;
074import com.vaadin.ui.Window;
075import com.vaadin.ui.themes.ValoTheme;
076
077/**
078 * The projects table.<p>
079 */
080public class CmsProjectsTable extends Table {
081
082    /**
083     * The delete project context menu entry.<p>
084     */
085    class DeleteEntry implements I_CmsSimpleContextMenuEntry<Set<CmsUUID>> {
086
087        /**
088         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#executeAction(java.lang.Object)
089         */
090        public void executeAction(final Set<CmsUUID> data) {
091
092            List<CmsResourceInfo> projectInfos = new ArrayList<CmsResourceInfo>();
093            String message;
094            CmsCssIcon projectIcon = new CmsCssIcon(OpenCmsTheme.ICON_PROJECT);
095            if (data.size() == 1) {
096                Item item = m_container.getItem(data.iterator().next());
097                message = CmsVaadinUtils.getMessageText(
098                    Messages.GUI_PROJECTS_CONFIRM_DELETE_PROJECT_1,
099                    item.getItemProperty(PROP_NAME).getValue());
100                projectInfos.add(
101                    new CmsResourceInfo(
102                        (String)item.getItemProperty(PROP_NAME).getValue(),
103                        (String)item.getItemProperty(PROP_DESCRIPTION).getValue(),
104                        projectIcon));
105            } else {
106                message = "";
107                for (CmsUUID id : data) {
108                    if (message.length() > 0) {
109                        message += ", ";
110                    }
111                    Item item = m_container.getItem(id);
112                    message += item.getItemProperty(PROP_NAME).getValue();
113                    projectInfos.add(
114                        new CmsResourceInfo(
115                            (String)item.getItemProperty(PROP_NAME).getValue(),
116                            (String)item.getItemProperty(PROP_DESCRIPTION).getValue(),
117                            projectIcon));
118                }
119                message = CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_CONFIRM_DELETE_PROJECTS_1, message);
120            }
121
122            CmsConfirmationDialog.show(
123                CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_DELETE_0),
124                message,
125                new Runnable() {
126
127                    public void run() {
128
129                        for (CmsUUID projectId : data) {
130                            try {
131                                A_CmsUI.getCmsObject().deleteProject(projectId);
132                                CmsAppWorkplaceUi.get().reload();
133                            } catch (CmsException e) {
134                                LOG.error("Error deleting project " + projectId, e);
135                                displayException(e);
136                            }
137                        }
138                    }
139                }).displayResourceInfoDirectly(projectInfos);
140        }
141
142        /**
143         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getTitle(java.util.Locale)
144         */
145        public String getTitle(Locale locale) {
146
147            return CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_DELETE_0);
148        }
149
150        /**
151         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getVisibility(java.lang.Object)
152         */
153        public CmsMenuItemVisibilityMode getVisibility(Set<CmsUUID> data) {
154
155            return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE;
156        }
157    }
158
159    /**
160     * The edit project context menu entry.<p>
161     */
162    class EditEntry implements I_CmsSimpleContextMenuEntry<Set<CmsUUID>> {
163
164        /**
165         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#executeAction(java.lang.Object)
166         */
167        public void executeAction(Set<CmsUUID> data) {
168
169            CmsUUID id = data.iterator().next();
170
171            Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide);
172            CmsEditProjectForm form = new CmsEditProjectForm(CmsProjectsTable.this, id, window);
173            window.setContent(form);
174            window.setCaption(
175                CmsVaadinUtils.getMessageText(
176                    Messages.GUI_PROJECTS_EDIT_1,
177                    m_container.getItem(id).getItemProperty(PROP_NAME).getValue()));
178            A_CmsUI.get().addWindow(window);
179            window.center();
180        }
181
182        /**
183         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getTitle(java.util.Locale)
184         */
185        public String getTitle(Locale locale) {
186
187            return CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_EDIT_0);
188        }
189
190        /**
191         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getVisibility(java.lang.Object)
192         */
193        public CmsMenuItemVisibilityMode getVisibility(Set<CmsUUID> data) {
194
195            return (data != null) && (data.size() == 1)
196            ? CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE
197            : CmsMenuItemVisibilityMode.VISIBILITY_INVISIBLE;
198        }
199    }
200
201    /**
202     * The publish project context menu entry.<p>
203     */
204    class PublishEntry implements I_CmsSimpleContextMenuEntry<Set<CmsUUID>> {
205
206        /**
207         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#executeAction(java.lang.Object)
208         */
209        public void executeAction(Set<CmsUUID> data) {
210
211            CmsUUID projectId = data.iterator().next();
212            CmsAppWorkplaceUi.get().disableGlobalShortcuts();
213            CmsGwtDialogExtension extension = new CmsGwtDialogExtension(A_CmsUI.get(), null);
214            try {
215                extension.openPublishDialog(A_CmsUI.getCmsObject().readProject(projectId));
216            } catch (CmsException e) {
217                LOG.error("Error reading project " + projectId, e);
218                displayException(e);
219            }
220        }
221
222        /**
223         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getTitle(java.util.Locale)
224         */
225        public String getTitle(Locale locale) {
226
227            return CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_PUBLISH_0);
228        }
229
230        /**
231         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getVisibility(java.lang.Object)
232         */
233        public CmsMenuItemVisibilityMode getVisibility(Set<CmsUUID> data) {
234
235            if ((data != null) && (data.size() == 1)) {
236                if (A_CmsUI.getCmsObject().getRequestContext().getCurrentProject().isOnlineProject()) {
237                    return CmsMenuItemVisibilityMode.VISIBILITY_INACTIVE;
238                }
239                CmsUUID projectId = data.iterator().next();
240                try {
241                    return A_CmsUI.getCmsObject().countLockedResources(projectId) == 0
242                    ? CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE
243                    : CmsMenuItemVisibilityMode.VISIBILITY_INACTIVE;
244                } catch (CmsException e) {
245                    LOG.error("Error reading locked resources on project " + projectId, e);
246                }
247            }
248            return CmsMenuItemVisibilityMode.VISIBILITY_INVISIBLE;
249        }
250    }
251
252    /**
253     * The show project files context menu entry.<p>
254     */
255    class ShowFilesEntry
256    implements I_CmsSimpleContextMenuEntry<Set<CmsUUID>>, I_CmsSimpleContextMenuEntry.I_HasCssStyles {
257
258        /**
259         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#executeAction(java.lang.Object)
260         */
261        public void executeAction(Set<CmsUUID> data) {
262
263            CmsUUID id = data.iterator().next();
264            m_manager.openSubView(
265                A_CmsWorkplaceApp.addParamToState(CmsProjectManager.PATH_NAME_FILES, "projectId", id.toString()),
266                true);
267        }
268
269        /**
270         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry.I_HasCssStyles#getStyles()
271         */
272        public String getStyles() {
273
274            return ValoTheme.LABEL_BOLD;
275        }
276
277        /**
278         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getTitle(java.util.Locale)
279         */
280        public String getTitle(Locale locale) {
281
282            return CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_SHOW_FILES_0);
283        }
284
285        /**
286         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getVisibility(java.lang.Object)
287         */
288        public CmsMenuItemVisibilityMode getVisibility(Set<CmsUUID> data) {
289
290            if ((data == null) || (data.size() != 1)) {
291                return CmsMenuItemVisibilityMode.VISIBILITY_INVISIBLE;
292            }
293            if (A_CmsUI.getCmsObject().getRequestContext().getCurrentProject().isOnlineProject()) {
294                return CmsMenuItemVisibilityMode.VISIBILITY_INACTIVE;
295            }
296            return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE;
297        }
298    }
299
300    /**
301     * The unlock project context menu entry.<p>
302     */
303    class UnlockEntry implements I_CmsSimpleContextMenuEntry<Set<CmsUUID>> {
304
305        /**
306         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#executeAction(java.lang.Object)
307         */
308        public void executeAction(Set<CmsUUID> data) {
309
310            for (CmsUUID projectId : data) {
311                try {
312                    A_CmsUI.getCmsObject().unlockProject(projectId);
313                } catch (CmsException e) {
314                    LOG.error("Error unlocking project " + projectId, e);
315                    displayException(e);
316                }
317            }
318        }
319
320        /**
321         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getTitle(java.util.Locale)
322         */
323        public String getTitle(Locale locale) {
324
325            return CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_UNLOCK_FILES_0);
326        }
327
328        /**
329         * @see org.opencms.ui.contextmenu.I_CmsSimpleContextMenuEntry#getVisibility(java.lang.Object)
330         */
331        public CmsMenuItemVisibilityMode getVisibility(Set<CmsUUID> data) {
332
333            if (A_CmsUI.getCmsObject().getRequestContext().getCurrentProject().isOnlineProject()) {
334                return CmsMenuItemVisibilityMode.VISIBILITY_INACTIVE;
335            }
336            if (data.size() == 1) {
337                CmsUUID projectId = data.iterator().next();
338                try {
339                    if (A_CmsUI.getCmsObject().countLockedResources(projectId) == 0) {
340                        return CmsMenuItemVisibilityMode.VISIBILITY_INACTIVE;
341                    }
342                } catch (CmsException e) {
343                    LOG.error("Error reading locked resources on project " + projectId, e);
344                }
345            }
346            return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE;
347        }
348    }
349
350    /** Project date created property. */
351    public static final String PROP_DATE_CREATED = "dateCreated";
352
353    /** Project description property. */
354    public static final String PROP_DESCRIPTION = "descrition";
355
356    /** Project icon property. */
357    public static final String PROP_ICON = "icon";
358
359    /** Project id property. */
360    public static final String PROP_ID = "id";
361
362    /** Project manager property. */
363    public static final String PROP_MANAGER = "manager";
364
365    /** Project name property. */
366    public static final String PROP_NAME = "name";
367
368    /** Project org unit property. */
369    public static final String PROP_ORG_UNIT = "orgUnit";
370
371    /** Project owner property. */
372    public static final String PROP_OWNER = "owner";
373
374    /** Project resources property. */
375    public static final String PROP_RESOURCES = "resources";
376
377    /** Project user property. */
378    public static final String PROP_USER = "user";
379
380    /** The logger for this class. */
381    protected static Log LOG = CmsLog.getLog(CmsProjectsTable.class.getName());
382
383    /** The serial version id. */
384    private static final long serialVersionUID = 1540265836332964510L;
385
386    /** The data container. */
387    IndexedContainer m_container;
388
389    /** The project manager instance. */
390    CmsProjectManager m_manager;
391
392    /** The context menu. */
393    CmsContextMenu m_menu;
394
395    /** The available menu entries. */
396    private List<I_CmsSimpleContextMenuEntry<Set<CmsUUID>>> m_menuEntries;
397
398    /**
399     * Constructor.<p>
400     *
401     * @param manager the project manager
402     */
403    public CmsProjectsTable(CmsProjectManager manager) {
404        m_manager = manager;
405
406        m_container = new IndexedContainer();
407        m_container.addContainerProperty(PROP_ID, CmsUUID.class, null);
408        m_container.addContainerProperty(PROP_ICON, Resource.class, new CmsCssIcon(OpenCmsTheme.ICON_PROJECT));
409        m_container.addContainerProperty(PROP_NAME, String.class, "");
410        m_container.addContainerProperty(PROP_DESCRIPTION, String.class, "");
411        m_container.addContainerProperty(PROP_ORG_UNIT, String.class, "");
412        m_container.addContainerProperty(PROP_OWNER, String.class, "");
413        m_container.addContainerProperty(PROP_MANAGER, String.class, "");
414        m_container.addContainerProperty(PROP_USER, String.class, "");
415        m_container.addContainerProperty(PROP_DATE_CREATED, Date.class, null);
416        m_container.addContainerProperty(PROP_RESOURCES, Label.class, null);
417
418        setContainerDataSource(m_container);
419        setItemIconPropertyId(PROP_ICON);
420        setRowHeaderMode(RowHeaderMode.ICON_ONLY);
421        setColumnHeader(PROP_NAME, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_NAME_0));
422        setColumnHeader(PROP_DESCRIPTION, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_DESCRIPTION_0));
423        setColumnHeader(PROP_ORG_UNIT, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_ORG_UNIT_0));
424        setColumnHeader(PROP_OWNER, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_OWNER_0));
425        setColumnHeader(PROP_MANAGER, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_MANAGER_GROUP_0));
426        setColumnHeader(PROP_USER, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_USER_GROUP_0));
427        setColumnHeader(PROP_DATE_CREATED, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_DATE_CREATED_0));
428        setColumnHeader(PROP_RESOURCES, CmsVaadinUtils.getMessageText(Messages.GUI_PROJECTS_RESOURCES_0));
429        setColumnWidth(null, 40);
430        setColumnExpandRatio(PROP_NAME, 2);
431        setColumnExpandRatio(PROP_DESCRIPTION, 2);
432        setColumnExpandRatio(PROP_RESOURCES, 2);
433        setSelectable(true);
434        setMultiSelect(true);
435        m_menu = new CmsContextMenu();
436        m_menu.setAsTableContextMenu(this);
437        addItemClickListener(new ItemClickListener() {
438
439            private static final long serialVersionUID = 1L;
440
441            public void itemClick(ItemClickEvent event) {
442
443                onItemClick(event);
444            }
445        });
446        setCellStyleGenerator(new CellStyleGenerator() {
447
448            private static final long serialVersionUID = 1L;
449
450            public String getStyle(Table source, Object itemId, Object propertyId) {
451
452                if (PROP_NAME.equals(propertyId)) {
453                    return OpenCmsTheme.HOVER_COLUMN;
454                }
455                return null;
456            }
457        });
458    }
459
460    /**
461     * Filters the displayed projects.<p>
462     *
463     * @param filter the filter
464     */
465    public void filterTable(String filter) {
466
467        m_container.removeAllContainerFilters();
468        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
469            m_container.addContainerFilter(
470                new Or(
471                    new SimpleStringFilter(PROP_NAME, filter, true, false),
472                    new SimpleStringFilter(PROP_DESCRIPTION, filter, true, false)));
473        }
474        if ((getValue() != null) & !((Set<CmsUUID>)getValue()).isEmpty()) {
475            setCurrentPageFirstItemId(((Set<CmsUUID>)getValue()).iterator().next());
476        }
477    }
478
479    /**
480     * Loads the projects table.<p>
481     */
482    public void loadProjects() {
483
484        CmsObject cms = A_CmsUI.getCmsObject();
485        Locale locale = UI.getCurrent().getLocale();
486        m_container.removeAllItems();
487        boolean isMultiOU = false;
488        // hide ou column if only one ou exists
489        try {
490            isMultiOU = !OpenCms.getOrgUnitManager().getOrganizationalUnits(cms, "", true).isEmpty();
491        } catch (CmsException e) {
492            // noop
493        }
494        if (isMultiOU) {
495            setVisibleColumns(
496                PROP_NAME,
497                PROP_DESCRIPTION,
498                PROP_ORG_UNIT,
499                PROP_OWNER,
500                PROP_MANAGER,
501                PROP_USER,
502                PROP_DATE_CREATED,
503                PROP_RESOURCES);
504        } else {
505            setVisibleColumns(
506                PROP_NAME,
507                PROP_DESCRIPTION,
508                PROP_OWNER,
509                PROP_MANAGER,
510                PROP_USER,
511                PROP_DATE_CREATED,
512                PROP_RESOURCES);
513        }
514
515        // get content
516        try {
517            List<CmsProject> projects = OpenCms.getOrgUnitManager().getAllManageableProjects(cms, "", true);
518            for (CmsProject project : projects) {
519                Item item = m_container.addItem(project.getUuid());
520                item.getItemProperty(PROP_ID).setValue(project.getUuid());
521                item.getItemProperty(PROP_NAME).setValue(project.getSimpleName());
522                item.getItemProperty(PROP_DESCRIPTION).setValue(project.getDescription());
523                try {
524                    item.getItemProperty(PROP_ORG_UNIT).setValue(
525                        OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName(
526                            locale));
527                    item.getItemProperty(PROP_OWNER).setValue(cms.readUser(project.getOwnerId()).getName());
528                    item.getItemProperty(PROP_MANAGER).setValue(
529                        cms.readGroup(project.getManagerGroupId()).getSimpleName());
530                    item.getItemProperty(PROP_USER).setValue(cms.readGroup(project.getGroupId()).getSimpleName());
531                } catch (CmsException e) {
532                    LOG.error("Error reading project properties for " + project.getSimpleName());
533                }
534                item.getItemProperty(PROP_DATE_CREATED).setValue(new Date(project.getDateCreated()));
535
536                StringBuffer html = new StringBuffer(512);
537                try {
538                    for (String resource : cms.readProjectResources(project)) {
539                        html.append(resource);
540                        html.append("<br />");
541                    }
542                } catch (CmsException e) {
543                    LOG.error("Error reading project resources for " + project.getSimpleName());
544                }
545                Label resLabel = new Label();
546                resLabel.setContentMode(ContentMode.HTML);
547                resLabel.setValue(html.toString());
548                item.getItemProperty(PROP_RESOURCES).setValue(resLabel);
549
550            }
551        } catch (CmsException e) {
552            LOG.error("Error reading manageable projects", e);
553            CmsErrorDialog.showErrorDialog(e);
554        }
555    }
556
557    /**
558     * Displays the given exception in the error dialog and reloads the UI on close.<p>
559     *
560     * @param e the exception
561     */
562    protected void displayException(Throwable e) {
563
564        CmsErrorDialog.showErrorDialog(e, new Runnable() {
565
566            public void run() {
567
568                CmsAppWorkplaceUi.get().reload();
569            }
570        });
571    }
572
573    /**
574     * Returns the available menu entries.<p>
575     *
576     * @return the menu entries
577     */
578    List<I_CmsSimpleContextMenuEntry<Set<CmsUUID>>> getMenuEntries() {
579
580        if (m_menuEntries == null) {
581            m_menuEntries = new ArrayList<I_CmsSimpleContextMenuEntry<Set<CmsUUID>>>();
582            m_menuEntries.add(new ShowFilesEntry());
583            m_menuEntries.add(new UnlockEntry());
584            m_menuEntries.add(new PublishEntry());
585            m_menuEntries.add(new EditEntry());
586            m_menuEntries.add(new DeleteEntry());
587        }
588        return m_menuEntries;
589    }
590
591    /**
592     * Handles the table item clicks.<p>
593     *
594     * @param event the click event
595     */
596    @SuppressWarnings("unchecked")
597    void onItemClick(ItemClickEvent event) {
598
599        if (!event.isCtrlKey() && !event.isShiftKey()) {
600            // don't interfere with multi-selection using control key
601            if (event.getButton().equals(MouseButton.RIGHT) || (event.getPropertyId() == null)) {
602                CmsUUID itemId = (CmsUUID)event.getItemId();
603                Set<CmsUUID> value = (Set<CmsUUID>)getValue();
604                if (value == null) {
605                    select(itemId);
606                } else if (!value.contains(itemId)) {
607                    setValue(null);
608                    select(itemId);
609                }
610                m_menu.setEntries(getMenuEntries(), (Set<CmsUUID>)getValue());
611                m_menu.openForTable(event, this);
612            } else if (event.getButton().equals(MouseButton.LEFT) && PROP_NAME.equals(event.getPropertyId())) {
613                Item item = event.getItem();
614                CmsUUID id = (CmsUUID)item.getItemProperty(PROP_ID).getValue();
615                m_manager.openSubView(
616                    A_CmsWorkplaceApp.addParamToState(CmsProjectManager.PATH_NAME_FILES, "projectId", id.toString()),
617                    true);
618            }
619        }
620    }
621}