public abstract class ShareService
ImplementsActionListener<ActionEvent>
Known subtypesEmailShare, FacebookShare, SMSShare
Constructors
public ShareService(String name, Image icon) | Constructor with the service name and icon |
Methods
public void actionPerformed(ActionEvent evt) | This method is called when the soft button/Menu item is clicked |
public abstract void share(String text) | This is the sharing method which should be implemented by the service. |
public 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 b… |
public abstract boolean canShareImage() | The implementing service needs to declare if it is capable to share an image |
public void setMessage(String message) | Sets the message to share, this is done by the ShareButton and shouldn’t be used by the developers |
public 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 |
public void setOriginalForm(Form original) | Sets the Original Form (this is the Form of the share button) |
public Form getOriginal() | Gets the original Form |
public void finish() | Once the share service has finished sharing it should call the finish method |
public void setShareResultListener(ShareResultListener listener) | Registers a listener to be notified once when the share completes. |
public ShareResultListener getShareResultListener() | Returns the registered result listener (may be null). |
protected void deliverResult(ShareResult result) | Delivers a ShareResult to the registered listener exactly once. |
Inherited fields
From Command
DESKTOP_MENU, DESKTOP_MENU_APP, DESKTOP_MENU_ABOUT, DESKTOP_MENU_PREFERENCES, DESKTOP_MENU_QUIT, DESKTOP_MENU_FILE, DESKTOP_MENU_EDIT, DESKTOP_MENU_VIEW, DESKTOP_MENU_WINDOW, DESKTOP_MENU_HELP, DESKTOP_SHORTCUT_KEY, DESKTOP_SHORTCUT_MODIFIERS, DESKTOP_SHORTCUT_MODIFIER_PRIMARY, DESKTOP_SHORTCUT_MODIFIER_SHIFT, DESKTOP_SHORTCUT_MODIFIER_ALT
Inherited methods
From Command
create, createMaterial, getId, getCommandName, setCommandName, getIcon, setIcon, toString, getPressedIcon, setPressedIcon, getDisabledIcon, setDisabledIcon, getRolloverIcon, setRolloverIcon, equals, hashCode, isDisposesDialog, setDisposesDialog, isEnabled, setEnabled, getClientProperty, putClientProperty, setDesktopMenu, getDesktopMenu, setDesktopShortcut, setDesktopShortcut, getDesktopShortcutKeyChar, getDesktopShortcutModifiers, getMaterialIcon, setMaterialIcon, getIconGapMM, setIconGapMM, getMaterialIconSize, setMaterialIconSize, getIconFont, setIconFont
Constructor details
ShareService
public ShareService(String name, Image icon)Parameters
nameString- the service name
iconImage- the service icon
Method details
actionPerformed
public void actionPerformed(ActionEvent evt)Parameters
evtActionEvent- the Event Object
setMessage
public void setMessage(String message)setImage
public void setImage(String image, String mime)Parameters
imageString- the file path to the image
mimeString- the image mime type e.g. image/png, image/jpeg
setOriginalForm
public void setOriginalForm(Form original)getOriginal
public Form getOriginal()finish
public void finish()