Index: VcsAttributes.java =================================================================== RCS file: /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsAttributes.java,v retrieving revision 1.25 diff -c -r1.25 VcsAttributes.java *** VcsAttributes.java 25 Mar 2003 12:41:50 -0000 1.25 --- VcsAttributes.java 1 Apr 2003 13:56:07 -0000 *************** *** 89,94 **** --- 89,106 ---- */ public static final String VCS_REFRESH = "VCS_REFRESH"; //NOI18N /** + * Attribute name for a VCS mkdir action. This action will create a folder + * in VCS. The "write" of this attribute will finish as soon as the action + * is completed. + */ + public static final String VCS_MKDIR_ACTION = "VCS_MKDIR_ACTION"; //NOI18N + + /** + * The name of MKDIR command. + */ + public static final String CMD_NAME_MKDIR = "MKDIR_CMD"; // NOI18N + + /** * Attribute name for a VCS action, that schedules the VCS operation for later processing. * This action should be performed on important secondary file objects. */ *************** *** 247,252 **** --- 259,266 ---- return commandsProvider; } else if (VcsSearchTypeFileSystem.VCS_SEARCH_TYPE_ATTRIBUTE.equals(attrName)) { return fileSystem; + } else if (VcsFileSystem.VAR_FS_DISPLAY_NAME.equals(attrName)) { + return fileSystem.getVariablesAsHashtable().get(VcsFileSystem.VAR_FS_DISPLAY_NAME); } else { if ("NetBeansAttrAssignedLoader".equals(attrName)) { /* DataObject.EA_ASSIGNED_LOADER */ //NOI18N CacheReference ref = fileSystem.getCacheReference(name); *************** *** 287,292 **** --- 301,310 ---- performVcsAction(name, (FeatureDescriptor) value); } else if (VCS_REFRESH.equals(attrName)) { performRefresh(name, value); + } else if (VCS_MKDIR_ACTION.equals(attrName)) { + if (value instanceof String) { + performMkDirAction(name, (String) value); + } } else if (VCS_SCHEDULING_SECONDARY_FO_ACTION.equals(attrName) && value instanceof String) { // Set the scheduling action for a secondary file. value is the action name, // currently "ADD" and "REMOVE" are the only supported values *************** *** 424,429 **** --- 442,474 ---- } } }); + } + + /** + * Call a VCS command, that will create the directory "dir" under "name". + */ + private void performMkDirAction(String name, String dir) throws java.net.UnknownServiceException { + final CommandSupport cmdSupport = fileSystem.getCommandSupport(CMD_NAME_MKDIR); + if (cmdSupport == null) throw new java.net.UnknownServiceException(CMD_NAME_MKDIR); + final Command cmd = cmdSupport.createCommand(); + final VcsDescribedCommand vcscmd; + if (cmd instanceof VcsDescribedCommand) { + vcscmd = (VcsDescribedCommand) cmd; + } else { + throw new java.net.UnknownServiceException(CMD_NAME_MKDIR); + } + java.io.File file = fileSystem.getFile(name); + file = new java.io.File(file, dir); + vcscmd.setDiskFiles(new java.io.File[] { file }); + boolean success = org.netbeans.api.vcs.VcsManager.getDefault().showCustomizer(vcscmd); + if (success) { + CommandTask task = vcscmd.execute(); + try { + task.waitFinished(0); + } catch (InterruptedException iex) { + // Interrupted, we'll finish... + } + } } /**