Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
#5 [Wizard] Tweak msg when the files exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoghuman committed Nov 14, 2015
1 parent b8f35dd commit 46a3a93
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

info.filename.isnt.valid=Provide valid 'Filename'.
info.filename.isnt.valid=Provide valid 'file name'.

error.filename.contains.wrong.chars=The 'Filename' contains invalid characters.
error.files.already.exists=The files with the prefix '{0}' already exists.
error.package.isnt.folder=The package isn't a folder.
error.package.name.isnt.valid=Provide valid package name.
error.target.folder.doesnt.exists=The target folder doesn't exists.
error.target.folder.is.readonly=The target folder is read-only.
error.filename.contains.wrong.chars=The 'file name' contains invalid characters.
error.files.already.exists=The files with the prefix %s already exists.
error.package.isnt.folder=The 'package' isn't a folder.
error.package.name.isnt.valid=Provide valid 'package' name.
error.target.folder.doesnt.exists=The 'target' folder doesn't exists.
error.target.folder.is.readonly=The 'target' folder is read-only.

msg.combobox.model.please.wait=Please Wait...

warning.file.and.package.name.arent.equals=Provided file and package name aren't equals.
warning.file.and.package.name.arent.equals=Provided 'file and package' names aren't equals.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ public static Object getPreselectedPackage(SourceGroupSupport.SourceGroupProxy g
* @return localized error message or null if all right
*/
public static String canUseFileName(FileObject targetFolder, String folderName, String newObjectName, String extension) {
String newObjectNameToDisplay = newObjectName;
// String newObjectNameToDisplay = newObjectName;
final String fileAndPackageName = newObjectName;
if (newObjectName != null) {
newObjectName = newObjectName.replace('.', '/'); // NOI18N
}

if (extension != null && extension.length() > 0) {
final StringBuilder sb = new StringBuilder();
sb.append(newObjectName);
Expand All @@ -111,14 +113,6 @@ public static String canUseFileName(FileObject targetFolder, String folderName,
newObjectName = sb.toString();
}

if (extension != null && extension.length() > 0) {
final StringBuilder sb = new StringBuilder();
sb.append(newObjectNameToDisplay);
sb.append('.'); // NOI18N
sb.append(extension);
newObjectNameToDisplay = sb.toString();
}

final String relFileName = folderName + '/' + newObjectName; // NOI18N

// test whether the selected folder on selected filesystem already exists
Expand All @@ -138,7 +132,10 @@ public static String canUseFileName(FileObject targetFolder, String folderName,
}

if (existFileName(targetFolder, relFileName)) {
return NbBundle.getMessage(PluginSupport.class, MSG_ERROR__FILES_ALREADY_EXISTS, newObjectNameToDisplay);
String msgFilesAlreadyExists = NbBundle.getMessage(PluginSupport.class, MSG_ERROR__FILES_ALREADY_EXISTS);
msgFilesAlreadyExists = String.format(msgFilesAlreadyExists, fileAndPackageName);

return msgFilesAlreadyExists;
}

// all ok
Expand Down

0 comments on commit 46a3a93

Please sign in to comment.