@Override public void onRename() { final String baseFileName = view.getName(); final String originalFileName = path.getFileName(); final String extension = (originalFileName.lastIndexOf(".") > 0 ? originalFileName.substring(originalFileName.lastIndexOf(".")) : ""); final String fileName = baseFileName + extension; validator.validate( fileName, new ValidatorWithReasonCallback() { @Override public void onFailure(final String reason) { if (ValidationErrorReason.DUPLICATED_NAME.name().equals(reason)) { view.handleDuplicatedFileName(); } else { view.handleInvalidFileName(); } } @Override public void onSuccess() { command.execute(new FileNameAndCommitMessage(baseFileName, view.getCheckInComment())); } @Override public void onFailure() { view.handleInvalidFileName(); } }); }
private void hide() { view.hide(); }
public void show() { view.show(); }