KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > extensions > itemactions > RemoveExtensionAction


1 /**
2  *
3  */

4 package com.sslexplorer.extensions.itemactions;
5
6 import com.sslexplorer.extensions.ExtensionBundle;
7 import com.sslexplorer.extensions.ExtensionBundleItem;
8 import com.sslexplorer.policyframework.Permission;
9 import com.sslexplorer.policyframework.PolicyConstants;
10 import com.sslexplorer.security.SessionInfo;
11 import com.sslexplorer.table.AvailableTableItemAction;
12 import com.sslexplorer.table.TableItemAction;
13
14 public final class RemoveExtensionAction extends TableItemAction {
15     public RemoveExtensionAction() {
16         super("removeExtension", "extensions", 200, "", true, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT,
17                         PolicyConstants.EXTENSIONS_RESOURCE_TYPE, new Permission[] { PolicyConstants.PERM_CHANGE });
18     }
19
20     public boolean isEnabled(AvailableTableItemAction availableItem) {
21         ExtensionBundleItem item = (ExtensionBundleItem)availableItem.getRowItem();
22         return !item.getBundle().isDevExtension() && ( item.getBundle().getType() == ExtensionBundle.TYPE_INSTALLED || item.getBundle().getType() == ExtensionBundle.TYPE_UPDATEABLE ) && !item.getSubFormName().equals("updateableExtensionsForm");
23     }
24
25     public String JavaDoc getPath(AvailableTableItemAction availableItem) {
26         ExtensionBundleItem item = (ExtensionBundleItem)availableItem.getRowItem();
27         return "/removeExtension.do?id=" + item.getBundle().getId() + "&subForm=" + item.getSubFormName();
28     }
29 }
Popular Tags