Class ShareService
java.lang.Object
com.codename1.ui.Command
com.codename1.share.ShareService
- All Implemented Interfaces:
ActionListener<ActionEvent>
- Direct Known Subclasses:
EmailShare, FacebookShare, SMSShare
This is an abstract sharing service.
-
Constructor Summary
ConstructorsConstructorDescriptionShareService(String name, Image icon) Constructor with the service name and icon -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method is called when the soft button/Menu item is clickedabstract booleanThe implementing service needs to declare if it is capable to share an imagevoidfinish()Once the share service has finished sharing it should call the finish methodGets the original FormvoidSets the image to share, this is done by the ShareButton and shouldn't be used by the developersvoidsetMessage(String message) Sets the message to share, this is done by the ShareButton and shouldn't be used by the developersvoidsetOriginalForm(Form original) Sets the Original Form (this is the Form of the share button)abstract voidThis is the sharing method which should be implemented by the service.voidThis 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 servicesMethods inherited from class Command
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
-
Constructor Details
-
ShareService
-
-
Method Details
-
actionPerformed
This method is called when the soft button/Menu item is clicked
Parameters
evt: the Event Object
- Specified by:
actionPerformedin interfaceActionListener<ActionEvent>- Overrides:
actionPerformedin classCommand
-
setMessage
Sets the message to share, this is done by the ShareButton and shouldn't be used by the developers
Parameters
message
-
setImage
-
setOriginalForm
Sets the Original Form (this is the Form of the share button) -
getOriginal
Gets the original Form -
finish
public void finish()Once the share service has finished sharing it should call the finish method
-