return null;
}
@Override
protected void encodeScriptAndStyles(FacesContext context, AbstractFileUpload abstractFileUpload, String clientId, String uniqueId) throws IOException {
SingleFileUpload fileUpload = (SingleFileUpload) abstractFileUpload;
String addButtonClass = Styles.getCSSClass(context, fileUpload, fileUpload.getBrowseButtonStyle(), StyleGroup.regularStyleGroup(), fileUpload.getBrowseButtonClass(), null);
String addButtonOnMouseOverClass = Styles.getCSSClass(context, fileUpload, fileUpload.getBrowseButtonRolloverStyle(), StyleGroup.regularStyleGroup(), fileUpload.getBrowseButtonRolloverClass(), null);
String addButtonOnMouseDownClass = Styles.getCSSClass(context, fileUpload, fileUpload.getBrowseButtonPressedStyle(), StyleGroup.regularStyleGroup(), fileUpload.getBrowseButtonPressedClass(), null);
String addButtonOnFocusClass = Styles.getCSSClass(context, fileUpload, fileUpload.getBrowseButtonFocusedStyle(), StyleGroup.regularStyleGroup(), fileUpload.getBrowseButtonFocusedClass(), null);
String addButtonDisabledClass = Styles.getCSSClass(context, fileUpload, fileUpload.getBrowseButtonDisabledStyle(), StyleGroup.regularStyleGroup(), fileUpload.getBrowseButtonDisabledClass(), "o_file_upload_addBtn_dis");
String dropTargetDragoverClass = Styles.getCSSClass(context, fileUpload, fileUpload.getDropTargetDragoverStyle(), StyleGroup.regularStyleGroup(), fileUpload.getDropTargetDragoverClass(), "o_file_drop_target_dragover");
Styles.renderStyleClasses(context, fileUpload);
int uploadedSize = 0;
boolean duplicateAllowed = true;//fileUpload.isDuplicateAllowed();
Position popupPosition = fileUpload.getPosition();
List<String> listOfImages = new LinkedList<String>();
String defStopUrl = null;
if (fileUpload.getStopButtonNearProgress()) {
if (stopButton == null) {
defStopUrl = Resources.getURL(context, null, null, DEFAULT_STOP_URL);
listOfImages.add(defStopUrl);
Rendering.renderPreloadImagesScript(context, listOfImages, false);
}
}
Script initScript = new ScriptBuilder().initScript(context, fileUpload, "O$.SingleFileUpload._init",
uploadedSize,
fileUpload.getNotUploadedStatusText(),
fileUpload.getInProgressStatusText(),
fileUpload.getUploadedStatusText(),
fileUpload.getFileSizeLimitErrorText(),
fileUpload.getUnexpectedErrorText(),
fileUpload.getAcceptedFileTypes(),
duplicateAllowed,
clientId + BROWSE_BTN_ID,
addButtonClass,
addButtonOnMouseOverClass,
addButtonOnMouseDownClass,
addButtonOnFocusClass,
addButtonDisabledClass,
fileUpload.isDisabled(),
fileUpload.getTabindex(),
progressBar.getClientId(context),
fileUpload.getStoppedStatusText(),
fileUpload.getStoppingStatusText(),
uniqueId,
Utilities.getFunctionOfEvent(fileUpload.getOnchange()),
Utilities.getFunctionOfEvent(fileUpload.getOnstart()),
Utilities.getFunctionOfEvent(fileUpload.getOnend()),
Utilities.getFunctionOfEvent(fileUpload.getOnfilestart()),
Utilities.getFunctionOfEvent(fileUpload.getOnfileinprogress()),
Utilities.getFunctionOfEvent(fileUpload.getOnfileend()),
Utilities.getFunctionOfEvent(fileUpload.getOnwrongfiletype()),
Utilities.getFunctionOfEvent(fileUpload.getOndirectorydropped()),
dropTargetDragoverClass,
getRender(context, fileUpload),
getExternalDropTargetId(context, fileUpload),
fileUpload.getAcceptedMimeTypes(),
fileUpload.getLayoutMode(),
defStopUrl,
getIconStyle(fileUpload, layoutMode),
fileUpload.getShowInfoAfterUpload(),
fileUpload.getBrowseButtonDuringUpload(),
fileUpload.getStopButtonNearProgress(),
fileUpload.getDirectoryDroppedText(),
fileUpload.getWrongFileTypeText(),
getExternalButtonId(context, fileUpload),
fileUpload.getShowInPopup(),
getPositionedBy(context, fileUpload),
popupPosition.getHorizontalAlignment(),
popupPosition.getVerticalAlignment(),
popupPosition.getHorizontalDistance(),
popupPosition.getVerticalDistance()