public class CmsUploadButton
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.user.client.ui.HasHorizontalAlignment
限定符和类型 | 类和说明 |
---|---|
protected static interface |
CmsUploadButton.I_CmsUploadButtonUiBinder
The ui-binder interface.
|
限定符和类型 | 字段和说明 |
---|---|
protected com.google.gwt.user.client.ui.HTML |
m_buttonFace
The button face.
|
protected CmsFlowPanel |
m_main
The main panel.
|
构造器和说明 |
---|
CmsUploadButton(I_CmsUploadButtonHandler buttonHandler)
The default constructor.
|
限定符和类型 | 方法和说明 |
---|---|
CmsFileInput |
createFileInput()
Creates and adds a file input.
|
void |
disable(java.lang.String disabledReason)
Disables the button and changes the button title attribute to the disabled reason.
|
void |
enable()
Enables the button, switching the button title attribute from the disabled reason to the original title.
|
static java.lang.String |
formatBytes(long filesize)
Formats a given bytes value (file size).
|
I_CmsUploadButtonHandler |
getButtonHandler()
Gets the upload button handler instance for this button.
|
protected java.lang.String |
getFaceHtml(java.lang.String text,
java.lang.String imageClass)
Convenience method to assemble the HTML to use for a button face.
|
com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant |
getHorizontalAlignment()
This is the alignment of the text in reference to the image, possible values are left or right.
|
java.lang.String |
getImageClass()
Returns the master image class.
|
I_CmsButton.Size |
getSize()
Returns the size.
|
java.lang.String |
getText()
Returns the text.
|
java.lang.String |
getTitle()
Returns the title.
|
protected void |
handleMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event)
Handles the mouse over event on the main panel.
|
protected void |
handleMouseOver(com.google.gwt.event.dom.client.MouseOverEvent event)
Handles the mouse over event on the main panel.
|
boolean |
isEnabled()
Returns if the upload button is enabled.
|
boolean |
isUseMinWidth()
Checks if the button is constraint to a minimal width.
|
void |
reinitButton(I_CmsUploadButtonHandler buttonHandler)
Reinitializes the button with a new button handler.
|
void |
setButtonStyle(I_CmsButton.ButtonStyle style,
I_CmsButton.ButtonColor color)
Sets the button style.
|
void |
setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
This is the alignment of the text in reference to the image, possible values are left or right.
|
void |
setImageClass(java.lang.String imageClass)
Sets the master image class.
|
void |
setSize(I_CmsButton.Size size)
Sets the size.
|
void |
setText(java.lang.String text)
Sets the text.
|
void |
setTitle(java.lang.String title) |
void |
setUpFace(java.lang.String text,
java.lang.String imageClass)
Sets the up face text and image.
|
void |
setUseMinWidth(boolean useMinWidth)
Tells the button to use a minimal width.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
@UiField protected com.google.gwt.user.client.ui.HTML m_buttonFace
@UiField protected CmsFlowPanel m_main
public CmsUploadButton(I_CmsUploadButtonHandler buttonHandler)
Creates a new upload button. This upload button opens a new OS file selector on click.
On change the button handler passed into the constructor is notified.
buttonHandler
- the buttonHandlerpublic static java.lang.String formatBytes(long filesize)
filesize
- the file size to formatpublic CmsFileInput createFileInput()
public void disable(java.lang.String disabledReason)
disabledReason
- the disabled reasonpublic void enable()
public I_CmsUploadButtonHandler getButtonHandler()
public com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
getHorizontalAlignment
在接口中 com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.getHorizontalAlignment()
public java.lang.String getImageClass()
public I_CmsButton.Size getSize()
public java.lang.String getText()
public java.lang.String getTitle()
getTitle
在类中 com.google.gwt.user.client.ui.UIObject
public boolean isEnabled()
true
if the upload button is enabledpublic boolean isUseMinWidth()
true
if the button is constraint to a minimal widthpublic void reinitButton(I_CmsUploadButtonHandler buttonHandler)
buttonHandler
- the button handlerpublic void setButtonStyle(I_CmsButton.ButtonStyle style, I_CmsButton.ButtonColor color)
style
- the style to setcolor
- the color to setpublic void setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
setHorizontalAlignment
在接口中 com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant)
public void setImageClass(java.lang.String imageClass)
imageClass
- the master image class to setpublic void setSize(I_CmsButton.Size size)
size
- the size to setpublic void setText(java.lang.String text)
text
- the text to setpublic void setTitle(java.lang.String title)
setTitle
在类中 com.google.gwt.user.client.ui.UIObject
UIObject.setTitle(java.lang.String)
public void setUpFace(java.lang.String text, java.lang.String imageClass)
text
- the up face text to set, set to null
to not show anyimageClass
- the up face image class to use, set to null
to not show anypublic void setUseMinWidth(boolean useMinWidth)
useMinWidth
- true
to use a minimal widthprotected java.lang.String getFaceHtml(java.lang.String text, java.lang.String imageClass)
text
- text the up face text to set, set to null
to not show anyimageClass
- the up face image class to use, set to null
to not show any@UiHandler(value="m_main") protected void handleMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event)
event
- the eventMouseOutHandler.onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent)
@UiHandler(value="m_main") protected void handleMouseOver(com.google.gwt.event.dom.client.MouseOverEvent event)
event
- the eventMouseOverHandler.onMouseOver(com.google.gwt.event.dom.client.MouseOverEvent)