Class PolicyEditor
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- net.adoptopenjdk.icedteaweb.client.policyeditor.PolicyEditor
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
public class PolicyEditor extends javax.swing.JPanelThis class provides a policy editing tool as a simpler alternate to the JDK PolicyTool.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPolicyEditor.JCheckBoxWithGroupprivate static classPolicyEditor.PolicyEditorDialogprivate static classPolicyEditor.PolicyEditorFramestatic interfacePolicyEditor.PolicyEditorWindowprivate static classPolicyEditor.PrincipalsPanel-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.event.ActionListeneraboutItwButtonActionprivate java.awt.event.ActionListeneraboutPolicyEditorButtonActionprivate javax.swing.JButtonaddEntryButtonprivate java.awt.event.ActionListeneraddEntryButtonActionprivate java.util.Map<PolicyEditorPermissions,javax.swing.JCheckBox>checkboxMapprivate javax.swing.JButtoncloseButtonprivate java.awt.event.ActionListenercloseButtonActionprivate booleanclosedprivate java.awt.event.ActionListenercopyEntryButtonActionprivate CustomPolicyViewercpViewerprivate javax.swing.JFileChooserfileChooserprivate java.util.List<PolicyEditor.JCheckBoxWithGroup>groupBoxListprivate javax.swing.JList<PolicyIdentifier>listprivate javax.swing.DefaultListModel<PolicyIdentifier>listModelprivate static LoggerLOGprivate java.awt.event.ActionListenermodifyCodebaseButtonActionprivate java.awt.event.ActionListenermodifyPrincipalsButtonActionprivate java.awt.event.ActionListenermodifySignedByButtonActionprivate java.awt.event.ActionListenernewButtonActionprivate javax.swing.JButtonokButtonprivate java.awt.event.ActionListenerokButtonActionprivate java.awt.event.ActionListeneropenButtonActionprivate java.awt.event.ActionListeneropenDefaultButtonActionprivate java.lang.ref.WeakReference<PolicyEditor>parentPolicyEditorSee showChangesSavedDialog/showCouldNotSaveDialog.private java.awt.event.ActionListenerpasteEntryButtonActionPolicyEditorControllerpolicyEditorControllerprivate java.awt.event.ActionListenerpolicyEditorHelpButtonActionprivate javax.swing.JButtonremoveEntryButtonprivate java.awt.event.ActionListenerremoveEntryButtonActionprivate java.awt.event.ActionListenersaveAsButtonActionprivate javax.swing.JScrollPanescrollPaneprivate java.awt.event.ActionListenerviewCustomButtonAction-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description PolicyEditor(java.lang.String filepath)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCustomPermission(PolicyIdentifier identifier, PolicyParser.PermissionEntry permission)private voidaddDefaultAllAppletsIdentifier()voidaddNewEntry(PolicyIdentifier identifier)Add a new identifier to the editor's model.voidaddNewIdentifierInteractive()Display an input dialog, which will disappear when the user enters a valid entry or when the user presses cancel.private intcheckPolicyChangesWithDialog()Detect if the policy settings have changed, either on-disk or in-app.private static java.lang.StringcleanFilePathArgument(java.lang.String filepath)voidclearCustomPermissions(PolicyIdentifier identifier)voidcopyEntry(PolicyIdentifier identifier)Copy an entry to the system clipboardstatic PolicyEditorcreateInstance(java.lang.String filepath)Create a new PolicyEditor instance without passing argv.private static javax.swing.JMenuBarcreateMenuBar(PolicyEditor editor)(package private) voidcustomPolicyViewerClosing()Called by the Custom Policy Viewer on its parent Policy Editor when the Custom Policy Viewer is closing(package private) static java.lang.StringgetCodebaseArgument(CommandLineOptionsParser optionParser)(package private) java.util.Set<java.lang.String>getCodebases()java.util.Collection<PolicyParser.PermissionEntry>getCustomPermissions(PolicyIdentifier identifier)private static java.lang.StringgetDefaultPolicyFilePath()java.io.FilegetFile()(package private) static java.lang.StringgetFilePathArgument(CommandLineOptionsParser optionParser)private booleangetModality()java.util.Map<PolicyEditorPermissions,java.lang.Boolean>getPermissions(PolicyIdentifier identifier)static PolicyEditor.PolicyEditorWindowgetPolicyEditorDialog(java.lang.String filepath)static PolicyEditor.PolicyEditorWindowgetPolicyEditorFrame(java.lang.String filepath)(package private) static java.util.Set<PolicyParser.PrincipalEntry>getPrincipalsArgument(CommandLineOptionsParser optionParser)private PolicyIdentifiergetSelectedPolicyIdentifier()(package private) static java.lang.StringgetSignedByArgument(CommandLineOptionsParser optionParser)private java.lang.StringgetWindowTitleForStatus()(package private) static PolicyIdentifieridentifierFromCodebase(java.lang.String codebase)booleanisClosed()Check if the PolicyEditor instance has been visually closed(package private) static booleanisCodeBaseIdentifier(PolicyIdentifier identifier)booleanisPerformingIO()static voidmain(java.lang.String[] args)Start a Policy Editor instance.voidmodifyCodebase(PolicyIdentifier identifier, java.lang.String newCodebase)voidmodifyPrincipals(PolicyIdentifier identifier, java.util.List<PolicyParser.PrincipalEntry> principalEntries)voidmodifySignedBy(PolicyIdentifier identifier, java.lang.String newSignedBy)voidopenAndParsePolicyFile()voidopenPolicyFileSynchronously()voidpasteEntry(PolicyIdentifier identifier)Paste a grant entry from the system clipboard with a new identifierprivate static voidpolicyEditorWindowQuit(java.awt.Window window)private static voidpreparePolicyEditorWindow(PolicyEditor.PolicyEditorWindow w, PolicyEditor e)private PolicyIdentifierpromptForPolicyIdentifier(PolicyIdentifier initialValues)private booleanpromptOnSaveChangesMade(boolean async)voidremoveIdentifier(PolicyIdentifier identifier)Remove an identifier from the editor's modelprivate voidreplaceIdentifier(PolicyIdentifier oldIdentifier, PolicyIdentifier newIdentifier)private voidresetEntries()private voidsavePolicyFile()Save the policy model into the file pointed to by the filePath field.private static voidsetButtonMnemonic(javax.swing.AbstractButton button, java.lang.String mnemonic)Set a mnemonic key for a menu item or button(package private) voidsetChangesMade(boolean b)private voidsetClosed()voidsetFile(java.lang.String filepath)private static voidsetMenuItemAccelerator(javax.swing.JMenuItem menuItem, java.lang.String accelerator)private voidsetParentWindowTitle(java.lang.String title)voidsetPermission(PolicyIdentifier identifier, PolicyEditorPermissions permission, boolean state)private voidsetupLayout()Lay out all controls, tooltips, etc.private static voidsetupPolicyEditorWindow(java.awt.Window window, PolicyEditor editor)private voidshowChangesSavedDialog()Show a dialog informing the user that their changes have been saved.private voidshowClipboardErrorDialog()private voidshowCouldNotAccessClipboardDialog()private voidshowCouldNotSaveDialog()Show a dialog informing the user that their changes could not be saved.private voidshowInvalidPolicyExceptionDialog(PolicyIdentifier identifier)private voidtoggleExpandedCheckboxGroupPanel(javax.swing.JPanel groupPanel)private voidupdateCheckboxes(PolicyIdentifier identifier)Update the checkboxes to show the permissions granted to the specified identifierprivate voidupdateCheckboxesImpl(PolicyIdentifier identifier)private static booleanvalidateCodebase(java.lang.String codebase)-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
closed
private boolean closed
-
checkboxMap
private final java.util.Map<PolicyEditorPermissions,javax.swing.JCheckBox> checkboxMap
-
groupBoxList
private final java.util.List<PolicyEditor.JCheckBoxWithGroup> groupBoxList
-
scrollPane
private final javax.swing.JScrollPane scrollPane
-
listModel
private final javax.swing.DefaultListModel<PolicyIdentifier> listModel
-
list
private final javax.swing.JList<PolicyIdentifier> list
-
okButton
private final javax.swing.JButton okButton
-
closeButton
private final javax.swing.JButton closeButton
-
addEntryButton
private final javax.swing.JButton addEntryButton
-
removeEntryButton
private final javax.swing.JButton removeEntryButton
-
fileChooser
private final javax.swing.JFileChooser fileChooser
-
cpViewer
private CustomPolicyViewer cpViewer
-
parentPolicyEditor
private final java.lang.ref.WeakReference<PolicyEditor> parentPolicyEditor
See showChangesSavedDialog/showCouldNotSaveDialog. This weak reference is needed because there is a modal child dialog which can sometimes appear after the editor has been closed and disposed. In this case, its parent should be set to 'null', but otherwise the parent should be the editor so that the dialog is modal.
-
policyEditorController
public final PolicyEditorController policyEditorController
-
okButtonAction
private final java.awt.event.ActionListener okButtonAction
-
addEntryButtonAction
private final java.awt.event.ActionListener addEntryButtonAction
-
removeEntryButtonAction
private final java.awt.event.ActionListener removeEntryButtonAction
-
newButtonAction
private final java.awt.event.ActionListener newButtonAction
-
openButtonAction
private final java.awt.event.ActionListener openButtonAction
-
openDefaultButtonAction
private final java.awt.event.ActionListener openDefaultButtonAction
-
saveAsButtonAction
private final java.awt.event.ActionListener saveAsButtonAction
-
viewCustomButtonAction
private final java.awt.event.ActionListener viewCustomButtonAction
-
modifyCodebaseButtonAction
private final java.awt.event.ActionListener modifyCodebaseButtonAction
-
modifyPrincipalsButtonAction
private final java.awt.event.ActionListener modifyPrincipalsButtonAction
-
modifySignedByButtonAction
private final java.awt.event.ActionListener modifySignedByButtonAction
-
copyEntryButtonAction
private final java.awt.event.ActionListener copyEntryButtonAction
-
pasteEntryButtonAction
private final java.awt.event.ActionListener pasteEntryButtonAction
-
policyEditorHelpButtonAction
private final java.awt.event.ActionListener policyEditorHelpButtonAction
-
aboutPolicyEditorButtonAction
private final java.awt.event.ActionListener aboutPolicyEditorButtonAction
-
aboutItwButtonAction
private final java.awt.event.ActionListener aboutItwButtonAction
-
closeButtonAction
private final java.awt.event.ActionListener closeButtonAction
-
-
Method Detail
-
getDefaultPolicyFilePath
private static java.lang.String getDefaultPolicyFilePath()
-
addDefaultAllAppletsIdentifier
private void addDefaultAllAppletsIdentifier()
-
getModality
private boolean getModality()
-
promptOnSaveChangesMade
private boolean promptOnSaveChangesMade(boolean async)
- Parameters:
async- use asynchronous saving, which displays a progress dialog, or use synchronous, which blocks the EDT but allows for eg the on-disk file to be changed without resorting to a busy-wait loop- Returns:
- false iff the user wishes to cancel the operation and keep the current editor state
-
setFile
public void setFile(java.lang.String filepath)
-
setParentWindowTitle
private void setParentWindowTitle(java.lang.String title)
-
getWindowTitleForStatus
private java.lang.String getWindowTitleForStatus()
-
getSelectedPolicyIdentifier
private PolicyIdentifier getSelectedPolicyIdentifier()
-
preparePolicyEditorWindow
private static void preparePolicyEditorWindow(PolicyEditor.PolicyEditorWindow w, PolicyEditor e)
-
setupPolicyEditorWindow
private static void setupPolicyEditorWindow(java.awt.Window window, PolicyEditor editor)
-
policyEditorWindowQuit
private static void policyEditorWindowQuit(java.awt.Window window)
-
getPolicyEditorFrame
public static PolicyEditor.PolicyEditorWindow getPolicyEditorFrame(java.lang.String filepath)
-
getPolicyEditorDialog
public static PolicyEditor.PolicyEditorWindow getPolicyEditorDialog(java.lang.String filepath)
-
setClosed
private void setClosed()
-
isClosed
public boolean isClosed()
Check if the PolicyEditor instance has been visually closed- Returns:
- if the PolicyEditor instance has been closed
-
customPolicyViewerClosing
void customPolicyViewerClosing()
Called by the Custom Policy Viewer on its parent Policy Editor when the Custom Policy Viewer is closing
-
addNewEntry
public void addNewEntry(PolicyIdentifier identifier)
Add a new identifier to the editor's model.- Parameters:
identifier- to be added
-
identifierFromCodebase
static PolicyIdentifier identifierFromCodebase(java.lang.String codebase)
-
validateCodebase
private static boolean validateCodebase(java.lang.String codebase)
-
getFile
public java.io.File getFile()
-
addNewIdentifierInteractive
public void addNewIdentifierInteractive()
Display an input dialog, which will disappear when the user enters a valid entry or when the user presses cancel.
-
promptForPolicyIdentifier
private PolicyIdentifier promptForPolicyIdentifier(PolicyIdentifier initialValues)
-
removeIdentifier
public void removeIdentifier(PolicyIdentifier identifier)
Remove an identifier from the editor's model- Parameters:
identifier- to be removed
-
modifyCodebase
public void modifyCodebase(PolicyIdentifier identifier, java.lang.String newCodebase)
-
modifyPrincipals
public void modifyPrincipals(PolicyIdentifier identifier, java.util.List<PolicyParser.PrincipalEntry> principalEntries)
-
modifySignedBy
public void modifySignedBy(PolicyIdentifier identifier, java.lang.String newSignedBy)
-
replaceIdentifier
private void replaceIdentifier(PolicyIdentifier oldIdentifier, PolicyIdentifier newIdentifier)
-
copyEntry
public void copyEntry(PolicyIdentifier identifier)
Copy an entry to the system clipboard- Parameters:
identifier- the identifier to copy
-
pasteEntry
public void pasteEntry(PolicyIdentifier identifier) throws java.awt.datatransfer.UnsupportedFlavorException, PolicyParser.ParsingException, java.io.IOException
Paste a grant entry from the system clipboard with a new identifier- Throws:
java.awt.datatransfer.UnsupportedFlavorExceptionPolicyParser.ParsingExceptionjava.io.IOException
-
getCodebases
java.util.Set<java.lang.String> getCodebases()
-
isCodeBaseIdentifier
static boolean isCodeBaseIdentifier(PolicyIdentifier identifier)
-
setPermission
public void setPermission(PolicyIdentifier identifier, PolicyEditorPermissions permission, boolean state)
-
getPermissions
public java.util.Map<PolicyEditorPermissions,java.lang.Boolean> getPermissions(PolicyIdentifier identifier)
-
addCustomPermission
public void addCustomPermission(PolicyIdentifier identifier, PolicyParser.PermissionEntry permission)
-
getCustomPermissions
public java.util.Collection<PolicyParser.PermissionEntry> getCustomPermissions(PolicyIdentifier identifier)
-
clearCustomPermissions
public void clearCustomPermissions(PolicyIdentifier identifier)
-
updateCheckboxes
private void updateCheckboxes(PolicyIdentifier identifier)
Update the checkboxes to show the permissions granted to the specified identifier- Parameters:
identifier- whose permissions to display
-
updateCheckboxesImpl
private void updateCheckboxesImpl(PolicyIdentifier identifier)
-
setButtonMnemonic
private static void setButtonMnemonic(javax.swing.AbstractButton button, java.lang.String mnemonic)Set a mnemonic key for a menu item or button- Parameters:
button- the component for which to set a mnemonicmnemonic- the mnemonic to set
-
setMenuItemAccelerator
private static void setMenuItemAccelerator(javax.swing.JMenuItem menuItem, java.lang.String accelerator)
-
createMenuBar
private static javax.swing.JMenuBar createMenuBar(PolicyEditor editor)
-
setupLayout
private void setupLayout()
Lay out all controls, tooltips, etc.
-
setChangesMade
void setChangesMade(boolean b)
-
resetEntries
private void resetEntries()
-
isPerformingIO
public boolean isPerformingIO()
- Returns:
- whether this PolicyEditor is currently opening or saving a policy file to disk
-
openPolicyFileSynchronously
public void openPolicyFileSynchronously()
-
openAndParsePolicyFile
public void openAndParsePolicyFile()
-
savePolicyFile
private void savePolicyFile()
Save the policy model into the file pointed to by the filePath field.
-
showChangesSavedDialog
private void showChangesSavedDialog()
Show a dialog informing the user that their changes have been saved.
-
showCouldNotSaveDialog
private void showCouldNotSaveDialog()
Show a dialog informing the user that their changes could not be saved.
-
showClipboardErrorDialog
private void showClipboardErrorDialog()
-
showInvalidPolicyExceptionDialog
private void showInvalidPolicyExceptionDialog(PolicyIdentifier identifier)
-
showCouldNotAccessClipboardDialog
private void showCouldNotAccessClipboardDialog()
-
checkPolicyChangesWithDialog
private int checkPolicyChangesWithDialog()
Detect if the policy settings have changed, either on-disk or in-app. If an on-disk change has occurred, update the Md5.- Returns:
- The user's choice (Yes/No/Cancel - see JOptionPane constants). "Cancel" if the file hasn't changed but the user has made modifications to the settings. "No" otherwise
-
toggleExpandedCheckboxGroupPanel
private void toggleExpandedCheckboxGroupPanel(javax.swing.JPanel groupPanel)
-
main
public static void main(java.lang.String[] args)
Start a Policy Editor instance.- Parameters:
args- "-file $FILENAME" and/or "-codebase $CODEBASE" are accepted flag/value pairs. -file specifies a file path to be opened by the editor. If none is provided, the default policy file location for the user is opened. -help will print a help message and immediately return (no editor instance opens)
-
getCodebaseArgument
static java.lang.String getCodebaseArgument(CommandLineOptionsParser optionParser)
-
getSignedByArgument
static java.lang.String getSignedByArgument(CommandLineOptionsParser optionParser)
-
getPrincipalsArgument
static java.util.Set<PolicyParser.PrincipalEntry> getPrincipalsArgument(CommandLineOptionsParser optionParser)
-
getFilePathArgument
static java.lang.String getFilePathArgument(CommandLineOptionsParser optionParser)
-
cleanFilePathArgument
private static java.lang.String cleanFilePathArgument(java.lang.String filepath)
-
createInstance
public static PolicyEditor createInstance(java.lang.String filepath)
Create a new PolicyEditor instance without passing argv. The returned instance is not yet set visible.- Parameters:
filepath- a policy file to open at start, or null if no file to load- Returns:
- a reference to a new PolicyEditor instance
-
-