public abstract class ShareService extends Command
Constructor and Description |
---|
ShareService(String name,
Image icon)
Constructor with the service name and icon
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt)
This method is called when the soft button/Menu item is clicked
|
abstract boolean |
canShareImage()
The implementing service needs to declare if it is capable to share an
image
|
void |
finish()
Once the share service has finished sharing it should call the finish
method
|
Form |
getOriginal()
Gets the original Form
|
void |
setImage(String image,
String mime)
Sets the image to share, this is done by the ShareButton and shouldn't
be used by the developers
|
void |
setMessage(String message)
Sets the message to share, this is done by the ShareButton and shouldn't
be used by the developers
|
void |
setOriginalForm(Form original)
Sets the Original Form (this is the Form of the share button)
|
abstract void |
share(String text)
This is the sharing method which should be implemented by the service.
|
void |
share(String text,
String image,
String imageMimeType)
This is the image sharing method which should be implemented by the
service, if the service returned true on the canShareImage() method
Notice not all services are able to share text and image together, in this
case the image sharing will be preferred by these services
|
create, createMaterial, equals, getClientProperty, getCommandName, getDisabledIcon, getIcon, getIconFont, getIconGapMM, getId, getMaterialIcon, getMaterialIconSize, getPressedIcon, getRolloverIcon, hashCode, isDisposesDialog, isEnabled, putClientProperty, setCommandName, setDisabledIcon, setDisposesDialog, setEnabled, setIcon, setIconFont, setIconGapMM, setMaterialIcon, setMaterialIconSize, setPressedIcon, setRolloverIcon, toString
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
actionPerformed
in class Command
evt
- the Event Objectpublic abstract void share(String text)
text
- text to sharepublic void share(String text, String image, String imageMimeType)
text
- text to shareimage
- image to sharepublic abstract boolean canShareImage()
public void setMessage(String message)
message
- public void setImage(String image, String mime)
image
- the file path to the imagemime
- the image mime type e.g. image/png, image/jpegpublic void setOriginalForm(Form original)
public Form getOriginal()
public void finish()