KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  *
3  */

4 package com.sslexplorer.extensions.itemactions;
5
6 import com.sslexplorer.extensions.ExtensionBundleItem;
7 import com.sslexplorer.policyframework.Permission;
8 import com.sslexplorer.policyframework.PolicyConstants;
9 import com.sslexplorer.security.SessionInfo;
10 import com.sslexplorer.table.AvailableTableItemAction;
11 import com.sslexplorer.table.TableItemAction;
12
13 public final class ExtensionInformationAction extends TableItemAction {
14
15     public ExtensionInformationAction() {
16         super("extensionInformation", "extensions", 400, "", 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().getInstructionsURL()!=null && !item.getBundle().getInstructionsURL().equals("") && !item.getSubFormName().equals("updateableExtensionsForm");
23     }
24
25     public String JavaDoc getOnClick(AvailableTableItemAction availableItem) {
26         ExtensionBundleItem item = (ExtensionBundleItem)availableItem.getRowItem();
27         return "window.open('" + item.getBundle().getInstructionsURL() + "')";
28     }
29 }
Popular Tags