public class UploadAction extends JosmAction
| Modifier and Type | Field and Description |
|---|---|
private static java.util.List<UploadHook> |
lateUploadHooks |
private static java.util.List<UploadHook> |
uploadHooks
The list of upload hooks.
|
sc| Constructor and Description |
|---|
UploadAction() |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.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, updateEnabledStateprivate static final java.util.List<UploadHook> uploadHooks
private static final java.util.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 JosmActionJosmAction.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 UploadHooks.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(java.awt.event.ActionEvent e)