Class TextTagPaster
- java.lang.Object
-
- org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster
-
- org.openstreetmap.josm.gui.datatransfer.importers.AbstractTagPaster
-
- org.openstreetmap.josm.gui.datatransfer.importers.TextTagPaster
-
public final class TextTagPaster extends AbstractTagPaster
This transfer support allows us to import tags from the text that was copied to the clipboard.- Since:
- 10604
-
-
Field Summary
Fields Modifier and Type Field Description private static String
HELP
-
Fields inherited from class org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster
df
-
-
Constructor Summary
Constructors Constructor Description TextTagPaster()
Create a newTextTagPaster
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
containsValidTags(TransferHandler.TransferSupport support)
protected Map<String,String>
getTags(TransferHandler.TransferSupport support)
Gets the tags that should be pasted.private Map<String,String>
getTagsImpl(TransferHandler.TransferSupport support)
static void
showBadBufferMessage(String helpTopic)
Shows message that the buffer can not be pasted, allowing user to clean the bufferboolean
supports(TransferHandler.TransferSupport support)
Checks if this supports importing the given transfer support.static int
warning(String text, String data, String code)
DefaultTextTagParser.TagWarningCallback
implementation.-
Methods inherited from class org.openstreetmap.josm.gui.datatransfer.importers.AbstractTagPaster
commitCommands, importData, importTagsOn
-
Methods inherited from class org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster
supports
-
-
-
-
Constructor Detail
-
TextTagPaster
public TextTagPaster()
Create a newTextTagPaster
-
-
Method Detail
-
supports
public boolean supports(TransferHandler.TransferSupport support)
Description copied from class:AbstractOsmDataPaster
Checks if this supports importing the given transfer support.- Overrides:
supports
in classAbstractOsmDataPaster
- Parameters:
support
- The support that should be supported.- Returns:
- True if we support that transfer.
-
containsValidTags
private boolean containsValidTags(TransferHandler.TransferSupport support) throws UnsupportedFlavorException, IOException
-
getTags
protected Map<String,String> getTags(TransferHandler.TransferSupport support) throws UnsupportedFlavorException, IOException
Description copied from class:AbstractTagPaster
Gets the tags that should be pasted.- Specified by:
getTags
in classAbstractTagPaster
- Parameters:
support
- The TransferSupport to get the tags from.- Returns:
- The tags
- Throws:
UnsupportedFlavorException
- if the requested data flavor is not supportedIOException
- if an I/O error occurs
-
getTagsImpl
private Map<String,String> getTagsImpl(TransferHandler.TransferSupport support) throws UnsupportedFlavorException, IOException
-
warning
public static int warning(String text, String data, String code)
DefaultTextTagParser.TagWarningCallback
implementation. Displays a warning about a problematic tag and ask user what to do about it.- Parameters:
text
- Message to displaydata
- Tag key and/or valuecode
- to use withExtendedDialog#toggleEnable(String)
- Returns:
- 1 to validate and display next warnings if any, 2 to cancel operation, 3 to clear buffer, 4 to paste tags
- Since:
- 12683
-
showBadBufferMessage
public static void showBadBufferMessage(String helpTopic)
Shows message that the buffer can not be pasted, allowing user to clean the buffer- Parameters:
helpTopic
- the help topic of the parent action TODO: Replace by proper HelpAwareOptionPane instead of self-made help link
-
-