source: josm/trunk/src/org/openstreetmap/josm/gui/layer/UploadToServer.java@ 12669

Last change on this file since 12669 was 9751, checked in by Don-vip, 8 years ago

see #12462 - Extend Save Layers dialog for more layer types (patch by holgermappt, modified for checkstyle compliance)

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.layer;
3
4import org.openstreetmap.josm.gui.io.AbstractIOTask;
5import org.openstreetmap.josm.gui.io.AbstractUploadDialog;
6import org.openstreetmap.josm.gui.progress.ProgressMonitor;
7
8/**
9 * Interface for layers that can upload data.
10 * @since 9751
11 */
12public interface UploadToServer {
13
14 /**
15 * Determines if the layer is able to upload data and implements the
16 * {@code UploadToServer} interface. A layer that implements the
17 * {@code UploadToServer} interface must return {@code true}.
18 *
19 * @return {@code true} if the layer is able to upload data; {@code false}, otherwise
20 */
21 boolean isUploadable();
22
23 /**
24 * Determines if the data managed by this layer needs to be uploaded to
25 * the server because it contains modified data.
26 *
27 * @return {@code true} if the data managed by this layer needs to be
28 * uploaded to the server because it contains modified data;
29 * {@code false}, otherwise
30 */
31 boolean requiresUploadToServer();
32
33 /**
34 * Determines if upload of data managed by this layer is discouraged.
35 * This feature allows to use "private" data layers.
36 *
37 * @return {@code true} if upload is discouraged for this layer; {@code false}, otherwise
38 */
39 boolean isUploadDiscouraged();
40
41 /**
42 * Initializes the layer after a successful upload to the server.
43 */
44 void onPostUploadToServer();
45
46 /**
47 * Creates a new {@code AbstractIOTask} for uploading data.
48 * @param monitor The progress monitor
49 * @return a new {@code AbstractIOTask} for uploading data, or {@code null} if not applicable
50 */
51 AbstractIOTask createUploadTask(ProgressMonitor monitor);
52
53 /**
54 * Returns the upload dialog for this layer.
55 * @return the upload dialog for this layer, or {@code null} if not applicable
56 */
57 AbstractUploadDialog getUploadDialog();
58}
Note: See TracBrowser for help on using the repository browser.