1 19 package org.netbeans.spi.project.ui.support; 20 21 import org.netbeans.api.project.Project; 22 import org.netbeans.spi.project.support.ProjectOperations; 23 import org.netbeans.modules.project.uiapi.DefaultProjectOperationsImplementation; 24 25 35 public final class DefaultProjectOperations { 36 37 40 private DefaultProjectOperations() { 41 } 42 43 54 public static void performDefaultDeleteOperation(Project p) throws IllegalArgumentException { 55 if (p == null) { 56 throw new IllegalArgumentException ("Project is null"); 57 } 58 59 if (!ProjectOperations.isDeleteOperationSupported(p)) { 60 throw new IllegalStateException ("Attempt to delete project that does not support deletion."); 61 } 62 63 DefaultProjectOperationsImplementation.deleteProject(p); 64 } 65 66 77 public static void performDefaultCopyOperation(Project p) throws IllegalArgumentException { 78 if (p == null) { 79 throw new IllegalArgumentException ("Project is null"); 80 } 81 82 if (!ProjectOperations.isCopyOperationSupported(p)) { 83 throw new IllegalStateException ("Attempt to delete project that does not support copy."); 84 } 85 86 DefaultProjectOperationsImplementation.copyProject(p); 87 } 88 89 100 public static void performDefaultMoveOperation(Project p) throws IllegalArgumentException { 101 if (p == null) { 102 throw new IllegalArgumentException ("Project is null"); 103 } 104 105 if (!ProjectOperations.isMoveOperationSupported(p)) { 106 throw new IllegalArgumentException ("Attempt to delete project that does not support move."); 107 } 108 109 DefaultProjectOperationsImplementation.moveProject(p); 110 } 111 112 124 public static void performDefaultRenameOperation(Project p, String newName) throws IllegalArgumentException { 125 if (p == null) { 126 throw new IllegalArgumentException ("Project is null"); 127 } 128 129 if (!ProjectOperations.isMoveOperationSupported(p)) { 130 throw new IllegalArgumentException ("Attempt to delete project that does not support move."); 131 } 132 133 DefaultProjectOperationsImplementation.renameProject(p, newName); 134 } 135 136 } 137 | Popular Tags |