public class Util extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
IMAGE_EXTS |
static String[] |
MEDIA_EXTS |
static String[] |
OFFICE_EXTS |
static String[] |
WEBCONTENT_EXTS |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static void |
changeLocale(String locale) |
static String |
contextPath() |
static void |
copyToClipboard(String text) |
static String |
downloadURL(long docId,
String fileVersion,
boolean open) |
static void |
exportCSV(com.smartgwt.client.widgets.grid.ListGrid listGrid,
boolean allFields)
Exports into the CSV format the content of a ListGrid.
|
static String |
flashHTML(String flashName,
int width,
int height,
String flashvars)
Generates Flash code
|
static String |
flashPrefix() |
static String |
flashPreview(String flashName,
int width,
int height,
int zoom,
String flashvars,
boolean printEnabled,
String language)
Generates Flash code for Preview
|
static String |
flashPreviewAudioVideo(String flashName,
String mediaUrl,
String mediaProvider,
int width,
int height)
Generates Flash code for Audio and Video Preview
|
static String |
flashUrl(String flashName) |
static String |
formatPercentage(double value,
int fixed)
Format number percentage.
|
static String |
formatSize(double size)
Format file size in Bytes, KBytes or MBytes.
|
static String |
formatSizeBytes(double size)
Format file size in bytes
|
static String |
formatSizeKB(double size)
Format file size in KB.
|
static String |
formatSizeW7(double size)
Format file size in Windows 7 Style.
|
static String |
fullPreviewUrl(String sid,
long docId,
String fileVersion) |
static String |
getBrowserLanguage()
Get browser language
|
static String |
getUserAgent()
returns 'opera', 'safari', 'ie6', 'ie7', 'gecko', or 'unknown'.
|
static String |
imageHTML(String imageName)
Generates HTML image code with style.
|
static String |
imageHTML(String imageName,
int width,
int height,
String style) |
static String |
imageHTML(String imageName,
String alt)
Generates HTML image code with style.
|
static String |
imagePrefix() |
static String |
imageUrl(String imageName) |
static boolean |
isAllowedForUpload(String filename)
Checks if the passed filename can be uploaded or not on the basis of what
configured in 'upload.disallow'.
|
static boolean |
isImageFile(String fileName) |
static boolean |
isMediaFile(String fileName) |
static boolean |
isOfficeFile(String fileName) |
static boolean |
isOfficeFileType(String type) |
static boolean |
isPreviewable(String fileName) |
static boolean |
isValidEmail(String email) |
static boolean |
isWebContentFile(String fileName) |
static void |
openDropSpot() |
static String |
padLeft(String s,
int n) |
static void |
redirect(String url) |
static void |
showDefaultCursor() |
static void |
showWaitCursor() |
static String |
strip(String src) |
static String |
webEditorUrl(long docId,
String fileName,
int height) |
public static String[] OFFICE_EXTS
public static String[] IMAGE_EXTS
public static String[] MEDIA_EXTS
public static String[] WEBCONTENT_EXTS
public static String imageHTML(String imageName, String alt)
imageName
- the name of the icon imagealt
- the image altpublic static String flashHTML(String flashName, int width, int height, String flashvars)
public static String flashPreview(String flashName, int width, int height, int zoom, String flashvars, boolean printEnabled, String language)
public static String flashPreviewAudioVideo(String flashName, String mediaUrl, String mediaProvider, int width, int height)
public static String contextPath()
public static void changeLocale(String locale)
public static String imagePrefix()
public static String flashPrefix()
public static String imageHTML(String imageName)
imageName
- the image namepublic static boolean isPreviewable(String fileName)
public static boolean isOfficeFile(String fileName)
public static boolean isImageFile(String fileName)
public static boolean isWebContentFile(String fileName)
public static boolean isMediaFile(String fileName)
public static boolean isOfficeFileType(String type)
public static void showWaitCursor()
public static void showDefaultCursor()
public static String formatSize(double size)
size
- The file size in bytes.public static String formatSizeKB(double size)
size
- The file size in bytes.public static String formatSizeW7(double size)
size
- The file size in bytes.public static String formatSizeBytes(double size)
size
- The file size in bytes.public static String formatPercentage(double value, int fixed)
value
- The value to be formatted.fixed
- The number of decimal places.public static String getBrowserLanguage()
public static String getUserAgent()
public static void copyToClipboard(String text)
public static boolean isValidEmail(String email)
public static void redirect(String url)
public static void openDropSpot()
public static void exportCSV(com.smartgwt.client.widgets.grid.ListGrid listGrid, boolean allFields)
listGrid
- Grid containing the dataallFields
- True if all the fields(even if hidden) have to be
extractedpublic static boolean isAllowedForUpload(String filename)
Copyright © 2008-2014 Logical Objects. All Rights Reserved.