public class UploadAction extends JosmAction
Modifier and Type | Field and Description |
---|---|
private static List<UploadHook> |
lateUploadHooks |
private static List<UploadHook> |
uploadHooks
The list of upload hooks.
|
sc
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
UploadAction() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
protected static void |
alertUnresolvedConflicts(OsmDataLayer layer) |
static boolean |
checkPreUploadConditions(AbstractModifiableLayer layer) |
static boolean |
checkPreUploadConditions(AbstractModifiableLayer layer,
APIDataSet apiData)
Check whether the preconditions are met to upload data in
apiData . |
static void |
registerUploadHook(UploadHook hook)
Registers an upload hook.
|
static void |
registerUploadHook(UploadHook hook,
boolean late)
Registers an upload hook.
|
static void |
unregisterUploadHook(UploadHook hook)
Unregisters an upload hook.
|
protected void |
updateEnabledState()
Refreshes the enabled state
|
void |
uploadData(OsmDataLayer layer,
APIDataSet apiData)
Uploads data to the OSM API.
|
static boolean |
warnUploadDiscouraged(AbstractModifiableLayer layer)
returns true if the user wants to cancel, false if they
want to continue
|
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
private static final List<UploadHook> uploadHooks
private static final List<UploadHook> lateUploadHooks
public UploadAction()
public static void registerUploadHook(UploadHook hook)
hook
- the upload hook. Ignored if null.public static void registerUploadHook(UploadHook hook, boolean late)
hook
- the upload hook. Ignored if null.late
- true, if the hook should be executed after the upload dialog
has been confirmed. Late upload hooks should in general succeed and not
abort the upload.public static void unregisterUploadHook(UploadHook hook)
hook
- the upload hook. Ignored if null.protected void updateEnabledState()
updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
public static boolean checkPreUploadConditions(AbstractModifiableLayer layer)
protected static void alertUnresolvedConflicts(OsmDataLayer layer)
public static boolean warnUploadDiscouraged(AbstractModifiableLayer layer)
public static boolean checkPreUploadConditions(AbstractModifiableLayer layer, APIDataSet apiData)
apiData
.
Makes sure upload is allowed, primitives in apiData
don't participate in conflicts and
runs the installed UploadHook
s.layer
- the source layer of the data to be uploadedapiData
- the data to be uploadedpublic void uploadData(OsmDataLayer layer, APIDataSet apiData)
layer
- the source layer for the data to uploadapiData
- the primitives to be added, updated, or deletedpublic void actionPerformed(ActionEvent e)