2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.client
.ui
.dist
.commands
;
18 import org
.argeo
.slc
.client
.ui
.dist
.DistPlugin
;
19 import org
.eclipse
.core
.commands
.AbstractHandler
;
20 import org
.eclipse
.core
.commands
.ExecutionEvent
;
21 import org
.eclipse
.core
.commands
.ExecutionException
;
22 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
25 * Add the {@code SlcNames.SLC_RELEVANT_CATEGORY} mixin to the selected node
27 public class MarkAsRelevantCategory
extends AbstractHandler
{
28 // private static final Log log = LogFactory.getLog(DeleteWorkspace.class);
30 public final static String ID
= DistPlugin
.ID
+ ".markAsRelevantCategory";
31 public final static String DEFAULT_LABEL
= "Mark as relevant category base";
32 public final static ImageDescriptor DEFAULT_ICON
= DistPlugin
33 .getImageDescriptor("icons/addItem.gif");
35 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
37 // IWorkbenchPart activePart = DistPlugin.getDefault().getWorkbench()
38 // .getActiveWorkbenchWindow().getActivePage().getActivePart();
40 // if (activePart instanceof IEditorPart) {
41 // ISelection selector = ((IEditorPart) activePart)
42 // .getEditorSite().getSelectionProvider().getSelection();
43 // if (selector != null
44 // && selector instanceof IStructuredSelection) {
45 // Iterator<?> it = ((IStructuredSelection) selector)
48 // Node node = (Node) it.next();
49 // if (node.isNodeType(SlcTypes.SLC_CATEGORY)) {
51 // "Your are about to unlist this category from the relevant category list for current workspace"
52 // + ".\n" + "Are you sure you want to proceed?";
53 // if (MessageDialog.openConfirm(DistPlugin.getDefault()
54 // .getWorkbench().getDisplay().getActiveShell(),
56 // node.removeMixin(SlcTypes.SLC_CATEGORY);
57 // node.getSession().save();
61 // "Your are about to mark this group as category base in the current workspace"
62 // + ".\n" + "Are you sure you want to proceed?";
64 // if (MessageDialog.openConfirm(DistPlugin.getDefault()
65 // .getWorkbench().getDisplay().getActiveShell(),
67 // node.addMixin(SlcTypes.SLC_CATEGORY);
68 // node.getSession().save();
73 // } catch (RepositoryException re) {
74 // throw new ArgeoException(
75 // "Unexpected error while deleting artifacts.", re);