Changeset 2017
- Timestamp:
- 03/28/08 10:36:48
(8 months ago)
- Author:
- apatel
- Message:
localized the messages in the custom action.
removed the remove custom policy action.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2009 |
r2017 |
|
| 46 | 46 | { |
|---|
| 47 | 47 | |
|---|
| 48 | | public static final String ID = "custom.policy.addpolicy"; |
|---|
| | 48 | public static final String ID = "custom.policy.addpolicy"; //$NON-NLS-1$ |
|---|
| 49 | 49 | private GraphicPolicyEditor mEditor; |
|---|
| 50 | 50 | |
|---|
| 51 | 51 | public AddCustomPolicy (GraphicPolicyEditor part) |
|---|
| 52 | 52 | { |
|---|
| 53 | | super ("Add Custom Policy..."); |
|---|
| | 53 | super (Messages.custom_policy_name); |
|---|
| 54 | 54 | mEditor = part; |
|---|
| 55 | 55 | setEnabled (false); |
|---|
| 56 | | setToolTipText ("Creates a new module that contains custom policy"); |
|---|
| | 56 | setToolTipText (Messages.custom_policy_tool_tip); |
|---|
| 57 | 57 | } |
|---|
| 58 | 58 | |
|---|
| … | … | |
| 74 | 74 | */ |
|---|
| 75 | 75 | Shell shell = SEFramework_Plugin.getDefault ().getWorkbench ().getActiveWorkbenchWindow ().getShell (); |
|---|
| 76 | | boolean OK = MessageDialog.openConfirm (shell, "Custom Policy", "Are you sure you want to modify the policy?"); |
|---|
| | 76 | boolean OK = MessageDialog.openConfirm (shell, Messages.custom_policy_dialog_title, Messages.custom_policy_warning_message); |
|---|
| 77 | 77 | |
|---|
| 78 | 78 | if( ! OK ) |
|---|
| … | … | |
| 86 | 86 | if( files == null ) |
|---|
| 87 | 87 | { |
|---|
| 88 | | MessageDialog.openError (shell, "Custom Policy", "Could not find files."); |
|---|
| | 88 | MessageDialog.openError (shell, Messages.custom_policy_dialog_title, Messages.custom_policy_file_error); //$NON-NLS-1$ |
|---|
| 89 | 89 | return; |
|---|
| 90 | 90 | } |
|---|
| … | … | |
| 99 | 99 | if( stream == null ) |
|---|
| 100 | 100 | { |
|---|
| 101 | | System.out.println ("AddCustomPolicy.run() --> No Policy Found"); |
|---|
| 102 | 101 | return; |
|---|
| 103 | 102 | } |
|---|
| … | … | |
| 117 | 116 | catch(PartInitException pe) |
|---|
| 118 | 117 | { |
|---|
| 119 | | ErrorDialog.openError (shell,"Error" ,pe.getMessage (), pe.getStatus ()); |
|---|
| | 118 | ErrorDialog.openError (shell,Messages.custom_policy_dialog_title,pe.getMessage (), pe.getStatus ()); |
|---|
| 120 | 119 | } |
|---|
| 121 | 120 | catch(CoreException ce) |
|---|
| 122 | 121 | { |
|---|
| 123 | | ErrorDialog.openError (shell,"Error" ,ce.getMessage (), ce.getStatus ()); |
|---|
| | 122 | ErrorDialog.openError (shell,Messages.custom_policy_dialog_title,ce.getMessage (), ce.getStatus ()); //$NON-NLS-1$ |
|---|
| 124 | 123 | } |
|---|
| 125 | 124 | } |
|---|
| … | … | |
| 129 | 128 | SELinuxSystem system = mEditor.getSystem(); |
|---|
| 130 | 129 | Linkage linkage = system.getLinkage (); |
|---|
| 131 | | // String module_name = system.getCustomPoilcyContainer().getCustomModuleName(); |
|---|
| 132 | 130 | SELinuxPolicy policy = new SELinuxPolicy(linkage, true, system.getName ()); |
|---|
| 133 | 131 | |
|---|
| … | … | |
| 169 | 167 | return null; |
|---|
| 170 | 168 | } |
|---|
| 171 | | |
|---|
| 172 | | void print_debug(Object o) |
|---|
| 173 | | { |
|---|
| 174 | | System.out.println ("---------------------------------------"); |
|---|
| 175 | | if( o == null ) |
|---|
| 176 | | System.out.println ("NULLLLLLLLLLLLLLLLLLLL"); |
|---|
| 177 | | else |
|---|
| 178 | | System.out.println (o); |
|---|
| 179 | | System.out.println ("---------------------------------------"); |
|---|
| 180 | | } |
|---|
| 181 | | |
|---|
| 182 | 169 | } |
|---|
| r2010 |
r2017 |
|
| 93 | 93 | import com.tresys.framework.plugin.builder.SELinuxSystem; |
|---|
| 94 | 94 | import com.tresys.framework.plugin.editor.action.AddCustomPolicy; |
|---|
| 95 | | import com.tresys.framework.plugin.editor.action.RemoveCustomPolicy; |
|---|
| 96 | 95 | import com.tresys.framework.plugin.editor.policy.IPolicyEditor; |
|---|
| 97 | 96 | import com.tresys.framework.plugin.editor.policy.graphic.model.ModelElement; |
|---|
| … | … | |
| 857 | 856 | registry.registerAction(action); |
|---|
| 858 | 857 | getSelectionActions().add(action.getId()); |
|---|
| 859 | | |
|---|
| 860 | | action = new RemoveCustomPolicy(this); |
|---|
| 861 | | registry.registerAction(action); |
|---|
| 862 | | getSelectionActions().add(action.getId()); |
|---|
| 863 | 858 | } |
|---|
| 864 | 859 | |
|---|
| r2010 |
r2017 |
|
| 24 | 24 | import com.tresys.framework.plugin.editor.CDSEditorActionConstants; |
|---|
| 25 | 25 | import com.tresys.framework.plugin.editor.action.AddCustomPolicy; |
|---|
| 26 | | import com.tresys.framework.plugin.editor.action.RemoveCustomPolicy; |
|---|
| 27 | 26 | |
|---|
| 28 | 27 | |
|---|
| … | … | |
| 93 | 92 | menu.appendToGroup (CDSEditorActionConstants.CUSTOM_POLICY, action); |
|---|
| 94 | 93 | } |
|---|
| 95 | | action = getAction (RemoveCustomPolicy.ID); |
|---|
| 96 | | if( action != null ) |
|---|
| 97 | | { |
|---|
| 98 | | action.setEnabled (true); |
|---|
| 99 | | menu.appendToGroup (CDSEditorActionConstants.CUSTOM_POLICY, action); |
|---|
| 100 | | } |
|---|
| 101 | 94 | } |
|---|
| 102 | 95 | |
|---|
Download in other formats:
* Generating other formats may take time.