org.openstreetmap.josm.gui.preferences
Class SourceEntry

java.lang.Object
  extended by org.openstreetmap.josm.gui.preferences.SourceEntry
Direct Known Subclasses:
SourceEditor.ExtendedSourceEntry, StyleSource

public class SourceEntry
extends java.lang.Object

A source entry primarily used to save the user's selection of mappaint styles, but also for preset sources.


Field Summary
 boolean active
          active is a boolean flag that can be used to turn the style on or off at runtime.
 java.lang.String name
          Name is used as a namespace for color preferences and (currently) only one file with a name can be loaded at a time.
 java.lang.String title
          A title that can be used as menu entry.
 java.lang.String url
          A URL can be anything that MirroredInputStream understands, i.e.
 
Constructor Summary
SourceEntry(SourceEntry e)
           
SourceEntry(java.lang.String url, java.lang.String name, java.lang.String title, java.lang.Boolean active)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDisplayString()
          String to show in menus and error messages.
 java.lang.String getFileNamePart()
          extract file part from url, e.g.: http://www.test.com/file.xml?format=text --> file.xml
 java.lang.String getLocalSourceDir()
           
 java.lang.String getPrefName()
          the name / identifier that should be used to save custom color values and similar stuff to the preference file
 int hashCode()
           
 boolean isLocal()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

url

public java.lang.String url
A URL can be anything that MirroredInputStream understands, i.e. a local file, http://, or a file from the current jar


name

public java.lang.String name
Name is used as a namespace for color preferences and (currently) only one file with a name can be loaded at a time. Additional styles must either have the same name as the main style or no name at all. If no name is provided, it will be set to the default value "standard". The name can also be given in the xml file as attribute for the rules tag. (This overrides the name given in the preferences, otherwise both methods are equivalent.)


title

public java.lang.String title
A title that can be used as menu entry.


active

public boolean active
active is a boolean flag that can be used to turn the style on or off at runtime.

Constructor Detail

SourceEntry

public SourceEntry(java.lang.String url,
                   java.lang.String name,
                   java.lang.String title,
                   java.lang.Boolean active)

SourceEntry

public SourceEntry(SourceEntry e)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDisplayString

public java.lang.String getDisplayString()
String to show in menus and error messages.

Returns:
Usually the shortdescription, but can be the file name if no shortdescription is available.

getFileNamePart

public java.lang.String getFileNamePart()
extract file part from url, e.g.: http://www.test.com/file.xml?format=text --> file.xml


getPrefName

public java.lang.String getPrefName()
the name / identifier that should be used to save custom color values and similar stuff to the preference file

Returns:
the identifier; never null. Usually the result is "standard"

isLocal

public boolean isLocal()

getLocalSourceDir

public java.lang.String getLocalSourceDir()


JOSM