Index: applications/editors/josm/plugins/build.xml
===================================================================
--- applications/editors/josm/plugins/build.xml	(revision 24513)
+++ applications/editors/josm/plugins/build.xml	(revision 24514)
@@ -29,4 +29,5 @@
         <ant antfile="build.xml" target="dist" dir="lakewalker"/>
         <ant antfile="build.xml" target="dist" dir="livegps"/>
+    	<ant antfile="build.xml" target="dist" dir="mapdust"/>
         <ant antfile="build.xml" target="dist" dir="measurement"/>
         <ant antfile="build.xml" target="dist" dir="michigan_left"/>
@@ -96,4 +97,5 @@
         <ant antfile="build.xml" target="clean" dir="lakewalker"/>
         <ant antfile="build.xml" target="clean" dir="livegps"/>
+        <ant antfile="build.xml" target="clean" dir="mapdust"/>
         <ant antfile="build.xml" target="clean" dir="measurement"/>
         <ant antfile="build.xml" target="clean" dir="michigan_left"/>
Index: applications/editors/josm/plugins/mapdust/.classpath
===================================================================
--- applications/editors/josm/plugins/mapdust/.classpath	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/.classpath	(revision 24514)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="lib" path="lib/gson-1.5.jar"/>
+	<classpathentry kind="lib" path="lib/josm-custom.jar"/>
+	<classpathentry kind="output" path="build/classes"/>
+</classpath>
Index: applications/editors/josm/plugins/mapdust/.project
===================================================================
--- applications/editors/josm/plugins/mapdust/.project	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/.project	(revision 24514)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>mapdust</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: applications/editors/josm/plugins/mapdust/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- applications/editors/josm/plugins/mapdust/.settings/org.eclipse.jdt.core.prefs	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/.settings/org.eclipse.jdt.core.prefs	(revision 24514)
@@ -0,0 +1,12 @@
+#Sat Nov 13 11:09:26 EET 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Index: applications/editors/josm/plugins/mapdust/GPL-v3.0.txt
===================================================================
--- applications/editors/josm/plugins/mapdust/GPL-v3.0.txt	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/GPL-v3.0.txt	(revision 24514)
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Index: applications/editors/josm/plugins/mapdust/LICENSE.txt
===================================================================
--- applications/editors/josm/plugins/mapdust/LICENSE.txt	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/LICENSE.txt	(revision 24514)
@@ -0,0 +1,26 @@
+Copyright (c) 2010, skobbler GmbH
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its
+   contributors may be used to endorse or promote products derived from this
+   software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
Index: applications/editors/josm/plugins/mapdust/README
===================================================================
--- applications/editors/josm/plugins/mapdust/README	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/README	(revision 24514)
@@ -0,0 +1,16 @@
+JOSM plugin for the MapDust Bug Reporter service. This plugin was created 
+in order to help to improve the Open Street Map.
+The MapDust plugin contains the following features:
+	- viewing the Bug Reports on the current area
+	- viewing the details of a given Bug report
+	- creating a new Bug Report
+	- commenting a new Bug Report
+	- closing a given Bug Report
+	- re-opening a given Bug Report
+	- invalidating a given Bug Report
+	- working in online and offline mode
+	
+* This plugin was created by Beata Jancso <beata.jancso@skobbler.com> .
+* This plugin is licensed under the GNU GPL v3 or later. See GPL-v3,0.txt for 
+  more details.
+     
Index: applications/editors/josm/plugins/mapdust/REVISION
===================================================================
--- applications/editors/josm/plugins/mapdust/REVISION	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/REVISION	(revision 24514)
@@ -0,0 +1,3 @@
+svn: '.' is not a working copy
+<?xml version="1.0"?>
+<info>
Index: applications/editors/josm/plugins/mapdust/build.xml
===================================================================
--- applications/editors/josm/plugins/mapdust/build.xml	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/build.xml	(revision 24514)
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="mapdust" default="dist" basedir=".">
+
+	<!-- properties -->
+	<property name="commit.message" value="MapDust bug reporter plugin" />
+	<property name="plugin.main.version" value="3592" />
+	<property name="josm.dir" value="../../core/dist/" />
+	<property name="plugin.build.dir" value="build/classes" />
+	<property name="apidoc.dir" value="build/doc" />
+	<property name="plugin.src.dir" value="src" />
+	<property name="plugin.lib.dir" value="lib" />
+	<property name="plugin.dist.dir" value="../../dist" />
+	<property name="ant.build.javac.target" value="1.5" />
+	<property name="plugin.dist.dir" value="../../dist" />
+	<property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar" />
+
+	<!-- classpath -->
+	<path id="classpath">
+		<fileset dir="${plugin.lib.dir}" includes="**/*.jar" />
+		<fileset dir="${josm.dir}" includes="josm-custom.jar" />
+	</path>
+
+	<!-- clean the build -->
+	<target name="clean">
+		<delete dir="${plugin.build.dir}" />
+		<delete file="${plugin.jar}" />
+	</target>
+
+	<!-- initialize the build -->
+	<target name="init" depends="clean">
+		<mkdir dir="${plugin.build.dir}" />
+	</target>
+
+	<!-- compiles the sources -->
+	<target name="compile" depends="init">
+		<echo message="compiling sources for  ${plugin.jar} ... " />
+		<javac srcdir="src" classpathref="classpath" debug="true" destdir="${plugin.build.dir}" includeantruntime="true" target="1.5" source="1.5">
+			<compilerarg value="-Xlint:deprecation" />
+			<compilerarg value="-Xlint:unchecked" />
+		</javac>
+	</target>
+
+	<!-- creates the javadocs -->
+	<target name="javadoc">
+		<mkdir dir="${apidoc.dir}" />
+		<javadoc destdir="${apidoc.dir}" source="1.6" classpathref="classpath" windowtitle="MapDust plugin API">
+			<link href="http://java.sun.com/javase/6/docs/api/" />
+			<link href="http://docs.jboss.org/hibernate/stable/core/api/" />
+			<packageset dir="${plugin.src.dir}">
+			</packageset>
+		</javadoc>
+
+	</target>
+
+	<!-- revision -->
+	<target name="revision">
+		<exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
+			<env key="LANG" value="C" />
+			<arg value="info" />
+			<arg value="--xml" />
+			<arg value="." />
+		</exec>
+		<xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true" />
+		<delete file="REVISION" />
+	</target>
+
+	<!-- creates the .jar file of the plugin -->
+	<target name="dist" depends="compile">
+		<echo message="creating ${ant.project.name}.jar ... " />
+		<copy todir="${plugin.build.dir}">
+			<fileset dir="conf" />
+		</copy>
+		<copy todir="${plugin.build.dir}/images">
+			<fileset dir="images" />
+		</copy>
+		<copy todir="${plugin.build.dir}">
+			<fileset dir=".">
+				<include name="README" />
+				<include name="LICENSE" />
+			</fileset>
+		</copy>
+		<jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
+			<zipfileset src="lib/gson-1.5.jar" includes="**/*.class" />
+			<manifest>
+				<attribute name="Author" value="Beata Jancso" />
+				<attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.mapdust.MapdustPlugin" />
+				<attribute name="Plugin-Date" value="${version.entry.commit.date}" />
+				<attribute name="Plugin-Description" value="The MapDust Plug-In shows the MapDust bug reports 
+					on the map. You can create, close, invalidate, re-open and 
+					comment bug reports by using this plugin." />
+				<attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/MapDust" />
+				<attribute name="Plugin-Mainversion" value="${plugin.main.version}" />
+				<attribute name="Plugin-Version" value="${version.entry.commit.revision}" />
+				<attribute name="Plugin-Icon" value="images/dialogs/mapdust_icon25.png" />
+			</manifest>
+		</jar>
+	</target>
+
+	<!-- installs the plugin  -->
+	<target name="install" depends="dist">
+		<property environment="env" />
+		<condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
+			<and>
+				<os family="windows" />
+			</and>
+		</condition>
+		<copy file="${plugin.jar}" todir="${josm.plugins.dir}" />
+	</target>
+
+	<!-- displays the information about the core josm -->
+	<target name="core-info">
+		<exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
+			<env key="LANG" value="C" />
+			<arg value="info" />
+			<arg value="--xml" />
+			<arg value="../../core" />
+		</exec>
+		<xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true" />
+		<echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
+		<echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
+		<delete file="core.info.xml" />
+	</target>
+
+	<!-- commits the current sources -->
+	<target name="commit-current">
+		<echo>Commiting the plugin source with message '${commit.message}' ...</echo>
+		<exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+			<env key="LANG" value="C" />
+			<arg value="commit" />
+			<arg value="-m '${commit.message}'" />
+			<arg value="." />
+		</exec>
+	</target>
+
+	<!-- updates the plugin -->
+	<target name="update-current">
+		<echo>Updating plugin source ...</echo>
+		<exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+			<env key="LANG" value="C" />
+			<arg value="up" />
+			<arg value="." />
+		</exec>
+		<echo>Updating ${plugin.jar} ...</echo>
+		<exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+			<env key="LANG" value="C" />
+			<arg value="up" />
+			<arg value="../dist/${plugin.jar}" />
+		</exec>
+	</target>
+
+	<!-- commit the .jar of the plugin -->
+	<target name="commit-dist">
+		<echo>
+    ***** Properties of published ${plugin.jar} *****
+    Commit message    : '${commit.message}'                    
+    Plugin-Mainversion: ${plugin.main.version}
+    JOSM build version: ${coreversion.info.entry.revision}
+    Plugin-Version    : ${version.entry.commit.revision}
+    ***** / Properties of published ${plugin.jar} *****                    
+                        
+    Now commiting ${plugin.jar} ...
+    </echo>
+		<exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+			<env key="LANG" value="C" />
+			<arg value="-m '${commit.message}'" />
+			<arg value="commit" />
+			<arg value="${plugin.jar}" />
+		</exec>
+	</target>
+
+	<!-- ** make sure svn is present as a command line tool ** -->
+	<target name="ensure-svn-present">
+		<exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
+			<env key="LANG" value="C" />
+			<arg value="--version" />
+		</exec>
+		<fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
+			<!-- return code not set at all? Most likely svn isn't installed -->
+			<condition>
+				<not>
+					<isset property="svn.exit.code" />
+				</not>
+			</condition>
+		</fail>
+		<fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
+			<!-- error code from SVN? Most likely svn is not what we are looking on this system -->
+			<condition>
+				<isfailure code="${svn.exit.code}" />
+			</condition>
+		</fail>
+	</target>
+
+	<!-- publish the plugin -->
+	<target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
+	</target>
+</project>
Index: applications/editors/josm/plugins/mapdust/conf/mapdust.properties
===================================================================
--- applications/editors/josm/plugins/mapdust/conf/mapdust.properties	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/conf/mapdust.properties	(revision 24514)
@@ -0,0 +1,8 @@
+#the Mapdus url address
+mapdust.url=http://www.mapdust.com/api
+
+#the MapDust bug details site url
+mapdust.site=http://www.mapdust.com/detail/
+
+#the Mapdust api key
+mapdust.key=20a2790c8c8ba273ff7baa619b2cf638
Index: applications/editors/josm/plugins/mapdust/mapdust.launch
===================================================================
--- applications/editors/josm/plugins/mapdust/mapdust.launch	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/mapdust.launch	(revision 24514)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/JOSM/src/org/openstreetmap/josm/gui/MainApplication.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK 6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.openstreetmap.josm.gui.MainApplication"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="mapdust"/>
+</launchConfiguration>
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustDownloadThread.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustDownloadThread.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustDownloadThread.java	(revision 24514)
@@ -0,0 +1,130 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust;
+
+
+import java.awt.geom.Point2D;
+import java.util.concurrent.TimeUnit;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+
+
+/**
+ * The MapDust download thread. Download the MapDust bugs in a given period of
+ * time.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class MapdustDownloadThread extends Thread {
+
+    /** The <code>MapdustDownloadThread</code> instance */
+    private static MapdustDownloadThread instance;
+
+    /** Specifies if the download was done or not */
+    private boolean downloadDone = false;
+
+    /** The interval */
+    private final long INTERVAL = TimeUnit.MINUTES.toMillis(30);
+
+    /** The <code>MapdustPlugin</code> object */
+    private MapdustPlugin plugin;
+
+    /** The <code>Point2D</code> object */
+    private Point2D lastCenter;
+
+    /**
+     * Builds a <code>MapdustDownloadThread</code> object.
+     */
+    public MapdustDownloadThread() {
+        setName("Downloading Mapdust data!");
+        start();
+    }
+
+    /**
+     *
+     * @return A <code>MapdustDownloadThread</code> object
+     */
+    public static synchronized MapdustDownloadThread getInstance() {
+        if (instance == null) {
+            instance = new MapdustDownloadThread();
+        }
+        return instance;
+    }
+
+    @Override
+    public void run() {
+        try {
+            while (true) {
+                // if the center of the map has changed, the user has dragged or
+                // zoomed the map
+                if (Main.map != null && Main.map.mapView != null) {
+                    Point2D currentCenter = Main.map.mapView.getCenter();
+                    if (currentCenter != null
+                            && !currentCenter.equals(lastCenter)) {
+                        downloadDone = false;
+                        lastCenter = currentCenter;
+                    }
+                }
+                String pluginState = Main.pref.get("mapdust.pluginState");
+                boolean modify =
+                        Boolean.parseBoolean(Main.pref.get("mapdust.modify"));
+                if (!downloadDone) {
+                    if (plugin != null
+                            && pluginState.equals(MapdustPluginState.ONLINE
+                                    .getValue()) && !modify) {
+                        plugin.updateData();
+                        downloadDone = true;
+                    }
+                }
+                Thread.sleep(INTERVAL);
+            }
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Returns the <code>MapdustPlugin</code> object
+     *
+     * @return the plugin
+     */
+    public MapdustPlugin getPlugin() {
+        return plugin;
+    }
+
+    /**
+     * Sets the <code>MapdustPlugin</code> object
+     *
+     * @param plugin the plugin to set
+     */
+    public void setPlugin(MapdustPlugin plugin) {
+        this.plugin = plugin;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustLayer.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustLayer.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustLayer.java	(revision 24514)
@@ -0,0 +1,336 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.image.ImageObserver;
+import java.text.DateFormat;
+import java.util.List;
+import java.util.Locale;
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JToolTip;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.RenameLayerAction;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
+import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
+import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * Defines the MapDust JOSM layer main functionality.
+ *
+ * @author Bea
+ */
+public class MapdustLayer extends Layer {
+
+    /** The <code>MapdustGUI</code> object */
+    private MapdustGUI mapdustGUI;
+
+    /** The list of <code>MapdustBugList</code> objects */
+    private List<MapdustBug> mapdustBugList;
+
+    /** The selected <code>MapdustBug</code> object */
+    private MapdustBug bugSelected;
+
+    /**
+     * Builds a <code>MapdustLayer</code> object based on the given parameters.
+     *
+     * @param name The name of the layer
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     * @param mapdustBugList The list of <code>MapdustBug</code> objects
+     */
+    public MapdustLayer(String name, MapdustGUI mapdustGUI,
+            List<MapdustBug> mapdustBugList) {
+        super(name);
+        this.mapdustGUI = mapdustGUI;
+        this.mapdustBugList = mapdustBugList;
+        this.bugSelected = null;
+    }
+
+    /**
+     * Returns the icon of the MapDust layer.
+     *
+     * @return icon
+     */
+    @Override
+    public Icon getIcon() {
+        Icon layerIcon = ImageProvider.get("dialogs/mapdust_icon16.png");
+        return layerIcon;
+    }
+
+    /**
+     * Returns the info components of the MapDust layer.
+     *
+     * @return object
+     */
+    @Override
+    public Object getInfoComponent() {
+        String infoComponent = "Shows the Mapdust bug reporter issues.";
+        return tr(infoComponent);
+    }
+
+    /**
+     * Returns the menu entries of the MapDust layer.
+     *
+     * @return an array of <code>Action</code> objects.
+     */
+    @Override
+    public Action[] getMenuEntries() {
+        Action[] menuEntries = new Action[6];
+        menuEntries[0] =
+                LayerListDialog.getInstance().createShowHideLayerAction();
+        menuEntries[1] =
+                LayerListDialog.getInstance().createDeleteLayerAction();
+        menuEntries[2] = SeparatorLayerAction.INSTANCE;
+        menuEntries[3] = new RenameLayerAction(null, this);
+        menuEntries[4] = SeparatorLayerAction.INSTANCE;
+        menuEntries[5] = new LayerListPopup.InfoAction(this);
+        return menuEntries;
+    }
+
+    /**
+     * Returns the text of the tool tip of the MapDust layer.
+     *
+     * @return the tooltip text
+     */
+    @Override
+    public String getToolTipText() {
+        String toolTipText = "Shows Mapdust bug reporter issues.";
+        return tr(toolTipText);
+    }
+
+    /**
+     * Returns the image icon based on the given status and type.
+     *
+     * @param iconType The type of the bug
+     * @param status The status of the bug
+     * @param bugType The type of the bug
+     * @return A <code>ImageIcom</code> object
+     */
+    private ImageIcon getImageIcon(String iconType, String status,
+            String bugType) {
+        String iconName = "bugs/" + iconType + "/";
+        iconName += status.toLowerCase() + "_";
+        iconName += bugType;
+        iconName += ".png";
+        ImageIcon icon = ImageProvider.get(iconName);
+        return icon;
+    }
+
+    /**
+     * Draw the objects to the given map view. Also draws the MapDust bugs to
+     * the map, and the tooltip for the selected MapDust bug.
+     *
+     * @param g The <code>Graphics2D</code> object
+     * @param mv The <code>MapView</code> object
+     * @param bounds The <code>Bounds</code> object
+     */
+    @Override
+    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
+        JToolTip tooltip = new JToolTip();
+        if (mapdustBugList != null) {
+            /* draw the current visible bugs */
+            for (MapdustBug bug : mapdustBugList) {
+                LatLon ll = bug.getLatLon();
+                Point p = mv.getPoint(ll);
+                /* get the icon */
+                String status = bug.getStatus().getValue();
+                String type = bug.getType().getKey();
+                ImageIcon icon = getImageIcon("normal", status, type);
+                int width = icon.getIconWidth();
+                int height = icon.getIconHeight();
+                /* draw the bug icon */
+                /*
+                 * need to do 2 times, because in some areas the bug image is
+                 * invisible
+                 */
+                for (int i = 0; i < 2; i++) {
+                    g.drawImage(icon.getImage(), p.x - (width / 2), p.y
+                            - (height / 2), new ImageObserver() {
+
+                        @Override
+                        public boolean imageUpdate(Image img, int infoflags,
+                                int x, int y, int width, int height) {
+                            return false;
+                        }
+                    });
+                }
+            }
+            /* draw the selected bug description */
+            /* selected by clicking */
+            MapdustBug bug1 = getBugSelected();
+            /* selected from the list */
+            MapdustBug bugSelected =
+                    getMapdustGUI().getPanel().getSelectedBug();
+            if (bugSelected == null) {
+                if (Main.map.mapView.getActiveLayer() == this) {
+                    bugSelected = bug1;
+                }
+            }
+            if (bugSelected != null) {
+                LatLon ll = bugSelected.getLatLon();
+                Point p = mv.getPoint(ll);
+                String status = bugSelected.getStatus().getValue();
+                String type = bugSelected.getType().getKey();
+                ImageIcon icon = getImageIcon("selected", status, type);
+                int width = icon.getIconWidth();
+                int height = icon.getIconHeight();
+                /* draw the icon */
+                g.drawImage(icon.getImage(), p.x - (width / 2), p.y
+                        - (height / 2), new ImageObserver() {
+
+                    @Override
+                    public boolean imageUpdate(Image img, int infoflags, int x,
+                            int y, int width, int height) {
+                        return false;
+                    }
+                });
+                /* draw description */
+                String text = buildTooltipText(bugSelected);
+                tooltip.setTipText(text);
+                tooltip.setFont(new Font("Times New Roman", Font.BOLD, 12));
+                tooltip.setBackground(Color.WHITE);
+                tooltip.setForeground(Color.BLUE);
+                tooltip.setLocation(p);
+                tooltip.setFocusable(true);
+                int tx = p.x + (width / 4);
+                int ty = (p.y + height / 4);
+                g.translate(tx, ty);
+                Dimension d = tooltip.getUI().getPreferredSize(tooltip);
+                d.width = Math.min(d.width, (mv.getWidth() * 2 / 3));
+                tooltip.setSize(d);
+                tooltip.paint(g);
+                g.translate(-tx, -ty);
+            }
+        }
+    }
+
+    @Override
+    public boolean isMergable(Layer layer) {
+        return false;
+    }
+
+    @Override
+    public void mergeFrom(Layer layer) {}
+
+    /**
+     * Builds the text of the tooltip containing a short description of the
+     * given <code>MapdustBug</code> object.
+     *
+     * @param bug The <code>MapdustBug</code> object
+     * @return A string containing the description text
+     */
+    private String buildTooltipText(MapdustBug bug) {
+        DateFormat df =
+                DateFormat.getDateInstance(DateFormat.DEFAULT,
+                        Locale.getDefault());
+        String text = "<html>Type: " + bug.getType().getValue() + "<br/>";
+        text += "Status: " + bug.getStatus().getValue() + "<br/>";
+        text += "Address: " + bug.getAddress() + " <br/>";
+        text += "Created by: " + bug.getNickname() + "<br/>";
+        text += "Created on: " + df.format(bug.getDateCreated()) + "<br/>";
+        text += "Last modified on: ";
+        text += df.format(bug.getDateUpdated()) + "<br/>";
+        text += "Comments: " + bug.getNumberOfComments();
+        text += "</html>";
+        return text;
+    }
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor arg0) {}
+
+    /**
+     * Returns the <code>MapdustGUI</code> object
+     *
+     * @return the mapdustGUI
+     */
+    public MapdustGUI getMapdustGUI() {
+        return mapdustGUI;
+    }
+
+    /**
+     * Sets the <code>MapdustGUI</code> object
+     *
+     * @param mapdustGUI the mapdustGUI to set
+     */
+    public void setMapdustGUI(MapdustGUI mapdustGUI) {
+        this.mapdustGUI = mapdustGUI;
+    }
+
+    /**
+     * Returns the list of <code>MapdustBug</code> objects
+     *
+     * @return the mapdustBugList
+     */
+    public List<MapdustBug> getMapdustBugList() {
+        return mapdustBugList;
+    }
+
+    /**
+     * Returns the selected bug
+     *
+     * @return the bugSelected
+     */
+    public MapdustBug getBugSelected() {
+        return bugSelected;
+    }
+
+    /**
+     * Sets the selected bug
+     *
+     * @param bugSelected the bugSelected to set
+     */
+    public void setBugSelected(MapdustBug bugSelected) {
+        this.bugSelected = bugSelected;
+    }
+
+    /**
+     * Sets the list of <code>MapdustBug</code> objects
+     * @param mapdustBugList the mapdustBugList to set
+     */
+    public void setMapdustBugList(List<MapdustBug> mapdustBugList) {
+        this.mapdustBugList = mapdustBugList;
+    }
+    
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(revision 24514)
@@ -0,0 +1,489 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.Point;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
+import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.plugins.Plugin;
+import org.openstreetmap.josm.plugins.PluginInformation;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CreateIssueDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustInitialUpdateObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.tools.Shortcut;
+
+
+/**
+ * This is the main class of the MapDust plugin. Defines the MapDust plugin main
+ * functionality.
+ * 
+ * @author Bea
+ * 
+ */
+public class MapdustPlugin extends Plugin implements LayerChangeListener,
+        MouseListener, MapdustRefreshObserver, MapdustBugObserver,
+        MapdustInitialUpdateObserver {
+    
+    /** The graphical user interface of the plugin */
+    private MapdustGUI mapdustGUI;
+    
+    /** The layer of the MapDust plugin */
+    private MapdustLayer mapdustLayer;
+    
+    /** The list of <code>MapdustBug</code> objects */
+    private List<MapdustBug> mapdustBugList;
+    
+    /**
+     * Builds a new <code>MapDustPlugin</code> object based on the given
+     * arguments.
+     * 
+     * @param info The <code>MapDustPlugin</code> object
+     */
+    public MapdustPlugin(PluginInformation info) {
+        super(info);
+        Main.pref.put("mapdust.pluginState",
+                MapdustPluginState.ONLINE.getValue());
+        Main.pref.put("mapdust.nickname", null);
+        Main.pref.put("mapdust.modify", false);
+        MapView.addLayerChangeListener(this);
+        if (Main.map != null && Main.map.mapView != null) {
+            Main.map.mapView.addMouseListener(this);
+            MapView.addLayerChangeListener(this);
+        }
+    }
+    
+    /**
+     * Initializes the new view with the MapDust Bugs from that area.
+     * 
+     * @param oldMapFrame The old <code>MapFrame</code> object
+     * @param newMapFrame The new <code>MapFrame</code> object
+     */
+    @Override
+    public void mapFrameInitialized(MapFrame oldMapFrame, MapFrame newMapFrame) {
+        if (newMapFrame == null) {
+            /* if new MapFrame is null, remove listener */
+            MapView.removeLayerChangeListener(this);
+        } else {
+            /* add MapDust dialog window */
+            Shortcut shortcut = Shortcut.registerShortcut("mapdust",
+                    tr("Toggle: {0}", tr("Open MapDust")), KeyEvent.VK_0, 
+                    Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT);
+            String name = "MapDust bug reports";
+            String tooltip = "Activates the MapDust bug reporter plugin";
+            mapdustGUI = new MapdustGUI(tr(name), "mapdust_icon.png", tr(tooltip),
+                    shortcut, 150, this);
+            mapdustGUI.setBounds(newMapFrame.getBounds());
+            mapdustGUI.addObserver(this);
+            newMapFrame.addToggleDialog(mapdustGUI);
+            NavigatableComponent
+                    .addZoomChangeListener(new ZoomChangeListener() {
+                        
+                        @Override
+                        public void zoomChanged() {
+                            updateData();
+                        }
+                    });
+            MapView.addLayerChangeListener(this);
+            Main.map.mapView.addMouseListener(this);
+        }
+    }
+    
+    /**
+     * Updates the MapDust plugin data. Downloads the list of
+     * <code>MapdustBug</code> objects for the given area, and updates the map
+     * and the Mapdust layer with the new data.
+     */
+    @Override
+    public synchronized void updateData() {
+        if (Main.map != null && Main.map.mapView != null) {
+            try {
+                /* downloads the MapDust bugs */
+                this.mapdustBugList = getMapdustBugs();
+                if (getMapdustGUI().isDialogShowing()) {
+                    /* updates the views */
+                    updateView();
+                    /* show message if there is not bug in the given area */
+                    if (this.mapdustBugList == null
+                            || this.mapdustBugList.size() == 0) {
+                        String waringMessage = "There is no MapDust bug in ";
+                        waringMessage += "your visible area.";
+                        JOptionPane.showMessageDialog(Main.parent, 
+                                tr(waringMessage), tr("Warning"),
+                                JOptionPane.WARNING_MESSAGE);
+                    }
+                }
+            } catch (MapdustServiceHandlerException e) {
+                /* show errprMessage, and remove the layer */
+                String errorMessage = "There was a Mapdust service error.";
+                errorMessage += " Please try later.";
+                JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                        tr("Error"), JOptionPane.ERROR_MESSAGE);
+                MapView.removeLayerChangeListener(this);
+                Main.map.mapView.removeLayer(mapdustLayer);
+                Main.map.remove(mapdustGUI);
+            }
+        }
+    }
+    
+    /**
+     * Updates the given <code>MapdustBug</code> object from the map and from
+     * the MapDust bugs list.
+     * 
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    @Override
+    public synchronized void changedData(MapdustBug mapdustBug) {
+        if (this.mapdustBugList == null) {
+            this.mapdustBugList = new ArrayList<MapdustBug>();
+        }
+        if (getMapdustGUI().isDialogShowing()) {
+            if (Main.map != null && Main.map.mapView != null) {
+                /* if the layer was active , should be active after the update */
+                boolean wasActive = false;
+                if (Main.map.mapView.getActiveLayer() == getMapdustLayer()) {
+                    wasActive = true;
+                }
+                /* update the list with the modified MapDust bug */
+                updateMapdustBugList(mapdustBug);
+                /* destroy the layer */
+                mapdustLayer.destroy();
+                Main.main.removeLayer(mapdustLayer);
+                mapdustLayer = null;
+                /* update the view, and activate the layer */
+                updateView();
+                if (wasActive) {
+                    Main.map.mapView.setActiveLayer(getMapdustLayer());
+                }
+            }
+        }
+    }
+    
+    @Override
+    public void activeLayerChange(Layer arg0, Layer arg1) {}
+    
+    @Override
+    public void layerAdded(Layer layer) {
+        if (layer instanceof MapdustLayer) {
+            /* download the MapDust bugs and update the plugin */
+            updateData();
+        }
+    }
+    
+    @Override
+    public void layerRemoved(Layer layer) {
+        if (layer instanceof MapdustLayer) {
+            /* remove the layer */
+            MapView.removeLayerChangeListener(this);
+            Main.map.mapView.removeLayer(layer);
+            Main.map.remove(mapdustGUI);
+            if (mapdustGUI != null) {
+                mapdustGUI.update(null, this);
+            }
+            mapdustLayer = null;
+        }
+    }
+    
+    @Override
+    public void mouseClicked(MouseEvent event) {
+        if (mapdustLayer != null && mapdustLayer.isVisible()
+                && Main.map.mapView.getActiveLayer() == getMapdustLayer()) {
+            /* show add bug dialog */
+            if (event.getClickCount() == 2) {
+                mapdustGUI.getPanel().getBtnPanel().getBtnWorkOffline()
+                        .setEnabled(false);
+                mapdustGUI.getPanel().getBtnPanel().getBtnRefresh()
+                        .setEnabled(false);
+                mapdustGUI.getPanel().getBtnPanel().getBtnAddComment()
+                        .setEnabled(false);
+                mapdustGUI.getPanel().getBtnPanel().getBtnFixBugReport()
+                        .setEnabled(false);
+                mapdustGUI.getPanel().getBtnPanel().getBtnInvalidateBugReport()
+                        .setEnabled(false);
+                mapdustGUI.getPanel().getBtnPanel().getBtnReOpenBugReport()
+                        .setEnabled(false);
+                Main.pref.put("mapdust.modify", true);
+                MapdustBug selectedBug = mapdustGUI.getPanel().getSelectedBug();
+                if (selectedBug != null) {
+                    Main.pref.put("selectedBug.status", selectedBug.getStatus()
+                            .getValue());
+                } else {
+                    Main.pref.put("selectedBug.status", "create");
+                }
+                String title = "Create bug report";
+                String iconName = "dialogs/open.png";
+                String messageText = "In order to create a new bug report you";
+                messageText += " need to provide your nickname and a brief";
+                messageText += " description for the bug.";
+                Point point = event.getPoint();
+                CreateIssueDialog dialog =
+                        new CreateIssueDialog(tr(title), iconName,
+                                tr(messageText), point, this);
+                dialog.setLocationRelativeTo(null);
+                dialog.getContentPane().setPreferredSize(dialog.getSize());
+                dialog.pack();
+                dialog.setVisible(true);
+                return;
+            }
+            if (event.getButton() == MouseEvent.BUTTON1) {
+                /* allow click on the bug icon on the map */
+                Point p = event.getPoint();
+                MapdustBug nearestBug = getNearestBug(p);
+                if (nearestBug != null) {
+                    mapdustLayer.setBugSelected(nearestBug);
+                    /* set also in the list of bugs the element */
+                    mapdustGUI.getPanel().setSelectedBug(nearestBug);
+                    Main.map.mapView.repaint();
+                }
+            }
+        }
+    }
+    
+    /**
+     * Updates the current view, with the given list of <code>MapdustBug</code>
+     * objects.
+     */
+    private void updateView() {
+        /* update the dialog with the new data */
+        mapdustGUI.update(mapdustBugList, this);
+        if (mapdustLayer == null) {
+            /* create and add the layer */
+            Main.map.mapView.removeAll();
+            mapdustLayer =
+                    new MapdustLayer("MapDust", mapdustGUI, mapdustBugList);
+            Main.main.addLayer(mapdustLayer);
+            Main.map.mapView.moveLayer(mapdustLayer, 0);
+            MapView.addLayerChangeListener(this);
+        } else {
+            /* re-set the properties */
+            mapdustLayer.destroy();
+            mapdustLayer.setMapdustGUI(mapdustGUI);
+            mapdustLayer.setMapdustBugList(mapdustBugList);
+            mapdustLayer.setBugSelected(null);
+        }
+        /* repaint */
+        Main.map.mapView.invalidate();
+        Main.map.repaint();
+        Main.map.mapView.repaint();
+    }
+    
+    /**
+     * Downloads the MapDust bugs from the current map view, and updates the
+     * plugin data with the new downloaded data.
+     */
+    @Override
+    public void initialUpdate() {
+        if (containsOsmDataLayer()) {
+            Main.worker.execute(new Runnable() {
+                
+                @Override
+                public void run() {
+                    updateData();
+                    
+                }
+            });
+        }
+    }
+    
+    /**
+     * Verifies if the <code>OsmDataLayer</code> layer has been added to the
+     * list of layers.
+     * 
+     * @return true if the <code>OsmDataLayer</code> layer has been added false
+     * otherwise
+     */
+    private boolean containsOsmDataLayer() {
+        boolean contains = false;
+        List<Layer> l = Main.map.mapView.getAllLayersAsList();
+        for (Layer ll : l) {
+            if (ll instanceof OsmDataLayer) {
+                contains = true;
+            }
+        }
+        return contains;
+    }
+    
+    /**
+     * Updates the MapDust bugs list with the given <code>MapdustBug</code>
+     * object.
+     * 
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    private void updateMapdustBugList(MapdustBug mapdustBug) {
+        MapdustBug oldBug = null;
+        for (MapdustBug bug : mapdustBugList) {
+            if (bug.getId().equals(mapdustBug.getId())) {
+                oldBug = bug;
+            }
+        }
+        if (oldBug != null) {
+            /* remove, add */
+            mapdustBugList.remove(oldBug);
+            mapdustBugList.add(0, mapdustBug);
+        } else {
+            /* new add */
+            mapdustBugList.add(0, mapdustBug);
+        }
+    }
+    
+    /**
+     * Returns the list of <code>MapdustBug</code> objects from the current
+     * area.
+     * 
+     * @return A list of <code>MapdustBug</code> objects
+     * @throws MapdustServiceHandlerException In the case of a MapDust service
+     * error
+     */
+    private List<MapdustBug> getMapdustBugs()
+            throws MapdustServiceHandlerException {
+        /* get the bounding box */
+        MapView mapView = Main.map.mapView;
+        Bounds bounds =
+                new Bounds(mapView.getLatLon(0, mapView.getHeight()),
+                        mapView.getLatLon(mapView.getWidth(), 0));
+        Double minLon = bounds.getMin().lon();
+        Double minLat = bounds.getMin().lat();
+        Double maxLon = bounds.getMax().lon();
+        Double maxLat = bounds.getMax().lat();
+        
+        /* get the bugs from the bounding box */
+        MapdustServiceHandler handler = new MapdustServiceHandler();
+        List<MapdustBug> list = handler.getBugs(minLon, minLat, maxLon, maxLat);
+        return list;
+    }
+    
+    /**
+     * Returns the nearest <code>MapdustBug</code> object to the given point on
+     * the map.
+     * 
+     * @param p A <code>Point</code> object
+     * @return A <code>MapdustBug</code> object
+     */
+    private MapdustBug getNearestBug(Point p) {
+        double snapDistance = 10;
+        double minDistanceSq = Double.MAX_VALUE;
+        MapdustBug nearestBug = null;
+        for (MapdustBug bug : mapdustBugList) {
+            Point sp = Main.map.mapView.getPoint(bug.getLatLon());
+            double dist = p.distanceSq(sp);
+            if (minDistanceSq > dist && p.distance(sp) < snapDistance) {
+                minDistanceSq = p.distanceSq(sp);
+                nearestBug = bug;
+            } else if (minDistanceSq == dist) {
+                nearestBug = bug;
+            }
+        }
+        return nearestBug;
+    }
+    
+    @Override
+    public void mouseEntered(MouseEvent arg0) {}
+    
+    @Override
+    public void mouseExited(MouseEvent arg0) {}
+    
+    @Override
+    public void mousePressed(MouseEvent arg0) {}
+    
+    @Override
+    public void mouseReleased(MouseEvent arg0) {}
+    
+    /**
+     * Returns the <code>MapdustGUI</code> object
+     * 
+     * @return the mapdustGUI
+     */
+    public MapdustGUI getMapdustGUI() {
+        return mapdustGUI;
+    }
+    
+    /**
+     * Sets the <code>MapdustGUI</code> object.
+     * 
+     * @param mapdustGUI the mapdustGUI to set
+     */
+    public void setMapdustGUI(MapdustGUI mapdustGUI) {
+        this.mapdustGUI = mapdustGUI;
+    }
+    
+    /**
+     * Returns the <code>MapdustLayer</code> object.
+     * 
+     * @return the mapdustLayer
+     */
+    public MapdustLayer getMapdustLayer() {
+        return mapdustLayer;
+    }
+    
+    /**
+     * Sets the <code>MapdustLayer</code> object.
+     * 
+     * @param mapdustLayer the mapdustLayer to set
+     */
+    public void setMapdustLayer(MapdustLayer mapdustLayer) {
+        this.mapdustLayer = mapdustLayer;
+    }
+    
+    /**
+     * Returns the list of MapDust bugs
+     * 
+     * @return the mapdustBugList
+     */
+    public List<MapdustBug> getMapdustBugList() {
+        return mapdustBugList;
+    }
+    
+    /**
+     * Sets the list of MapDust bugs
+     * 
+     * @param mapdustBugList the mapdustBugList to set
+     */
+    public void setMapdustBugList(List<MapdustBug> mapdustBugList) {
+        this.mapdustBugList = mapdustBugList;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploader.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploader.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploader.java	(revision 24514)
@@ -0,0 +1,122 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui;
+
+
+import java.util.List;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustServiceCommand;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+
+
+/**
+ * Uploads the user's modifications to the MapDust service.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class MapdustActionUploader {
+
+    /** The <code>MapdustActionUploader</code> instance */
+    private static MapdustActionUploader instance;
+
+    /** The <code>MapdustServiceHandler</code> object */
+    private static MapdustServiceHandler handler;
+
+    /**
+     * Builds a <code>MapdustActionUploader</code> object
+     */
+    private MapdustActionUploader() {
+        handler = new MapdustServiceHandler();
+    }
+
+    /**
+     * Returns a new instance of the <code>MapdustActionUploader</code> object.
+     * If the instance is null, then creates a new one. Otherwise returns the
+     * existing instance.
+     *
+     * @return new instance of <code>MapdustActionUploader</code>
+     */
+    public static MapdustActionUploader getInstance() {
+        if (instance == null) {
+            instance = new MapdustActionUploader();
+        }
+        return instance;
+    }
+
+    /**
+     * Uploads the given data to the MapdDst service.
+     *
+     * @param actionList A list of <code>MapdustAction</code> objects
+     * @throws MapdustActionUploaderException If there was some error during the
+     * upload to MapDust service
+     */
+    public void uploadData(List<MapdustAction> actionList)
+            throws MapdustActionUploaderException {
+        if (actionList != null && actionList.size() > 0) {
+            try {
+                for (MapdustAction action : actionList) {
+                    dispatchAction(action);
+                }
+            } catch (MapdustServiceHandlerException e) {
+                throw new MapdustActionUploaderException(
+                        "Error durring uploading data to Mapdust service!", e);
+            }
+        }
+
+    }
+
+    /**
+     * Handles the given action based on the command type. If the command is
+     * "addBug" then creates a new bug. If the command is "commentBug" then
+     * creates a new comment for the given bug. Otherwise changes the status of
+     * the given bug.
+     *
+     * @param action A <code>MapdustAction</code> object
+     * @throws MapdustServiceHandlerException If there was some error during the
+     * upload to MapDust service
+     */
+    private void dispatchAction(MapdustAction action)
+            throws MapdustServiceHandlerException {
+        if (action.getCommand().equals(MapdustServiceCommand.ADD_BUG)) {
+            /* create new bug */
+            handler.addBug(action.getMapdustBug());
+        } else {
+            if (action.getCommand().equals(MapdustServiceCommand.COMMENT_BUG)) {
+                /* comment bug */
+                handler.commentBug(action.getMapdustComment());
+            } else {
+                /* change bug status */
+                handler.changeBugStatus(action.getNewStatus(),
+                        action.getMapdustComment());
+            }
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploaderException.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploaderException.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploaderException.java	(revision 24514)
@@ -0,0 +1,79 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui;
+
+
+/**
+ * Specific exception for the <code>MapdustActionUploader</code> object
+ * 
+ * @author Bea
+ * @version $Revision$
+ */
+public class MapdustActionUploaderException extends Exception {
+    
+    /** Serial version UID */
+    private static final long serialVersionUID = 1L;
+    
+    /**
+     * Builds an empty <code>MapdustActionUploaderException</code> object.
+     */
+    public MapdustActionUploaderException() {
+        super();
+    }
+    
+    /**
+     * Builds a <code>MapdustActionUploaderException</code> object based on the
+     * given argument.
+     * 
+     * @param message The message of the exception.
+     */
+    public MapdustActionUploaderException(String message) {
+        super(message);
+    }
+    
+    /**
+     * Builds a <code>MapdustActionUploaderException</code> object based on the
+     * given argument.
+     * 
+     * @param cause The cause of the exception.
+     */
+    public MapdustActionUploaderException(Throwable cause) {
+        super(cause);
+    }
+    
+    /**
+     * Builds a <code>MapdustActionUploaderException</code> object based on the
+     * given arguments.
+     * 
+     * @param message The message of the exception.
+     * @param cause The cause of the exception.
+     */
+    public MapdustActionUploaderException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustGUI.java	(revision 24514)
@@ -0,0 +1,406 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.BorderLayout;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustActionPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustBugPropertiesPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugDetailsObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugDetailsObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustInitialUpdateObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustInitialUpdateObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.tools.Shortcut;
+
+
+/**
+ * This class is the main graphical user interface class.
+ *
+ * @author Bea
+ */
+public class MapdustGUI extends ToggleDialog implements
+        MapdustActionListObserver, MapdustBugDetailsObservable,
+        MapdustInitialUpdateObservable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of MapDust bug details observers */
+    private final ArrayList<MapdustBugDetailsObserver> bugDetailsObservers =
+            new ArrayList<MapdustBugDetailsObserver>();
+
+    /** The list of MapDust initial update observers */
+    private final ArrayList<MapdustInitialUpdateObserver> initialUpdateObservers =
+            new ArrayList<MapdustInitialUpdateObserver>();
+
+    /** The <code>MapdustPanel</code> object */
+    private MapdustPanel panel;
+
+    /** The <code>MapdustActionPanel</code> object */
+    private MapdustActionPanel queuePanel;
+
+    /** The <code>JTabbedPanel</code> object */
+    private JTabbedPane tabbedPane;
+
+    /** The <code>MapdustPlugin</code> plugin */
+    private MapdustPlugin mapdustPlugin;
+
+    /** The <code>MapdustBugPropertiesPanel</code> */
+    private final MapdustBugPropertiesPanel detailsPanel;
+
+    /** The <code>JPanel</code> */
+    private JPanel mainPanel;
+
+    /**
+     * Flag indicating if the MapDust data was downloaded and the view was
+     * updated
+     */
+    private boolean initialUpdate = false;
+
+    /**
+     * Builds a <code>MapdustGUi</code> based on the given parameters.
+     *
+     * @param name The name of the GUI
+     * @param iconName The name of the icon
+     * @param tooltip The tool tip
+     * @param shortcut The shortcut
+     * @param preferredHeight The height
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public MapdustGUI(String name, String iconName, String tooltip,
+            Shortcut shortcut, int preferredHeight, MapdustPlugin mapdustPlugin) {
+        super(tr(name), iconName, tr(tooltip), shortcut, preferredHeight);
+        this.mapdustPlugin = mapdustPlugin;
+        panel = new MapdustPanel(mapdustPlugin.getMapdustBugList(),
+                "Bug reports", mapdustPlugin);
+        MapdustBug bug = null;
+        if (mapdustPlugin.getMapdustBugList() != null
+                && mapdustPlugin.getMapdustBugList().size() > 0) {
+            bug = mapdustPlugin.getMapdustBugList().get(0);
+        }
+        detailsPanel = new MapdustBugPropertiesPanel(bug);
+        panel.addObserver(detailsPanel);
+        addObserver(detailsPanel);
+        String pluginState = Main.pref.get("mapdust.pluginState");
+        if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+            /* offline mode, need to add also queue panel */
+            tabbedPane = new JTabbedPane();
+            List<MapdustAction> list = new LinkedList<MapdustAction>();
+            mainPanel = new JPanel();
+            mainPanel.setAutoscrolls(true);
+            mainPanel.setLayout(new BorderLayout(5, 10));
+            mainPanel.add(detailsPanel, BorderLayout.NORTH);
+            mainPanel.add(panel, BorderLayout.CENTER);
+            queuePanel = new MapdustActionPanel(list, "Work offline", mapdustPlugin);
+            tabbedPane.add(mainPanel, 0);
+            tabbedPane.add(queuePanel);
+            add(tabbedPane, BorderLayout.CENTER);
+        } else {
+            /* online mode */
+            mainPanel = new JPanel();
+            mainPanel.setIgnoreRepaint(true);
+            mainPanel.setAutoscrolls(true);
+            mainPanel.setLayout(new BorderLayout(5, 10));
+            mainPanel.add(detailsPanel, BorderLayout.NORTH);
+            mainPanel.add(panel, BorderLayout.CENTER);
+            add(mainPanel, BorderLayout.CENTER);
+            tabbedPane = null;
+            queuePanel = null;
+        }
+    }
+
+    /**
+     * Updates the MapDust GUI with the given list of <code>MapdustBug</code>
+     * objects.
+     *
+     * @param mapdustBugs The list of <code>MapdustBug</code> objects
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public synchronized void update(List<MapdustBug> mapdustBugs,
+            MapdustPlugin mapdustPlugin) {
+        this.mapdustPlugin = mapdustPlugin;
+        String pluginState = Main.pref.get("mapdust.pluginState");
+        if (pluginState.equals(MapdustPluginState.ONLINE.getValue())) {
+            /* remove the panels */
+            if (tabbedPane != null) {
+                /* offline to online */
+                tabbedPane.remove(panel);
+                tabbedPane.remove(queuePanel);
+                mainPanel.remove(tabbedPane);
+                remove(mainPanel);
+                queuePanel = null;
+            } else {
+                /* online to online */
+                mainPanel.remove(detailsPanel);
+                mainPanel.remove(panel);
+                remove(mainPanel);
+            }
+            /* add panels with updated data */
+            panel = new MapdustPanel(mapdustBugs, "Bug reports", mapdustPlugin);
+            panel.addObserver(detailsPanel);
+            MapdustBug selectedBug =
+                    (mapdustBugs != null && mapdustBugs.size() > 0) ? mapdustBugs
+                            .get(0) : null;
+            notifyObservers(selectedBug);
+            mainPanel = new JPanel();
+            mainPanel.setAutoscrolls(true);
+            mainPanel.setLayout(new BorderLayout());
+            if (mapdustBugs != null) {
+                mainPanel.add(detailsPanel, BorderLayout.NORTH);
+            }
+            mainPanel.add(panel, BorderLayout.CENTER);
+            add(mainPanel, BorderLayout.CENTER);
+        } else {
+            List<MapdustAction> list = new ArrayList<MapdustAction>();
+            /* remove panels */
+            if (queuePanel == null) {
+                /* from online to offline */
+                mainPanel.remove(detailsPanel);
+                mainPanel.remove(panel);
+                remove(mainPanel);
+            } else {
+                list = queuePanel.getActionList();
+                mainPanel.remove(detailsPanel);
+                tabbedPane.remove(panel);
+                tabbedPane.remove(queuePanel);
+                mainPanel.remove(tabbedPane);
+                remove(mainPanel);
+            }
+            /* add panels with updated data */
+            tabbedPane = new JTabbedPane();
+            queuePanel = new MapdustActionPanel(list, "Offline Contribution",
+                            mapdustPlugin);
+            panel = new MapdustPanel(mapdustBugs, "Bug reports (offline)",
+                            mapdustPlugin);
+            panel.addObserver(detailsPanel);
+            mainPanel = new JPanel();
+            mainPanel.setAutoscrolls(true);
+            mainPanel.setLayout(new BorderLayout());
+            if (mapdustBugs != null && mapdustBugs.size() > 0) {
+                mainPanel.add(detailsPanel, BorderLayout.NORTH);
+            }
+            tabbedPane.add(panel, 0);
+            tabbedPane.add(queuePanel);
+            mainPanel.add(tabbedPane, BorderLayout.CENTER);
+            add(mainPanel, BorderLayout.CENTER);
+        }
+        /* invalidate and repaint */
+        invalidate();
+        repaint();
+    }
+
+    /**
+     * Adds the given <code>MapdustAction</code> object to the list of actions.
+     *
+     * @param action The <code>MapdustAction</code> object
+     */
+    @Override
+    public synchronized void addAction(MapdustAction action) {
+        /* add the action */
+        List<MapdustAction> list = queuePanel.getActionList();
+        List<MapdustBug> mapdustBugs = panel.getMapdustBugsList();
+        mapdustBugs = modifyBug(mapdustBugs, action.getMapdustBug());
+
+        /* remove panels */
+        mainPanel.remove(detailsPanel);
+        tabbedPane.remove(panel);
+        tabbedPane.remove(queuePanel);
+        mainPanel.remove(tabbedPane);
+        remove(mainPanel);
+        /* create new tabbed pane */
+        tabbedPane = new JTabbedPane();
+        list.add(action);
+        queuePanel = new MapdustActionPanel(list, "Offline Contribution",
+                mapdustPlugin);
+        panel = new MapdustPanel(mapdustBugs, "Bug reports (offline)",
+                mapdustPlugin);
+        mainPanel = new JPanel();
+        mainPanel.setAutoscrolls(true);
+        mainPanel.setLayout(new BorderLayout());
+        mainPanel.add(detailsPanel, BorderLayout.NORTH);
+        tabbedPane.add(panel, 0);
+        tabbedPane.add(queuePanel);
+        mainPanel.add(tabbedPane, BorderLayout.CENTER);
+        add(mainPanel, BorderLayout.CENTER);
+        /* invalidate and repaint */
+        invalidate();
+        repaint();
+    }
+
+    /**
+     * Shows the MapDust main dialog. In the case if the plugin was not updated
+     * with the new MapDust data, or the data was not downloaded; it will also
+     * download the MapDust data from the current view, and update the plugin
+     * with the new data.
+     *
+     */
+    @Override
+    public void showDialog() {
+        super.showDialog();
+        /* was not updated */
+        if (!initialUpdate && isShowing) {
+            notifyObservers();
+            initialUpdate = true;
+        }
+    }
+
+    /**
+     * Modifies the given <code>MapdustBug</code> in the given list of
+     * <code>MapdustBug</code> objects. Returns the list of bugs containing the
+     * modified bug.
+     *
+     * @param mapdustBugs The list of <code>MapdustBug</code> objects
+     * @param modifiedBug The <code>MapdustBug</code> object
+     * @return the modified list
+     */
+    private List<MapdustBug> modifyBug(List<MapdustBug> mapdustBugs,
+            MapdustBug modifiedBug) {
+        int index = -1;
+        for (int i = 0; i < mapdustBugs.size(); i++) {
+            if (modifiedBug.getId() != null) {
+                if (mapdustBugs.get(i).getId().equals(modifiedBug.getId())) {
+                    index = i;
+                }
+            }
+        }
+        if (index != -1) {
+            /* remove, and add to the top of the list */
+            mapdustBugs.remove(index);
+            mapdustBugs.add(0, modifiedBug);
+        }
+        return mapdustBugs;
+    }
+
+    /**
+     * Adds a new MapDust bug details observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugDetailsObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustBugDetailsObserver observer) {
+        if (!this.bugDetailsObservers.contains(observer)) {
+            this.bugDetailsObservers.add(observer);
+        }
+    }
+
+    /**
+     * Adds a new MapDust initial update observer to the list of observers.
+     *
+     * @param observer The <code>MapdustInitialUpdateObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustInitialUpdateObserver observer) {
+        if (!this.initialUpdateObservers.contains(observer)) {
+            this.initialUpdateObservers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the given MapDust bug details observer from the list of
+     * observers.
+     *
+     * @param observer The <code>MapdustBugDetailsObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustBugDetailsObserver observer) {
+        this.bugDetailsObservers.remove(observer);
+
+    }
+
+    /**
+     * Removes the given MapDust initial update observer from the list of
+     * observers.
+     *
+     * @param observer The <code>MapdustInitialUpdateObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustInitialUpdateObserver observer) {
+        this.initialUpdateObservers.remove(observer);
+
+    }
+
+    /**
+     * Notifies the <code>MapdustBugDetailsObserver</code> objects observing the
+     * given <code>MapdustBug</code> object.
+     */
+    @Override
+    public void notifyObservers(MapdustBug mapdustBug) {
+        Iterator<MapdustBugDetailsObserver> elements =
+                this.bugDetailsObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).showDetails(mapdustBug);
+        }
+    }
+
+    /**
+     * Notifies the <code>MapdustInitialUpdateObserver</code> objects waiting
+     * for the initial download, and update of plugin.
+     */
+    @Override
+    public void notifyObservers() {
+        Iterator<MapdustInitialUpdateObserver> elements =
+                this.initialUpdateObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).initialUpdate();
+        }
+    }
+
+    /**
+     * Returns the <code>MapdustPanel</code> object
+     *
+     * @return the panel
+     */
+    public MapdustPanel getPanel() {
+        return panel;
+    }
+
+    /**
+     * Returns the <code>MapdustActionPanel</code> object
+     *
+     * @return the queuePanel
+     */
+    public MapdustActionPanel getQueuePanel() {
+        return queuePanel;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/DisplayMenu.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/DisplayMenu.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/DisplayMenu.java	(revision 24514)
@@ -0,0 +1,109 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.adapter;
+
+
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.JList;
+import javax.swing.JPopupMenu;
+
+
+/**
+ * Displays the pop-up menu for the given selected element from the list of
+ * bugs.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class DisplayMenu extends MouseAdapter {
+
+    /** The <code>JPopupMenu</code> */
+    private JPopupMenu menu;
+
+    /** The list of bugs */
+    private JList listBugs;
+
+    /**
+     * Builds a <code>DisplayMenu</code> object
+     */
+    public DisplayMenu() {}
+
+    /**
+     * Builds a <code>DisplayMenu</code> object with the given arguments.
+     *
+     * @param listBugs The <code>JList</code> of <code>MapdustBug</code> objects
+     * @param menu The <code>JPopupMenu</code> object
+     */
+    public DisplayMenu(JList listBugs, JPopupMenu menu) {
+        this.listBugs = listBugs;
+        this.menu = menu;
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent e) {
+        /* show the pop-up menu */
+        showMenu(e);
+    }
+
+    @Override
+    public void mousePressed(MouseEvent e) {
+        /* show the pop-up menu */
+        showMenu(e);
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) {
+        /* show the pop-up menu */
+        showMenu(e);
+    }
+
+    /**
+     * Shows the menu if the given <code>MouseEvent</code> object has trigger
+     * the popup action.
+     *
+     * @param event The <code>MouseEvent</code> object
+     */
+    private void showMenu(MouseEvent event) {
+        if (event.isPopupTrigger()) {
+            JList c = (JList) event.getComponent();
+            int x = event.getX();
+            int y = event.getY();
+            int locationToIndex = listBugs.locationToIndex(event.getPoint());
+            int selectedIndex = listBugs.getSelectedIndex();
+            if (!listBugs.isSelectionEmpty()
+                    && locationToIndex == selectedIndex) {
+                int count = c.getModel().getSize();
+                int cal = count * 18;
+                if (y <= cal) {
+                    menu.show(listBugs, x, y);
+                }
+            }
+        }
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/WindowClose.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/WindowClose.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/WindowClose.java	(revision 24514)
@@ -0,0 +1,134 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.adapter;
+
+
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.AbstractDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Status;
+
+
+/**
+ * Closes the given dialog window.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class WindowClose extends WindowAdapter {
+
+    /** Serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** A <code>AbstractDialog</code> object */
+    private AbstractDialog dialog;
+
+    /** The <code>MapdustButtonPanel</code> object */
+    private MapdustButtonPanel btnPanel;
+
+    /** The <code>JToggleButton</code> which had fired the dialog */
+    private JToggleButton btnFired;
+
+    /**
+     * Builds a <code>WindowClose</code> object
+     */
+    public WindowClose() {}
+
+    /**
+     * Builds a <code>WindowClose</code> object based on the given arguments
+     *
+     * @param dialog The dialog which will be closed
+     * @param btnPanel The button panel
+     * @param btnFired The button which fired the display dialog action
+     */
+    public WindowClose(AbstractDialog dialog, MapdustButtonPanel btnPanel,
+            JToggleButton btnFired) {
+        this.dialog = dialog;
+        this.btnPanel = btnPanel;
+        this.btnFired = btnFired;
+    }
+
+    @Override
+    public void windowClosing(WindowEvent event) {
+        String status = Main.pref.get("selectedBug.status");
+        String pluginState = Main.pref.get("mapdust.pluginState");
+        /* enable buttons */
+        if (btnPanel != null) {
+            btnPanel.getBtnWorkOffline().setEnabled(true);
+            btnPanel.getBtnWorkOffline().setSelected(false);
+            if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                btnPanel.getBtnRefresh().setEnabled(false);
+            } else {
+                btnPanel.getBtnRefresh().setEnabled(true);
+            }
+            if (status.equals(Status.OPEN.getValue())) {
+                btnPanel.getBtnFixBugReport().setEnabled(true);
+                btnPanel.getBtnInvalidateBugReport().setEnabled(true);
+                btnPanel.getBtnReOpenBugReport().setEnabled(false);
+                btnPanel.getBtnAddComment().setEnabled(true);
+            } else {
+                if (status.equals(Status.FIXED.getValue())) {
+                    btnPanel.getBtnFixBugReport().setEnabled(false);
+                    btnPanel.getBtnInvalidateBugReport().setEnabled(false);
+                    btnPanel.getBtnReOpenBugReport().setEnabled(true);
+                    btnPanel.getBtnAddComment().setEnabled(true);
+                } else {
+                    if (status.equals(Status.INVALID.getValue())) {
+                        btnPanel.getBtnFixBugReport().setEnabled(false);
+                        btnPanel.getBtnInvalidateBugReport().setEnabled(false);
+                        btnPanel.getBtnReOpenBugReport().setEnabled(true);
+                        btnPanel.getBtnAddComment().setEnabled(true);
+                    } else {
+                        btnPanel.getBtnFixBugReport().setEnabled(false);
+                        btnPanel.getBtnInvalidateBugReport().setEnabled(false);
+                        btnPanel.getBtnReOpenBugReport().setEnabled(false);
+                        btnPanel.getBtnAddComment().setEnabled(false);
+                    }
+                }
+            }
+            btnPanel.getBtnRefresh().setSelected(false);
+            btnPanel.getBtnAddComment().setSelected(false);
+            btnPanel.getBtnFixBugReport().setSelected(false);
+            btnPanel.getBtnInvalidateBugReport().setSelected(false);
+            btnPanel.getBtnReOpenBugReport().setSelected(false);
+        }
+        /* enable fired button */
+        if (btnFired != null) {
+            btnFired.setEnabled(true);
+            btnFired.setSelected(false);
+        }
+        /* dispose dialog */
+        Main.pref.put("mapdust.modify", false);
+        dialog.dispose();
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the adapter classes.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.adapter;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java	(revision 24514)
@@ -0,0 +1,126 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.JOptionPane;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploader;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploaderException;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+
+
+/**
+ * Uploads the <code>MapdustAction</code> objects from the action list to the
+ * MapDust service. After the upload is done, the plugin state become 'ONLINE'
+ * and the MapdustBug objects will be refreshed.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteActionList extends MapdustExecuteAction implements
+        MapdustRefreshObservable {
+
+    /** Serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** List of MapdustRefreshObserver objects */
+    private final ArrayList<MapdustRefreshObserver> observers =
+            new ArrayList<MapdustRefreshObserver>();
+
+    /**
+     * Builds a <code>ExceuteActionList</code> object
+     *
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteActionList(MapdustGUI mapdustGUI) {
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event.getSource() instanceof JToggleButton) {
+            // upload actions
+            try {
+                MapdustActionUploader.getInstance().uploadData(
+                        getMapdustGUI().getQueuePanel().getActionList());
+            } catch (MapdustActionUploaderException e) {
+                String errorMessage = "There was an error uploading the ";
+                errorMessage += "action list.";
+                JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                        tr("Error"), JOptionPane.ERROR_MESSAGE);
+            }
+            Main.pref.put("mapdust.pluginState",
+                    MapdustPluginState.ONLINE.getValue());
+            getMapdustGUI().getPanel().getBtnPanel().getBtnRefresh()
+                    .setEnabled(true);
+            notifyObservers();
+        }
+    }
+
+    /**
+     * Adds a new MapDust refresh observer to the list of observers.
+     *
+     * @param observer The <code>MapdustRefreshObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustRefreshObserver observer) {
+        if (!this.observers.contains(observer)) {
+            this.observers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust refresh observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustRefreshObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustRefreshObserver observer) {
+        this.observers.remove(observer);
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers() {
+        Iterator<MapdustRefreshObserver> elements = this.observers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).updateData();
+        }
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteAddBug.java	(revision 24514)
@@ -0,0 +1,240 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CreateIssueDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustServiceCommand;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Status;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Type;
+
+
+/**
+ * Creates a new <code>MapdustBug</code> object. Validates the input data, and
+ * based on the plugin state executes the corresponding action. If the plugin is
+ * in the "ONLINE" state then executes the Mapdust Service 'addBug' method with
+ * the given input parameters. If the plugin is in the "OFFLINE" state then adds
+ * the given action to the actions list.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteAddBug extends MapdustExecuteAction implements
+        MapdustBugObservable, MapdustActionListObservable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of Mapdust bug observers */
+    private final ArrayList<MapdustBugObserver> bugObservers =
+            new ArrayList<MapdustBugObserver>();
+
+    /** The list of Mapdust action observers */
+    private final ArrayList<MapdustActionListObserver> actionObservers =
+            new ArrayList<MapdustActionListObserver>();
+
+    /**
+     * Builds a <code>ExecuteAddBug</code> object
+     */
+    public ExecuteAddBug() {}
+
+    /***
+     * Builds a <code>ExecuteAddBug</code> object based on the given arguments.
+     *
+     * @param dialog The <code>CreateIssueDialog</code> object
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteAddBug(CreateIssueDialog dialog, MapdustGUI mapdustGUI) {
+        setDialog(dialog);
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event != null) {
+            CreateIssueDialog createDialog = (CreateIssueDialog) getDialog();
+            Type type = (Type) (createDialog).getCbbType().getSelectedItem();
+            String nickname = createDialog.getTxtNickname().getText();
+            String commentText = createDialog.getTxtDescription().getText();
+            /* validates the input */
+            String errorMessage = validate(nickname, commentText);
+            if (errorMessage != null) {
+                /* invalid data */
+                JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                        tr("Missing input data"), JOptionPane.WARNING_MESSAGE);
+                return;
+            }
+            /* valid data */
+            Main.pref.put("mapdust.nickname", nickname);
+            Point p = createDialog.getPoint();
+            LatLon latlon = null;
+            if (p != null) {
+                latlon = Main.map.mapView.getLatLon(p.x, p.y);
+            }
+            MapdustBug bug =
+                    new MapdustBug(latlon, type, commentText, nickname);
+            String pluginState = Main.pref.get("mapdust.pluginState");
+            if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                /* offline state */
+                int index = getSelectedBugIndex();
+                bug.setStatus(Status.OPEN);
+                String iconPath = getIconPath(bug);
+                MapdustAction mapdustAction =
+                        new MapdustAction(MapdustServiceCommand.ADD_BUG,
+                                iconPath, bug);
+                if (getMapdustGUI().getQueuePanel() != null) {
+                    notifyObservers(mapdustAction);
+                }
+                resetSelectedBug(index);
+            } else {
+                /* online state */
+                MapdustServiceHandler handler = new MapdustServiceHandler();
+                Long id = null;
+                try {
+                    id = handler.addBug(bug);
+                } catch (MapdustServiceHandlerException e) {
+                    errorMessage = "There was a Mapdust service error.";
+                    JOptionPane.showMessageDialog(Main.parent,
+                            tr(errorMessage), tr("Error"),
+                            JOptionPane.ERROR_MESSAGE);
+                }
+                if (id != null) {
+                    /* success */
+                    MapdustBug newMapdustBug = null;
+                    try {
+                        newMapdustBug = handler.getBug(id, null);
+                    } catch (MapdustServiceHandlerException e) {
+                        errorMessage = "There was a Mapdust service error.";
+                        JOptionPane.showMessageDialog(Main.parent,
+                                tr(errorMessage), tr("Error"),
+                                JOptionPane.ERROR_MESSAGE);
+                    }
+                    if (newMapdustBug != null) {
+                        notifyObservers(newMapdustBug);
+                    }
+                }
+                resetSelectedBug(0);
+            }
+            Main.pref.put("mapdust.modify", false);
+            /* destroy dialog */
+            getDialog().dispose();
+        }
+    }
+
+    /**
+     * Adds a new MapDust bug observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustBugObserver observer) {
+        if (!this.bugObservers.contains(observer)) {
+            this.bugObservers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust bug observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustBugObserver observer) {
+        this.bugObservers.remove(observer);
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    @Override
+    public void notifyObservers(MapdustBug mapdustBug) {
+        Iterator<MapdustBugObserver> elements = this.bugObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).changedData(mapdustBug);
+        }
+    }
+
+    /**
+     * Adds a new MapDust action list observer to the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustActionListObserver observer) {
+        if (!this.actionObservers.contains(observer)) {
+            this.actionObservers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust action list observer object from the list of
+     * observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustActionListObserver observer) {
+        this.actionObservers.remove(observer);
+
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     *
+     * @param mapdustAction The <code>MapdustAction</code> object
+     */
+    @Override
+    public void notifyObservers(MapdustAction mapdustAction) {
+        Iterator<MapdustActionListObserver> elements =
+                this.actionObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).addAction(mapdustAction);
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCancel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCancel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCancel.java	(revision 24514)
@@ -0,0 +1,124 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import java.awt.event.ActionEvent;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.AbstractDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Status;
+
+
+/**
+ * This class is invoked whenever a "Cancel" button is pressed.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteCancel extends MapdustExecuteAction {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a <code>CancelAction</code> object
+     */
+    public ExecuteCancel() {}
+
+    /**
+     * Builds a <code>CancelAction</code> object
+     *
+     * @param dialog The <code>AbstractDialog</code> object
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteCancel(AbstractDialog dialog, MapdustGUI mapdustGUI) {
+        setDialog(dialog);
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event != null) {
+            String pluginState = Main.pref.get("mapdust.pluginState");
+            String status = Main.pref.get("selectedBug.status");
+            /* enable buttons */
+            MapdustButtonPanel btnPanel =
+                    getMapdustGUI().getPanel().getBtnPanel();
+            if (btnPanel != null) {
+                btnPanel.getBtnWorkOffline().setEnabled(true);
+                btnPanel.getBtnWorkOffline().setSelected(false);
+                if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                    btnPanel.getBtnRefresh().setEnabled(false);
+                } else {
+                    btnPanel.getBtnRefresh().setEnabled(true);
+                }
+                if (status.equals(Status.OPEN.getValue())) {
+                    btnPanel.getBtnFixBugReport().setEnabled(true);
+                    btnPanel.getBtnInvalidateBugReport().setEnabled(true);
+                    btnPanel.getBtnReOpenBugReport().setEnabled(false);
+                    btnPanel.getBtnAddComment().setEnabled(true);
+                } else {
+                    if (status.equals(Status.FIXED.getValue())) {
+                        btnPanel.getBtnFixBugReport().setEnabled(false);
+                        btnPanel.getBtnInvalidateBugReport().setEnabled(false);
+                        btnPanel.getBtnReOpenBugReport().setEnabled(true);
+                        btnPanel.getBtnAddComment().setEnabled(true);
+                    } else {
+                        if (status.equals(Status.INVALID.getValue())) {
+                            btnPanel.getBtnFixBugReport().setEnabled(false);
+                            btnPanel.getBtnInvalidateBugReport().setEnabled(
+                                    false);
+                            btnPanel.getBtnReOpenBugReport().setEnabled(true);
+
+                            btnPanel.getBtnAddComment().setEnabled(true);
+                        } else {
+                            // created bug, then close dialog
+                            btnPanel.getBtnFixBugReport().setEnabled(false);
+                            btnPanel.getBtnInvalidateBugReport().setEnabled(
+                                    false);
+                            btnPanel.getBtnReOpenBugReport().setEnabled(false);
+                            btnPanel.getBtnAddComment().setEnabled(false);
+                        }
+                    }
+                }
+                btnPanel.getBtnRefresh().setSelected(false);
+                btnPanel.getBtnAddComment().setSelected(false);
+                btnPanel.getBtnFixBugReport().setSelected(false);
+                btnPanel.getBtnInvalidateBugReport().setSelected(false);
+                btnPanel.getBtnReOpenBugReport().setSelected(false);
+            }
+            /* dispose dialog */
+            Main.pref.put("mapdust.modify", false);
+            getDialog().dispose();
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java	(revision 24514)
@@ -0,0 +1,232 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.JButton;
+import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustServiceCommand;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Status;
+
+
+/**
+ * Fixes the given <code>MapdustBug</code> object. Validates the input data, and
+ * based on the plugin state executes the corresponding action. If the plugin is
+ * in the "ONLINE" state then executes the Mapdust Service 'changeBugStatus'
+ * action with statusId=2 and the given input parameters. If the plugin is in
+ * the "OFFLINE" state then adds the given action to the queue list.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteCloseBug extends MapdustExecuteAction implements
+        MapdustBugObservable, MapdustActionListObservable {
+
+    /** Serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of Mapdust bug observers */
+    private final ArrayList<MapdustBugObserver> bugObservers =
+            new ArrayList<MapdustBugObserver>();
+
+    /** The list of Mapdust action observers */
+    private final ArrayList<MapdustActionListObserver> actionObservers =
+            new ArrayList<MapdustActionListObserver>();
+
+    /**
+     * Builds a <code>ExecuteCloseBug</code> object.
+     */
+    public ExecuteCloseBug() {}
+
+    /**
+     * Builds a <code>ExecuteCloseBug</code> object
+     *
+     * @param dialog The <code>ChangeIssueStatusDialog</code> object
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteCloseBug(ChangeIssueStatusDialog dialog, MapdustGUI mapdustGUI) {
+        setDialog(dialog);
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event.getSource() instanceof JButton) {
+            JButton btn = (JButton) event.getSource();
+            if (btn.getText().equals("OK")) {
+                /* the OK button was pressed */
+                ChangeIssueStatusDialog issueDialog =
+                        (ChangeIssueStatusDialog) getDialog();
+                String nickname = issueDialog.getTxtNickname().getText();
+                String commentText = issueDialog.getTxtDescription().getText();
+                /* validate nickname & comment text */
+                String errorMessage = validate(nickname, commentText);
+                if (errorMessage != null) {
+                    /* invalid input data */
+                    JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                           tr("Missing input data"), JOptionPane.WARNING_MESSAGE);
+                    return;
+                }
+                /* valid input data */
+                Main.pref.put("mapdust.nickname", nickname);
+                MapdustBug selectedBug = getSelectedBug();
+                MapdustComment comment = new MapdustComment(selectedBug.getId(),
+                        commentText, nickname);
+                String pluginState = Main.pref.get("mapdust.pluginState");
+                if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                    /* offline state, put to the actions list */
+                    selectedBug.setStatus(Status.FIXED);
+                    String iconPath = getIconPath(selectedBug);
+                    MapdustAction mapdustAction = new MapdustAction(
+                            MapdustServiceCommand.CHANGE_BUG_STATUS, iconPath,
+                            selectedBug, comment, 2);
+                    if (getMapdustGUI().getQueuePanel() != null) {
+                        notifyObservers(mapdustAction);
+                    }
+                } else {
+                    /* online state, execute Mapdust service method */
+                    MapdustServiceHandler handler = new MapdustServiceHandler();
+                    Long id = null;
+                    try {
+                        id = handler.changeBugStatus(2, comment);
+                    } catch (MapdustServiceHandlerException e) {
+                        errorMessage = "There was a Mapdust service error.";
+                        JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                                tr("Error"), JOptionPane.ERROR_MESSAGE);
+                    }
+                    if (id != null) {
+                        // success
+                        MapdustBug newMapdustBug = null;
+                        try {
+                            newMapdustBug = handler.getBug(selectedBug.getId(), null);
+                        } catch (MapdustServiceHandlerException e) {
+                            errorMessage = "There was a Mapdust service error.";
+                            JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                                    tr("Error"), JOptionPane.ERROR_MESSAGE);
+                        }
+                        if (newMapdustBug != null) {
+                            notifyObservers(newMapdustBug);
+                        }
+                    }
+                }
+                /* enable buttons */
+                enableFiredButton(issueDialog.getFiredButton());
+                resetSelectedBug(0);
+                Main.pref.put("mapdust.modify", false);
+                /* destroy dialog */
+                issueDialog.dispose();
+            }
+        }
+    }
+
+    /**
+     * Adds a new MapDust bug observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustBugObserver observer) {
+        if (!this.bugObservers.contains(observer)) {
+            this.bugObservers.add(observer);
+        }
+    }
+
+    /**
+     * Adds a new MapDust action list observer to the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustActionListObserver observer) {
+        if (!this.actionObservers.contains(observer)) {
+            this.actionObservers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust bug observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustBugObserver observer) {
+        this.bugObservers.remove(observer);
+
+    }
+    /**
+     * Removes the MapDust action list observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustActionListObserver observer) {
+        this.actionObservers.remove(observer);
+
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustBug mapdustBug) {
+        Iterator<MapdustBugObserver> elements = this.bugObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).changedData(mapdustBug);
+        }
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustAction mapdustAction) {
+        Iterator<MapdustActionListObserver> elements =
+                this.actionObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).addAction(mapdustAction);
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCommentBug.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCommentBug.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCommentBug.java	(revision 24514)
@@ -0,0 +1,230 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.JButton;
+import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CommentIssueDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustServiceCommand;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+
+
+/**
+ * Comments the given <code>MapdustBug</code> object. Validates the input data,
+ * and based on the plugin state executes the corresponding action. If the
+ * plugin is in the "ONLINE" state then executes the Mapdust Service
+ * 'commentBug' method with the given input parameters. If the plugin is in the
+ * "OFFLINE" state then the given action is added to the actions list.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteCommentBug extends MapdustExecuteAction implements
+        MapdustBugObservable, MapdustActionListObservable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of Mapdust bug observers */
+    private final ArrayList<MapdustBugObserver> bugObservers =
+            new ArrayList<MapdustBugObserver>();
+
+    /** The list of mapdust action observers */
+    private final ArrayList<MapdustActionListObserver> actionObservers =
+            new ArrayList<MapdustActionListObserver>();
+
+    /**
+     * Builds a <code>ExecuteCommentBug</code> object
+     */
+    public ExecuteCommentBug() {}
+
+    /**
+     * Builds a <code>ExecuteCommentBug</code> object with the given arguments.
+     *
+     * @param dialog The <code>CommentIssueDialog</code> object
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteCommentBug(CommentIssueDialog dialog, MapdustGUI mapdustGUI) {
+        setDialog(dialog);
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event.getSource() instanceof JButton) {
+            JButton btn = (JButton) event.getSource();
+            if (btn.getText().equals("OK")) {
+                /* ok button was pressed */
+                CommentIssueDialog issueDialog =
+                        (CommentIssueDialog) getDialog();
+                String nickname = issueDialog.getTxtNickname().getText();
+                String commentText = issueDialog.getTxtComment().getText();
+                /* validate */
+                String errorMessage = validate(nickname, commentText);
+                if (errorMessage != null) {
+                    /* invalid input data */
+                    JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                            tr("Missing input data"), JOptionPane.WARNING_MESSAGE);
+                    return;
+                }
+                /* valid */
+                Main.pref.put("mapdust.nickname", nickname);
+                MapdustBug selectedBug = getSelectedBug();
+                MapdustComment comment = new MapdustComment(selectedBug.getId(),
+                        commentText, nickname);
+                String pluginState = Main.pref.get("mapdust.pluginState");
+                if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                    /* offline, save to actions list */
+                    String iconPath = getIconPath(selectedBug);
+                    MapdustAction mapdustAction = new MapdustAction(
+                            MapdustServiceCommand.COMMENT_BUG, iconPath,
+                            selectedBug, comment);
+                    if (getMapdustGUI().getQueuePanel() != null) {
+                        notifyObservers(mapdustAction);
+                    }
+                } else {
+                    /* online, execute Mapdust service method */
+                    MapdustServiceHandler handler = new MapdustServiceHandler();
+                    Long id = null;
+                    try {
+                        id = handler.commentBug(comment);
+                    } catch (MapdustServiceHandlerException e) {
+                        errorMessage = "There was a Mapdust service error.";
+                        JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                                tr("Error"), JOptionPane.ERROR_MESSAGE);
+                    }
+                    if (id != null) {
+                        // success
+                        MapdustBug newMapdustBug = null;
+                        try {
+                            newMapdustBug = handler.getBug(selectedBug.getId(), null);
+                        } catch (MapdustServiceHandlerException e) {
+                            errorMessage = "There was a Mapdust service error.";
+                            JOptionPane.showMessageDialog(Main.parent,
+                                    tr(errorMessage), tr("Error"),
+                                    JOptionPane.ERROR_MESSAGE);
+                        }
+                        if (newMapdustBug != null) {
+                            notifyObservers(newMapdustBug);
+                        }
+                    }
+                }
+                /* enable buttons */
+                enableFiredButton(issueDialog.getFiredButton());
+                resetSelectedBug(0);
+                Main.pref.put("mapdust.modify", false);
+                /* destroy dialog */
+                issueDialog.dispose();
+            }
+        }
+    }
+
+    /**
+     * Adds a new MapDust bug observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustBugObserver observer) {
+        if (!this.bugObservers.contains(observer)) {
+            this.bugObservers.add(observer);
+        }
+    }
+
+    /**
+     * Adds a new MapDust action list observer to the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustActionListObserver observer) {
+        if (!this.actionObservers.contains(observer)) {
+            this.actionObservers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust bug observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustBugObserver observer) {
+        this.bugObservers.remove(observer);
+
+    }
+
+    /**
+     * Removes the MapDust action list observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustActionListObserver observer) {
+        this.actionObservers.remove(observer);
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustBug mapdustBug) {
+        Iterator<MapdustBugObserver> elements = this.bugObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).changedData(mapdustBug);
+        }
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustAction mapdustAction) {
+        Iterator<MapdustActionListObserver> elements =
+                this.actionObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).addAction(mapdustAction);
+        }
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteInvalidateBug.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteInvalidateBug.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteInvalidateBug.java	(revision 24514)
@@ -0,0 +1,236 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.JButton;
+import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustServiceCommand;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Status;
+
+
+/**
+ * Invalidates the given <code>MapdustBug</code> object. Validates the input
+ * data, and based on the plugin state executes the corresponding action. If the
+ * plugin is in the "ONLINE" state then executes the MapDust Service
+ * 'changeBugStatus' action with statusId=3 and the given input parameters. If
+ * the plugin is in the "OFFLINE" state then adds the given action to the action
+ * list.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteInvalidateBug extends MapdustExecuteAction implements
+        MapdustBugObservable, MapdustActionListObservable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of mapdust bug observers */
+    private final ArrayList<MapdustBugObserver> bugObservers =
+            new ArrayList<MapdustBugObserver>();
+
+    /** The list of mapdust action observers */
+    private final ArrayList<MapdustActionListObserver> actionObservers =
+            new ArrayList<MapdustActionListObserver>();
+
+    /**
+     * Builds a <code>ExecuteInvalidateBug</code> object
+     */
+    public ExecuteInvalidateBug() {}
+
+    /**
+     * Builds a <code>ExecuteInvalidateBug</code> object based on the given
+     * arguments.
+     *
+     * @param dialog The <code>ChangeIssueStatusDialog</code> object
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteInvalidateBug(ChangeIssueStatusDialog dialog,
+            MapdustGUI mapdustGUI) {
+        setDialog(dialog);
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event.getSource() instanceof JButton) {
+            JButton btn = (JButton) event.getSource();
+            if (btn.getText().equals("OK")) {
+                /* ok button was pressed */
+                ChangeIssueStatusDialog issueDialog = (ChangeIssueStatusDialog) getDialog();
+                String nickname = issueDialog.getTxtNickname().getText();
+                String commentText = issueDialog.getTxtDescription().getText();
+                /* validate input */
+                String errorMessage = validate(nickname, commentText);
+                if (errorMessage != null) {
+                    /* invalid input */
+                    JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                            tr("Missing input data"), JOptionPane.WARNING_MESSAGE);
+                    return;
+                }
+                /* valid input */
+                Main.pref.put("mapdust.nickname", nickname);
+                MapdustBug selectedBug = getSelectedBug();
+                MapdustComment comment = new MapdustComment(selectedBug.getId(),
+                        commentText, nickname);
+                String pluginState = Main.pref.get("mapdust.pluginState");
+                if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                    /* 'offline' state , add to action list */
+                    selectedBug.setStatus(Status.INVALID);
+                    String iconPath = getIconPath(selectedBug);
+                    MapdustAction mapdustAction = new MapdustAction(
+                            MapdustServiceCommand.CHANGE_BUG_STATUS, iconPath,
+                            selectedBug, comment, 3);
+                    if (getMapdustGUI().getQueuePanel() != null) {
+                        notifyObservers(mapdustAction);
+                    }
+                } else {
+                    /* online state, execute Mapdust method */
+                    MapdustServiceHandler handler = new MapdustServiceHandler();
+                    Long id = null;
+                    try {
+                        id = handler.changeBugStatus(3, comment);
+                    } catch (MapdustServiceHandlerException e) {
+                        errorMessage = "There was a Mapdust service error.";
+                        JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                                tr("Error"), JOptionPane.ERROR_MESSAGE);
+                    }
+                    if (id != null) {
+                        // success
+                        MapdustBug newMapdustBug = null;
+                        try {
+                            newMapdustBug = handler.getBug(selectedBug.getId(), null);
+                        } catch (MapdustServiceHandlerException e) {
+                            errorMessage = "There was a Mapdust service error.";
+                            errorMessage += "Mapdust bug report.";
+                            JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                                    tr("Error"), JOptionPane.ERROR_MESSAGE);
+                        }
+                        if (newMapdustBug != null) {
+                            notifyObservers(newMapdustBug);
+                        }
+                    }
+                }
+                /* enable buttons */
+                enableFiredButton(issueDialog.getFiredButton());
+                resetSelectedBug(0);
+                Main.pref.put("mapdust.modify", false);
+                /* destroy dialog */
+                issueDialog.dispose();
+            }
+        }
+    }
+
+    /**
+     * Adds a new MapDust bug observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustBugObserver observer) {
+        if (!this.bugObservers.contains(observer)) {
+            this.bugObservers.add(observer);
+        }
+    }
+
+    /**
+     * Adds a new MapDust action list observer to the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustActionListObserver observer) {
+        if (!this.actionObservers.contains(observer)) {
+            this.actionObservers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust bug observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustBugObserver observer) {
+        this.bugObservers.remove(observer);
+
+    }
+
+    /**
+     * Removes the MapDust action list observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustActionListObserver observer) {
+        this.actionObservers.remove(observer);
+
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustBug mapdustBug) {
+        Iterator<MapdustBugObserver> elements = this.bugObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).changedData(mapdustBug);
+        }
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustAction mapdustAction) {
+        Iterator<MapdustActionListObserver> elements =
+                this.actionObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).addAction(mapdustAction);
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteReOpenBug.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteReOpenBug.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteReOpenBug.java	(revision 24514)
@@ -0,0 +1,242 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.JButton;
+import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustActionListObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustServiceCommand;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Status;
+
+
+/**
+ * Re-opens the given <code>MapdustBug</code> object. Validates the input data,
+ * and based on the plugin state executes the corresponding action. If the
+ * plugin is in the "ONLINE" state then executes the MapDust Service
+ * 'changeBugStatus' action with statusId=1 and the given input parameters. If
+ * the plugin is in the "OFFLINE" state then adds the given action to the action
+ * list.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteReOpenBug extends MapdustExecuteAction implements
+        MapdustBugObservable, MapdustActionListObservable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of mapdust bug observers */
+    private final ArrayList<MapdustBugObserver> bugObservers =
+            new ArrayList<MapdustBugObserver>();
+
+    /** The list of mapdust action observers */
+    private final ArrayList<MapdustActionListObserver> actionObservers =
+            new ArrayList<MapdustActionListObserver>();
+
+    /**
+     * Builds a <code>ExecuteReOpenBug</code> object
+     */
+    public ExecuteReOpenBug() {}
+
+    /**
+     * Builds a <code>ExecuteReOpenBug</code> object with the given arguments.
+     *
+     * @param dialog The <code>ChangeIssueStatusDialog</code> object
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteReOpenBug(ChangeIssueStatusDialog dialog,
+            MapdustGUI mapdustGUI) {
+        setDialog(dialog);
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event.getSource() instanceof JButton) {
+            JButton btn = (JButton) event.getSource();
+            if (btn.getText().equals("OK")) {
+                /* pressed ok */
+                ChangeIssueStatusDialog issueDialog =
+                        (ChangeIssueStatusDialog) getDialog();
+                String nickname = issueDialog.getTxtNickname().getText();
+                String commentText = issueDialog.getTxtDescription().getText();
+                /* validate */
+                String errorMessage = validate(nickname, commentText);
+                if (errorMessage != null) {
+                    /* invalid data */
+                    JOptionPane.showMessageDialog(Main.parent,
+                            tr(errorMessage), tr("Missing input data"),
+                            JOptionPane.WARNING_MESSAGE);
+                    return;
+                }
+                /* valid */
+                Main.pref.put("mapdust.nickname", nickname);
+                MapdustBug selectedBug = getSelectedBug();
+                MapdustComment comment =
+                        new MapdustComment(selectedBug.getId(), commentText,
+                                nickname);
+                String pluginState = Main.pref.get("mapdust.pluginState");
+                if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                    /* offline , save to action list */
+                    selectedBug.setStatus(Status.OPEN);
+                    String iconPath = getIconPath(selectedBug);
+                    MapdustAction mapdustAction =
+                            new MapdustAction(
+                                    MapdustServiceCommand.CHANGE_BUG_STATUS,
+                                    iconPath, selectedBug, comment, 1);
+                    if (getMapdustGUI().getQueuePanel() != null) {
+                        notifyObservers(mapdustAction);
+                    }
+                } else {
+                    /* online, call Mapdust service method */
+                    MapdustServiceHandler handler = new MapdustServiceHandler();
+                    Long id = null;
+                    try {
+                        id = handler.changeBugStatus(1, comment);
+                    } catch (MapdustServiceHandlerException e) {
+                        errorMessage = "There was a Mapdust service error.";
+                        errorMessage += "Mapdust bug report.";
+                        JOptionPane.showMessageDialog(Main.parent,
+                                tr(errorMessage), tr("Error"),
+                                JOptionPane.ERROR_MESSAGE);
+                    }
+                    if (id != null) {
+                        // success
+                        MapdustBug newMapdustBug = null;
+                        try {
+                            newMapdustBug =
+                                    handler.getBug(selectedBug.getId(), null);
+                        } catch (MapdustServiceHandlerException e) {
+                            errorMessage = "There was a Mapdust service error.";
+                            errorMessage += "Mapdust bug report.";
+                            JOptionPane.showMessageDialog(Main.parent,
+                                    tr(errorMessage), tr("Error"),
+                                    JOptionPane.ERROR_MESSAGE);
+                        }
+                        if (newMapdustBug != null) {
+                            notifyObservers(newMapdustBug);
+                        }
+                    }
+                }
+                /* enable buttons */
+                enableFiredButton(issueDialog.getFiredButton());
+                resetSelectedBug(0);
+                Main.pref.put("mapdust.modify", false);
+                /* destroy dialog */
+                issueDialog.dispose();
+            }
+        }
+    }
+
+    /**
+     * Adds a new MapDust bug observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustBugObserver observer) {
+        if (!this.bugObservers.contains(observer)) {
+            this.bugObservers.add(observer);
+        }
+    }
+
+    /**
+     * Adds a new MapDust action list observer to the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustActionListObserver observer) {
+        if (!this.actionObservers.contains(observer)) {
+            this.actionObservers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust bug observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustBugObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustBugObserver observer) {
+        this.bugObservers.remove(observer);
+
+    }
+
+    /**
+     * Removes the MapDust action list observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustActionListObserver observer) {
+        this.actionObservers.remove(observer);
+
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustBug mapdustBug) {
+        Iterator<MapdustBugObserver> elements = this.bugObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).changedData(mapdustBug);
+        }
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers(MapdustAction mapdustAction) {
+        Iterator<MapdustActionListObserver> elements =
+                this.actionObservers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).addAction(mapdustAction);
+        }
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteRefresh.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteRefresh.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteRefresh.java	(revision 24514)
@@ -0,0 +1,104 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.AbstractAction;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObserver;
+
+
+/**
+ * Executes a refresh action. The refresh action returns all the
+ * <code>MapdustBug</code> object from the current view.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteRefresh extends AbstractAction implements
+        MapdustRefreshObservable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of MapDust refresh observers */
+    private final ArrayList<MapdustRefreshObserver> observers =
+            new ArrayList<MapdustRefreshObserver>();
+
+    /**
+     * Builds a <code>EexecuteRefresh<code> object
+     */
+    public ExecuteRefresh() {}
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event.getSource() instanceof JToggleButton) {
+            JToggleButton btn = (JToggleButton) event.getSource();
+            /* update the bugs */
+            notifyObservers();
+            btn.setSelected(false);
+        }
+    }
+
+    /**
+     * Adds a new MapDust refresh observer to the list of observers.
+     *
+     * @param observer The <code>MapdustRefreshObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustRefreshObserver observer) {
+        if (!this.observers.contains(observer)) {
+            this.observers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust refresh observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustRefreshObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustRefreshObserver observer) {
+        this.observers.remove(observer);
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers() {
+        Iterator<MapdustRefreshObserver> elements = this.observers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).updateData();
+        }
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteWorkOffline.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteWorkOffline.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteWorkOffline.java	(revision 24514)
@@ -0,0 +1,155 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import javax.swing.JOptionPane;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploader;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploaderException;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustRefreshObserver;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+
+
+/**
+ * Executes the work offline action. In the offline mode the user actions will
+ * not be uploaded immediately to the Mapdust service. The user can perform the
+ * following actions in offline mode: add bug, comment bug and change bug
+ * status. After deactivating the offline mode the user's modifications will be
+ * uploaded to the Mapdust service.
+ *
+ * @author Bea
+ *
+ */
+public class ExecuteWorkOffline extends MapdustExecuteAction implements
+        MapdustRefreshObservable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of mapdust refresh observers */
+    private final ArrayList<MapdustRefreshObserver> observers =
+            new ArrayList<MapdustRefreshObserver>();
+
+    /**
+     * Builds a <code>ExecuteWorkOffline</code> object.
+     */
+    public ExecuteWorkOffline() {}
+
+    /**
+     * Builds a <code>ExecuteWorkOffline</code> object based on the given
+     * arguments.
+     *
+     * @param mapdustGUI The <code>MapdustGUI</code> object
+     */
+    public ExecuteWorkOffline(MapdustGUI mapdustGUI) {
+        setMapdustGUI(mapdustGUI);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event.getSource() instanceof JToggleButton) {
+            JToggleButton btn = (JToggleButton) event.getSource();
+            if (getMapdustGUI() != null) {
+                String pluginState = Main.pref.get("mapdust.pluginState");
+                if (pluginState.equals(MapdustPluginState.ONLINE.getValue())) {
+                    Main.pref.put("mapdust.pluginState",
+                            MapdustPluginState.OFFLINE.getValue());
+                    btn.setSelected(false);
+                } else {
+                    // was offline, becomes online
+                    String title = "MapDust";
+                    String message = "Do you want to submit your changes ";
+                    message += "to Mapdust?";
+                    int result =
+                            JOptionPane.showConfirmDialog(Main.parent,
+                                    tr(message), tr(title),
+                                    JOptionPane.YES_NO_OPTION);
+                    if (result == JOptionPane.YES_OPTION) {
+                        // process data
+                        try {
+                            MapdustActionUploader.getInstance().uploadData(
+                                    getMapdustGUI().getQueuePanel()
+                                            .getActionList());
+                        } catch (MapdustActionUploaderException e) {
+                            String errorMessage =
+                                    "There was a Mapdust service error.";
+                            JOptionPane.showMessageDialog(Main.parent,
+                                    tr(errorMessage), tr("Error"),
+                                    JOptionPane.ERROR_MESSAGE);
+                        }
+                    }
+                    Main.pref.put("mapdust.pluginState",
+                            MapdustPluginState.ONLINE.getValue());
+                    btn.setSelected(false);
+                }
+                notifyObservers();
+            }
+        }
+    }
+
+    /**
+     * Adds a new MapDust refresh observer to the list of observers.
+     *
+     * @param observer The <code>MapdustRefreshObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustRefreshObserver observer) {
+        if (!this.observers.contains(observer)) {
+            this.observers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the MapDust refresh observer object from the list of observers.
+     *
+     * @param observer The <code>MapdustRefreshObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustRefreshObserver observer) {
+        this.observers.remove(observer);
+    }
+
+    /**
+     * Notifies the observers observing this action.
+     */
+    @Override
+    public void notifyObservers() {
+        Iterator<MapdustRefreshObserver> elements = this.observers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).updateData();
+        }
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/MapdustExecuteAction.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/MapdustExecuteAction.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/MapdustExecuteAction.java	(revision 24514)
@@ -0,0 +1,224 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
+
+
+import javax.swing.AbstractAction;
+import javax.swing.JList;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.AbstractDialog;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+
+
+/**
+ * This is an abstract class, defining the commonly used methods by the
+ * ExecuteAction classes.
+ *
+ * @author Bea
+ *
+ */
+public abstract class MapdustExecuteAction extends AbstractAction {
+
+    /** Serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The abstract dialog object */
+    protected AbstractDialog dialog;
+
+    /** The MapDust GUI object */
+    protected MapdustGUI mapdustGUI;
+
+    /**
+     * Validates the nickname and the commentText fields, and returns the
+     * corresponding message. If the fields are both valid, the method return
+     * null.
+     *
+     * @param nickname The nickname of the user
+     * @param commentText A comment given by the user
+     * @return An error string
+     */
+    protected String validate(String nickname, String commentText) {
+        String errorMessage = null;
+        String invalidNickname = " Your nickname length has to be between 3";
+        invalidNickname += " and 16 characters.Please use letters,numbers, ";
+        invalidNickname += " '-', '.' or '_' '.'";
+        if (emptyValue(nickname) && emptyValue(commentText)) {
+            errorMessage = " Missing nickname and comment.";
+            errorMessage += invalidNickname;
+        } else {
+            if (emptyValue(nickname)) {
+                errorMessage = " Missing nickname.";
+                errorMessage += nickname;
+            } else {
+                if (emptyValue(commentText)) {
+                    if (!validNickname(nickname)) {
+                        errorMessage = " Missing comment and invalid nickname.";
+                        errorMessage += invalidNickname;
+                    } else {
+                        errorMessage = " The comment is missing.";
+                    }
+                } else {
+                    if (!validNickname(nickname)) {
+                        errorMessage = " Invalid nickname.";
+                        errorMessage += invalidNickname;
+                    }
+                }
+            }
+        }
+        return errorMessage;
+    }
+
+    /**
+     * Returns the icon path for the given MapDust bug. The icons are located in
+     * the "dialogs" directory under the "images" directory. The name of an icon
+     * for a given bug has the following format: status_type.png.
+     *
+     * @param bug The <code>MapdustBug</code> object
+     * @return The path of the icon
+     */
+    protected String getIconPath(MapdustBug bug) {
+        String iconPath = "bugs/normal/";
+        iconPath += bug.getStatus().getValue().toLowerCase();
+        iconPath += "_";
+        iconPath += bug.getType().getKey();
+        iconPath += ".png";
+        return iconPath;
+    }
+
+    /**
+     * Returns the selected MapDust bug from the MapDust bugs list.
+     *
+     * @return A <code>MapdustBug</code> object
+     */
+    protected MapdustBug getSelectedBug() {
+        JList listBugs = this.mapdustGUI.getPanel().getListBugs();
+        MapdustBug selectedBug = (MapdustBug) listBugs.getSelectedValue();
+        return selectedBug;
+    }
+
+    /**
+     * Returns the index of the MapDust bug selected from the MapDust bugs list.
+     *
+     * @return index
+     */
+    protected int getSelectedBugIndex() {
+        JList listBugs = this.mapdustGUI.getPanel().getListBugs();
+        int index = listBugs.getSelectedIndex();
+        return index;
+    }
+
+    /**
+     * Sets the given object from the given index to be selected.
+     *
+     * @param index The index of the element from the list of bugs
+     */
+    protected void resetSelectedBug(int index) {
+        JList listBugs = this.mapdustGUI.getPanel().getListBugs();
+        listBugs.setSelectedIndex(index);
+    }
+
+    /**
+     * Enables the given button. This button had fired a corresponding action,
+     * and after the action finishes, the button need to become enabled.
+     *
+     * @param button A <code>JToggleButton</code> object
+     */
+    protected void enableFiredButton(JToggleButton button) {
+        if (button != null) {
+            button.setEnabled(true);
+            button.setSelected(false);
+        }
+    }
+
+    /**
+     * Verifies if the given value is empty or not.
+     *
+     * @param value A string
+     * @return true if the value is empty false otherwise
+     */
+    private boolean emptyValue(String value) {
+        String modifiedValue = value != null ? value.trim() : "";
+        if (value == null || value.isEmpty() || modifiedValue.isEmpty()) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Validates the given nickname. A nickname is valid if its length is
+     * between 3 and 16 characters.
+     *
+     * @param value The nickname
+     * @return true if the nickname is valid false otherwise
+     */
+    private boolean validNickname(String value) {
+        int length = value.length();
+        if (length < 3 || length > 16) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Returns the abstract dialog
+     *
+     * @return the dialog
+     */
+    public AbstractDialog getDialog() {
+        return this.dialog;
+    }
+
+    /**
+     * Sets the abstract dialog
+     *
+     * @param dialog the dialog to set
+     */
+    public void setDialog(AbstractDialog dialog) {
+        this.dialog = dialog;
+    }
+
+    /**
+     * Returns the <code>MapdustGUI</code> object
+     *
+     * @return the mapdustGUI
+     */
+    public MapdustGUI getMapdustGUI() {
+        return this.mapdustGUI;
+    }
+
+    /**
+     * Sets the <code>MapdustGUI</code> object
+     *
+     * @param mapdustGUI the mapdustGUI to set
+     */
+    public void setMapdustGUI(MapdustGUI mapdustGUI) {
+        this.mapdustGUI = mapdustGUI;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the Action classes which handles the user actions.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.execute;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/package-info.java	(revision 24514)
@@ -0,0 +1,5 @@
+/**
+ * Contains the GUI action classes. 
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action;
+
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/MapdustShowAction.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/MapdustShowAction.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/MapdustShowAction.java	(revision 24514)
@@ -0,0 +1,151 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.show;
+
+
+import javax.swing.AbstractAction;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+
+
+/**
+ * This class is a base action class. Defines the common functionality for the
+ * other 'show' action classes.
+ *
+ * @author Bea
+ *
+ */
+public abstract class MapdustShowAction extends AbstractAction {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The title of the dialog window */
+    protected String title;
+
+    /** The icon name of the dialog window */
+    protected String iconName;
+
+    /** The message to display on the dialog */
+    protected String messageText;
+
+    /** The <code>MapdustPlugin</code> */
+    protected MapdustPlugin mapdustPlugin;
+
+    /**
+     * Returns the <code>MapdustButtonPanel</code> object.
+     *
+     * @return MapdustButtonPanel
+     */
+    protected MapdustButtonPanel getButtonPanel() {
+        MapdustButtonPanel btnPanel =
+                this.mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel();
+        return btnPanel;
+    }
+
+    /**
+     * Returns the <code>MapdustPlugin</code> object
+     *
+     * @return the mapdustPlugin
+     */
+    public MapdustPlugin getMapdustPlugin() {
+        return this.mapdustPlugin;
+    }
+
+    /**
+     * Sets the <code>MapdustPlugin</code> object
+     *
+     * @param mapdustPlugin the mapdustPlugin to set
+     */
+    public void setMapdustPlugin(MapdustPlugin mapdustPlugin) {
+        this.mapdustPlugin = mapdustPlugin;
+    }
+
+    /**
+     * Returns the title
+     *
+     * @return the title
+     */
+    public String getTitle() {
+        return this.title;
+    }
+
+    /**
+     * Sets the title
+     *
+     * @param title the title to set
+     */
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    /**
+     * Returns the name of the icon
+     *
+     * @return the iconName
+     */
+    public String getIconName() {
+        return this.iconName;
+    }
+
+    /**
+     * Sets the name of the icon
+     *
+     * @param iconName the iconName to set
+     */
+    public void setIconName(String iconName) {
+        this.iconName = iconName;
+    }
+
+    /**
+     * Returns the message text
+     *
+     * @return the messageText
+     */
+    public String getMessageText() {
+        return this.messageText;
+    }
+
+    /**
+     * Returns the message text
+     *
+     * @param messageText the messageText to set
+     */
+    public void setMessageText(String messageText) {
+        this.messageText = messageText;
+    }
+
+
+    /**
+     * Disables the buttons from the given button panel.
+     *
+     * @param buttonPanel The <code>MapdustButtonPanel</code> object
+     */
+    abstract void disableButtons(MapdustButtonPanel buttonPanel);
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCloseBugAction.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCloseBugAction.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCloseBugAction.java	(revision 24514)
@@ -0,0 +1,99 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.show;
+
+
+import java.awt.event.ActionEvent;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+
+
+/**
+ * Displays the close bug action dialog window.
+ *
+ * @author Bea
+ *
+ */
+public class ShowCloseBugAction extends MapdustShowAction {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a <code>ShowCloseBugAction</code> object
+     */
+    public ShowCloseBugAction() {}
+
+    /**
+     * Builds a <code>ShowCloseBugAction</code> object
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public ShowCloseBugAction(MapdustPlugin mapdustPlugin) {
+        setMapdustPlugin(mapdustPlugin);
+        setTitle("Close bug report");
+        setIconName("dialogs/fixed.png");
+        String text = "In order to close a bug report, please provide your";
+        text += " nickname and your reason of closing the bug report.";
+        setMessageText(text);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event != null) {
+            JToggleButton btn = null;
+            if (event.getSource() instanceof JToggleButton) {
+                btn = (JToggleButton) event.getSource();
+                btn.setEnabled(false);
+            }
+            disableButtons(getButtonPanel());
+            Main.pref.put("mapdust.modify", true);
+            ChangeIssueStatusDialog dialog = new ChangeIssueStatusDialog(
+                    getTitle(), getIconName(), getMessageText(), "close", btn,
+                    getMapdustPlugin());
+            dialog.setLocationRelativeTo(null);
+            dialog.getContentPane().setPreferredSize(dialog.getSize());
+            dialog.pack();
+            dialog.setVisible(true);
+        }
+    }
+
+    @Override
+    void disableButtons(MapdustButtonPanel buttonPanel) {
+        buttonPanel.getBtnWorkOffline().setEnabled(false);
+        buttonPanel.getBtnRefresh().setEnabled(false);
+        buttonPanel.getBtnAddComment().setEnabled(false);
+        buttonPanel.getBtnInvalidateBugReport().setEnabled(false);
+        buttonPanel.getBtnReOpenBugReport().setEnabled(false);
+
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCommentBugAction.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCommentBugAction.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowCommentBugAction.java	(revision 24514)
@@ -0,0 +1,98 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.show;
+
+
+import java.awt.event.ActionEvent;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.CommentIssueDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+
+
+/**
+ * Displays the comment bug dialog.
+ *
+ * @author Bea
+ *
+ */
+public class ShowCommentBugAction extends MapdustShowAction {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a <code>ShowCommentBugAction</code> object
+     */
+    public ShowCommentBugAction() {}
+
+    /**
+     * Builds a <code>ShowCommentBugAction</code> object based on the given
+     * argument.
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code>
+     */
+    public ShowCommentBugAction(MapdustPlugin mapdustPlugin) {
+        setMapdustPlugin(mapdustPlugin);
+        setTitle("Create bug report comment");
+        setIconName("dialogs/comment.png");
+        String text = "In order to comment a bug report, you need to ";
+        text += "provide your nickname and a brief comment for the bug.";
+        setMessageText(text);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event != null) {
+            JToggleButton btn = null;
+            if (event.getSource() instanceof JToggleButton) {
+                btn = (JToggleButton) event.getSource();
+                btn.setEnabled(false);
+            }
+            disableButtons(getButtonPanel());
+            Main.pref.put("mapdust.modify", true);
+            CommentIssueDialog dialog = new CommentIssueDialog(getTitle(),
+                    getIconName(), getMessageText(), btn, getMapdustPlugin());
+            dialog.setLocationRelativeTo(null);
+            dialog.getContentPane().setPreferredSize(dialog.getSize());
+            dialog.pack();
+            dialog.setVisible(true);
+        }
+    }
+
+    @Override
+    void disableButtons(MapdustButtonPanel buttonPanel) {
+        buttonPanel.getBtnWorkOffline().setEnabled(false);
+        buttonPanel.getBtnRefresh().setEnabled(false);
+        buttonPanel.getBtnFixBugReport().setEnabled(false);
+        buttonPanel.getBtnInvalidateBugReport().setEnabled(false);
+        buttonPanel.getBtnReOpenBugReport().setEnabled(false);
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowInvalidateBugAction.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowInvalidateBugAction.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowInvalidateBugAction.java	(revision 24514)
@@ -0,0 +1,99 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.show;
+
+
+import java.awt.event.ActionEvent;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+
+
+/**
+ * Displays the invalidate bug dialog.
+ *
+ * @author Bea
+ *
+ */
+public class ShowInvalidateBugAction extends MapdustShowAction {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 5163950675223273862L;
+
+    /**
+     * Builds a <code>ShowInvalidateBugAction</code> object
+     */
+    public ShowInvalidateBugAction() {}
+
+    /**
+     * Builds a <code>ShowInvalidateBugAction</code> object based on the given
+     * argument.
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object.
+     */
+    public ShowInvalidateBugAction(MapdustPlugin mapdustPlugin) {
+        setMapdustPlugin(mapdustPlugin);
+        setTitle("Invalidate bug report");
+        setIconName("dialogs/invalid.png");
+        String text = "In order to invalidate the bug report, please provide ";
+        text += "your nickname and your reason of invalidating the bug report.";
+        setMessageText(text);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event != null) {
+            JToggleButton btn = null;
+            if (event.getSource() instanceof JToggleButton) {
+                btn = (JToggleButton) event.getSource();
+                btn.setEnabled(false);
+            }
+            disableButtons(getButtonPanel());
+            Main.pref.put("mapdust.modify", true);
+            ChangeIssueStatusDialog dialog = new ChangeIssueStatusDialog(
+                    getTitle(), getIconName(), getMessageText(), "invalidate",
+                    btn, getMapdustPlugin());
+            dialog.setLocationRelativeTo(null);
+            dialog.getContentPane().setPreferredSize(dialog.getSize());
+            dialog.pack();
+            dialog.setVisible(true);
+        }
+    }
+
+    @Override
+    void disableButtons(MapdustButtonPanel buttonPanel) {
+        buttonPanel.getBtnWorkOffline().setEnabled(false);
+        buttonPanel.getBtnRefresh().setEnabled(false);
+        buttonPanel.getBtnAddComment().setEnabled(false);
+        buttonPanel.getBtnFixBugReport().setEnabled(false);
+        buttonPanel.getBtnReOpenBugReport().setEnabled(false);
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowReOpenBugAction.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowReOpenBugAction.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/ShowReOpenBugAction.java	(revision 24514)
@@ -0,0 +1,100 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.show;
+
+
+import java.awt.event.ActionEvent;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.ChangeIssueStatusDialog;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+
+
+/**
+ * Displays the re-open bug dialog window.
+ *
+ * @author Bea
+ */
+public class ShowReOpenBugAction extends MapdustShowAction {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = -1362380763238161011L;
+
+    /**
+     * Builds a <code>ShowReOpenBugAction</code> object
+     */
+    public ShowReOpenBugAction() {}
+
+    /**
+     * Builds a <code>ShowReOpenBugAction</code> object based on the given
+     * argument
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> action.
+     */
+    public ShowReOpenBugAction(MapdustPlugin mapdustPlugin) {
+        setMapdustPlugin(mapdustPlugin);
+        setTitle("Re-open bug report");
+        setIconName("dialogs/reopen.png");
+        String text = "In order to re-open the bug report, please provide ";
+        text += "your nickname and your reason of re-opening the bug report.";
+        setMessageText(text);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (event != null) {
+            JToggleButton btn = null;
+            if (event.getSource() instanceof JToggleButton) {
+                btn = (JToggleButton) event.getSource();
+                btn.setEnabled(false);
+            }
+            disableButtons(getButtonPanel());
+            Main.pref.put("mapdust.modify", true);
+            ChangeIssueStatusDialog dialog = new ChangeIssueStatusDialog(
+                    getTitle(), getIconName(), getMessageText(), "reopen", btn,
+                    getMapdustPlugin());
+            dialog.setLocationRelativeTo(null);
+            dialog.getContentPane().setPreferredSize(dialog.getSize());
+            dialog.pack();
+            dialog.setVisible(true);
+        }
+    }
+
+    @Override
+    void disableButtons(MapdustButtonPanel buttonPanel) {
+        if (buttonPanel != null) {
+            buttonPanel.getBtnWorkOffline().setEnabled(false);
+            buttonPanel.getBtnRefresh().setEnabled(false);
+            buttonPanel.getBtnAddComment().setEnabled(false);
+            buttonPanel.getBtnFixBugReport().setEnabled(false);
+            buttonPanel.getBtnInvalidateBugReport().setEnabled(false);
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/show/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the classes, which are used in order to display the dialogs of the plugin.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.action.show;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/AbstractDialog.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/AbstractDialog.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/AbstractDialog.java	(revision 24514)
@@ -0,0 +1,73 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog;
+
+
+import javax.swing.JDialog;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+
+
+/**
+ * Defines the basic methods used for creating swing components.
+ *
+ * @author Bea
+ */
+public abstract class AbstractDialog extends JDialog {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The button which opened the dialog window */
+    private JToggleButton firedButton;
+
+    /**
+     * Add the components to the panel
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public abstract void addComponents(MapdustPlugin mapdustPlugin);
+
+    /**
+     * Returns the button which fired the action
+     *
+     * @return the firedButton
+     */
+    public JToggleButton getFiredButton() {
+        return this.firedButton;
+    }
+
+    /**
+     * Sets the button which fired the action
+     *
+     * @param firedButton the firedButton to set
+     */
+    public void setFiredButton(JToggleButton firedButton) {
+        this.firedButton = firedButton;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/ChangeIssueStatusDialog.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/ChangeIssueStatusDialog.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/ChangeIssueStatusDialog.java	(revision 24514)
@@ -0,0 +1,312 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog;
+
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Image;
+import java.awt.Rectangle;
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.JToggleButton;
+import javax.swing.WindowConstants;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.adapter.WindowClose;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteCancel;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteCloseBug;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteInvalidateBug;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteReOpenBug;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * This class is used for creating a dialog window for the following MapDust BUG
+ * related actions: close bug report, invalidate bug report and re-open bug
+ * report.
+ *
+ * @author Bea
+ */
+public class ChangeIssueStatusDialog extends AbstractDialog {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The message test */
+    private final String messageText;
+
+    /** Custom text */
+    private JScrollPane cmpMessage;
+
+    /** Nickname label */
+    private JLabel lblNickname;
+
+    /** Nickname text field */
+    private JTextField txtNickname;
+
+    /** Comment label */
+    private JLabel lblComment;
+
+    /** Description text area */
+    private JScrollPane cmpDescription;
+
+    /** The description text */
+    private JTextArea txtDescription;
+
+    /** Cancel button */
+    private JButton btnCancel;
+
+    /** OK button */
+    private JButton btnOk;
+
+    /** The type */
+    private final String type;
+
+    /**
+     * Builds a new <code>ChangeStatusDialog</code> object with the given
+     * parameters.
+     *
+     * @param title The title of the dialog
+     * @param iconName The name of the icon
+     * @param messageText The text of the message component.
+     * @param type The type of the dialog ( close ,invalidate , re-open)
+     * @param firedButton The button which fired this action
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public ChangeIssueStatusDialog(String title, String iconName,
+            String messageText, String type, JToggleButton firedButton,
+            MapdustPlugin mapdustPlugin) {
+        this.type = type;
+        this.messageText = messageText;
+        if (firedButton != null) {
+            setFiredButton(firedButton);
+        }
+        setTitle(title);
+        setModal(true);
+        Image image = ImageProvider.get(iconName).getImage();
+        setIconImage(image);
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        getContentPane().setFont(new Font("Times New Roman", Font.BOLD, 14));
+        setBackground(Color.white);
+        setResizable(false);
+        setForeground(Color.black);
+        setLayout(null);
+        addComponents(mapdustPlugin);
+        MapdustButtonPanel btnPanel =
+                mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel();
+        addWindowListener(new WindowClose(this, btnPanel, getFiredButton()));
+    }
+
+    /**
+     * Adds the components to the panel.
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    @Override
+    public void addComponents(MapdustPlugin mapdustPlugin) {
+        /* initialize components of the JDialog */
+        Color backgroundColor = getContentPane().getBackground();
+        Font font = new Font("Times New Roman", Font.BOLD, 14);
+        /* create the message cmp */
+        if (cmpMessage == null) {
+            JTextPane txtPane = ComponentUtil.createJTextPane(messageText,
+                    backgroundColor);
+            Rectangle bounds = new Rectangle(10, 10, 330, 50);
+            cmpMessage = ComponentUtil.createJScrollPane(txtPane, bounds,
+                    backgroundColor, true, true);
+        }
+        /* create the nickname label and text field */
+        if (lblNickname == null) {
+            Rectangle bounds = new Rectangle(10, 70, 85, 25);
+            lblNickname = ComponentUtil.createJLabel("Nickname", font, bounds);
+        }
+        String nickname = Main.pref.get("mapdust.nickname");
+        if (txtNickname == null) {
+            Rectangle bounds = new Rectangle(100, 70, 230, 25);
+            txtNickname = ComponentUtil.createJTextField(bounds);
+            if (nickname != null && !nickname.isEmpty()) {
+                txtNickname.setText(nickname);
+            }
+        }
+        /* creates the comment label and text area */
+        if (lblComment == null) {
+            Rectangle bounds = new Rectangle(10, 110, 89, 25);
+            lblComment = ComponentUtil.createJLabel("Comment", font, bounds);
+        }
+        if (cmpDescription == null) {
+            Rectangle bounds = new Rectangle(100, 110, 230, 50);
+            txtDescription = new JTextArea();
+            txtDescription.setLineWrap(true);
+            txtDescription.setFont(new Font("Times New Roman", Font.PLAIN, 12));
+            cmpDescription = ComponentUtil.createJScrollPane(txtDescription,
+                    bounds, backgroundColor, false, true);
+        }
+        /* creates the cancel action */
+        ExecuteCancel cancelAction = new ExecuteCancel(this, mapdustPlugin.getMapdustGUI());
+        AbstractAction okAction;
+        if (type.equals("close")) {
+            /* create the execute close bug action */
+            okAction = new ExecuteCloseBug(this, mapdustPlugin.getMapdustGUI());
+            ((ExecuteCloseBug) okAction).addObserver(mapdustPlugin);
+            ((ExecuteCloseBug) okAction).addObserver(mapdustPlugin
+                    .getMapdustGUI());
+        } else {
+            if (type.equals("invalidate")) {
+                /* create the invalidate bug action */
+                okAction = new ExecuteInvalidateBug(this, mapdustPlugin.getMapdustGUI());
+                ((ExecuteInvalidateBug) okAction).addObserver(mapdustPlugin);
+                ((ExecuteInvalidateBug) okAction).addObserver(mapdustPlugin
+                        .getMapdustGUI());
+            } else {
+                /* executes the re-open bug action */
+                okAction = new ExecuteReOpenBug(this, mapdustPlugin.getMapdustGUI());
+                ((ExecuteReOpenBug) okAction).addObserver(mapdustPlugin);
+                ((ExecuteReOpenBug) okAction).addObserver(mapdustPlugin
+                        .getMapdustGUI());
+            }
+        }
+        /* creates the cancel button */
+        if (btnCancel == null) {
+            Rectangle bounds = new Rectangle(250, 170, 80, 25);
+            btnCancel = ComponentUtil.createJButton("Cancel", bounds, cancelAction);
+        }
+        /* creates the ok button */
+        if (btnOk == null) {
+            Rectangle bounds = new Rectangle(180, 170, 60, 25);
+            btnOk = ComponentUtil.createJButton("OK", bounds, okAction);
+        }
+        /* add components to the frame */
+        add(cmpMessage);
+        add(lblNickname);
+        add(txtNickname);
+        add(lblComment);
+        add(cmpDescription);
+        add(btnCancel);
+        add(btnOk);
+        setSize(340, 210);
+    }
+
+    /**
+     * Returns the <code>JScrollPane</code> of the info message.
+     *
+     * @return the cmpMessage
+     */
+    public JScrollPane getCmpMessage() {
+        return this.cmpMessage;
+    }
+
+    /**
+     * Returns the <code>JLabel</code> of the nickname
+     *
+     * @return the lblNickname
+     */
+    public JLabel getLblNickname() {
+        return this.lblNickname;
+    }
+
+    /**
+     * Returns the <code>JTextField</code> of the nickname
+     *
+     * @return the txtNickname
+     */
+    public JTextField getTxtNickname() {
+        return this.txtNickname;
+    }
+
+    /**
+     * Returns the <code>JLabel</code> of the comment
+     *
+     * @return the lblComment
+     */
+    public JLabel getLblComment() {
+        return this.lblComment;
+    }
+
+    /**
+     * Returns the <code>JScrollPane</code> of the description
+     *
+     * @return the cmpDescription
+     */
+    public JScrollPane getCmpDescription() {
+        return this.cmpDescription;
+    }
+
+    /**
+     * Returns the <code>JTextArea</code> of the description
+     *
+     * @return the txtDescription
+     */
+    public JTextArea getTxtDescription() {
+        return this.txtDescription;
+    }
+
+    /**
+     * Returns the cancel button
+     *
+     * @return the btnCancel
+     */
+    public JButton getBtnCancel() {
+        return this.btnCancel;
+    }
+
+    /**
+     * Returns the ok buttons
+     *
+     * @return the btnOk
+     */
+    public JButton getBtnOk() {
+        return this.btnOk;
+    }
+
+    /**
+     * Retruns the message text
+     *
+     * @return the messageText
+     */
+    public String getMessageText() {
+        return this.messageText;
+    }
+
+    /**
+     * Returns the type
+     *
+     * @return the type
+     */
+    public String getType() {
+        return this.type;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CommentIssueDialog.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CommentIssueDialog.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CommentIssueDialog.java	(revision 24514)
@@ -0,0 +1,274 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog;
+
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Image;
+import java.awt.Rectangle;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.JToggleButton;
+import javax.swing.WindowConstants;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.adapter.WindowClose;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteCancel;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteCommentBug;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * This class is used for creating a dialog window for the comment MapDust Bug
+ * action.
+ *
+ * @author Bea
+ *
+ */
+public class CommentIssueDialog extends AbstractDialog {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The message text */
+    private final String messageText;
+
+    /** Custom text */
+    private JScrollPane cmpMessage;
+
+    /** Nickname label */
+    private JLabel lblNickname;
+
+    /** Nickname text field */
+    private JTextField txtNickname;
+
+    /** Comment label */
+    private JLabel lblComment;
+
+    /** Comment text area */
+    private JScrollPane cmpComment;
+
+    /** The comment */
+    private JTextArea txtComment;
+
+    /** Cancel button */
+    private JButton btnCancel;
+
+    /** OK button */
+    private JButton btnOk;
+
+    /**
+     * Builds a new <code>ChangeStatusDialog</code> object with the given
+     * parameters.
+     *
+     * @param title The title of the dialog
+     * @param iconName The name of the icon
+     * @param messageText The text of the message component.
+     * @param firedButton The button which action was to show this dialog
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public CommentIssueDialog(String title, String iconName,
+            String messageText, JToggleButton firedButton,
+            MapdustPlugin mapdustPlugin) {
+        this.messageText = messageText;
+        if (firedButton != null) {
+            setFiredButton(firedButton);
+        }
+        setTitle(title);
+        setModal(true);
+        Image image = ImageProvider.get(iconName).getImage();
+        setIconImage(image);
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        getContentPane().setFont(new Font("Times New Roman", Font.BOLD, 14));
+        setBackground(getContentPane().getBackground());
+        setResizable(false);
+        setForeground(Color.black);
+        setLayout(null);
+        addComponents(mapdustPlugin);
+        MapdustButtonPanel btnPanel = mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel();
+        addWindowListener(new WindowClose(this, btnPanel, getFiredButton()));
+    }
+
+    /**
+     * Add the components to the panel
+     */
+    @Override
+    public void addComponents(MapdustPlugin mapdustPlugin) {
+        /* initialize components of the JDialog */
+        Color backgroundColor = getContentPane().getBackground();
+        Font font = new Font("Times New Roman", Font.BOLD, 14);
+        /* create the message cmp */
+        if (cmpMessage == null) {
+            JTextPane txtPane = ComponentUtil.createJTextPane(messageText,
+                    backgroundColor);
+            Rectangle bounds = new Rectangle(10, 10, 320, 50);
+            cmpMessage = ComponentUtil.createJScrollPane(txtPane, bounds,
+                    backgroundColor, true, true);
+        }
+        /* create the nickname label and text field */
+        if (lblNickname == null) {
+            Rectangle bounds = new Rectangle(10, 70, 91, 25);
+            lblNickname = ComponentUtil.createJLabel("Nickname", font, bounds);
+        }
+        String nickname = Main.pref.get("mapdust.nickname");
+        if (txtNickname == null) {
+            Rectangle bounds = new Rectangle(100, 70, 230, 25);
+            txtNickname = ComponentUtil.createJTextField(bounds);
+            if (nickname != null && !nickname.isEmpty()) {
+                txtNickname.setText(nickname);
+            }
+        }
+        /* creates the comment label and text area */
+        if (lblComment == null) {
+            Rectangle bounds = new Rectangle(10, 110, 79, 25);
+            lblComment = ComponentUtil.createJLabel("Comment", font, bounds);
+        }
+        if (cmpComment == null) {
+            Rectangle bounds = new Rectangle(100, 110, 230, 50);
+            txtComment = new JTextArea();
+            txtComment.setFont(new Font("Times New Roman", Font.PLAIN, 12));
+            txtComment.setLineWrap(true);
+            cmpComment = ComponentUtil.createJScrollPane(txtComment, bounds,
+                    backgroundColor, false, true);
+        }
+        /* creates the cancel button */
+        if (btnCancel == null) {
+            Rectangle bounds = new Rectangle(250, 170, 80, 25);
+            ExecuteCancel cancelAction = new ExecuteCancel(this,
+                    mapdustPlugin.getMapdustGUI());
+            btnCancel = ComponentUtil.createJButton("Cancel", bounds,
+                    cancelAction);
+        }
+        /* creates the ok button */
+        if (btnOk == null) {
+            Rectangle bounds = new Rectangle(180, 170, 60, 25);
+            ExecuteCommentBug okAction =
+                    new ExecuteCommentBug(this, mapdustPlugin.getMapdustGUI());
+            okAction.addObserver(mapdustPlugin);
+            okAction.addObserver(mapdustPlugin.getMapdustGUI());
+            btnOk = ComponentUtil.createJButton("OK", bounds, okAction);
+        }
+        /* add components to the frame */
+        add(cmpMessage);
+        add(lblNickname);
+        add(txtNickname);
+        add(lblComment);
+        add(cmpComment);
+        add(btnCancel);
+        add(btnOk);
+        setSize(340, 210);
+    }
+
+    /**
+     * Returns the message <code>JScrollPane</code> object
+     *
+     * @return the cmpMessage
+     */
+    public JScrollPane getCmpMessage() {
+        return cmpMessage;
+    }
+
+    /**
+     * Returns the nickname <code>JLabel</code> object
+     *
+     * @return the lblNickname
+     */
+    public JLabel getLblNickname() {
+        return lblNickname;
+    }
+
+    /**
+     * Returns the nickname <code>JTextField</code> object
+     *
+     * @return the txtNickname
+     */
+    public JTextField getTxtNickname() {
+        return txtNickname;
+    }
+
+    /**
+     * Returns the comment <code>JLabel</code> object
+     *
+     * @return the lblComment
+     */
+    public JLabel getLblComment() {
+        return lblComment;
+    }
+
+    /**
+     * Returns the comment <code>JScrollPane</code> object
+     *
+     * @return the cmpComment
+     */
+    public JScrollPane getCmpComment() {
+        return cmpComment;
+    }
+
+    /**
+     * Returns the comment <code>JTextArea</code> object
+     *
+     * @return the txtComment
+     */
+    public JTextArea getTxtComment() {
+        return txtComment;
+    }
+
+    /**
+     * Returns the cancel <code>JButton</code> object
+     *
+     * @return the btnCancel
+     */
+    public JButton getBtnCancel() {
+        return btnCancel;
+    }
+
+    /**
+     * Returns the ok <code>JButton</code> object
+     *
+     * @return the btnOk
+     */
+    public JButton getBtnOk() {
+        return btnOk;
+    }
+
+    /**
+     * Returns the message text
+     *
+     * @return the messageText
+     */
+    public String getMessageText() {
+        return messageText;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CreateIssueDialog.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CreateIssueDialog.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CreateIssueDialog.java	(revision 24514)
@@ -0,0 +1,288 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog;
+
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Rectangle;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.WindowConstants;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.adapter.WindowClose;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteAddBug;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteCancel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.panel.MapdustButtonPanel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.ComboBoxRenderer;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * This class is used for creating a dialog window for the new issue Mapdust Bug
+ * action.
+ *
+ * @author Bea
+ *
+ */
+public class CreateIssueDialog extends AbstractDialog {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The create issue text */
+    private final String createIssueText;
+
+    /** Text message */
+    private JScrollPane cmpMessage;
+
+    /** Type */
+    private JLabel lblType;
+
+    /** The type combo box */
+    private JComboBox cbbType;
+
+    /** Nickname */
+    private JLabel lblNickname;
+
+    /** The txt nickname */
+    private JTextField txtNickname;
+
+    /** Description */
+    private JLabel lblDescription;
+
+    /** The description scroll pane */
+    private JScrollPane cmpDescription;
+
+    /** The description text area */
+    private JTextArea txtDescription;
+
+    /** The cancel button */
+    private JButton btnCancel;
+
+    /** The ok button */
+    private JButton btnOk;
+
+    /** The point */
+    private final Point point;
+
+    /**
+     * Builds a new <code>ChangeStatusDialog</code> object with the given
+     * parameters.
+     *
+     * @param title The title of the dialog
+     * @param iconName The name of the icon
+     * @param messageText The text of the message component.
+     * @param point The position where the bug was created
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public CreateIssueDialog(String title, String iconName, String messageText,
+            Point point, MapdustPlugin mapdustPlugin) {
+        this.createIssueText = messageText;
+        this.point = point;
+        setTitle(title);
+        setDefaultLookAndFeelDecorated(true);
+        Image image = ImageProvider.get(iconName).getImage();
+        setIconImage(image);
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        getContentPane().setFont(new Font("Times New Roman", Font.BOLD, 14));
+        setResizable(false);
+        setForeground(Color.black);
+        setLayout(null);
+        setModal(true);
+        addComponents(mapdustPlugin);
+        MapdustButtonPanel btnPanel = mapdustPlugin.getMapdustGUI().getPanel().getBtnPanel();
+        addWindowListener(new WindowClose(this, btnPanel, getFiredButton()));
+    }
+
+    @Override
+    public void addComponents(MapdustPlugin mapdustPlugin) {
+        Color backgroundColor = getContentPane().getBackground();
+        Font font = new Font("Times New Roman", Font.BOLD, 14);
+        /* create the message cmp */
+        if (cmpMessage == null) {
+            JTextPane txtPane = ComponentUtil.createJTextPane(createIssueText,
+                    backgroundColor);
+            cmpMessage = ComponentUtil.createJScrollPane(txtPane,
+                    new Rectangle(10, 10, 330, 50), backgroundColor, true, true);
+        }
+        /* the type label and combo box */
+        if (lblType == null) {
+            lblType = ComponentUtil.createJLabel("Type", font,
+                    new Rectangle(10, 70, 91, 25));
+        }
+        if (cbbType == null) {
+            ComboBoxRenderer renderer = new ComboBoxRenderer();
+            cbbType = ComponentUtil.createJComboBox(new Rectangle(110, 70, 230, 25),
+                    renderer, backgroundColor);
+        }
+        /* create the nickname label and text field */
+        if (lblNickname == null) {
+            lblNickname = ComponentUtil.createJLabel("Nickname", font,
+                    new Rectangle(10, 110, 79, 25));
+        }
+        if (txtNickname == null) {
+            txtNickname = ComponentUtil.createJTextField(new Rectangle(110, 110, 230, 25));
+            /* nickname was set before */
+            String nickname = Main.pref.get("mapdust.nickname");
+            if (nickname != null && !nickname.isEmpty()) {
+                txtNickname.setText(nickname);
+            }
+        }
+        /* creates the description label and text area */
+        if (lblDescription == null) {
+            lblDescription = ComponentUtil.createJLabel("Description", font,
+                    new Rectangle(10, 150, 85, 25));
+        }
+        if (cmpDescription == null) {
+            txtDescription = new JTextArea();
+            txtDescription.setFont(new Font("Times New Roman", Font.PLAIN, 12));
+            txtDescription.setLineWrap(true);
+            cmpDescription = ComponentUtil.createJScrollPane(txtDescription,
+                    new Rectangle(110, 150, 230, 50), backgroundColor, false, true);
+        }
+        /* creates the cancel button */
+        if (btnCancel == null) {
+            Rectangle bounds = new Rectangle(260, 210, 80, 25);
+            ExecuteCancel cancelAction = new ExecuteCancel(this,
+                    mapdustPlugin.getMapdustGUI());
+            btnCancel = ComponentUtil.createJButton("Cancel", bounds,
+                    cancelAction);
+        }
+        /* creates the ok button */
+        if (btnOk == null) {
+            Rectangle bounds = new Rectangle(190, 210, 60, 25);
+            ExecuteAddBug okAction = new ExecuteAddBug(this,
+                    mapdustPlugin.getMapdustGUI());
+            okAction.addObserver(mapdustPlugin);
+            okAction.addObserver(mapdustPlugin.getMapdustGUI());
+            btnOk = ComponentUtil.createJButton("OK", bounds, okAction);
+        }
+        /* add components to the frame */
+        add(cmpMessage);
+        add(lblType);
+        add(cbbType);
+        add(lblNickname);
+        add(txtNickname);
+        add(lblDescription);
+        add(cmpDescription);
+        add(btnCancel);
+        add(btnOk);
+        setSize(350, 250);
+    }
+
+    /**
+     * Returns the message <code>JScrollPane</code>
+     *
+     * @return the cmpMessage
+     */
+    public JScrollPane getCmpMessage() {
+        return cmpMessage;
+    }
+
+    /**
+     * Returns the type <code>JLabel</code>
+     *
+     * @return the lblType
+     */
+    public JLabel getLblType() {
+        return lblType;
+    }
+
+    /**
+     * Returns the type <code>JComboBox</code>
+     *
+     * @return the cbbType
+     */
+    public JComboBox getCbbType() {
+        return cbbType;
+    }
+
+    /**
+     * Returns the nickname <code>JLabel</code>
+     *
+     * @return the lblNickname
+     */
+    public JLabel getLblNickname() {
+        return lblNickname;
+    }
+
+    /**
+     * Returns the nickname <code>JTextField</code>
+     *
+     * @return the txtNickname
+     */
+    public JTextField getTxtNickname() {
+        return txtNickname;
+    }
+
+    /**
+     * Returns the description <code>JLabel</code>
+     *
+     * @return the lblDescription
+     */
+    public JLabel getLblDescription() {
+        return lblDescription;
+    }
+
+    /**
+     * Returns the description <code>JScrollPane</code>
+     *
+     * @return the cmpDescription
+     */
+    public JScrollPane getCmpDescription() {
+        return cmpDescription;
+    }
+
+    /**
+     * Returns the description <code>JTextArea</code>
+     *
+     * @return the txtDescription
+     */
+    public JTextArea getTxtDescription() {
+        return txtDescription;
+    }
+
+    /**
+     * Returns the <code>Point</code>
+     *
+     * @return point
+     */
+    public Point getPoint() {
+        return point;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the dialog classes.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/ActionListModel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/ActionListModel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/ActionListModel.java	(revision 24514)
@@ -0,0 +1,77 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
+
+
+import java.util.List;
+import javax.swing.AbstractListModel;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+
+
+/**
+ * The list model for the <code>MapdustAction</code> objects.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class ActionListModel extends AbstractListModel {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * The list of <code>MapdustAction</code> objects
+     */
+    private final List<MapdustAction> list;
+
+    /**
+     * Builds a <code>MapdustAction</code> object
+     */
+    public ActionListModel() {
+        this.list = null;
+    }
+
+    /**
+     * Builds a <code>MapdustAction</code> object
+     * @param list A list of <code>MapdustAction</code> objects
+     */
+    public ActionListModel(List<MapdustAction> list) {
+        this.list = list;
+    }
+
+    @Override
+    public Object getElementAt(int index) {
+        return list.get(index);
+    }
+
+    @Override
+    public int getSize() {
+        return list.size();
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java	(revision 24514)
@@ -0,0 +1,80 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
+
+
+import java.util.List;
+import javax.swing.ListModel;
+import javax.swing.event.ListDataListener;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+
+
+/**
+ * The list model for the <code>MapdustBug</code> objects.
+ *
+ * @author Bea
+ *
+ */
+public class BugsListModel implements ListModel {
+
+    /** The list of <code>MapdustBug</code> objects */
+    private final List<MapdustBug> bugs;
+
+    /**
+     * Builds a <code>BugsListModel</code> object
+     */
+    public BugsListModel() {
+        this.bugs = null;
+    }
+
+    /**
+     * Builds a <code>BugsListModel</code> object
+     *
+     * @param bugs The list of <code>MapdustBug</code> objects
+     */
+    public BugsListModel(List<MapdustBug> bugs) {
+        this.bugs = bugs;
+    }
+
+    @Override
+    public void addListDataListener(ListDataListener l) {}
+
+    @Override
+    public Object getElementAt(int index) {
+        return bugs.get(index);
+    }
+
+    @Override
+    public int getSize() {
+        return (bugs != null ? bugs.size() : 0);
+    }
+
+    @Override
+    public void removeListDataListener(ListDataListener l) {}
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/CommentListModel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/CommentListModel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/CommentListModel.java	(revision 24514)
@@ -0,0 +1,79 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
+
+
+import javax.swing.ListModel;
+import javax.swing.event.ListDataListener;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+
+
+/**
+ * List model for <code>MapdustComment</code> objects
+ *
+ * @author Bea
+ *
+ */
+public class CommentListModel implements ListModel {
+
+    /** The list of <code>MapdustBug</code> objects */
+    private final MapdustComment[] comments;
+
+    /**
+     * Builds a <code>BugsListModel</code> object
+     */
+    public CommentListModel() {
+        this.comments = null;
+    }
+
+    /**
+     * Builds a <code>BugsListModel</code> object
+     *
+     * @param comments The array of comments
+     */
+    public CommentListModel(MapdustComment[] comments) {
+        this.comments = comments;
+    }
+
+    @Override
+    public void addListDataListener(ListDataListener l) {}
+
+    @Override
+    public Object getElementAt(int index) {
+        return comments[index];
+    }
+
+    @Override
+    public int getSize() {
+        return comments.length;
+    }
+
+    @Override
+    public void removeListDataListener(ListDataListener l) {}
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/TypesListModel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/TypesListModel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/TypesListModel.java	(revision 24514)
@@ -0,0 +1,79 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
+
+
+import javax.swing.AbstractListModel;
+import javax.swing.ComboBoxModel;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Type;
+
+
+/**
+ * The combo box model for the bug <code>Type</code>s.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class TypesListModel extends AbstractListModel implements ComboBoxModel {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The array of types */
+    private final Type[] types;
+
+    /** The selected type */
+    private Type selection = null;
+
+    /**
+     * Builds a <code>TypesListModel</code> object
+     */
+    public TypesListModel() {
+        this.types = Type.getTypes();
+    }
+
+    @Override
+    public Object getElementAt(int index) {
+        return types[index];
+    }
+
+    @Override
+    public int getSize() {
+        return types.length;
+    }
+
+    @Override
+    public Object getSelectedItem() {
+        return selection;
+    }
+
+    @Override
+    public void setSelectedItem(Object anItem) {
+        selection = (Type) anItem;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/package-info.java	(revision 24514)
@@ -0,0 +1,2 @@
+
+package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the components of the GUI.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustActionPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustActionPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustActionPanel.java	(revision 24514)
@@ -0,0 +1,129 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.BorderLayout;
+import java.util.List;
+import javax.swing.AbstractAction;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteActionList;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+
+
+/**
+ * Defines a JPanel for the <code>MapdustAction</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustActionPanel extends JPanel {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The scroll pane */
+    private JScrollPane cmpActionList;
+
+    /** The JList containing the MapDust action objects */
+    private JList queueList;
+
+    /** The list of <code>MapdustAction</code> objects */
+    private final List<MapdustAction> actionList;
+
+    /**
+     * Builds a <code>MapdustActionPanel</code> object based on the given
+     * arguments.
+     *
+     * @param actionList The list of <code>MapdustAction</code> objects
+     * @param name The name of the panel
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public MapdustActionPanel(List<MapdustAction> actionList, String name,
+            MapdustPlugin mapdustPlugin) {
+        this.actionList = actionList;
+        setLayout(new BorderLayout());
+        addComponents(actionList, mapdustPlugin);
+        setName(tr(name));
+    }
+
+    /**
+     * Creates and adds the components to the MapdustAction panel.
+     *
+     * @param list The list of <code>MapdustAction</code> objects
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    private void addComponents(List<MapdustAction> list,
+            MapdustPlugin mapdustPlugin) {
+        /* create components */
+        AbstractAction action = new ExecuteActionList(mapdustPlugin.getMapdustGUI());
+        JToggleButton btnUpload = ComponentUtil.createJButton("Upload list data",
+                null, null, action);
+        ((ExecuteActionList) action).addObserver(mapdustPlugin);
+        if (cmpActionList == null) {
+            queueList = ComponentUtil.createJList(list);
+            cmpActionList = ComponentUtil.createJScrollPane(queueList);
+        }
+        add(cmpActionList, BorderLayout.CENTER);
+        add(btnUpload, BorderLayout.SOUTH);
+    }
+
+    /**
+     * Returns the list of <code>MapdustAction</code> object
+     *
+     * @return the actionList
+     */
+    public List<MapdustAction> getActionList() {
+        return actionList;
+    }
+
+    /**
+     * Returns the action list <code>JScrollPane</code> object
+     *
+     * @return the cmpActionList
+     */
+    public JScrollPane getCmpActionList() {
+        return cmpActionList;
+    }
+
+    /**
+     * Returns the action list <code>JList</code> object
+     *
+     * @return the queueList
+     */
+    public JList getQueueList() {
+        return queueList;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustAddressPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustAddressPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustAddressPanel.java	(revision 24514)
@@ -0,0 +1,116 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.GridLayout;
+import javax.swing.JPanel;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Address;
+
+
+/**
+ * Defines the JPanel for displaying the address of the <code>MapdustBug</code>
+ * object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustAddressPanel extends JPanel {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a new <code>MapdustBugDetailsPanel</code> object.
+     *
+     * @param address The address of the MapDust bug
+     * @param coordinates The coordinates of the MapDust bug
+     */
+    public MapdustAddressPanel(Address address, LatLon coordinates) {
+        setLayout(new GridLayout(8, 1));
+        setBackground(Color.white);
+        addComponents(address, coordinates);
+    }
+
+    /**
+     * Creates the components of the panel, and adds to the parent panel.
+     *
+     * @param address The address of the <code>MapdustBug</code> object
+     * @param coordinates The coordinate of the <code>MapdustBug</code> object
+     */
+    private void addComponents(Address address, LatLon coordinates) {
+        /* the font of the label and label value */
+        Font fontLabel = new Font("Times New Roman", Font.BOLD, 12);
+        Font fontLabelVal = new Font("Times New Roman", Font.PLAIN, 12);
+
+        /* add country */
+        add(ComponentUtil.createJLabel("Country: ", fontLabel, null));
+        String country = address != null ? address.getCountryCode() : "";
+        add(ComponentUtil.createJLabel(country, fontLabelVal, null));
+
+        /* add label */
+        add(ComponentUtil.createJLabel("City: ", fontLabel, null));
+        String city = address != null ? address.getCity() : "";
+        add(ComponentUtil.createJLabel(city, fontLabelVal, null));
+
+        /* add statecode */
+        add(ComponentUtil.createJLabel("State code: ", fontLabel, null));
+        String state = address != null ? address.getStateCode() : "";
+        add(ComponentUtil.createJLabel(state, fontLabelVal, null));
+
+        /* add label */
+        add(ComponentUtil.createJLabel("Zip code: ", fontLabel, null));
+        String zip = address != null ? address.getZipCode() : "";
+        add(ComponentUtil.createJLabel(zip, fontLabelVal, null));
+
+        /* add street name */
+        add(ComponentUtil.createJLabel("Street: ", fontLabel, null));
+        String street = address != null ? address.getStreetName() : "";
+        add(ComponentUtil.createJLabel(street, fontLabelVal, null));
+
+        /* add house number */
+        add(ComponentUtil.createJLabel("House number: ", fontLabel, null));
+        String houseNr = address != null ? address.getHouseNumber() : "";
+        add(ComponentUtil.createJLabel(houseNr, fontLabelVal, null));
+
+        /* add lat */
+        add(ComponentUtil.createJLabel("Latitude: ", fontLabel, null));
+        String lat = coordinates != null ? ("" + coordinates.lat()) : "";
+        add(ComponentUtil.createJLabel(lat, fontLabelVal, null));
+
+        /* add lon */
+        add(ComponentUtil.createJLabel("Longitude: ", fontLabel, null));
+        String lon = coordinates != null ? ("" + coordinates.lon()) : "";
+        add(ComponentUtil.createJLabel(lon, fontLabelVal, null));
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugDetailsPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugDetailsPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugDetailsPanel.java	(revision 24514)
@@ -0,0 +1,161 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridLayout;
+import java.text.DateFormat;
+import java.util.Locale;
+import javax.swing.JEditorPane;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.HTMLEditorKit;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.util.Configuration;
+
+
+/**
+ * Defines the JPanel for the <code>MapdustBug</code> object details.
+ *
+ * @author Bea
+ */
+public class MapdustBugDetailsPanel extends JPanel implements HyperlinkListener {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The <code>MapdustBug</code> object */
+    private final MapdustBug bug;
+
+    /**
+     * Builds a new <code>MapdustBugDetailsPanel</code> object.
+     *
+     * @param bug The <code>MapdustBug</code> object
+     */
+    public MapdustBugDetailsPanel(MapdustBug bug) {
+        this.bug = bug;
+        setLayout(new GridLayout(7, 2));
+        addComponents();
+        setBackground(Color.white);
+    }
+
+    /**
+     * Add the components to the panel.
+     */
+    private void addComponents() {
+        /* the font of the label and label value */
+        Font fontLabel = new Font("Times New Roman", Font.BOLD, 12);
+        Font fontLabelVal = new Font("Times New Roman", Font.PLAIN,12);
+        /* date formatter */
+        DateFormat df = DateFormat.getDateInstance( DateFormat.DEFAULT,
+                Locale.getDefault());
+
+        /* add the id */
+        add(ComponentUtil.createJLabel("Id: ", fontLabel, null));
+        String idStr = bug != null ? bug.getId().toString() : "";
+        String txt = "<html>";
+        txt += "<font style='font-size:10px' face='Times New Roman'>";
+        txt += "<a href='' target='_blank'>" + idStr + "</a>";
+        txt += "</font></html>";
+        JEditorPane txtId = new JEditorPane("text/html", "");
+        txtId.setEditorKit(new HTMLEditorKit());
+        txtId.setEditable(false);
+        txtId.setText(txt);
+        txtId.setPreferredSize(new Dimension(100, 20));
+        txtId.addHyperlinkListener(this);
+        add(txtId);
+
+        /* add the type */
+        add(ComponentUtil.createJLabel("Type: ", fontLabel, null));
+        String typeStr = bug != null ? bug.getType().getValue() : "";
+        add(ComponentUtil.createJLabel(typeStr, fontLabelVal, null));
+
+        /* add the status */
+        add(ComponentUtil.createJLabel("Status: ", fontLabel, null));
+        String statusStr = bug != null ? bug.getStatus().getValue() : "";
+        add(ComponentUtil.createJLabel(statusStr, fontLabelVal, null));
+
+        /* add the source */
+        add(ComponentUtil.createJLabel("Source: ", fontLabel, null));
+        String sourceStr = bug != null ? bug.getSource() : "";
+        add(ComponentUtil.createJLabel(sourceStr, fontLabelVal, null));
+
+        /* add the nickname */
+        add(ComponentUtil.createJLabel("Created by: ", fontLabel, null));
+        String nicknameStr = bug != null ? bug.getNickname() : "";
+        add(ComponentUtil.createJLabel(nicknameStr, fontLabelVal, null));
+
+        /* add the date created */
+        add(ComponentUtil.createJLabel("Date created: ", fontLabel, null));
+        String dateCreatedStr =
+                bug != null ? df.format(bug.getDateCreated()) : "";
+        add(ComponentUtil.createJLabel(dateCreatedStr, fontLabelVal, null));
+
+        /* add the date updated */
+        add(ComponentUtil.createJLabel("Date updated: ", fontLabel, null));
+        String dateUpdatedStr =
+                bug != null ? df.format(bug.getDateUpdated()) : "";
+        add(ComponentUtil.createJLabel(dateUpdatedStr, fontLabelVal, null));
+
+    }
+
+    @Override
+    public void hyperlinkUpdate(HyperlinkEvent event) {
+        if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+            java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
+            java.net.URI uri;
+            String bugDetailsUrl = null;
+            if (bug != null) {
+                String mapdustSite =
+                        Configuration.getInstance().getMapdustBugDetailsUrl();
+                bugDetailsUrl = mapdustSite + bug.getId().toString();
+            }
+            if (bugDetailsUrl != null) {
+                try {
+                    uri = new java.net.URI(bugDetailsUrl);
+                    desktop.browse(uri);
+                } catch (Exception e) {
+                    String errorMessage = "Error opening the MapDust wiki page";
+                    JOptionPane.showMessageDialog(Main.parent,
+                            tr(errorMessage), tr("Error"),
+                            JOptionPane.ERROR_MESSAGE);
+                }
+            }
+
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugPropertiesPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugPropertiesPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugPropertiesPanel.java	(revision 24514)
@@ -0,0 +1,202 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugDetailsObserver;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandler;
+import org.openstreetmap.josm.plugins.mapdust.service.MapdustServiceHandlerException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Address;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+
+
+/**
+ * Defines the JPanel for the <code>MapdustBug</code> object properties.
+ *
+ * @author Bea
+ */
+public class MapdustBugPropertiesPanel extends JPanel implements
+        MapdustBugDetailsObserver {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The <code>MapdustCommentsPanel</code> object */
+    private MapdustCommentsPanel commentsPanel;
+
+    /** The <code>MapdustBugDetailsPanel</code> object */
+    private MapdustBugDetailsPanel detailsPanel;
+
+    /** The <code>MapdustAddressPanel</code> object */
+    private MapdustAddressPanel addressPanel;
+
+    /** The <code>MapdustDescriptionPanel</code> object */
+    private MapdustDescriptionPanel descriptionPanel;
+
+    /** The <code>MapdustHelpPanel</code> object */
+    private MapdustHelpPanel helpPanel;
+
+    /** The <code>JScrollPane</code> for the address */
+    private JScrollPane cmpAddress;
+
+    /** The <code>JScrollPane</code> for the details */
+    private JScrollPane cmpDetails;
+
+    /** The main panel */
+    private JTabbedPane mainPanel;
+
+    /**
+     * Builds a <code>MapdustBugPropertiesPanel</code> object.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    public MapdustBugPropertiesPanel(MapdustBug mapdustBug) {
+        setLayout(new BorderLayout());
+        setName("Bug Details");
+        addComponents(mapdustBug);
+
+    }
+
+    @Override
+    public void showDetails(MapdustBug mapdustBug) {
+        MapdustBug selectedBug=mapdustBug;
+        if (mapdustBug != null) {
+            if (mapdustBug.getNumberOfComments() > 0) {
+                Long id = mapdustBug.getId();
+                selectedBug = getBug(id);
+            }
+        }
+        int index = -1;
+        /* remove components */
+        if (mainPanel != null) {
+            index = mainPanel.getSelectedIndex();
+            cmpDetails.remove(detailsPanel);
+            mainPanel.remove(cmpDetails);
+            mainPanel.remove(cmpAddress);
+            mainPanel.remove(descriptionPanel);
+            mainPanel.remove(commentsPanel);
+            mainPanel.remove(helpPanel);
+            remove(mainPanel);
+        }
+        /* create the panels */
+        createPanels(selectedBug);
+        if (index != -1) {
+            mainPanel.setSelectedIndex(index);
+        }
+    }
+
+    /**
+     * Creates and adds the components to the main panel.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    private void addComponents(MapdustBug mapdustBug) {
+        MapdustBug selectedBug=mapdustBug;
+        if (mapdustBug != null) {
+            if (mapdustBug.getNumberOfComments() > 0) {
+                Long id = mapdustBug.getId();
+                selectedBug = getBug(id);
+            }
+            createPanels(selectedBug);
+        }
+    }
+
+    /**
+     * Creates the JPanels for displaying the <code>MapdustBug</code> details.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    private void createPanels(MapdustBug mapdustBug) {
+        /* create details panel */
+        detailsPanel = new MapdustBugDetailsPanel(mapdustBug);
+        cmpDetails =
+                ComponentUtil.createJScrollPane(detailsPanel, getBounds(),
+                        getBackground(), true, true);
+        cmpDetails.setPreferredSize(new Dimension(100, 100));
+        cmpDetails.setName("Bug Details");
+
+        /* create address panel */
+        Address address = mapdustBug != null ? mapdustBug.getAddress() : null;
+        LatLon coordinates = mapdustBug != null ? mapdustBug.getLatLon() : null;
+        addressPanel = new MapdustAddressPanel(address, coordinates);
+        cmpAddress =
+                ComponentUtil.createJScrollPane(addressPanel, getBounds(),
+                        getBackground(), true, true);
+        cmpAddress.setName("Address");
+        cmpAddress.setPreferredSize(new Dimension(100, 100));
+
+        /* create description panel */
+        String description =
+                mapdustBug != null ? mapdustBug.getDescription() : "";
+        descriptionPanel = new MapdustDescriptionPanel(description);
+
+        /* create comments panel */
+        MapdustComment[] comments =
+                mapdustBug != null ? mapdustBug.getComments()
+                        : new MapdustComment[0];
+        commentsPanel = new MapdustCommentsPanel(comments);
+
+        /* create the help panel */
+        helpPanel = new MapdustHelpPanel();
+
+        /* creates the main panel */
+        mainPanel = new JTabbedPane();
+        mainPanel.setIgnoreRepaint(true);
+        mainPanel.add(cmpDetails, 0);
+        mainPanel.add(cmpAddress, 1);
+        mainPanel.add(descriptionPanel, 2);
+        mainPanel.add(commentsPanel, 3);
+        mainPanel.add(helpPanel);
+        add(mainPanel, BorderLayout.CENTER);
+    }
+
+    /**
+     * Returns the bug with the given id.
+     *
+     * @param id The id of the object
+     * @return A <code>MapdustBug</code> object
+     */
+    private MapdustBug getBug(Long id) {
+        MapdustBug bug = null;
+        try {
+            bug = new MapdustServiceHandler().getBug(id, null);
+        } catch (MapdustServiceHandlerException e) {
+
+        }
+        return bug;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustButtonPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustButtonPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustButtonPanel.java	(revision 24514)
@@ -0,0 +1,219 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import java.awt.GridLayout;
+import javax.swing.AbstractAction;
+import javax.swing.JPanel;
+import javax.swing.JToggleButton;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteRefresh;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteWorkOffline;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowCloseBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowCommentBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowInvalidateBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowReOpenBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState;
+
+
+/**
+ * Defines the panel of the Mapdust bug list action buttons.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class MapdustButtonPanel extends JPanel {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The work offline button */
+    private JToggleButton btnWorkOffline;
+
+    /** The refresh button */
+    private JToggleButton btnRefresh;
+
+    /** The add comment button */
+    private JToggleButton btnAddComment;
+
+    /** The fix bug report button */
+    private JToggleButton btnFixBugReport;
+
+    /** The invalidate bug report button */
+    private JToggleButton btnInvalidateBugReport;
+
+    /** The re-open bug report button */
+    private JToggleButton btnReOpenBugReport;
+
+    /**
+     * Builds a <code>MapdustButtonPanel</code> object
+     */
+    public MapdustButtonPanel() {}
+
+    /**
+     * Builds a <code>MapdustButtonPanel</code> object based on the given
+     * parameter
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public MapdustButtonPanel(MapdustPlugin mapdustPlugin) {
+        setLayout(new GridLayout(1, 7));
+        addComponents(mapdustPlugin);
+    }
+
+    /**
+     * Add the components to the button panel
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    private void addComponents(MapdustPlugin mapdustPlugin) {
+        /* create components */
+        /* 'Work offline' button */
+        if (btnWorkOffline == null) {
+            String pluginState = Main.pref.get("mapdust.pluginState");
+            String tooltipText = "";
+            String imagePath = "";
+            if (pluginState.equals(MapdustPluginState.ONLINE.getValue())) {
+                tooltipText = "Work offline mode";
+                imagePath = "dialogs/workoffline.png";
+            } else {
+                tooltipText = "Work online mode";
+                imagePath = "dialogs/online.png";
+            }
+            AbstractAction action = new ExecuteWorkOffline(mapdustPlugin.getMapdustGUI());
+            ((ExecuteWorkOffline) action).addObserver(mapdustPlugin);
+            btnWorkOffline = ComponentUtil.createJButton("Work offline",
+                    tooltipText, imagePath, action);
+        }
+        /* 'Refresh' button */
+        if (btnRefresh == null) {
+            String pluginState = Main.pref.get("mapdust.pluginState");
+            AbstractAction action = new ExecuteRefresh();
+            ((ExecuteRefresh) action).addObserver(mapdustPlugin);
+            btnRefresh = ComponentUtil.createJButton("Refresh", "Refresh",
+                    "dialogs/refresh.png", action);
+            if (pluginState.equals(MapdustPluginState.OFFLINE.getValue())) {
+                btnRefresh.setEnabled(false);
+            }
+        }
+        /* 'Add Comment' button */
+        if (btnAddComment == null) {
+            AbstractAction action = new ShowCommentBugAction(mapdustPlugin);
+            btnAddComment = ComponentUtil.createJButton("Comment bug report",
+                    "Comment bug report", "dialogs/comment.png", action);
+            btnAddComment.setEnabled(false);
+        }
+        /* 'Fix bug report' button */
+        if (btnFixBugReport == null) {
+            AbstractAction action = new ShowCloseBugAction(mapdustPlugin);
+            btnFixBugReport = ComponentUtil.createJButton("Close bug report",
+                    "Close bug report", "dialogs/fixed.png", action);
+            btnFixBugReport.setEnabled(false);
+        }
+        /* 'Invalidate bug report' button */
+        if (btnInvalidateBugReport == null) {
+            AbstractAction action = new ShowInvalidateBugAction(mapdustPlugin);
+            btnInvalidateBugReport = ComponentUtil.createJButton("Invalidate bug report",
+                    "Invalidate bug report", "dialogs/invalid.png", action);
+            btnInvalidateBugReport.setEnabled(false);
+        }
+        /* 'Re-open bug report' button */
+        if (btnReOpenBugReport == null) {
+            AbstractAction action = new ShowReOpenBugAction(mapdustPlugin);
+            btnReOpenBugReport = ComponentUtil.createJButton("Re-open bug report",
+                    "Re-open bug report", "dialogs/reopen.png", action);
+            btnReOpenBugReport.setEnabled(false);
+        }
+
+        /* add components */
+        add(btnWorkOffline);
+        add(btnRefresh);
+        add(btnAddComment);
+        add(btnFixBugReport);
+        add(btnInvalidateBugReport);
+        add(btnReOpenBugReport);
+    }
+
+    /**
+     * Returns the work offline button
+     *
+     * @return the btnWorkOffline
+     */
+    public JToggleButton getBtnWorkOffline() {
+        return btnWorkOffline;
+    }
+
+    /**
+     * Returns the refresh button
+     *
+     * @return the btnRefresh
+     */
+    public JToggleButton getBtnRefresh() {
+        return btnRefresh;
+    }
+
+    /**
+     * Returns the add comment button
+     *
+     * @return the btnAddComment
+     */
+    public JToggleButton getBtnAddComment() {
+        return btnAddComment;
+    }
+
+    /**
+     * Returns the fix bug report button
+     *
+     * @return the btnFixBugReport
+     */
+    public JToggleButton getBtnFixBugReport() {
+        return btnFixBugReport;
+    }
+
+    /**
+     * Returns the invalidate button
+     *
+     * @return the btnInvalidateBugReport
+     */
+    public JToggleButton getBtnInvalidateBugReport() {
+        return btnInvalidateBugReport;
+    }
+
+    /**
+     * Returns the re-open bug report button
+     *
+     * @return the btnReOpenBugReport
+     */
+    public JToggleButton getBtnReOpenBugReport() {
+        return btnReOpenBugReport;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustCommentsPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustCommentsPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustCommentsPanel.java	(revision 24514)
@@ -0,0 +1,102 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.text.DateFormat;
+import java.util.Locale;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+
+
+/**
+ * Defines the JPanel which displays the comments of a <code>MapdustBug</code>
+ * object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustCommentsPanel extends JPanel {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a <code>MapdustCommentsPanel</code> object based on the given
+     * arguments.
+     *
+     * @param comments The array of <code>MapdustComment</code> object
+     */
+    public MapdustCommentsPanel(MapdustComment[] comments) {
+        setLayout(new BorderLayout());
+        String name = "Bug Comments (";
+        name += comments.length + " )";
+        setName(name);
+        addComponents(comments);
+    }
+
+    /**
+     * Adds the components to the panel.
+     *
+     * @param comments The array of <code>MapdustComment</code> objects
+     */
+    private void addComponents(MapdustComment[] comments) {
+        JTextArea txt = new JTextArea();
+        txt.setAutoscrolls(true);
+        txt.setEditable(false);
+        String line = "";
+        DateFormat df = DateFormat.getDateInstance(DateFormat.DEFAULT,
+                Locale.getDefault());
+        int index = comments.length;
+        for (MapdustComment com : comments) {
+            line += "Comment " + index + ":";
+            line += "\n";
+            line += "  " + com.getCommentText();
+            line += "\n ";
+            line += " added by " + "[" + com.getNickname() + "]";
+            line += " on ";
+            line += "[ " + df.format(com.getDateCreated()) + " ";
+            line += "] \n\n";
+            index--;
+        }
+        txt.setText(line);
+        txt.setFont(new Font("Times New Roman", Font.BOLD, 12));
+        txt.setCaretPosition(0);
+        JScrollPane sp = ComponentUtil.createJScrollPane(txt, null, Color.white,
+                true, true);
+        sp.setPreferredSize(new Dimension(100, 100));
+        add(sp);
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustDescriptionPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustDescriptionPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustDescriptionPanel.java	(revision 24514)
@@ -0,0 +1,74 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+
+
+/**
+ * Defines the JPanel which displays the <code>MapdustBug</code> object
+ * description.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustDescriptionPanel extends JPanel {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a <code>MapdustDescriptionPanel</code> object
+     *
+     * @param description The description of the bug
+     */
+    public MapdustDescriptionPanel(String description) {
+        setLayout(new BorderLayout());
+        String name = "Description ";
+        setName(name);
+        if (description != null && !description.isEmpty()) {
+            JTextArea txtDescription = new JTextArea(description);
+            txtDescription.setLineWrap(true);
+            txtDescription.setFont(new Font("Times New Roman", Font.BOLD, 12));
+            txtDescription.setEditable(false);
+            JScrollPane cmpDescription = ComponentUtil.createJScrollPane(txtDescription,
+                    null, Color.white, true, true);
+            cmpDescription.setPreferredSize(new Dimension(100, 100));
+            add(cmpDescription, BorderLayout.CENTER);
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java	(revision 24514)
@@ -0,0 +1,100 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import javax.swing.JEditorPane;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.HTMLEditorKit;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+
+
+/**
+ * Defines the JPanel which displays the Help.
+ *
+ * @author Bea
+ */
+public class MapdustHelpPanel extends JPanel implements HyperlinkListener {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a <code>MapdustDescriptionPanel</code> object
+     */
+    public MapdustHelpPanel() {
+        setLayout(new BorderLayout());
+        String name = "Help";
+        setName(name);
+        String txt = "<html>";
+        txt += "<font style='font-size:10px' face='Times New Roman'>";
+        txt += "<b>To select or add bugs on the map you need to activate ";
+        txt += "the MapDust layer in the Layer List Dialog. ";
+        txt += "Click <a href='' target='_blank'>here</a> for more help.";
+        txt += "</b></font></html>";
+        JEditorPane txtHelp = new JEditorPane("text/html", "");
+        txtHelp.setEditorKit(new HTMLEditorKit());
+        txtHelp.setEditable(false);
+        txtHelp.setText(txt);
+        txtHelp.addHyperlinkListener(this);
+        JScrollPane cmpDescription =
+                ComponentUtil.createJScrollPane(txtHelp, null, Color.white,
+                        true, true);
+        cmpDescription.setPreferredSize(new Dimension(100, 100));
+        add(cmpDescription, BorderLayout.CENTER);
+    }
+
+    @Override
+    public void hyperlinkUpdate(HyperlinkEvent event) {
+        if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+            java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
+            String url =
+                    "http://wiki.openstreetmap.org/wiki/JOSM/Plugins/MapDust";
+            java.net.URI uri;
+            try {
+                uri = new java.net.URI(url);
+                desktop.browse(uri);
+            } catch (Exception e) {
+                String errorMessage = "Error opening the MapDust wiki page";
+                JOptionPane.showMessageDialog(Main.parent, tr(errorMessage),
+                        tr("Error"), JOptionPane.ERROR_MESSAGE);
+            }
+
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustPanel.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustPanel.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustPanel.java	(revision 24514)
@@ -0,0 +1,350 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.BorderLayout;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.swing.JList;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
+import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.adapter.DisplayMenu;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.MapdustShowAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowCloseBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowCommentBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowInvalidateBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.action.show.ShowReOpenBugAction;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugDetailsObservable;
+import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustBugDetailsObserver;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+
+
+/**
+ * Defines the components of the MapDust panel
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class MapdustPanel extends JPanel implements ListSelectionListener,
+        MapdustBugDetailsObservable {
+
+    /** The list of observers */
+    private final ArrayList<MapdustBugDetailsObserver> observers =
+            new ArrayList<MapdustBugDetailsObserver>();
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The list of <code>MapdustBug</code> objects */
+    private List<MapdustBug> mapdustBugsList;
+
+    /** The list of bugs */
+    private JList listBugs;
+
+    /** The button panel */
+    private MapdustButtonPanel btnPanel;
+
+    /** The <code>MapdustGUI</code> */
+    private MapdustGUI mapdustGUI;
+
+    /** The pop-up menu */
+    private JPopupMenu menu;
+
+    /** The add comment menu item */
+    private JMenuItem menuAddComment;
+
+    /** The fixed menu item */
+    private JMenuItem menuFixed;
+
+    /** The invalidate menu item */
+    private JMenuItem menuInvalidate;
+
+    /** The re-open menu item */
+    private JMenuItem menuReopen;
+
+    /**
+     * Builds a <code>MapdustPlugin</code> object
+     */
+    public MapdustPanel() {
+
+    }
+
+    /**
+     * Builds a <code>MapdustPlugin</code> object with the given parameters.
+     *
+     * @param mapdustBugsList The list of <code>MapdustBug</code> objects
+     * @param name The name of the panel
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    public MapdustPanel(List<MapdustBug> mapdustBugsList, String name,
+            MapdustPlugin mapdustPlugin) {
+        this.mapdustGUI = mapdustPlugin.getMapdustGUI();
+        this.mapdustBugsList = mapdustBugsList;
+        setLayout(new BorderLayout(5, 10));
+        addComponents(mapdustPlugin);
+        setName(tr(name));
+    }
+
+    /**
+     * Adds the components to the MapDust panel.
+     *
+     * @param mapdustPlugin The <code>MapdustPlugin</code> object
+     */
+    private void addComponents(MapdustPlugin mapdustPlugin) {
+        /* create components */
+        btnPanel = new MapdustButtonPanel(mapdustPlugin);
+        if (menu == null) {
+            menu = new JPopupMenu();
+            /* add comment item */
+            MapdustShowAction action = new ShowCommentBugAction(mapdustPlugin);
+            menuAddComment =
+                    ComponentUtil.createJMenuItem(action, tr("Add comment"),
+                            "dialogs/comment.png");
+            menu.add(menuAddComment);
+            /* fix bug item */
+            action = new ShowCloseBugAction(mapdustPlugin);
+            menuFixed =
+                    ComponentUtil.createJMenuItem(action, tr("Close bug"),
+                            "dialogs/fixed.png");
+            menu.add(menuFixed);
+            /* invalidate bug item */
+            action = new ShowInvalidateBugAction(mapdustPlugin);
+            menuInvalidate =
+                    ComponentUtil.createJMenuItem(action, tr("Invalidate bug"),
+                            "dialogs/invalid.png");
+            menu.add(menuInvalidate);
+            /* re-open bug item */
+            action = new ShowReOpenBugAction(mapdustPlugin);
+            menuReopen =
+                    ComponentUtil.createJMenuItem(action, tr("Re-open bug"),
+                            "dialogs/reopen.png");
+            menu.add(menuReopen);
+        }
+        /* create bugs list */
+        listBugs = ComponentUtil.createJList(mapdustBugsList, menu);
+        listBugs.addListSelectionListener(this);
+        DisplayMenu adapter = new DisplayMenu(listBugs, menu);
+        listBugs.addMouseListener(adapter);
+        JScrollPane cmpBugs = ComponentUtil.createJScrollPane(listBugs);
+        /* add components */
+        add(cmpBugs, BorderLayout.CENTER);
+        add(btnPanel, BorderLayout.SOUTH);
+    }
+
+    @Override
+    public void valueChanged(ListSelectionEvent event) {
+        MapdustBug selectedBug = (MapdustBug) listBugs.getSelectedValue();
+        Main.pref.put("selectedBug.status", selectedBug.getStatus().getValue());
+        notifyObservers(selectedBug);
+        if (selectedBug.getStatus().getKey().equals(1)) {
+            /* status fixed */
+            btnPanel.getBtnAddComment().setEnabled(true);
+            btnPanel.getBtnReOpenBugReport().setEnabled(false);
+            btnPanel.getBtnInvalidateBugReport().setEnabled(true);
+            btnPanel.getBtnFixBugReport().setEnabled(true);
+            getMenuReopen().setEnabled(false);
+            getMenuInvalidate().setEnabled(true);
+            getMenuFixed().setEnabled(true);
+        }
+        if (selectedBug.getStatus().getKey().equals(2)) {
+            /* status fixed */
+            btnPanel.getBtnAddComment().setEnabled(true);
+            btnPanel.getBtnReOpenBugReport().setEnabled(true);
+            btnPanel.getBtnInvalidateBugReport().setEnabled(false);
+            btnPanel.getBtnFixBugReport().setEnabled(false);
+            getMenuReopen().setEnabled(true);
+            getMenuInvalidate().setEnabled(false);
+            getMenuFixed().setEnabled(false);
+        }
+        if (selectedBug.getStatus().getKey().equals(3)) {
+            /* status invalid */
+            btnPanel.getBtnAddComment().setEnabled(true);
+            btnPanel.getBtnReOpenBugReport().setEnabled(true);
+            btnPanel.getBtnInvalidateBugReport().setEnabled(false);
+            btnPanel.getBtnFixBugReport().setEnabled(false);
+            getMenuReopen().setEnabled(true);
+            getMenuInvalidate().setEnabled(false);
+            getMenuFixed().setEnabled(false);
+        }
+        Main.map.mapView.repaint();
+        mapdustGUI.repaint();
+    }
+
+    /**
+     * Returns the selected bug from the list of MapDust bugs.
+     *
+     * @return a <code>MapdustBug</code> object
+     */
+    public MapdustBug getSelectedBug() {
+        MapdustBug selectedBug = (MapdustBug) getListBugs().getSelectedValue();
+        return selectedBug;
+    }
+
+    /**
+     * Returns the index of the selected MapDust bug.
+     *
+     * @return index
+     */
+    public int getSelectedIndex() {
+        return getListBugs().getSelectedIndex();
+    }
+
+    /**
+     * Sets the <code>MapdustBug</code> which will be selected from the list of
+     * MapDust bug.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    public void setSelectedBug(MapdustBug mapdustBug) {
+        getListBugs().setSelectedValue(mapdustBug, false);
+        int index = getSelectedIndex();
+        getListBugs().ensureIndexIsVisible(index);
+    }
+
+    /**
+     * Returns the list of bugs
+     *
+     * @return the listBugs
+     */
+    public JList getListBugs() {
+        return listBugs;
+    }
+
+    /**
+     * Return the menu
+     *
+     * @return the menu
+     */
+    public JPopupMenu getMenu() {
+        return menu;
+    }
+
+    /**
+     * Returns the button panel
+     *
+     * @return the btnPanel
+     */
+    public MapdustButtonPanel getBtnPanel() {
+        return btnPanel;
+    }
+
+    /**
+     * Returns the 'add comment' menu item
+     *
+     * @return the menuAddComment
+     */
+    public JMenuItem getMenuAddComment() {
+        return menuAddComment;
+    }
+
+    /**
+     * Returns the 'fixed' menu item
+     *
+     * @return the menuFixed
+     */
+    public JMenuItem getMenuFixed() {
+        return menuFixed;
+    }
+
+    /**
+     * Returns the 'invalidate' menu item
+     *
+     * @return the menuInvalidate
+     */
+    public JMenuItem getMenuInvalidate() {
+        return menuInvalidate;
+    }
+
+    /**
+     * Returns the 're-open' menu item
+     *
+     * @return the menuReopen
+     */
+    public JMenuItem getMenuReopen() {
+        return menuReopen;
+    }
+
+    /**
+     * Returns the list of <code>MapdustBug</code> objects
+     *
+     * @return the mapdustBugsList
+     */
+    public List<MapdustBug> getMapdustBugsList() {
+        return mapdustBugsList;
+    }
+
+    /**
+     * Adds a new MapDust bug details observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugDetailsObserver</code> object
+     */
+    @Override
+    public void addObserver(MapdustBugDetailsObserver observer) {
+        if (!this.observers.contains(observer)) {
+            this.observers.add(observer);
+        }
+    }
+
+    /**
+     * Removes the given MapDust bug details observer from the list of
+     * observers.
+     *
+     * @param observer The <code>MapdustBugDetailsObserver</code> object
+     */
+    @Override
+    public void removeObserver(MapdustBugDetailsObserver observer) {
+        this.observers.remove(observer);
+
+    }
+
+    /**
+     * Notifies the MapDust bug details observers observing the given
+     * <code>MapdustBug</code> object.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    @Override
+    public void notifyObservers(MapdustBug mapdustBug) {
+        Iterator<MapdustBugDetailsObserver> elements =
+                this.observers.iterator();
+        while (elements.hasNext()) {
+            (elements.next()).showDetails(mapdustBug);
+        }
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * constains the panel classes
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ActionListCellRenderer.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ActionListCellRenderer.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ActionListCellRenderer.java	(revision 24514)
@@ -0,0 +1,121 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
+
+
+import java.awt.Component;
+import java.awt.Font;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * Cell renderer for the <code>MapdustAction</code> objects.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class ActionListCellRenderer extends DefaultListCellRenderer {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Returns the cell renderer component of the action list.
+     *
+     * @param list The action list
+     * @param value The selected object
+     * @param index The selected index
+     * @param isSelected Specifies if the item is selected or not
+     * @param hasFocus Specifies if the item has focus or not
+     */
+    @Override
+    public Component getListCellRendererComponent(JList list, Object value,
+            int index, boolean isSelected, boolean hasFocus) {
+        JLabel label = (JLabel) super.getListCellRendererComponent(list, value,
+                index, isSelected, hasFocus);
+        if (value instanceof MapdustAction) {
+            MapdustAction mapdustAction = (MapdustAction) value;
+            String text = "";
+            MapdustBug bug = mapdustAction.getMapdustBug();
+            MapdustComment comment = mapdustAction.getMapdustComment();
+            if (comment == null) {
+                /* created a new bug */
+                bug = mapdustAction.getMapdustBug();
+                text += bug.getType().getValue() + ":";
+                text += bug.getDescription() + " ";
+                text += " created by ";
+                text += bug.getNickname();
+            } else {
+                if (mapdustAction.getNewStatus() != null) {
+                    switch (mapdustAction.getNewStatus()) {
+                        case 1:
+                            /* bug was re-opened */
+                            text += bug.getId() + ":";
+                            text += bug.getType().getValue() + " ";
+                            text += " re-opened by ";
+                            text += comment.getNickname();
+                            break;
+                        case 2:
+                            /* bug was fixed */
+                            text += bug.getId() + ":";
+                            text += bug.getType().getValue() + " ";
+                            text += " fixed by ";
+                            text += comment.getNickname();
+                            break;
+                        case 3:
+                            /* bug was invalidated */
+                            text += bug.getId() + ":";
+                            text += bug.getType().getValue() + " ";
+                            text += " invalidated by ";
+                            text += comment.getNickname();
+                            break;
+                    }
+
+                } else {
+                    /* new comment */
+                    text += bug.getId() + ":";
+                    text += bug.getType().getValue() + " ";
+                    text += " commented by ";
+                    text += comment.getNickname();
+                }
+            }
+            /* set the text and icon */
+            label.setText(text);
+            label.setIcon(ImageProvider.get(mapdustAction.getIconPath()));
+            label.setFont(new Font("Times New Roman", Font.BOLD, 12));
+        }
+        return (label);
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/BugListCellRenderer.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/BugListCellRenderer.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/BugListCellRenderer.java	(revision 24514)
@@ -0,0 +1,92 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
+
+
+import java.awt.Component;
+import java.awt.Font;
+import java.text.DateFormat;
+import java.util.Locale;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * Cell renderer for the list of <code>MapdustBug</code> objects.
+ *
+ * @author Bea
+ */
+public class BugListCellRenderer extends DefaultListCellRenderer {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Returns the cell renderer component of the MapDust bug list.
+     *
+     * @param list The MapDust bug list
+     * @param value The selected object
+     * @param index The selected index
+     * @param isSelected Specifies if the item is selected or not
+     * @param hasFocus Specifies if the item has focus or not
+     */
+    @Override
+    public Component getListCellRendererComponent(JList list, Object value,
+            int index, boolean isSelected, boolean hasFocus) {
+        JLabel label =
+                (JLabel) super.getListCellRendererComponent(list, value, index,
+                        isSelected, hasFocus);
+        if (value instanceof MapdustBug) {
+            MapdustBug mapdustBug = (MapdustBug) value;
+            String iconPath = "bugs/normal/";
+            iconPath += mapdustBug.getStatus().getValue().toLowerCase();
+            iconPath += "_";
+            iconPath += mapdustBug.getType().getKey() + ".png";
+            ImageIcon icon = ImageProvider.get(iconPath);
+            icon.setDescription(mapdustBug.getType().getValue());
+            label.setIcon(ImageProvider.get(iconPath));
+            String text = "" + mapdustBug.getId() + ": ";
+            text += mapdustBug.getType().getValue();
+            if (mapdustBug.getAddress() != null) {
+                text += " (" + mapdustBug.getAddress().toString() + " )";
+            }
+            DateFormat df = DateFormat.getDateInstance(DateFormat.DEFAULT,
+                    Locale.getDefault());
+            text +=" last modified on ";
+            text += df.format(mapdustBug.getDateUpdated());
+            label.setText(text);
+            label.setFont(new Font("Times New Roman", Font.BOLD, 12));
+        }
+        return (label);
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ComboBoxRenderer.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ComboBoxRenderer.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ComboBoxRenderer.java	(revision 24514)
@@ -0,0 +1,79 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
+
+
+import java.awt.Component;
+import java.awt.Font;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.ListCellRenderer;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Type;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * Cell renderer for the <code>MapdustBug</code> types.
+ *
+ * @author Bea
+ */
+public class ComboBoxRenderer implements ListCellRenderer {
+
+    /** The default renderer */
+    private final DefaultListCellRenderer defaultRenderer =
+            new DefaultListCellRenderer();
+
+    /**
+     * Returns the cell renderer component of the MapDust type combo box.
+     *
+     * @param list The list of types
+     * @param value The selected object
+     * @param index The selected index
+     * @param isSelected Specifies if the item is selected or not
+     * @param cellHasFocus Specifies if the item has focus or not
+     */
+    @Override
+    public Component getListCellRendererComponent(JList list, Object value,
+            int index, boolean isSelected, boolean cellHasFocus) {
+        JLabel label = (JLabel) defaultRenderer.getListCellRendererComponent(
+                list, value, index, isSelected, cellHasFocus);
+        if (value instanceof Type) {
+            Type type = (Type) value;
+            String iconPath = "bugs/normal/open_" + type.getKey() + ".png";
+            String text = type.getValue();
+            ImageIcon icon = ImageProvider.get(iconPath);
+            label.setIcon(icon);
+            label.setText(text);
+            label.setFont( new Font("Times New Roman", Font.BOLD, 12));
+        }
+        return label;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * contains the custom renderer classes used by lists and combo boxes
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/ComponentUtil.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/ComponentUtil.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/ComponentUtil.java	(revision 24514)
@@ -0,0 +1,288 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.component.util;
+
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Font;
+import java.awt.Rectangle;
+import java.util.List;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.JToggleButton;
+import javax.swing.ListCellRenderer;
+import javax.swing.ListSelectionModel;
+import javax.swing.border.LineBorder;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.model.ActionListModel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.model.BugsListModel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.model.TypesListModel;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.ActionListCellRenderer;
+import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.BugListCellRenderer;
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+
+/**
+ * Helper class, used for creating the GUI elements.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public class ComponentUtil {
+
+    /**
+     * Creates a <code>JLabel</code> object with the given properties.
+     *
+     * @param text The text of the label
+     * @param font The font of the label
+     * @param bounds The bounds of the element
+     * @return A <code>JLabel</code> label
+     */
+    public static JLabel createJLabel(String text, Font font, Rectangle bounds) {
+        JLabel jLabel = new JLabel();
+        if (bounds != null) {
+            jLabel.setBounds(bounds);
+        }
+        jLabel.setText(text);
+        jLabel.setFont(font);
+        return jLabel;
+    }
+
+    /**
+     * Creates a new <code>JButton</code> object with the given properties.
+     *
+     * @param text The text which appears on the button
+     * @param bounds The position and dimension attributes
+     * @param action The action of the button
+     * @return A <code>JButton</code> object
+     */
+    public static JButton createJButton(String text, Rectangle bounds,
+            Action action) {
+        JButton jButton = null;
+        if (action != null) {
+            jButton = new JButton(action);
+        } else {
+            jButton = new JButton();
+        }
+        jButton.setFont(new Font("Times New Roman", Font.BOLD, 14));
+        jButton.setText(text);
+        jButton.setBounds(bounds);
+        return jButton;
+    }
+
+    /**
+     * Creates a new <code>JToggleButton</code> object with the given
+     * properties.
+     *
+     * @param text The text of the button
+     * @param toolTipText The tool tip text
+     * @param iconName The name of the icon
+     * @param action The action of the button
+     * @return A <code>JToggleButton</code> object
+     */
+    public static JToggleButton createJButton(String text, String toolTipText,
+            String iconName, AbstractAction action) {
+        JToggleButton jButton = new JToggleButton(tr(text));
+        if (action != null) {
+            jButton.setAction(action);
+        }
+        if (toolTipText != null) {
+            jButton.setToolTipText(tr(toolTipText));
+        }
+        if (iconName != null) {
+            jButton.setIcon(ImageProvider.get(iconName));
+        } else {
+            jButton.setText(tr(text));
+            jButton.setFont(new Font("Times New Roman", Font.BOLD, 14));
+        }
+        return jButton;
+    }
+
+    /**
+     * Creates a new <code>JTextField</code> object with the given properties.
+     *
+     * @param bounds The position and dimension attributes
+     * @return A <code>JTextField</code> object
+     */
+    public static JTextField createJTextField(Rectangle bounds) {
+        JTextField txtField = new JTextField();
+        txtField.setFont(new Font("Times New Roman", Font.PLAIN, 12));
+        txtField.setBounds(bounds);
+        return txtField;
+    }
+
+    /**
+     * Creates a new <code>JScrollPane</code> object with the given properties.
+     *
+     * @param component The component of the scroll pane
+     * @param bounds The dimension of the component
+     * @param backgroundColor The color of the background
+     * @param noBorder if true then the scroll pane is without border otherwise
+     * the scroll pane will have also a border
+     * @param visible if true then the scroll pane will be visible otherwise the
+     * scroll pane will be invisible
+     * @return A <code>JScrollPane</code> object
+     */
+    public static JScrollPane createJScrollPane(Component component,
+            Rectangle bounds, Color backgroundColor, boolean noBorder,
+            boolean visible) {
+        JScrollPane pane = new JScrollPane();
+        if (bounds != null) {
+            pane.setBounds(bounds);
+        }
+        pane.setBackground(backgroundColor);
+        pane.setViewportView(component);
+        if (noBorder) {
+            pane.setBorder(null);
+        }
+        if (!visible) {
+            pane.setVisible(false);
+        }
+        return pane;
+    }
+
+    /**
+     * Creates a new <code>JScrollPane</code> object with the given properties.
+     *
+     * @param list The list of the scroll pane
+     * @return A <code>JScrollPane</code> object
+     */
+    public static JScrollPane createJScrollPane(JList list) {
+        JScrollPane jScrollPane = new JScrollPane();
+        jScrollPane.setViewportView(list);
+        jScrollPane.setAutoscrolls(true);
+        return jScrollPane;
+    }
+
+    /**
+     * Creates a new <code>JList</code> object with the given properties.
+     *
+     * @param list The list of <code>MapdustAction</code> objects
+     * @return A <code>JList</code> object
+     */
+    public static JList createJList(List<MapdustAction> list) {
+        final JList jList = new JList(new ActionListModel(list));
+        jList.setBorder(new LineBorder(Color.black, 1, false));
+        jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        jList.setCellRenderer(new ActionListCellRenderer());
+        jList.setAutoscrolls(true);
+        return jList;
+    }
+
+    /**
+     * Creates a new <code>JList</code> object with the given properties.
+     *
+     * @param bugsList The list of <code>MapdustBug</code> objects
+     * @param menu The menu
+     * @return A <code>JList</code>
+     */
+    public static JList createJList(List<MapdustBug> bugsList,
+            final JPopupMenu menu) {
+        final JList jList = new JList(new BugsListModel(bugsList));
+        jList.setBorder(new LineBorder(Color.black, 1, false));
+        jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        jList.setCellRenderer(new BugListCellRenderer());
+        jList.setAutoscrolls(true);
+        return jList;
+    }
+
+    /**
+     * Creates a new <code>JMenuItem</code> object with the given properties.
+     *
+     * @param action the Action of the menu item
+     * @param title The title of the menu item
+     * @param iconPath The path of the icon
+     * @return A <code>JMenuItem</code> object
+     */
+    public static JMenuItem createJMenuItem(Action action, String title,
+            String iconPath) {
+        JMenuItem menuItem = new JMenuItem(action);
+        menuItem.setText(title);
+        menuItem.setIcon(ImageProvider.get(iconPath));
+        menuItem.setFont(new Font("Times New Roman", Font.BOLD, 12));
+        return menuItem;
+    }
+
+    /**
+     * Creates a new <code>JTextPane</code> object with the given properties.
+     *
+     * @param text The text which will appear in the text pane
+     * @param backgroundColor The background color
+     * @return A <code>JTextPane</code> object
+     */
+    public static JTextPane createJTextPane(String text, Color backgroundColor) {
+        JTextPane jTextPane = new JTextPane();
+        jTextPane.setBorder(null);
+        jTextPane.setEditable(false);
+        jTextPane.setBackground(backgroundColor);
+        jTextPane.setFont(new Font("Times New Roman", Font.PLAIN, 14));
+        if (text != null) {
+            jTextPane.setText(text);
+        }
+        jTextPane.setVerifyInputWhenFocusTarget(false);
+        jTextPane.setAutoscrolls(false);
+        return jTextPane;
+    }
+
+    /**
+     * Creates a new <code>JComboBox</code> object with the given properties.
+     *
+     * @param bounds The dimension of the combo box
+     * @param renderer The <code>ListCellRenderer</code> object
+     * @param backgroundColor The background color
+     * @return A <code>JComboBox</code> object
+     */
+    public static JComboBox createJComboBox(Rectangle bounds,
+            ListCellRenderer renderer, Color backgroundColor) {
+        JComboBox jComboBox = new JComboBox(new TypesListModel());
+        jComboBox.setSelectedIndex(0);
+        jComboBox.setBackground(backgroundColor);
+        jComboBox.setFont(new Font("Times New Roman", Font.BOLD, 12));
+        jComboBox.setDoubleBuffered(false);
+        jComboBox.setBorder(null);
+        jComboBox.setBounds(bounds);
+        if (renderer != null) {
+            jComboBox.setRenderer(renderer);
+            jComboBox.setMaximumRowCount(7);
+        }
+        return jComboBox;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/package-info.java	(revision 24514)
@@ -0,0 +1,2 @@
+
+package org.openstreetmap.josm.plugins.mapdust.gui.component.util;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustActionListObservable.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustActionListObservable.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustActionListObservable.java	(revision 24514)
@@ -0,0 +1,63 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+
+
+/**
+ * Observable interface for the MapdustAction list.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustActionListObservable {
+
+    /**
+     * Adds a new observer to the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    public void addObserver(MapdustActionListObserver observer);
+
+    /**
+     * Removes the given observer from the list of observers.
+     *
+     * @param observer The <code>MapdustActionListObserver</code> object
+     */
+    public void removeObserver(MapdustActionListObserver observer);
+
+    /**
+     * Notifies all the observers observing the given <code>MapdustAction</code>
+     * object.
+     *
+     * @param mapdustAction The <code>MapdustAction</code> object
+     */
+    public void notifyObservers(MapdustAction mapdustAction);
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustActionListObserver.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustActionListObserver.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustActionListObserver.java	(revision 24514)
@@ -0,0 +1,48 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
+
+
+/**
+ * The observer interface for the <code>MapdustAction</code> object.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustActionListObserver {
+
+    /**
+     * Adds a new <code>MapdustAction</code> object to the MapDust action list
+     *
+     * @param mapdustAction The <code>MapdustAction</code> list
+     */
+    public void addAction(MapdustAction mapdustAction);
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugDetailsObservable.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugDetailsObservable.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugDetailsObservable.java	(revision 24514)
@@ -0,0 +1,63 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+
+
+/**
+ * The observable interface for the <code>MapdustBug</code> object details.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustBugDetailsObservable {
+
+    /**
+     * Adds a new observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugDetailsObserver</code> object
+     */
+    public void addObserver(MapdustBugDetailsObserver observer);
+
+    /**
+     * Removes the given observer from the list of observers.
+     *
+     * @param observer The <code>MapdustBugDetailsObserver</code> object
+     */
+    public void removeObserver(MapdustBugDetailsObserver observer);
+
+    /**
+     * Notifies all the observers observing the given <code>MapdustAction</code>
+     * object.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    public void notifyObservers(MapdustBug mapdustBug);
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugDetailsObserver.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugDetailsObserver.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugDetailsObserver.java	(revision 24514)
@@ -0,0 +1,49 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+
+
+/**
+ * The observer interface for the <code>MapdustBug</code> object details.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustBugDetailsObserver {
+
+    /**
+     * Shows the details of the <code>MapdustBug</code> object in the MapDust
+     * plugin panel.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    public void showDetails(MapdustBug mapdustBug);
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugObservable.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugObservable.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugObservable.java	(revision 24514)
@@ -0,0 +1,64 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+
+
+/**
+ * The observable interface for the <code>MapdustBug</code> object. Observes the
+ * changes of a given <code>MapdustBug</code> object.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustBugObservable {
+
+    /**
+     * Adds a new observer to the list of observers.
+     *
+     * @param observer The <code>MapdustBugObservable</code> object
+     */
+    public void addObserver(MapdustBugObserver observer);
+
+    /**
+     * Removes the given observer from the list of observers.
+     *
+     * @param observer The <code>MapdustBugObservable</code> object
+     */
+    public void removeObserver(MapdustBugObserver observer);
+
+    /**
+     * Notifies all the observers observing the given <code>MapdustBug</code>
+     * object.
+     *
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    public void notifyObservers(MapdustBug mapdustBug);
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugObserver.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugObserver.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustBugObserver.java	(revision 24514)
@@ -0,0 +1,48 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+
+
+/**
+ * The observer interface for the <code>MapdustBug</code> object.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustBugObserver {
+
+    /**
+     * Modifies the given <code>MapdustBug</code> object.
+     *
+     * @param mapdustBug A <code>MapdustBug</code> object
+     */
+    public void changedData(MapdustBug mapdustBug);
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustInitialUpdateObservable.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustInitialUpdateObservable.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustInitialUpdateObservable.java	(revision 24514)
@@ -0,0 +1,59 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+/**
+ * The observable interface used for the initial MapDust data download and
+ * plugin update.
+ *
+ * @author Bea
+ */
+public interface MapdustInitialUpdateObservable {
+
+
+    /**
+     * Adds a new observer to the list of observers.
+     *
+     * @param observer The <code>MapdustInitialUpdateObserver</code> object
+     */
+    public void addObserver(MapdustInitialUpdateObserver observer);
+
+    /**
+     * Removes the given observer from the list of observers.
+     *
+     * @param observer The <code>MapdustInitialUpdateObserver</code> object
+     */
+    public void removeObserver(MapdustInitialUpdateObserver observer);
+
+    /**
+     * Notifies all the observers observing the initial download action.
+     *
+     */
+    public void notifyObservers();
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustInitialUpdateObserver.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustInitialUpdateObserver.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustInitialUpdateObserver.java	(revision 24514)
@@ -0,0 +1,44 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+/**
+ * The observer interface used for the initial MapDust data download and plugin
+ * update.
+ *
+ * @author Bea
+ *
+ */
+public interface MapdustInitialUpdateObserver {
+
+    /**
+     * Downloads initially the MapDust Bugs and updates the plugin.
+     */
+    public void initialUpdate();
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustRefreshObservable.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustRefreshObservable.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustRefreshObservable.java	(revision 24514)
@@ -0,0 +1,58 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+/**
+ * The observable interface for the refresh action.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustRefreshObservable {
+
+    /**
+     * Adds a new observer to the list of observers.
+     *
+     * @param observer The <code>MapdustRefreshObserver</code>
+     */
+    public void addObserver(MapdustRefreshObserver observer);
+
+    /**
+     * Removes the given observer from the list of observers.
+     *
+     * @param observer the <code>MapdustRefreshObserver</code>
+     */
+    public void removeObserver(MapdustRefreshObserver observer);
+
+    /**
+     * Notifies all the observers observing this action.
+     */
+    public void notifyObservers();
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustRefreshObserver.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustRefreshObserver.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/MapdustRefreshObserver.java	(revision 24514)
@@ -0,0 +1,44 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
+
+
+/**
+ * The observer interface for the refresh action. Updates the MapDust plugin
+ * with new MapDust data.
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public interface MapdustRefreshObserver {
+
+    /**
+     * Updates the data of the MapDust plugin data.
+     */
+    public void updateData();
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/observer/package-info.java	(revision 24514)
@@ -0,0 +1,2 @@
+
+package org.openstreetmap.josm.plugins.mapdust.gui.observer;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/package-info.java	(revision 24514)
@@ -0,0 +1,5 @@
+/**
+ * Contains the graphical user interface related part of the Mapdust plugin.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui;
+
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustAction.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustAction.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustAction.java	(revision 24514)
@@ -0,0 +1,157 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.value;
+
+
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+
+
+/**
+ * Represents the <code>MapdustAction</code> object .
+ *
+ * @author Bea
+ *
+ */
+public class MapdustAction {
+
+    /** The <code>MapdustServiceCommand</code> object */
+    private MapdustServiceCommand command;
+
+    /** The icon path */
+    private String iconPath;
+
+    /** The <code>MapdustBug</code> object */
+    private MapdustBug mapdustBug;
+
+    /** The <code>MapdustComment</code> object */
+    private MapdustComment mapdustComment;
+
+    /** The new status of the bug */
+    private Integer newStatus;
+
+    /**
+     * The <code>MapdustAction</code> object
+     */
+    public MapdustAction() {}
+
+    /**
+     * The <code>MapdustAction</code> object.
+     *
+     * @param command The <code>MapdustServiceCommand</code> object
+     * @param iconPath The icon path
+     * @param mapdustBug The <code>MapdustBug</code> object
+     */
+    public MapdustAction(MapdustServiceCommand command, String iconPath,
+            MapdustBug mapdustBug) {
+        this.command = command;
+        this.iconPath = iconPath;
+        this.mapdustBug = mapdustBug;
+    }
+
+    /**
+     * The <code>MapdustAction</code> object.
+     *
+     * @param command The <code>MapdustServiceCommand</code> object
+     * @param iconPath The icon path
+     * @param mapdustBug The <code>MapdustBug</code> object
+     * @param mapdustComment The <code>MapdustComment</code> object
+     */
+    public MapdustAction(MapdustServiceCommand command, String iconPath,
+            MapdustBug mapdustBug, MapdustComment mapdustComment) {
+        this.command = command;
+        this.iconPath = iconPath;
+        this.mapdustBug = mapdustBug;
+        this.mapdustComment = mapdustComment;
+    }
+
+    /**
+     * The <code>MapdustAction</code> object.
+     *
+     * @param command The <code>MapdustServiceCommand</code> object
+     * @param iconPath The icon path
+     * @param mapdustBug The <code>MapdustBug</code> object
+     * @param mapdustComment The <code>MapdustComment</code> object
+     * @param newStatus The new status of the object
+     */
+    public MapdustAction(MapdustServiceCommand command, String iconPath,
+            MapdustBug mapdustBug, MapdustComment mapdustComment,
+            Integer newStatus) {
+        this.command = command;
+        this.iconPath = iconPath;
+        this.mapdustBug = mapdustBug;
+        this.mapdustComment = mapdustComment;
+        this.newStatus = newStatus;
+    }
+
+    /**
+     * Returns the <code>MapdustServiceCommand</code> object
+     *
+     * @return the command
+     */
+    public MapdustServiceCommand getCommand() {
+        return command;
+    }
+
+    /**
+     * Returns the <code>MapdustComment</code> object
+     *
+     * @return the mapdustComment
+     */
+    public MapdustComment getMapdustComment() {
+        return mapdustComment;
+    }
+
+    /**
+     * Returns the icon path
+     *
+     * @return the iconPath
+     */
+    public String getIconPath() {
+        return iconPath;
+    }
+
+    /**
+     * Returns the <code>MapdustBug</code> object
+     *
+     * @return the mapdustBug
+     */
+    public MapdustBug getMapdustBug() {
+        return mapdustBug;
+    }
+
+    /**
+     * Returns the status
+     *
+     * @return the newStatus
+     */
+    public Integer getNewStatus() {
+        return newStatus;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustPluginState.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustPluginState.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustPluginState.java	(revision 24514)
@@ -0,0 +1,89 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.value;
+
+
+/**
+ * Enum representing the MapDust plugin state. The plugin can be in the
+ * following 2 states: online and offline.
+ *
+ * @author Bea
+ */
+public enum MapdustPluginState {
+
+    /** The online state */
+    ONLINE("online"),
+
+    /** The offline state */
+    OFFLINE("offline");
+
+    /** The value of the state */
+    private String value;
+
+    /**
+     * Builds a new <code>ActivationStatus</code> with the given value
+     *
+     * @param value The value of the object
+     */
+    private MapdustPluginState(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Returns the value of the payment status
+     *
+     * @return value
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Returns a <code>MapdustPluginState</code> object for the given type. If
+     * the type is invalid, the method return null.
+     * @param type The type
+     * @return A <code>MapdustPluginState</code> object.
+     */
+    public static MapdustPluginState getMapdustPluginState(String type) {
+        MapdustPluginState[] pluginStates = values();
+        if (pluginStates != null) {
+            for (MapdustPluginState state : pluginStates) {
+                if (state.getValue().equalsIgnoreCase(type)) {
+                    return state;
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + ":'" + getValue() + "'";
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustServiceCommand.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustServiceCommand.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/MapdustServiceCommand.java	(revision 24514)
@@ -0,0 +1,82 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.gui.value;
+
+
+/**
+ * Enum representing the MapDust service "commands".
+ *
+ * @author Bea
+ * @version $Revision$
+ */
+public enum MapdustServiceCommand {
+
+    /** The add bug command */
+    ADD_BUG("addBug", "Add Bug"),
+    /** The comment bug command */
+    COMMENT_BUG("commentBug", "Comment Bug"),
+    /** The change bug status command */
+    CHANGE_BUG_STATUS("changeBugStatus", "Modify Bug status");
+
+    /** The key */
+    private String key;
+
+    /** The value */
+    private String value;
+
+    /**
+     * Builds a new <code>MapdustServiceCommand</code> object
+     */
+    private MapdustServiceCommand() {}
+
+    /**
+     * Builds a new <code>MapdustServiceCommand</code> object
+     *
+     * @param key The key
+     * @param value The value
+     */
+    private MapdustServiceCommand(String key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    /**
+     * @return the key
+     */
+    public String getKey() {
+        return key;
+    }
+
+    /**
+     * @return the value
+     */
+    public String getValue() {
+        return value;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/value/package-info.java	(revision 24514)
@@ -0,0 +1,2 @@
+
+package org.openstreetmap.josm.plugins.mapdust.gui.value;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/package-info.java	(revision 24514)
@@ -0,0 +1,5 @@
+/**
+ * The Mapdust OSM Bug reported JOSM plugin classes.
+ * 
+ */
+package org.openstreetmap.josm.plugins.mapdust;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/MapdustServiceHandler.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/MapdustServiceHandler.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/MapdustServiceHandler.java	(revision 24514)
@@ -0,0 +1,238 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service;
+
+
+import java.util.List;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.MapdustConnector;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.MapdustConnectorException;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugsResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustPostResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.converter.MapdustConverter;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Paging;
+
+
+/**
+ * This class responsibility is to handle the MapDust API HTTP
+ * request/responses.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustServiceHandler {
+
+    /** The <code>MapdustConnector</code> object */
+    private final MapdustConnector connector;
+
+    /**
+     * Builds a <code>MapdustServiceHandler</code> object with the default
+     * settings.
+     *
+     */
+    public MapdustServiceHandler() {
+        this.connector = new MapdustConnector();
+    }
+
+    /**
+     * Builds a <code>MapdustServiceHandler</code> object based on the given
+     * arguments.
+     *
+     * @param connector The <code>MapdustConnector</code> object
+     */
+    public MapdustServiceHandler(MapdustConnector connector) {
+        this.connector = connector;
+    }
+
+    /**
+     * Searches for the <code>MapdustBug</code> objects in the bounding box
+     * defined by the given coordinates. If there are no bugs in the given area
+     * then an empty list will be returned. If one of the coordinates is missing
+     * a corresponding exception will be thrown.
+     *
+     * @param minLon The minimum longitude. This parameter is required.
+     * @param minLat The minimum latitude.This parameter is required.
+     * @param maxLon The maximum longitude.This parameter is required.
+     * @param maxLat The maximum latitude.This parameter is required.
+     * @return A list of <code>MapdustBug</code> objects.
+     *
+     * @throws MapdustServiceHandlerException In the case of an error
+     */
+    public List<MapdustBug> getBugs(Double minLon, Double minLat,
+            Double maxLon, Double maxLat) throws MapdustServiceHandlerException {
+        MapdustGetBugsResponse getBugsResponse = null;
+        /* validates the coordinates */
+        if (minLon == null || minLat == null || maxLon == null
+                || maxLat == null) {
+            throw new MapdustServiceHandlerException("Invalid coordinates!");
+        }
+        /* executes the getBug MapDust method */
+        try {
+            getBugsResponse = connector.getBugs(minLon, minLat, maxLon, maxLat);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustServiceHandlerException(e.getMessage(), e);
+        }
+        /* converts the result into a list of MapDust bugs */
+        List<MapdustBug> bugsList =
+                MapdustConverter.buildMapdustBugList(getBugsResponse);
+        return bugsList;
+    }
+
+    /**
+     * Retrieves the <code>MapdustBug</code> object with the given id. If the
+     * paging object is not null, then the comments of the bug will be
+     * paginated. If no bug found with the given id, then an empty object will
+     * be returned.
+     *
+     * @param id The id of the object. This parameter is a required parameter.
+     * @param paging A <code>Paging</code> object. This parameter is optional.
+     * If it is null, it will be ignored.
+     * @return A <code>MapdustBug</code> object with the given id.
+     * @throws MapdustServiceHandlerException In the case of an error
+     */
+    public MapdustBug getBug(Long id, Paging paging)
+            throws MapdustServiceHandlerException {
+        MapdustGetBugResponse getBugResponse = null;
+        /* validate id */
+        if (id == null) {
+            String errorMessage = "Invalid id. The id cannot be null!";
+            throw new MapdustServiceHandlerException(errorMessage);
+        }
+        /* executes the getBug MapDust method */
+        try {
+            getBugResponse = connector.getBug(id, paging);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustServiceHandlerException(e.getMessage(), e);
+        }
+        /* converts the response into a MapdustBug object */
+        MapdustBug bug = MapdustConverter.buildMapdustBug(getBugResponse);
+        return bug;
+    }
+
+    /**
+     * Adds a new <code>MapdustBug</code> object to the MapDust OSM bug service.
+     * If the object is null, a corresponding exception will be thrown.
+     *
+     * @param bug A <code>BugReport</code> object
+     * @return The if of the created bug.
+     * @throws MapdustServiceHandlerException In the case of an error
+     */
+    public Long addBug(MapdustBug bug) throws MapdustServiceHandlerException {
+        MapdustPostResponse postResponse = null;
+        /* validates the bug */
+        if (bug == null) {
+            String errorMessage = "Invalid bug. The bug cannot be null!";
+            throw new MapdustServiceHandlerException(errorMessage);
+        }
+        /* executes the addbug MapDust method */
+        try {
+            postResponse = connector.addBug(bug);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustServiceHandlerException(e.getMessage(), e);
+        }
+        /* get the id */
+        Long id = null;
+        if (postResponse != null) {
+            id = postResponse.getId();
+        }
+        return id;
+    }
+
+    /**
+     * Create a comment for a given MapDust bug. If the
+     * <code>MapdustComment</code> object is null, an exception will be thrown.
+     * The method returns the id of the created <code>MapdustComment</code>
+     * object.
+     *
+     * @param comment A <code>MapdustComment</code> object.
+     * @return The id of the created object.
+     * @throws MapdustServiceHandlerException In the case of an error.
+     */
+    public Long commentBug(MapdustComment comment)
+            throws MapdustServiceHandlerException {
+        MapdustPostResponse postResponse = null;
+        /* validates comment */
+        if (comment == null) {
+            String errorMessage="Invalid comment. The comment cannot be null!";
+            throw new MapdustServiceHandlerException(errorMessage);
+        }
+        /* execute commentBug MapDust method */
+        try {
+            postResponse = connector.commentBug(comment);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustServiceHandlerException(e.getMessage(), e);
+        }
+        /* get the id */
+        Long id = null;
+        if (postResponse != null) {
+            id = postResponse.getId();
+        }
+        return id;
+    }
+
+    /**
+     * Changes the status of a given MapDust bug. The status of a MapDust bug
+     * can be one of the following: 1-open, 2-fixed, 3-invalid. If the statusId
+     * or the comment is null an exception will be thrown.
+     *
+     * @param statusId The id of the status. Possible values are:1, 2, or 3.
+     * @param comment The <code>MapdustComment</code> object.
+     * @return The id of the bug object.
+     * @throws MapdustServiceHandlerException In the case of an error.
+     */
+    public Long changeBugStatus(Integer statusId, MapdustComment comment)
+            throws MapdustServiceHandlerException {
+        MapdustPostResponse postResponse = null;
+        /* validates statusId */
+        if (statusId == null) {
+            String errorMessage = "Invalid status id. The status id cannot ";
+            errorMessage += "be null!";
+            throw new MapdustServiceHandlerException(errorMessage);
+        }
+        /* validates comment */
+        if (comment == null) {
+            String errorMessage="Invalid comment. The comment cannot be null!";
+            throw new MapdustServiceHandlerException(errorMessage);
+        }
+        /* executes changeBugStatus MapDust method */
+        try {
+            postResponse = connector.changeBugStatus(statusId, comment);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustServiceHandlerException(e.getMessage(), e);
+        }
+        /* get the id */
+        Long id = null;
+        if (postResponse != null) {
+            id = postResponse.getId();
+        }
+        return id;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/MapdustServiceHandlerException.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/MapdustServiceHandlerException.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/MapdustServiceHandlerException.java	(revision 24514)
@@ -0,0 +1,78 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service;
+
+
+/**
+ * Defines the exception type for <code>MapdustServiceHandler</code> object.
+ * 
+ * @author Bea
+ */
+public class MapdustServiceHandlerException extends Exception {
+    
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+    
+    /**
+     * Builds an empty <code>MapdustServiceHandlerException</code> object.
+     */
+    public MapdustServiceHandlerException() {
+        super();
+    }
+    
+    /**
+     * Builds a <code>MapdustServiceHandlerException</code> object based on the
+     * given argument.
+     * 
+     * @param message The message of the exception.
+     */
+    public MapdustServiceHandlerException(String message) {
+        super(message);
+    }
+    
+    /**
+     * Builds a <code>MapdustServiceHandlerException</code> object based on the
+     * given argument.
+     * 
+     * @param cause The cause of the exception.
+     */
+    public MapdustServiceHandlerException(Throwable cause) {
+        super(cause);
+    }
+    
+    /**
+     * Builds a <code>MapdustServiceHandlerException</code> object based on the
+     * given arguments.
+     * 
+     * @param message The message of the exception.
+     * @param cause The cause of the exception.
+     */
+    public MapdustServiceHandlerException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnector.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnector.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnector.java	(revision 24514)
@@ -0,0 +1,566 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector;
+
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugsResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustPostResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.parser.MapdustParser;
+import org.openstreetmap.josm.plugins.mapdust.service.parser.MapdustParserException;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustResponseStatusCode;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Paging;
+import org.openstreetmap.josm.plugins.mapdust.util.Configuration;
+import org.openstreetmap.josm.plugins.mapdust.util.http.HttpConnector;
+import org.openstreetmap.josm.plugins.mapdust.util.http.HttpResponse;
+import org.openstreetmap.josm.plugins.mapdust.util.retry.RetrySetup;
+
+
+/**
+ * The <code>MapdustConnector</code> object. Connects to the Mapdust service,
+ * and executes the following Mapdust service methods: getBug, getBugs, addBug,
+ * commentBug and changeBugStatus.
+ *
+ * @author Bea
+ */
+public class MapdustConnector {
+
+    /** The <code>HttpConnector</code> object */
+    private final HttpConnector httpConnector;
+
+    /** The <code>MapdustParser</code> object */
+    private final MapdustParser parser;
+
+    /**
+     * Builds a <code>MapdustConnector</code> object with the default settings.
+     */
+    public MapdustConnector() {
+        httpConnector = new HttpConnector(RetrySetup.DEFAULT);
+        parser = new MapdustParser();
+    }
+
+    /**
+     * Builds a <code>MapdustConnector</code> object based on the given
+     * arguments.
+     *
+     * @param httpConnector The <code>HttpConnector</code> object.
+     * @param parser The <code>MapdustParser</code> object.
+     */
+    public MapdustConnector(HttpConnector httpConnector, MapdustParser parser) {
+        this.httpConnector = httpConnector;
+        this.parser = parser;
+    }
+
+    /**
+     * Searches for the OSM Mapdust bugs in the given bounding box. The method
+     * executes the 'getBugs' Mapdust service method, parses the obtained
+     * response object and return a <code>MapdustGetBugsResponse</code> object
+     * containing the pagination information and the array of bugs. In the case
+     * if the response code is not 200,201 or 204, a corresponding exception
+     * will be thrown.
+     *
+     * @param minLon The minimum longitude. This parameter is required.
+     * @param minLat The minimum latitude.This parameter is required.
+     * @param maxLon The maximum longitude.This parameter is required.
+     * @param maxLat The maximum latitude.This parameter is required.
+     * @return A <code>MapdustGetBugsResponse</code> object, containing the
+     * pagination information and an array of <code>MapdustBugContent</code>
+     * object.
+     * @throws MapdustConnectorException In the case of an error.
+     */
+    public MapdustGetBugsResponse getBugs(Double minLon, Double minLat,
+            Double maxLon, Double maxLat) throws MapdustConnectorException {
+        /* execute GET method and get the response */
+        HttpResponse httpResponse = null;
+        try {
+            httpResponse = executeGetBugs(minLon, minLat, maxLon, maxLat);
+        } catch (MalformedURLException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (IOException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (Exception e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+
+        /* parse HttpResponse */
+        MapdustGetBugsResponse result = null;
+        try {
+            /* verify status codes */
+            handleStatusCode(httpResponse);
+            result =(MapdustGetBugsResponse) getParser().parseResponse(
+                            httpResponse.getContent(),
+                            MapdustGetBugsResponse.class);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (MapdustParserException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+        return result;
+    }
+
+    /**
+     * Returns the OSM bug with the given id. If the <code>Paging</code> object
+     * is set, then the comments of the bug will be paginated. The method
+     * executes the 'getBug' Mapdust service method, parses the obtained
+     * response object and return a <code>MapdustGetBugResponse</code> object.
+     * In the case if the response code is not 2
+     *
+     * @param id The id of the object
+     * @param paging The <code>Paging</code> object
+     * @return A <code>MapdustGetBugResponse</code> object.
+     *
+     * @throws MapdustConnectorException In the case of an error.
+     */
+    public MapdustGetBugResponse getBug(Long id, Paging paging)
+            throws MapdustConnectorException {
+        HttpResponse httpResponse = null;
+        try {
+            httpResponse = executeGetBug(id, paging);
+        } catch (MalformedURLException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (IOException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (Exception e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+
+        /* parse result */
+        MapdustGetBugResponse result = null;
+        try {
+            handleStatusCode(httpResponse);
+            result =(MapdustGetBugResponse) parser.parseResponse(
+                            httpResponse.getContent(),
+                            MapdustGetBugResponse.class);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (MapdustParserException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+        return result;
+    }
+
+    /**
+     * Creates a new OSM bug with the specified arguments. The method executes
+     * the 'addBug' Mapdust service method, parses the obtained response object
+     * and return a <code>MapdustPostResponse</code> object containing the id of
+     * the created comment. In the case if the response code is not 200,201 or
+     * 204, a corresponding exception will be thrown.
+     *
+     * @param bug A <code>MapdustBug</code> object
+     * @return A <code>MapdustPostResponse</code> object which contains the id
+     * of the created object.
+     *
+     * @throws MapdustConnectorException In the case of an error
+     */
+    public MapdustPostResponse addBug(MapdustBug bug)
+            throws MapdustConnectorException {
+        HttpResponse httpResponse = null;
+        try {
+            httpResponse = executeAddBug(bug);
+        } catch (MalformedURLException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (IOException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (Exception e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+
+        /* parse result */
+        MapdustPostResponse result = null;
+        try {
+            handleStatusCode(httpResponse);
+            result =(MapdustPostResponse) parser.parseResponse(
+                            httpResponse.getContent(),
+                            MapdustPostResponse.class);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (MapdustParserException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+        return result;
+    }
+
+    /**
+     * Creates a new comment for the given bug. The method executes the
+     * 'commentBug' Mapdust service method, parses the obtained response object
+     * and return a <code>MapdustPostResponse</code> object containing the id of
+     * the created comment. In the case if the response code is not 200,201 or
+     * 204, a corresponding exception will be thrown.
+     *
+     * @param comment A <code>MapdustComment</code> object
+     * @return A <code>MapdustPostResponse</code> object which contains the id
+     * of the created object.
+     * @throws MapdustConnectorException In the case of an error
+     */
+    public MapdustPostResponse commentBug(MapdustComment comment)
+            throws MapdustConnectorException {
+        HttpResponse httpResponse = null;
+        try {
+            httpResponse = executeCommentBug(comment);
+        } catch (MalformedURLException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (IOException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (Exception e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+
+        /* parse result */
+        MapdustPostResponse result = null;
+        try {
+            handleStatusCode(httpResponse);
+            result = (MapdustPostResponse) parser.parseResponse(
+                            httpResponse.getContent(),
+                            MapdustPostResponse.class);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (MapdustParserException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+        return result;
+    }
+
+    /**
+     * Changes the status of a given bug. The method executes the
+     * 'changeBugStatus' Mapdust service method, parses the obtained response
+     * object and return a <code>MapdustPostResponse</code> object containing
+     * the id of the created comment. In the case if the response code is not
+     * 200,201 or 204, a corresponding exception will be thrown.
+     *
+     * @param statusId The new value for the status. Possible values are: 1, 2
+     * or 3.
+     * @param comment A <code>MapdustComment</code> object
+     * @return A <code>MapdustPostResponse</code> object which contains the id
+     * of the created object.
+     * @throws MapdustConnectorException In the case of an error
+     */
+    public MapdustPostResponse changeBugStatus(Integer statusId,
+            MapdustComment comment) throws MapdustConnectorException {
+        HttpResponse httpResponse = null;
+        try {
+            httpResponse = executeChangeBugStatus(statusId, comment);
+        } catch (MalformedURLException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (IOException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (Exception e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+        /* parse result */
+        MapdustPostResponse result = null;
+        try {
+            handleStatusCode(httpResponse);
+            result = (MapdustPostResponse) parser.parseResponse(
+                    httpResponse.getContent(), MapdustPostResponse.class);
+        } catch (MapdustConnectorException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        } catch (MapdustParserException e) {
+            throw new MapdustConnectorException(e.getMessage(), e);
+        }
+        return result;
+    }
+
+    /**
+     * Executes the 'getBugs' Mapdust service method.
+     *
+     * @param minLon The minimum longitude. This parameter is required.
+     * @param minLat The minimum latitude.This parameter is required.
+     * @param maxLon The maximum longitude.This parameter is required.
+     * @param maxLat The maximum latitude.This parameter is required.
+     *
+     * @return A <code>HttpResponse</code> object containing the JSON response.
+     * @throws MalformedURLException In the case if the format of the URL is
+     * invalid
+     * @throws IOException In the case of an IO error
+     */
+    private HttpResponse executeGetBugs(Double minLon, Double minLat,
+            Double maxLon, Double maxLat) throws MalformedURLException,
+            IOException {
+        HttpResponse httpResponse = null;
+        String mapdustUri = Configuration.getInstance().getMapdustUrl();
+        String mapdustApiKey = Configuration.getInstance().getMapdustKey();
+        String urlString = null;
+        if (mapdustUri != null && mapdustApiKey != null) {
+            urlString = mapdustUri;
+            urlString += "/getBugs?";
+            urlString += "key=" + mapdustApiKey;
+            urlString += "&bbox=" + minLon + "," + minLat + ",";
+            urlString += maxLon + "," + maxLat;
+        }
+        URL url = null;
+        if (urlString != null) {
+            url = new URL(urlString);
+            httpResponse = httpConnector.executeGET(url);
+
+        }
+        return httpResponse;
+    }
+
+    /**
+     * Executes the 'getBug' Mapdust service method.
+     *
+     * @param id The id of the object
+     * @param paging The <code>Paging</code> object
+     * @return A <code>HttpResponse</code> containing the JSON response of the
+     * Mapdust method.
+     *
+     * @throws MalformedURLException In the case if the format of the URL is
+     * invalid
+     * @throws IOException In the case of an IO error
+     */
+    private HttpResponse executeGetBug(Long id, Paging paging)
+            throws MalformedURLException, IOException {
+        HttpResponse httpResponse = null;
+        String mapdustUri = Configuration.getInstance().getMapdustUrl();
+        String mapdustApiKey = Configuration.getInstance().getMapdustKey();
+        String urlString = null;
+        if (mapdustUri != null && mapdustApiKey != null) {
+            urlString = mapdustUri;
+            urlString += "/getBug?";
+            urlString += "key=" + mapdustApiKey;
+            if (id != null) {
+                urlString += "&id=" + id;
+            }
+            if (paging != null && paging.getItems() != null
+                    && paging.getPage() != null) {
+                urlString += "&items=" + paging.getItems();
+                urlString += "&p=" + paging.getPage();
+            }
+        }
+        URL url = null;
+        if (urlString != null) {
+            url = new URL(urlString);
+            httpResponse = httpConnector.executeGET(url);
+
+        }
+        return httpResponse;
+    }
+
+    /**
+     * Executes the 'addBug' Mapdust service method.
+     *
+     * @param bug A <code>MapdustBug</code> object
+     * @return A <code>HttpResponse</code> containing the JSON response of the
+     * Mapdust method.
+     *
+     * @throws MalformedURLException In the case if the format of the URL is
+     * invalid
+     * @throws IOException In the case of an IO error
+     */
+    private HttpResponse executeAddBug(MapdustBug bug)
+            throws MalformedURLException, IOException {
+        HttpResponse httpResponse = null;
+        String mapdustUri = Configuration.getInstance().getMapdustUrl();
+        String mapdustApiKey = Configuration.getInstance().getMapdustKey();
+        String urlString = null;
+        Map<String, String> requestParameters = new HashMap<String, String>();
+        if (mapdustUri != null && mapdustApiKey != null) {
+            urlString = mapdustUri;
+            urlString += "/addBug";
+            requestParameters.put("key", mapdustApiKey);
+            String coordinatesStr =
+                    bug.getLatLon().getX() + "," + bug.getLatLon().getY();
+            requestParameters.put("coordinates", coordinatesStr);
+            requestParameters.put("type", bug.getType().getKey());
+            requestParameters.put("description", bug.getDescription());
+            requestParameters.put("nickname", bug.getNickname());
+        }
+        URL url = null;
+        if (urlString != null) {
+            url = new URL(urlString);
+            httpResponse = httpConnector.executePOST(url, null,
+                    requestParameters);
+
+        }
+        return httpResponse;
+    }
+
+    /**
+     * Executes the 'commentBug' Mapdust service method.
+     *
+     * @param comment The <code>MapdustComment</code> object
+     * @return A <code>HttpResponse</code> containing the JSON response of the
+     * Mapdust method.
+     * @throws MalformedURLException In the case if the format of the URL is
+     * invalid
+     * @throws IOException In the case of an IO error
+     */
+    private HttpResponse executeCommentBug(MapdustComment comment)
+            throws MalformedURLException, IOException {
+        HttpResponse httpResponse = null;
+        String mapdustUri = Configuration.getInstance().getMapdustUrl();
+        String mapdustApiKey = Configuration.getInstance().getMapdustKey();
+        String urlString = null;
+        Map<String, String> requestParameters = new HashMap<String, String>();
+        if (mapdustUri != null && mapdustApiKey != null) {
+            urlString = mapdustUri;
+            urlString += "/commentBug";
+            requestParameters.put("key", mapdustApiKey);
+            requestParameters.put("id", comment.getBugId().toString());
+            requestParameters.put("comment", comment.getCommentText());
+            requestParameters.put("nickname", comment.getNickname());
+        }
+        URL url = null;
+        if (urlString != null) {
+            url = new URL(urlString);
+            httpResponse = httpConnector.executePOST(url, null,
+                    requestParameters);
+
+        }
+        return httpResponse;
+    }
+
+    /**
+     * Executes the 'changeBugStatus' Mapdust service method.
+     *
+     * @param statusId The id of the status.
+     * @param comment A <code>MapdustComment</code> object.
+     * @return A <code>HttpResponse</code> containing the JSON response of the
+     * Mapdust method.
+     *
+     * @throws MalformedURLException In the case if the format of the URL is
+     * invalid
+     * @throws IOException In the case of an IO error
+     */
+    private HttpResponse executeChangeBugStatus(Integer statusId,
+            MapdustComment comment) throws MalformedURLException, IOException {
+        HttpResponse httpResponse = null;
+        String mapdustUri = Configuration.getInstance().getMapdustUrl();
+        String mapdustApiKey = Configuration.getInstance().getMapdustKey();
+        String urlString = null;
+        Map<String, String> requestParameters = new HashMap<String, String>();
+        if (mapdustUri != null && mapdustApiKey != null) {
+            urlString = mapdustUri;
+            urlString += "/changeBugStatus";
+            requestParameters.put("key", mapdustApiKey);
+            requestParameters.put("id", comment.getBugId().toString());
+            requestParameters.put("status", statusId.toString());
+            requestParameters.put("comment", comment.getCommentText());
+            requestParameters.put("nickname", comment.getNickname());
+        }
+        URL url = null;
+        if (urlString != null) {
+            url = new URL(urlString);
+            httpResponse = httpConnector.executePOST(url, null,
+                    requestParameters);
+
+        }
+        return httpResponse;
+    }
+
+    /**
+     * Handles the response codes of the given <code>HttpResponse</code> object.
+     * If the response code is 200, 201 or 204, the method returns without any
+     * exception. Otherwise a <code>MapdustConnectorException</code> will be
+     * thrown with an appropriate message.
+     *
+     * @param httpResponse The <code>HttpResponse</code> method.
+     * @throws MapdustConnectorException In the case if the status code is not
+     * 200, 201 or 204.
+     */
+    private void handleStatusCode(HttpResponse httpResponse)
+            throws MapdustConnectorException {
+        String errorMessage = "";
+        Integer statusCode = httpResponse.getStatusCode();
+        String statusMessage = httpResponse.getStatusMessage();
+        if (statusCode.equals(MapdustResponseStatusCode.Status200
+                .getStatusCode())
+                || statusCode.equals(MapdustResponseStatusCode.Status201
+                        .getStatusCode())
+                || statusCode.equals(MapdustResponseStatusCode.Status204
+                        .getStatusCode())) {
+            // no error
+            return;
+        }
+        switch (statusCode) {
+            case 400:
+                errorMessage = statusMessage + " ";
+                errorMessage+= MapdustResponseStatusCode.Status400.getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            case 401:
+                errorMessage = statusMessage+ " ";
+                errorMessage+= MapdustResponseStatusCode.Status401.getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            case 403:
+                errorMessage = statusMessage   + " ";
+                errorMessage+= MapdustResponseStatusCode.Status403
+                                        .getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            case 404:
+                errorMessage = statusMessage+ " ";
+                errorMessage+=MapdustResponseStatusCode.Status404
+                                        .getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            case 405:
+                errorMessage = statusMessage+ " ";
+                errorMessage+= MapdustResponseStatusCode.Status405
+                                        .getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            case 500:
+                errorMessage = statusMessage  + " ";
+                errorMessage+=MapdustResponseStatusCode.Status500
+                                        .getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            case 601:
+                errorMessage = statusMessage  + " ";
+                errorMessage+=MapdustResponseStatusCode.Status601
+                                        .getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            case 602:
+                errorMessage = statusMessage+ " ";
+                errorMessage+= MapdustResponseStatusCode.Status602
+                                        .getDescription();
+                throw new MapdustConnectorException(errorMessage);
+            default:
+                throw new MapdustConnectorException(
+                        MapdustResponseStatusCode.Status.getDescription());
+        }
+    }
+
+    /**
+     * @return the httpConnector
+     */
+    public HttpConnector getHttpConnector() {
+        return httpConnector;
+    }
+
+    /**
+     * @return the parser
+     */
+    public MapdustParser getParser() {
+        return parser;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnectorException.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnectorException.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/MapdustConnectorException.java	(revision 24514)
@@ -0,0 +1,80 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector;
+
+
+/**
+ * Defines the exception type for the <code>MapdustConnector</code> object.
+ * 
+ * @author Bea
+ * 
+ */
+public class MapdustConnectorException extends Exception {
+    
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+    
+    /**
+     * Builds a <code>MapdustConnectorException</code> object.
+     */
+    public MapdustConnectorException() {
+        super();
+    }
+    
+    /**
+     * Builds a <code>MapdustConnectorException</code> object based on the given
+     * argument.
+     * 
+     * @param message The message of the exception
+     */
+    public MapdustConnectorException(String message) {
+        super(message);
+    }
+    
+    /**
+     * Builds a <code>MapdustConnectorException</code> object based on the given
+     * argument.
+     * 
+     * @param cause The cause of the exception
+     */
+    public MapdustConnectorException(Throwable cause) {
+        super(cause);
+    }
+    
+    /**
+     * Builds a <code>MapdustConnectorException</code> object based on the given
+     * arguments.
+     * 
+     * @param message The message of the exception
+     * @param cause The cause of the exception
+     */
+    public MapdustConnectorException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * contains the http connector
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/GeneralContent.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/GeneralContent.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/GeneralContent.java	(revision 24514)
@@ -0,0 +1,73 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+/**
+ * Defines a general content, containing a given id.
+ *
+ * @author Bea
+ *
+ */
+public class GeneralContent {
+
+    /** The id */
+    private Long id;
+
+    /**
+     * Builds a <code>GeneralContent</code> object.
+     */
+    public GeneralContent() {}
+
+    /**
+     * Builds a <code>GeneralContent</code> object.
+     *
+     * @param id The id of the object
+     */
+    public GeneralContent(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * Returns the id
+     * @return the id
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * Sets the id
+     *
+     * @param id the id to set
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/Geometry.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/Geometry.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/Geometry.java	(revision 24514)
@@ -0,0 +1,74 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+/**
+ * Defines the attributes of the geometry object.
+ *
+ * @author Bea
+ *
+ */
+public class Geometry {
+
+    /** The array of coordinates */
+    private Double coordinates[];
+
+    /**
+     * Builds a <code>Geometry</code> object
+     */
+    public Geometry() {}
+
+    /**
+     * Builds a <code>Geometry</code> object
+     *
+     * @param coordinates An array of coordinates.
+     */
+    public Geometry(Double[] coordinates) {
+        this.coordinates = coordinates;
+    }
+
+    /**
+     * Returns the coordinates
+     *
+     * @return the coordinates
+     */
+    public Double[] getCoordinates() {
+        return coordinates;
+    }
+
+    /**
+     * Returns the coordinates
+     *
+     * @param coordinates the coordinates to set
+     */
+    public void setCoordinates(Double[] coordinates) {
+        this.coordinates = coordinates;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugContent.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugContent.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugContent.java	(revision 24514)
@@ -0,0 +1,99 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+/**
+ * Defines the attributes of the <code>MapdustBugContent</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustBugContent extends GeneralContent {
+
+    /** The <code>Geometry</code> object */
+    private Geometry geometry;
+
+    /** The <code>MapdustBugProperties</code> object */
+    private MapdustBugProperties properties;
+
+    /**
+     * Builds a <code>MapdustBugContent</code> object.
+     *
+     */
+    public MapdustBugContent() {}
+
+    /**
+     * Builds a <code>MapdustBugContent</code> object based on the given
+     * arguments.
+     *
+     * @param geometry A <code>Geometry</code> object
+     * @param properties A <code>MapdustBugProperties</code> object
+     */
+    public MapdustBugContent(Geometry geometry, MapdustBugProperties properties) {
+        this.geometry = geometry;
+        this.properties = properties;
+    }
+
+    /**
+     * Returns the geometry
+     *
+     * @return the geometry
+     */
+    public Geometry getGeometry() {
+        return geometry;
+    }
+
+    /**
+     * Sets the geometry
+     *
+     * @param geometry the geometry to set
+     */
+    public void setGeometry(Geometry geometry) {
+        this.geometry = geometry;
+    }
+
+    /**
+     * Returns the MapDust bug properties
+     *
+     * @return the properties
+     */
+    public MapdustBugProperties getProperties() {
+        return properties;
+    }
+
+    /**
+     * Sets the MapDust bug properties
+     *
+     * @param properties the properties to set
+     */
+    public void setProperties(MapdustBugProperties properties) {
+        this.properties = properties;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugProperties.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugProperties.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustBugProperties.java	(revision 24514)
@@ -0,0 +1,357 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+import java.util.Date;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Address;
+
+
+/**
+ * Defines the attributes of the <code>MapdustBugProperties</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustBugProperties {
+
+    /** The creation date */
+    private Date dateCreated;
+
+    /** The update date */
+    private Date dateUpdated;
+
+    /** The status of the bug */
+    private Integer status;
+
+    /** The type of the bug */
+    private String type;
+
+    /** The description of the bug */
+    private String description;
+
+    /** The nickname of the bug */
+    private String nickname;
+
+    /** The skobbler user id */
+    private String skoUid;
+
+    /** The external user id */
+    private String extUid;
+
+    /** The source of the bug */
+    private String source;
+
+    /** The url of the kml */
+    private String kmlUrl;
+
+    /** The address of the bug */
+    private Address address;
+
+    /** The number of comments */
+    private Integer numberOfComments;
+
+    /** The bug comments */
+    private MapdustCommentProperties[] comments;
+
+    /**
+     * Builds a <code>MapdustBugProperties</code> object.
+     */
+    public MapdustBugProperties() {}
+
+    /**
+     * Builds a <code>MapdustBugProperties</code> object.
+     *
+     * @param dateCreated The creation date
+     * @param dateUpdated The update date
+     * @param status The status of the bug
+     * @param type The type of the bug
+     * @param description The description of the bug
+     * @param nickname The nickname
+     * @param skoUid The skobbler user id
+     * @param extUid The external user id
+     * @param source The source of the bug
+     * @param kmlUrl The URL of the KML
+     * @param address The address of the object
+     * @param numberOfComments The number of comments
+     * @param comments The array of comments
+     */
+    public MapdustBugProperties(Date dateCreated, Date dateUpdated,
+            Integer status, String type, String description, String nickname,
+            String skoUid, String extUid, String source, String kmlUrl,
+            Address address, Integer numberOfComments,
+            MapdustCommentProperties[] comments) {
+        this.dateCreated = dateCreated;
+        this.dateUpdated = dateUpdated;
+        this.status = status;
+        this.type = type;
+        this.description = description;
+        this.nickname = nickname;
+        this.skoUid = skoUid;
+        this.extUid = extUid;
+        this.source = source;
+        this.kmlUrl = kmlUrl;
+        this.address = address;
+        this.numberOfComments = numberOfComments;
+        this.comments = comments;
+    }
+
+    /**
+     * Returns the date created
+     *
+     * @return the dateCreated
+     */
+    public Date getDateCreated() {
+        return dateCreated;
+    }
+
+    /**
+     * Sets the date created
+     *
+     * @param dateCreated the dateCreated to set
+     */
+    public void setDateCreated(Date dateCreated) {
+        this.dateCreated = dateCreated;
+    }
+
+    /**
+     * Returns the date updated
+     *
+     * @return the dateUpdated
+     */
+    public Date getDateUpdated() {
+        return dateUpdated;
+    }
+
+    /**
+     * Sets the date updated
+     *
+     * @param dateUpdated the dateUpdated to set
+     */
+    public void setDateUpdated(Date dateUpdated) {
+        this.dateUpdated = dateUpdated;
+    }
+
+    /**
+     * Returns the status id
+     *
+     * @return the status
+     */
+    public Integer getStatus() {
+        return status;
+    }
+
+    /**
+     * Sets the status id
+     *
+     * @param status the status to set
+     */
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    /**
+     * Returns the type
+     *
+     * @return the type
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the type
+     *
+     * @param type the type to set
+     */
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    /**
+     * Returns the description
+     *
+     * @return the description
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the description
+     *
+     * @param description the description to set
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * Returns the nickname
+     *
+     * @return the nickname
+     */
+    public String getNickname() {
+        return nickname;
+    }
+
+    /**
+     * Sets the nickname
+     *
+     * @param nickname the nickname to set
+     */
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    /**
+     * Returns the skobbler user id
+     *
+     * @return the skoUid
+     */
+    public String getSkoUid() {
+        return skoUid;
+    }
+
+    /**
+     * Sets the skobbler user id
+     *
+     * @param skoUid the skoUid to set
+     */
+    public void setSkoUid(String skoUid) {
+        this.skoUid = skoUid;
+    }
+
+    /**
+     * Returns the external user id
+     *
+     * @return the extUid
+     */
+    public String getExtUid() {
+        return extUid;
+    }
+
+    /**
+     * Sets the external user id
+     *
+     * @param extUid the erxtUid to set
+     */
+    public void setExtUid(String extUid) {
+        this.extUid = extUid;
+    }
+
+    /**
+     * Returns the source
+     *
+     * @return the source
+     */
+    public String getSource() {
+        return source;
+    }
+
+    /**
+     * Sets the source
+     *
+     * @param source the source to set
+     */
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+    /**
+     * Returns the kml URL
+     *
+     * @return the kmlUrl
+     */
+    public String getKmlUrl() {
+        return kmlUrl;
+    }
+
+    /**
+     * Sets the kml URL
+     *
+     * @param kmlUrl the kmlUrl to set
+     */
+    public void setKmlUrl(String kmlUrl) {
+        this.kmlUrl = kmlUrl;
+    }
+
+    /**
+     * Returns the address
+     *
+     * @return the address
+     */
+    public Address getAddress() {
+        return address;
+    }
+
+    /**
+     * Sets the address
+     *
+     * @param address the address to set
+     */
+    public void setAddress(Address address) {
+        this.address = address;
+    }
+
+    /**
+     * Returns the number of the comments
+     *
+     * @return the numberOfComments
+     */
+    public Integer getNumberOfComments() {
+        return numberOfComments;
+    }
+
+    /**
+     * Sets the number of the comments
+     *
+     * @param numberOfComments the numberOfComments to set
+     */
+    public void setNumberOfComments(Integer numberOfComments) {
+        this.numberOfComments = numberOfComments;
+    }
+
+    /**
+     * Returns the comments
+     *
+     * @return the comments
+     */
+    public MapdustCommentProperties[] getComments() {
+        return comments;
+    }
+
+    /**
+     * Sets the comments
+     *
+     * @param comments the comments to set
+     */
+    public void setComments(MapdustCommentProperties[] comments) {
+        this.comments = comments;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustCommentProperties.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustCommentProperties.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustCommentProperties.java	(revision 24514)
@@ -0,0 +1,191 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+import java.util.Date;
+
+
+/**
+ * Defines the attributes of the <code>MapdustCommentProperties</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustCommentProperties {
+
+    /** The date created */
+    private Date dateCreated;
+
+    /** The comment text */
+    private String comment;
+
+    /** The nickname */
+    private String nickname;
+
+    /** The skobbler user id */
+    private String skoUid;
+
+    /** The external user id */
+    private String extUid;
+
+    /** The source */
+    private String source;
+
+    /**
+     * Builds a <code>MapdustCommentProperties</code> object
+     */
+    public MapdustCommentProperties() {}
+
+    /**
+     * Builds a <code>MapdustCommentProperties</code> object
+     *
+     * @param dateCreated The date of creation
+     * @param comment The text of the comment
+     * @param nickname The nickname of the user
+     * @param skoUid The skobbler user id of the user
+     * @param extUid The external user id of the user
+     * @param source The source of the user
+     */
+    public MapdustCommentProperties(Date dateCreated, String comment,
+            String nickname, String skoUid, String extUid, String source) {
+        this.dateCreated = dateCreated;
+        this.comment = comment;
+        this.nickname = nickname;
+        this.skoUid = skoUid;
+        this.extUid = extUid;
+        this.source = source;
+    }
+
+    /**
+     * Returns the date created
+     *
+     * @return the dateCreated
+     */
+    public Date getDateCreated() {
+        return dateCreated;
+    }
+
+    /**
+     * Sets the date created
+     *
+     * @param dateCreated the dateCreated to set
+     */
+    public void setDateCreated(Date dateCreated) {
+        this.dateCreated = dateCreated;
+    }
+
+    /**
+     * Returns the comment text
+     *
+     * @return the comment
+     */
+    public String getComment() {
+        return comment;
+    }
+
+    /**
+     * Sets the comment text
+     *
+     * @param comment the comment to set
+     */
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+
+    /**
+     * Returns the nickname
+     *
+     * @return the nickname
+     */
+    public String getNickname() {
+        return nickname;
+    }
+
+    /**
+     * Sets the nickname
+     *
+     * @param nickname the nickname to set
+     */
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    /**
+     * Returns the skobbler user id
+     *
+     * @return the skoUid
+     */
+    public String getSkoUid() {
+        return skoUid;
+    }
+
+    /**
+     * Sets the skobbler user id
+     *
+     * @param skoUid the skoUid to set
+     */
+    public void setSkoUid(String skoUid) {
+        this.skoUid = skoUid;
+    }
+
+    /**
+     * Returns the external user id
+     *
+     * @return the extUid
+     */
+    public String getExtUid() {
+        return extUid;
+    }
+
+    /**
+     * Sets the external user id
+     *
+     * @param extUid the extUid to set
+     */
+    public void setExtUid(String extUid) {
+        this.extUid = extUid;
+    }
+
+    /**
+     * Returns the source
+     *
+     * @return the source
+     */
+    public String getSource() {
+        return source;
+    }
+
+    /**
+     * Sets the source
+     *
+     * @param source the source to set
+     */
+    public void setSource(String source) {
+        this.source = source;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugResponse.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugResponse.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugResponse.java	(revision 24514)
@@ -0,0 +1,122 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+/**
+ * Represents the response of the 'getBug' method . This object is used for
+ * building the response from a JSON format.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustGetBugResponse {
+
+    /** The <code>Geometry</code> object */
+    private Geometry geometry;
+
+    /** The id */
+    private Long id;
+
+    /** The <code>MapdustBugProprties</code> object */
+    private MapdustBugProperties properties;
+
+    /**
+     * Builds a <code>MapdustGetBugResponse</code> object
+     */
+    public MapdustGetBugResponse() {}
+
+    /**
+     * Builds a <code>MapdustGetBugResponse</code> object
+     *
+     * @param geometry The <code>Geometry</code object
+     * @param id The id of the object
+     * @param properties The <code>MapdustBugProperties</code> object
+     */
+    public MapdustGetBugResponse(Geometry geometry, Long id,
+            MapdustBugProperties properties) {
+        this.geometry = geometry;
+        this.id = id;
+        this.properties = properties;
+    }
+
+    /**
+     * Returns the <code>Geometry</code> object
+     *
+     * @return the geometry
+     */
+    public Geometry getGeometry() {
+        return geometry;
+    }
+
+    /**
+     * Sets the <code>Geometry</code> object
+     *
+     * @param geometry the geometry to set
+     */
+    public void setGeometry(Geometry geometry) {
+        this.geometry = geometry;
+    }
+
+    /**
+     * Returns the id
+     *
+     * @return the id
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * Sets the id
+     *
+     * @param id the id to set
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * Returns the <code>MapdustBugProperties</code> properties
+     *
+     * @return the properties
+     */
+    public MapdustBugProperties getProperties() {
+        return properties;
+    }
+
+    /**
+     * Sets the <code>MapdustBugProperties</code> object
+     *
+     * @param properties the properties to set
+     */
+    public void setProperties(MapdustBugProperties properties) {
+        this.properties = properties;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugsResponse.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugsResponse.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetBugsResponse.java	(revision 24514)
@@ -0,0 +1,76 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+/**
+ * Represents the response of the 'getBugs' method . This object is used for
+ * building the response from a JSON format.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustGetBugsResponse  {
+
+    /** The array of <code>MapdustBugContent</code> object */
+    private MapdustBugContent[] features;
+
+    /**
+     * Builds a <code>MapdustGetBugsResponse</code> object.
+     */
+    public MapdustGetBugsResponse() {}
+
+    /**
+     * Builds a <code>MapdustGetBugsResponse</code> object.
+     *
+     * @param features An array of <code>MapdustBugContent</code> object
+     */
+    public MapdustGetBugsResponse(MapdustBugContent[] features) {
+        this.features = features;
+    }
+
+    /**
+     * Returns the array of <code>MapdustBugContent</code> objects
+     *
+     * @return the features
+     */
+    public MapdustBugContent[] getFeatures() {
+        return features;
+    }
+
+    /**
+     * Sets the array of <code>MapdustBugContent</code> objects
+     *
+     * @param features the features to set
+     */
+    public void setFeatures(MapdustBugContent[] features) {
+        this.features = features;
+    }
+
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetResponse.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetResponse.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustGetResponse.java	(revision 24514)
@@ -0,0 +1,75 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+import org.openstreetmap.josm.plugins.mapdust.service.value.Paging;
+
+
+/**
+ * Represents a general response for the "GET" http method.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustGetResponse  {
+
+    /**
+     * The <code>Paging</code> object
+     */
+    private Paging paging;
+
+    /**
+     * Builds a <code>MapdustGetResponse</code> object
+     */
+    public MapdustGetResponse() {}
+
+    /**
+     * Builds a <code>MapdustGetResponse</code> object
+     *
+     * @param paging A <code>Paging</code> object
+     */
+    public MapdustGetResponse(Paging paging) {
+        this.paging = paging;
+    }
+
+    /**
+     * @return the paging
+     */
+    public Paging getPaging() {
+        return paging;
+    }
+
+    /**
+     * @param paging the paging to set
+     */
+    public void setPaging(Paging paging) {
+        this.paging = paging;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustPostResponse.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustPostResponse.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/MapdustPostResponse.java	(revision 24514)
@@ -0,0 +1,75 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
+
+
+/**
+ * Represents a response object for the HTTP POST method.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustPostResponse {
+
+    /** The id */
+    private Long id;
+
+    /**
+     * Builds a <code>MapdustPostResponse</code> object.
+     */
+    public MapdustPostResponse() {
+
+    }
+
+    /**
+     * Builds a <code>MapdustPostResponse</code> object.
+     *
+     * @param id The id of the object
+     */
+    public MapdustPostResponse(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * Returns the id
+     *
+     * @return the id
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * Sets the id
+     *
+     * @param id the id to set
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/connector/response/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * contains the response objects
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.connector.response;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/converter/MapdustConverter.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/converter/MapdustConverter.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/converter/MapdustConverter.java	(revision 24514)
@@ -0,0 +1,253 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.converter;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.Geometry;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustBugContent;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustBugProperties;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustCommentProperties;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.connector.response.MapdustGetBugsResponse;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
+import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustComment;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Status;
+import org.openstreetmap.josm.plugins.mapdust.service.value.Type;
+
+
+/**
+ * The <code>MapdustConverter</code> object. Builds a MapdustBug, list of
+ * MapdustBug based on the given response object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustConverter {
+
+    /**
+     * Builds a <code>MapdustBug</code> object from the given
+     * <code>MapdustGetBugResponse</code> object.
+     *
+     * @param bugResponse A <code>MapdustGetBugResponse</code> object.
+     * @return A <code>MapdustBug</code> object.
+     */
+    public static MapdustBug buildMapdustBug(MapdustGetBugResponse bugResponse) {
+        MapdustBug bug = new MapdustBug();
+        if (bugResponse != null) {
+            /* sets the id */
+            bug.setId(bugResponse.getId());
+
+            /* sets the coordinates */
+            Geometry geometry = bugResponse.getGeometry();
+            LatLon latLon = null;
+            if (geometry != null && geometry.getCoordinates() != null
+                    && geometry.getCoordinates().length == 2) {
+                Double longitude = geometry.getCoordinates()[0];
+                Double latitude = geometry.getCoordinates()[1];
+                latLon = new LatLon(latitude, longitude);
+            }
+            bug.setLatLon(latLon);
+
+            /* sets the properties of the bug */
+            MapdustBugProperties bugProperties = bugResponse.getProperties();
+            if (bugProperties != null) {
+                /* sets the address */
+                bug.setAddress(bugProperties.getAddress());
+                /* sets the status */
+                Status status = Status.getStatus(bugProperties.getStatus());
+                bug.setStatus(status);
+                /* sets the type */
+                Type type = Type.getType(bugProperties.getType());
+                bug.setType(type);
+                /* sets the creation date */
+                bug.setDateCreated(bugProperties.getDateCreated());
+                /* sets the update date */
+                bug.setDateUpdated(bugProperties.getDateUpdated());
+                /* sets the description */
+                bug.setDescription(bugProperties.getDescription());
+                /* sets the skobbler user id */
+                bug.setSkoUid(bugProperties.getSkoUid());
+                /* sets the external user id */
+                bug.setExtUid(bugProperties.getExtUid());
+                /* sets the nickname */
+                bug.setNickname(bugProperties.getNickname());
+                /* sets the source */
+                bug.setSource(bugProperties.getSource());
+                /* sets the kml url */
+                bug.setKmlUrl(bugProperties.getKmlUrl());
+                /* sets the number of comments */
+                bug.setNumberOfComments(bugProperties.getNumberOfComments());
+                /* sets the comments */
+                MapdustCommentProperties[] commentProperties =
+                        bugProperties.getComments();
+                MapdustComment[] commentArray =
+                        buildMapdustCommentArray(bug.getId(), commentProperties);
+                bug.setComments(commentArray);
+            }
+        }
+        return bug;
+    }
+
+    /**
+     * Builds a list of <code>MapdustBug</code> objects based on the given
+     * <code>MapdustGetBugsResponse</code> object.
+     *
+     * @param bugsResponse A <code>MapdustGetBugsResponse</code> object
+     * @return A list of <code>MapdustBug</code> objects
+     */
+    public static List<MapdustBug> buildMapdustBugList(
+            MapdustGetBugsResponse bugsResponse) {
+        List<MapdustBug> bugsList = new ArrayList<MapdustBug>();
+        if (bugsResponse != null) {
+            MapdustBugContent[] bugContent = bugsResponse.getFeatures();
+            if (bugContent != null) {
+                for (MapdustBugContent obj : bugContent) {
+                    MapdustBug bug = buildMapdustBug(obj);
+                    bugsList.add(bug);
+                }
+            }
+        }
+        return bugsList;
+    }
+
+    /**
+     * Builds a <code>MapdustBug</code> object from the given
+     * <code>MapdustBugContent</code> object.
+     *
+     * @param bugContent A <code>MapdustBugContent</code> object
+     * @return A <code>MapdustBug</code> object.
+     */
+    private static MapdustBug buildMapdustBug(MapdustBugContent bugContent) {
+        MapdustBug bug = new MapdustBug();
+        if (bugContent != null) {
+            /* set the id */
+            bug.setId(bugContent.getId());
+            /* set the coordinates */
+            Geometry geometry = bugContent.getGeometry();
+            LatLon latLon = null;
+            if (geometry != null && geometry.getCoordinates() != null
+                    && geometry.getCoordinates().length == 2) {
+                Double longitude = geometry.getCoordinates()[0];
+                Double latitude = geometry.getCoordinates()[1];
+                latLon = new LatLon(latitude, longitude);
+            }
+            bug.setLatLon(latLon);
+            /* set the bug properties */
+            MapdustBugProperties bugProperties = bugContent.getProperties();
+            if (bugProperties != null) {
+                /* sets the address */
+                bug.setAddress(bugProperties.getAddress());
+                /* sets the status */
+                Status status = Status.getStatus(bugProperties.getStatus());
+                bug.setStatus(status);
+                /* sets the type */
+                Type type = Type.getType(bugProperties.getType());
+                bug.setType(type);
+                /* sets the creation date */
+                bug.setDateCreated(bugProperties.getDateCreated());
+                /* sets the update date */
+                bug.setDateUpdated(bugProperties.getDateUpdated());
+                /* sets the description */
+                bug.setDescription(bugProperties.getDescription());
+                /* sets the skobbler user id */
+                bug.setSkoUid(bugProperties.getSkoUid());
+                /* sets the external user id */
+                bug.setExtUid(bugProperties.getExtUid());
+                /* sets the nickname */
+                bug.setNickname(bugProperties.getNickname());
+                /* sets the source */
+                bug.setSource(bugProperties.getSource());
+                /* sets the kml url */
+                bug.setKmlUrl(bugProperties.getKmlUrl());
+                /* sets the number of comments */
+                bug.setNumberOfComments(bugProperties.getNumberOfComments());
+                /* sets the comments */
+                MapdustCommentProperties[] commentProperties =
+                        bugProperties.getComments();
+                MapdustComment[] commentArray =
+                        buildMapdustCommentArray(bug.getId(), commentProperties);
+                bug.setComments(commentArray);
+            }
+        }
+        return bug;
+    }
+
+    /**
+     * Builds a <code>MapdustComment</code> object based on the given arguments.
+     *
+     * @param bugId The id of the bug
+     * @param commentProperties The <code>MapdustCommentProperties</code>
+     * object.
+     * @return A <code>MapdustComment</code> object
+     */
+    private static MapdustComment buildMapdustComment(Long bugId,
+            MapdustCommentProperties commentProperties) {
+        MapdustComment comment = new MapdustComment();
+        if (bugId != null) {
+            comment.setBugId(bugId);
+        }
+        if (commentProperties != null) {
+            comment.setDateCreated(commentProperties.getDateCreated());
+            comment.setCommentText(commentProperties.getComment());
+            comment.setExtUid(commentProperties.getExtUid());
+            comment.setNickname(commentProperties.getNickname());
+            comment.setSkoUid(commentProperties.getSkoUid());
+            comment.setSource(commentProperties.getSource());
+        }
+        return comment;
+    }
+
+    /**
+     * Builds an array of <code>MapdustComment</code> objects based on the given
+     * arguments.
+     *
+     * @param bugId the if of the bug
+     * @param commentProperties The array of
+     * <code>MapdusrCommentProperties</code> objects
+     * @return An array of <code>MapdustComment</code> object
+     */
+    private static MapdustComment[] buildMapdustCommentArray(Long bugId,
+            MapdustCommentProperties[] commentProperties) {
+        List<MapdustComment> commentList = new ArrayList<MapdustComment>();
+        if (bugId != null) {
+            if (commentProperties != null) {
+                for (MapdustCommentProperties obj : commentProperties) {
+                    MapdustComment comment = buildMapdustComment(bugId, obj);
+                    commentList.add(comment);
+                }
+            }
+        }
+        MapdustComment[] commentArray =
+                commentList.toArray(new MapdustComment[0]);
+        return commentArray;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/converter/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/converter/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/converter/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * contains the converter object
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.converter;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/package-info.java	(revision 24514)
@@ -0,0 +1,5 @@
+/**
+ * retrieves and sends data from/to the Mapdust api
+ * 
+ */
+package org.openstreetmap.josm.plugins.mapdust.service;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/MapdustParser.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/MapdustParser.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/MapdustParser.java	(revision 24514)
@@ -0,0 +1,72 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.parser;
+
+
+import com.google.gson.FieldNamingPolicy;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonParseException;
+
+
+/**
+ * The <code>MapdustParser</code> object parses the given JSON format into the
+ * given object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustParser {
+
+    /**
+     * Parses the given JSON response of the given type.
+     *
+     * @param response A string containing a JSON response
+     * @param responseClass The type of the result.
+     * @return A <code>MapdustGeneralResponse</code> object
+     * @throws MapdustParserException In the case of an error
+     */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    public Object parseResponse(String response,
+            Class responseClass) throws MapdustParserException {
+        Object result = null;
+        FieldNamingPolicy policy =
+                FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES;
+        GsonBuilder gsonBuilder = new GsonBuilder();
+        gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+        gsonBuilder.setFieldNamingPolicy(policy);
+        Gson gson = gsonBuilder.create();
+        try {
+            result = gson.fromJson(response, responseClass);
+        } catch (JsonParseException e) {
+            throw new MapdustParserException();
+        }
+        return result;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/MapdustParserException.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/MapdustParserException.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/MapdustParserException.java	(revision 24514)
@@ -0,0 +1,79 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.parser;
+
+
+/**
+ * Defines the exception for the <code>MapdustParser</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustParserException extends Exception {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Builds a <code>MapdustParserException</code> object.
+     */
+    public MapdustParserException() {
+        super();
+    }
+
+    /**
+     * Builds a <code>MapdustParserException</code> object based on the given
+     * arguments.
+     *
+     * @param message The message of the exception
+     */
+    public MapdustParserException(String message) {
+        super(message);
+    }
+
+    /**
+     * Builds a <code>MapdustParserException</code> object based on the given
+     * arguments.
+     *
+     * @param cause The cause of the exception
+     */
+    public MapdustParserException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Builds a <code>MapdustParserException</code> object based on the given
+     * arguments.
+     *
+     * @param message The message of the exception
+     * @param cause The cause of the exception
+     */
+    public MapdustParserException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/parser/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * contains the parses classes.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.parser;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Address.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Address.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Address.java	(revision 24514)
@@ -0,0 +1,230 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
+
+
+/**
+ * Defines the attributes of the <code>Address</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class Address {
+
+    /** The country code */
+    private String countryCode;
+
+    /** The city */
+    private String city;
+
+    /** The state code */
+    private String stateCode;
+
+    /** The ZIP code */
+    private String zipCode;
+
+    /** The street name */
+    private String streetName;
+
+    /** The house number */
+    private String houseNumber;
+
+    /**
+     * Builds a <code>Address</code> object.
+     */
+    public Address() {}
+
+    /**
+     * Builds a <code>Address</code> object based on the given arguments.
+     *
+     * @param countryCode The country code
+     * @param city The city
+     * @param stateCode The state code
+     * @param zipCode The ZIP code
+     * @param streetName The street name
+     * @param houseNumber The house number
+     */
+    public Address(String countryCode, String city, String stateCode,
+            String zipCode, String streetName, String houseNumber) {
+        this.countryCode = countryCode;
+        this.city = city;
+        this.stateCode = stateCode;
+        this.zipCode = zipCode;
+        this.streetName = streetName;
+        this.houseNumber = houseNumber;
+    }
+
+    /**
+     * Returns the country code
+     *
+     * @return the countryCode
+     */
+    public String getCountryCode() {
+        return countryCode;
+    }
+
+    /**
+     * Sets the country code
+     *
+     * @param countryCode the countryCode to set
+     */
+    public void setCountryCode(String countryCode) {
+        this.countryCode = countryCode;
+    }
+
+    /**
+     * Returns the city
+     *
+     * @return the city
+     */
+    public String getCity() {
+        return city;
+    }
+
+    /**
+     * Sets the city
+     *
+     * @param city the city to set
+     */
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    /**
+     * Returns the state code
+     *
+     * @return the stateCode
+     */
+    public String getStateCode() {
+        return stateCode;
+    }
+
+    /**
+     * Sets the state code
+     *
+     * @param stateCode the stateCode to set
+     */
+    public void setStateCode(String stateCode) {
+        this.stateCode = stateCode;
+    }
+
+    /**
+     * Returns the zip code
+     *
+     * @return the zipCode
+     */
+    public String getZipCode() {
+        return zipCode;
+    }
+
+    /**
+     * Sets the zip code
+     *
+     * @param zipCode the zipCode to set
+     */
+    public void setZipCode(String zipCode) {
+        this.zipCode = zipCode;
+    }
+
+    /**
+     * Returns the street name
+     *
+     * @return the streetName
+     */
+    public String getStreetName() {
+        return streetName;
+    }
+
+    /**
+     * Sets the street name
+     *
+     * @param streetName the streetName to set
+     */
+    public void setStreetName(String streetName) {
+        this.streetName = streetName;
+    }
+
+    /**
+     * Returns the house number
+     *
+     * @return the houseNumber
+     */
+    public String getHouseNumber() {
+        return houseNumber;
+    }
+
+    /**
+     * Sets the house number
+     *
+     * @param houseNumber the houseNumber to set
+     */
+    public void setHouseNumber(String houseNumber) {
+        this.houseNumber = houseNumber;
+    }
+
+    @Override
+    public String toString() {
+        String addressStr = "";
+        if (countryCode != null && !countryCode.isEmpty()) {
+            addressStr += countryCode;
+        }
+        if (city != null && !city.isEmpty()) {
+            if (!addressStr.isEmpty()) {
+                addressStr += ", ";
+            }
+            addressStr += city;
+        }
+
+        if (stateCode != null && !stateCode.isEmpty()) {
+            if (!addressStr.isEmpty()) {
+                addressStr += ", ";
+            }
+            addressStr += stateCode;
+        }
+
+        if (zipCode != null && !zipCode.isEmpty()) {
+            if (!addressStr.isEmpty()) {
+                addressStr += ", ";
+            }
+            addressStr += zipCode;
+        }
+        if (streetName != null && !streetName.isEmpty()) {
+            if (!addressStr.isEmpty()) {
+                addressStr += ", ";
+            }
+            addressStr += streetName;
+        }
+        if (houseNumber != null && !houseNumber.isEmpty()) {
+            if (!addressStr.isEmpty()) {
+                addressStr += ", ";
+            }
+            addressStr += houseNumber;
+        }
+        return addressStr;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustBug.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustBug.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustBug.java	(revision 24514)
@@ -0,0 +1,421 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
+
+
+import java.util.Date;
+import org.openstreetmap.josm.data.coor.LatLon;
+
+
+/**
+ * Defines the attributes of the <code>MapdustBug</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustBug {
+
+    /** The id of the bug */
+    private Long id;
+
+    /** The coordinates of the bug */
+    private LatLon latLon;
+
+    /** The address of the bug */
+    private Address address;
+
+    /** The creation date */
+    private Date dateCreated;
+
+    /** The update date */
+    private Date dateUpdated;
+
+    /** The status of the object */
+    private Status status;
+
+    /** The type of the object */
+    private Type type;
+
+    /** The description of the bug */
+    private String description;
+
+    /** The nickname of the user who created the bug */
+    private String nickname;
+
+    /** The skobbler user id */
+    private String skoUid;
+
+    /** The external user id */
+    private String extUid;
+
+    /** The source of the bug */
+    private String source;
+
+    /** The url of the KML file */
+    private String kmlUrl;
+
+    /** The number of comments */
+    private Integer numberOfComments;
+
+    /** The array of comments */
+    private MapdustComment[] comments;
+
+    /**
+     * Builds a <code>MapdustBug</code> object.
+     */
+    public MapdustBug() {
+
+    }
+
+    /**
+     * Builds a <code>MapdustBug</code> object based on the given arguments.
+     *
+     * @param latLon The coordinate
+     * @param type The type of the bug
+     * @param description The description of the bug
+     * @param nickname The nickname of the user who created the bug
+     */
+    public MapdustBug(LatLon latLon, Type type, String description,
+            String nickname) {
+        this.latLon = latLon;
+        this.type = type;
+        this.description = description;
+        this.nickname = nickname;
+    }
+
+    /**
+     * Builds a <code>MapdustBug</code> object based on the given arguments.
+     *
+     * @param id The id of the bug
+     * @param latLon The coordinates of the bug
+     * @param address The address of the bug
+     * @param dateCreated The creation date
+     * @param dateUpdated The update date
+     * @param status The status of the bug
+     * @param type The type of the bug
+     * @param description The description of the bug
+     * @param nickname The nickname
+     * @param skoUid The skobbler user id
+     * @param extUid The external user id
+     * @param source The source of the bug
+     * @param kmlUrl The URL of the KML
+     * @param numberOfComments The number of comments
+     * @param comments The array of comments
+     */
+    public MapdustBug(Long id, LatLon latLon, Address address,
+            Date dateCreated, Date dateUpdated, Status status, Type type,
+            String description, String nickname, String skoUid, String extUid,
+            String source, String kmlUrl, Integer numberOfComments,
+            MapdustComment[] comments) {
+        this.id = id;
+        this.latLon = latLon;
+        this.address = address;
+        this.dateCreated = dateCreated;
+        this.dateUpdated = dateUpdated;
+        this.status = status;
+        this.type = type;
+        this.description = description;
+        this.nickname = nickname;
+        this.skoUid = skoUid;
+        this.extUid = extUid;
+        this.source = source;
+        this.kmlUrl = kmlUrl;
+        this.numberOfComments = numberOfComments;
+        this.comments = comments;
+    }
+
+    /**
+     * Returns the id
+     *
+     * @return the id
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * Sets the id
+     *
+     * @param id the id to set
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * Returns the coordinates of the bug
+     *
+     * @return the latLon
+     */
+    public LatLon getLatLon() {
+        return latLon;
+    }
+
+    /**
+     * Sets the coordinates of the bug
+     *
+     * @param latLon the latLon to set
+     */
+    public void setLatLon(LatLon latLon) {
+        this.latLon = latLon;
+    }
+
+    /**
+     * Returns the date created
+     *
+     * @return the dateCreated
+     */
+    public Date getDateCreated() {
+        return dateCreated;
+    }
+
+    /**
+     * Sets the date created
+     *
+     * @param dateCreated the dateCreated to set
+     */
+    public void setDateCreated(Date dateCreated) {
+        this.dateCreated = dateCreated;
+    }
+
+    /**
+     * Returns the date updated
+     *
+     * @return the dateUpdated
+     */
+    public Date getDateUpdated() {
+        return dateUpdated;
+    }
+
+    /**
+     * Sets the date updated
+     *
+     * @param dateUpdated the dateUpdated to set
+     */
+    public void setDateUpdated(Date dateUpdated) {
+        this.dateUpdated = dateUpdated;
+    }
+
+    /**
+     * Returns the status
+     *
+     * @return the status
+     */
+    public Status getStatus() {
+        return status;
+    }
+
+    /**
+     * Sets the status
+     *
+     * @param status the status to set
+     */
+    public void setStatus(Status status) {
+        this.status = status;
+    }
+
+    /**
+     * Returns the type
+     *
+     * @return the type
+     */
+    public Type getType() {
+        return type;
+    }
+
+    /**
+     * Sets the type
+     *
+     * @param type the type to set
+     */
+    public void setType(Type type) {
+        this.type = type;
+    }
+
+    /**
+     * Returns the description
+     *
+     * @return the description
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the description
+     *
+     * @param description the description to set
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * Returns the address
+     *
+     * @return the address
+     */
+    public Address getAddress() {
+        return address;
+    }
+
+    /**
+     * Sets the address
+     *
+     * @param address the address to set
+     */
+    public void setAddress(Address address) {
+        this.address = address;
+    }
+
+    /**
+     * Returns the nickname
+     *
+     * @return the nickname
+     */
+    public String getNickname() {
+        return nickname;
+    }
+
+    /**
+     * Sets the nickname
+     *
+     * @param nickname the nickname to set
+     */
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    /**
+     * Returns the skobbler user id
+     *
+     * @return the skoUid
+     */
+    public String getSkoUid() {
+        return skoUid;
+    }
+
+    /**
+     * Sets the skobbler user id
+     *
+     * @param skoUid the skoUid to set
+     */
+    public void setSkoUid(String skoUid) {
+        this.skoUid = skoUid;
+    }
+
+    /**
+     * Returns the external user id
+     *
+     * @return the extUid
+     */
+    public String getExtUid() {
+        return extUid;
+    }
+
+    /**
+     * Sets the external user id
+     *
+     * @param extUid the extUid to set
+     */
+    public void setExtUid(String extUid) {
+        this.extUid = extUid;
+    }
+
+    /**
+     * Returns the source
+     *
+     * @return the source
+     */
+    public String getSource() {
+        return source;
+    }
+
+    /**
+     * Sets the source
+     *
+     * @param source the source to set
+     */
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+    /**
+     * Returns the kml URL
+     *
+     * @return the kmlUrl
+     */
+    public String getKmlUrl() {
+        return kmlUrl;
+    }
+
+    /**
+     * Sets the kml URL
+     *
+     * @param kmlUrl the kmlUrl to set
+     */
+    public void setKmlUrl(String kmlUrl) {
+        this.kmlUrl = kmlUrl;
+    }
+
+    /**
+     * Returns the number of comments
+     *
+     * @return the numberOfComments
+     */
+    public Integer getNumberOfComments() {
+        return numberOfComments;
+    }
+
+    /**
+     * Sets the number of comments
+     *
+     * @param numberOfComments the numberOfComments to set
+     */
+    public void setNumberOfComments(Integer numberOfComments) {
+        this.numberOfComments = numberOfComments;
+    }
+
+    /**
+     * Returns the bug comments
+     *
+     * @return the comments
+     */
+    public MapdustComment[] getComments() {
+        return comments;
+    }
+
+    /**
+     * Sets the bug comments
+     * @param comments the comments to set
+     */
+    public void setComments(MapdustComment[] comments) {
+        this.comments = comments;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustComment.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustComment.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustComment.java	(revision 24514)
@@ -0,0 +1,228 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
+
+import java.util.Date;
+
+
+/**
+ * Defines the attributes of the <code>MapdustComment</code> object.
+ *
+ * @author Bea
+ *
+ */
+public class MapdustComment {
+
+    /** The id of the bug */
+    private Long bugId;
+
+    /** The creation date */
+    private Date dateCreated;
+
+    /** The text of the comment */
+    private String commentText;
+
+    /** The nickname of the user who created the comment */
+    private String nickname;
+
+    /** The skobbler user id of the user who created the comment */
+    private String skoUid;
+
+    /** The external user id of the user who created the comment */
+    private String extUid;
+
+    /** The source of the comment */
+    private String source;
+
+    /**
+     * Builds a <code>MapdustComment</code> object
+     */
+    public MapdustComment() {}
+
+    /**
+     * Builds a <code>MapdustComment</code> object based on the given arguments.
+     *
+     * @param bugId The id of the bug
+     * @param commentText The text of the comment
+     * @param nickname The nickname of the user
+     */
+    public MapdustComment(Long bugId, String commentText, String nickname) {
+        this.bugId = bugId;
+        this.commentText = commentText;
+        this.nickname = nickname;
+    }
+
+    /**
+     * Builds a <code>MapdustComment</code> object based on the given arguments.
+     *
+     * @param bugId The id of the bug
+     * @param dateCreated The date of creation
+     * @param commentText The text of the comment
+     * @param nickname The nickname of the user
+     * @param skoUid The skobbler user id of the user
+     * @param extUid The external user id of the user
+     * @param source The source of the user
+     */
+    public MapdustComment(Long bugId, Date dateCreated, String commentText,
+            String nickname, String skoUid, String extUid, String source) {
+        this.bugId = bugId;
+        this.dateCreated = dateCreated;
+        this.commentText = commentText;
+        this.nickname = nickname;
+        this.skoUid = skoUid;
+        this.extUid = extUid;
+        this.source = source;
+    }
+
+    /**
+     * Returns the id of the bug
+     *
+     * @return the bugId
+     */
+    public Long getBugId() {
+        return bugId;
+    }
+
+    /**
+     * Sets the id of the bug
+     *
+     * @param bugId the bugId to set
+     */
+    public void setBugId(Long bugId) {
+        this.bugId = bugId;
+    }
+
+    /**
+     * Returns the date created
+     *
+     * @return the dateCreated
+     */
+    public Date getDateCreated() {
+        return dateCreated;
+    }
+
+    /**
+     * Sets the date created
+     *
+     * @param dateCreated the dateCreated to set
+     */
+    public void setDateCreated(Date dateCreated) {
+        this.dateCreated = dateCreated;
+    }
+
+    /**
+     * Returns the text of the comment
+     *
+     * @return the commentText
+     */
+    public String getCommentText() {
+        return commentText;
+    }
+
+    /**
+     * Sets the comment text
+     *
+     * @param commentText the commentText to set
+     */
+    public void setCommentText(String commentText) {
+        this.commentText = commentText;
+    }
+
+    /**
+     * Returns the nickname
+     *
+     * @return the nickname
+     */
+    public String getNickname() {
+        return nickname;
+    }
+
+    /**
+     * Sets the nickname
+     *
+     * @param nickname the nickname to set
+     */
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    /**
+     * Returns the skobbler userid
+     *
+     * @return the skoUid
+     */
+    public String getSkoUid() {
+        return skoUid;
+    }
+
+    /**
+     * Sets the skobbler user id
+     *
+     * @param skoUid the skoUid to set
+     */
+    public void setSkoUid(String skoUid) {
+        this.skoUid = skoUid;
+    }
+
+    /**
+     * Returns the external user id
+     *
+     * @return the extUid
+     */
+    public String getExtUid() {
+        return extUid;
+    }
+
+    /**
+     * Sets the external user id
+     *
+     * @param extUid the extUid to set
+     */
+    public void setExtUid(String extUid) {
+        this.extUid = extUid;
+    }
+
+    /**
+     * Returns the source
+     *
+     * @return the source
+     */
+    public String getSource() {
+        return source;
+    }
+
+    /**
+     * Sets the source
+     *
+     * @param source the source to set
+     */
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustResponseStatusCode.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustResponseStatusCode.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/MapdustResponseStatusCode.java	(revision 24514)
@@ -0,0 +1,123 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
+
+
+/**
+ * Defines the response status codes of the Mapdust service.
+ *
+ * @author Bea
+ */
+public enum MapdustResponseStatusCode {
+
+    /** Status 200 */
+    Status200(200, null, "SUCESS"),
+
+    /** Status 201 */
+    Status201(201, null, "SUCESS"),
+
+    /** Status 204 */
+    Status204(204, 204, "No results found."),
+
+    /** A general status */
+    Status(null, null, "Some other error."),
+
+    /** Status 400 */
+    Status400(400, 400, "Missing or invalid value for parameter 'x'."),
+
+    /** Status 401 */
+    Status401(401, 401, "Invalid API key."),
+
+    /** Status 403 */
+    Status403(403, 403, "Request rate limit exceeded."),
+
+    /** Status 405 */
+    Status405(405, 405, "Method not allowed."),
+
+    /** Status 404 */
+    Status404(404, 404, "Not found."),
+
+    /** Status 500 */
+    Status500(500, 500, "Internal server error."),
+
+    /** Status 601 */
+    Status601(400, 601, "There is no bug with the given ID."),
+
+    /** Status 602 */
+    Status602(400, 602, "There is no skobbler user with thw igven ID.");
+
+    /** The code of the error */
+    private Integer statusCode;
+
+    /** The Mapdust API code */
+    private Integer apiCode;
+
+    /** The description of the response code */
+    private String description;
+
+    /**
+     * Builds a new <code>BillingServiceResponseCode</code>
+     *
+     * @param statusCode The code of the response
+     * @param apiCode The code of the Mapdust API
+     * @param description The description of the response
+     */
+    private MapdustResponseStatusCode(Integer statusCode, Integer apiCode,
+            String description) {
+        this.statusCode = statusCode;
+        this.apiCode = apiCode;
+        this.description = description;
+    }
+
+    /**
+     * Returns the status code
+     *
+     * @return the statusCode
+     */
+    public Integer getStatusCode() {
+        return statusCode;
+    }
+
+    /**
+     * Returns the api code
+     *
+     * @return the apiCode
+     */
+    public Integer getApiCode() {
+        return apiCode;
+    }
+
+    /**
+     * Returns the description
+     *
+     * @return the description
+     */
+    public String getDescription() {
+        return description;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Paging.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Paging.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Paging.java	(revision 24514)
@@ -0,0 +1,120 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
+
+
+/**
+ * Defines the attributes of the <code>Paging</code> object.
+ *
+ * @author Bea
+ */
+public class Paging {
+
+    /** The page */
+    private Integer page;
+
+    /** The items */
+    private Integer items;
+
+    /** The total */
+    private Integer total;
+
+    /**
+     * Builds a <code>Paging</code> object.
+     *
+     */
+    public Paging() {}
+
+    /**
+     * Builds a <code>Paging</code> object with the given argument.
+     *
+     * @param page The page number
+     * @param items The items of objects displayed on that page
+     * @param total The total number of objects
+     */
+    public Paging(Integer page, Integer items, Integer total) {
+        this.page = page;
+        this.items = items;
+        this.total = total;
+    }
+
+    /**
+     * Returns the page number
+     *
+     * @return the page
+     */
+    public Integer getPage() {
+        return page;
+    }
+
+    /**
+     * Sets the page number
+     *
+     * @param page the page to set
+     */
+    public void setPage(Integer page) {
+        this.page = page;
+    }
+
+    /**
+     * Returns the items
+     *
+     * @return the items
+     */
+    public Integer getItems() {
+        return items;
+    }
+
+    /**
+     * Sets the items
+     *
+     * @param items the items to set
+     */
+    public void setItems(Integer items) {
+        this.items = items;
+    }
+
+    /**
+     * Returns the total
+     *
+     * @return the total
+     */
+    public Integer getTotal() {
+        return total;
+    }
+
+    /**
+     * Sets the total
+     *
+     * @param total the total to set
+     */
+    public void setTotal(Integer total) {
+        this.total = total;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Status.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Status.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Status.java	(revision 24514)
@@ -0,0 +1,133 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
+
+
+import java.io.Serializable;
+import java.util.HashMap;
+
+
+/**
+ * Defines the attributes of the <code>Status</code> object.
+ *
+ * @author Bea
+ */
+public class Status implements Serializable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The key of the <code>Status</code> */
+    private Integer key;
+
+    /** The value of the <code>Status</code> */
+    private String value;
+
+    /** The hash map containing the valid values */
+    private static java.util.HashMap<Integer, Status> table = null;
+
+    /**
+     * Builds a new <code>Status</code> object
+     */
+    public Status() {}
+
+    /**
+     * Builds a new <code>status</code> object
+     *
+     * @param key The key of the object
+     * @param value The value of the object
+     */
+    public Status(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+        if (Status.table == null) {
+            Status.table = new HashMap<Integer, Status>();
+        }
+        Status.table.put(key, this);
+    }
+
+    /** The open status */
+    public static final Status OPEN = new Status(1, "Open");
+
+    /** The fixed status */
+    public static final Status FIXED = new Status(2, "Fixed");
+
+    /** The closed status */
+    public static final Status INVALID = new Status(3, "Invalid");
+
+    /**
+     * Returns the <code>Status</code> object for the given value.
+     *
+     * @param value The value of the object
+     * @return A <code>Status</code> object
+     * @throws java.lang.IllegalStateException If the status value is invalid
+     */
+    public static Status getStatus(Integer value)
+            throws java.lang.IllegalStateException {
+        Status status = table.get(value);
+        if (status == null) {
+            throw new java.lang.IllegalStateException();
+        }
+        return status;
+    }
+
+    /**
+     * Verifies if two objects are equals or not.
+     */
+    @Override
+    public boolean equals(java.lang.Object obj) {
+        return (obj == this);
+    }
+
+    /**
+     * Returns the hash code of the object
+     */
+    @Override
+    public int hashCode() {
+        return toString().hashCode();
+    }
+
+    /**
+     * Returns the key
+     *
+     * @return the key
+     */
+    public Integer getKey() {
+        return key;
+    }
+
+    /**
+     * Sets the key
+     *
+     * @return the value
+     */
+    public String getValue() {
+        return value;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Type.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Type.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/Type.java	(revision 24514)
@@ -0,0 +1,189 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
+
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+
+
+/**
+ * Defines the values for the <code>Type</code>.
+ *
+ * @author Bea
+ *
+ */
+public class Type implements Serializable {
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 1L;
+
+    /** The key of the <code>Type</code> */
+    private String key;
+
+    /** The value of the <code>Type</code> */
+    private String value;
+
+    /** The hash map containing the valid values */
+    private static java.util.HashMap<String, Type> table = null;
+
+    /**
+     * Builds a new <code>Type</code> object
+     */
+    public Type() {}
+
+    /**
+     * Builds a new <code>status</code> object
+     *
+     * @param key The key of the object
+     * @param value The value of the object
+     */
+    public Type(String key, String value) {
+        this.key = key;
+        this.value = value;
+        if (Type.table == null) {
+            Type.table = new HashMap<String, Type>();
+        }
+        Type.table.put(key, this);
+    }
+
+    /** The wrong turn <code>Type</code> */
+    public static final Type WRONG_TURN = new Type("wrong_turn", "Wrong turn");
+
+    /** The bad routing <code>Type</code> */
+    public static final Type BAD_ROUTING = new Type("bad_routing",
+            "Bad routing");
+
+    /** The oneway road <code>Type</code> */
+    public static final Type ONEWAY_ROAD = new Type("oneway_road",
+            "Oneway road");
+
+    /** The blocked street <code>Type</code> */
+    public static final Type BLOCKED_STREET = new Type("blocked_street",
+            "Blocked streeet");
+
+    /** The missing street <code>Type</code> */
+    public static final Type MISSING_STREET = new Type("missing_street",
+            "Missing street");
+
+    /** The wrong roundabout <code>Type</code> */
+    public static final Type WRONG_ROUNDABOUT = new Type("wrong_roundabout",
+            "Wrong roundabout");
+
+    /** The missing speedlimit <code>Type</code> */
+    public static final Type MISSING_SPEEDLIMIT = new Type(
+            "missing_speedlimit", "Missing speedlimit");
+
+    /** The other <code>Type</code> */
+    public static final Type OTHER = new Type("other", "Other");
+
+    /**
+     * Returns the <code>Type</code> for the given value.
+     *
+     * @param value The value
+     * @return A <code>Type</code> object
+     * @throws java.lang.IllegalStateException If the value is invalid
+     */
+    public static Type getType(java.lang.String value)
+            throws java.lang.IllegalStateException {
+        Type type = table.get(value);
+        if (type == null) {
+            type = Type.OTHER;
+        }
+        return type;
+    }
+
+    /**
+     * Returns the <code>Type</code> object for the given value. If there is no
+     * Type with the given value, the returned value is null.
+     *
+     * @param value The value of the type
+     * @return A <code>Type</code> object
+     */
+    public static Type getTypeFromValue(String value) {
+        Type type = null;
+        for (Type obj : table.values()) {
+            if (obj.getValue().equals(value)) {
+                type = obj;
+                break;
+            }
+        }
+        return type;
+    }
+
+    /**
+     * Returns all the types.
+     *
+     * @return An array of <code>Type</code> objects
+     */
+    public static Type[] getTypes() {
+        Collection<Type> collection = table.values();
+        return collection.toArray(new Type[0]);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see java.lang.Object#equals()
+     */
+    @Override
+    public boolean equals(java.lang.Object obj) {
+        return (obj == this);
+    }
+
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return super.hashCode();
+    }
+
+    /**
+     * Returns the key
+     *
+     * @return the key
+     */
+    public String getKey() {
+        return key;
+    }
+
+    /**
+     * Returns the value
+     *
+     * @return the value
+     */
+    public String getValue() {
+        return value;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/service/value/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the objects used by representing the Mapdust data.
+ */
+package org.openstreetmap.josm.plugins.mapdust.service.value;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/Configuration.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/Configuration.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/Configuration.java	(revision 24514)
@@ -0,0 +1,124 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util;
+
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * This class is used for reading the configurations for the connection to the
+ * MapDust service, from a configuration file.
+ *
+ * @author Bea
+ */
+public class Configuration {
+
+    /** The instance of this singleton object type */
+    private static final Configuration INSTANCE = new Configuration();
+
+    /** The resource bundle containing properties needed at runtime */
+    private static ResourceBundle properties;
+
+    /** The MapDust URL */
+    private String mapdustUrl;
+
+    /** The MapDust api key */
+    private String mapdustKey;
+
+    /** The MapDust bug details url */
+    private String mapdustBugDetailsUrl;
+
+    /**
+     * Returns the only instance of this singleton object type.
+     *
+     * @return the instance of the <code>Configuration</code>
+     */
+    public static Configuration getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Reads the configuration parameters.
+     */
+    private Configuration() {
+        try {
+            properties = ResourceBundle.getBundle("mapdust");
+        } catch (RuntimeException e) {
+            throw new MissingResourceException(
+                    "Could not instantiate resource bundle ", "", "mapdust");
+        }
+        try {
+            mapdustUrl = properties.getString("mapdust.url");
+        } catch (RuntimeException e) {
+            throw new MissingResourceException("Could not read mapdust.url ",
+                    "", "mapdust");
+        }
+        try {
+            mapdustKey = properties.getString("mapdust.key");
+        } catch (RuntimeException e) {
+            throw new MissingResourceException("Could not read mapdust.key ",
+                    "", "mapdust");
+        }
+        try {
+            mapdustBugDetailsUrl = properties.getString("mapdust.site");
+        } catch (RuntimeException e) {
+            throw new MissingResourceException("Could not read mapdust.site ",
+                    "", "mapdust");
+        }
+    }
+
+    /**
+     * Returns the MapDust service URL
+     *
+     * @return the mapdustUrl
+     */
+    public String getMapdustUrl() {
+        return mapdustUrl;
+    }
+
+    /**
+     * Returns the MapDust API key
+     *
+     * @return the mapdustKey
+     */
+    public String getMapdustKey() {
+        return mapdustKey;
+    }
+
+    /**
+     * Returns the MapDust bug details URL
+     *
+     * @return the mapdustBugDetailsUrl
+     */
+    public String getMapdustBugDetailsUrl() {
+        return mapdustBugDetailsUrl;
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpConnector.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpConnector.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpConnector.java	(revision 24514)
@@ -0,0 +1,238 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util.http;
+
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.Map;
+import org.openstreetmap.josm.plugins.mapdust.util.retry.RetryAgent;
+import org.openstreetmap.josm.plugins.mapdust.util.retry.RetrySetup;
+
+
+/**
+ * General connector to a given REST web service.
+ *
+ * @author Bea
+ *
+ */
+public class HttpConnector {
+
+    /** The timeout */
+    private final int timeout = 10000;
+
+    /** The <code>RetrySetup</code> */
+    private final RetrySetup retrySetup;
+
+    /** The <code>HttpURLConnection</code> object */
+    protected HttpURLConnection connection;
+
+    /**
+     * Builds a new <code>HttpConnector</code> object based on the given
+     * argument.
+     *
+     * @param retrySetup The <code>RetrySetup</code> object.
+     */
+    public HttpConnector(RetrySetup retrySetup) {
+        this.retrySetup = retrySetup;
+    }
+
+    /**
+     * Executes a HTTP GET method, based on the given URL. Returns a
+     * <code>HttpResponse</code> object containing the response code , response
+     * message and the response content.
+     *
+     * @param url The URL
+     * @return a <code>HttpResponse</code> object.
+     *
+     * @throws IOException In the case of an error
+     */
+    public HttpResponse executeGET(final URL url) throws IOException {
+        HttpResponse response;
+        RetryAgent<Boolean> agent = new RetryAgent<Boolean>(retrySetup) {
+
+            @Override
+            protected Boolean target() throws IOException {
+                /* 1: set up the connection */
+                connection = (HttpURLConnection) url.openConnection();
+                connection.setConnectTimeout(timeout);
+                connection.setReadTimeout(timeout);
+                /* 2: connect */
+                connection.connect();
+                return true;
+            }
+
+            @Override
+            protected void cleanup() throws IOException {
+                /* No cleanup is needed. */
+            }
+        };
+        try {
+            agent.run();
+        } catch (Exception e) {
+            if (e instanceof IOException) {
+                throw (IOException) e;
+            }
+                throw new IOException(e);
+
+        }
+        /* 3: build the response */
+        int responseCode = connection.getResponseCode();
+        String responseMessage = connection.getResponseMessage();
+        String responseContent = null;
+        if (responseCode == 200 || responseCode == 201 || responseCode == 204) {
+            responseContent = readContent(connection.getContent());
+        }
+        response = new HttpResponse(responseCode, responseMessage, responseContent);
+        return response;
+
+    }
+
+    /**
+     * Executes a HTTP POST method based on the given arguments.
+     *
+     * @param url The URL
+     * @param requestHeaders A map of request headers
+     * @param requestParameters A map of request parameters
+     * @return a <code>HttpResponse</code> object.
+     * @throws IOException In the case of an error
+     */
+    public HttpResponse executePOST(final URL url,
+            final Map<String, String> requestHeaders,
+            final Map<String, String> requestParameters) throws IOException {
+        HttpResponse response = null;
+        RetryAgent<Boolean> agent = new RetryAgent<Boolean>(retrySetup) {
+
+            @Override
+            protected Boolean target() throws IOException {
+                /* 1: set up the connection */
+                connection = (HttpURLConnection) url.openConnection();
+                connection.setConnectTimeout(timeout);
+                connection.setReadTimeout(timeout);
+                /* set the request header */
+                if (requestHeaders != null) {
+                    for (String key : requestHeaders.keySet()) {
+                        connection.addRequestProperty(key,
+                                requestHeaders.get(key));
+                    }
+                }
+                final StringBuffer sbEncodeParameters = new StringBuffer();
+                if (requestParameters != null) {
+                    connection.setDoOutput(true);
+                    sbEncodeParameters
+                            .append(encodeParameters(requestParameters));
+                }
+
+                /* 2: connect */
+                connection.connect();
+
+                /* 3: write content */
+                if (sbEncodeParameters.length() > 0) {
+                    OutputStreamWriter out =
+                            new OutputStreamWriter(connection.getOutputStream());
+
+                    out.write(sbEncodeParameters.toString());
+                    out.close();
+                }
+
+                return true;
+            }
+
+            @Override
+            protected void cleanup() throws IOException {
+                /* No cleanup is needed. */
+            }
+        };
+        try {
+            agent.run();
+        } catch (Exception e) {
+            if (e instanceof IOException) {
+                throw (IOException) e;
+            }
+                throw new IOException(e);
+
+        }
+        /* 3: build the response */
+        int responseCode = connection.getResponseCode();
+        String responseMessage = connection.getResponseMessage();
+        String responseContent = null;
+        if (responseCode == 200 || responseCode == 201 || responseCode == 204) {
+            responseContent = readContent(connection.getContent());
+        }
+        response = new HttpResponse(responseCode, responseMessage, responseContent);
+        return response;
+    }
+
+    /**
+     * Reads the content of the given object.
+     *
+     * @param obj An object
+     * @return A string containing the content of the object.
+     *
+     * @throws IOException In the case of an error
+     */
+    protected String readContent(Object obj) throws IOException {
+        String result = "";
+        InputStreamReader in = new InputStreamReader((InputStream) obj);
+        BufferedReader buff = new BufferedReader(in);
+        String line = "";
+        while ((line = buff.readLine()) != null) {
+            result += line;
+        }
+        return result;
+    }
+
+    /**
+     * Encodes with 'utf-8' the given map of parameters.
+     *
+     * @param postParameters A map of POST parameters
+     * @return An encoded string.
+     */
+    protected String encodeParameters(Map<String, String> postParameters) {
+        StringBuffer buf = new StringBuffer();
+        int i = 0;
+        for (String key : postParameters.keySet()) {
+            if (i != 0) {
+                buf.append("&");
+            }
+            try {
+                buf.append(key).append("=").append(URLEncoder.encode(
+                        postParameters.get(key), "utf-8"));
+            } catch (java.io.UnsupportedEncodingException neverHappen) {}
+            i++;
+        }
+        return buf.toString();
+    }
+
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpResponse.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpResponse.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/HttpResponse.java	(revision 24514)
@@ -0,0 +1,119 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util.http;
+
+
+/**
+ * Defines the attributes of a HTTP response.
+ *
+ * @author Bea
+ */
+public class HttpResponse {
+
+    /** The status code */
+    private Integer statusCode;
+
+    /** The status message */
+    private String statusMessage;
+
+    /** The content of the response */
+    private String content;
+
+    /**
+     * Builds an empty <code>HttpResponse</code> object
+     */
+    public HttpResponse() {}
+
+    /**
+     * Builds a new <code>HttpResponse</code> object based on the given
+     * arguments.
+     *
+     * @param statusCode The status code
+     * @param statusMessage The status message
+     * @param content The content of the response
+     */
+    public HttpResponse(Integer statusCode, String statusMessage, String content) {
+        this.statusCode = statusCode;
+        this.statusMessage = statusMessage;
+        this.content = content;
+    }
+
+    /**
+     * Returns the status code.
+     *
+     * @return the statusCode
+     */
+    public Integer getStatusCode() {
+        return statusCode;
+    }
+
+    /**
+     * Sets the status code
+     *
+     * @param statusCode the statusCode to set
+     */
+    public void setStatusCode(Integer statusCode) {
+        this.statusCode = statusCode;
+    }
+
+    /**
+     * Returns the status message
+     *
+     * @return the statusMessage
+     */
+    public String getStatusMessage() {
+        return statusMessage;
+    }
+
+    /**
+     * Sets the status message
+     *
+     * @param statusMessage the statusMessage to set
+     */
+    public void setStatusMessage(String statusMessage) {
+        this.statusMessage = statusMessage;
+    }
+
+    /**
+     * Returns the content of the message
+     *
+     * @return the content
+     */
+    public String getContent() {
+        return content;
+    }
+
+    /**
+     * Sets the content of the message
+     *
+     * @param content the content to set
+     */
+    public void setContent(String content) {
+        this.content = content;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/http/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the classes used for HTTP connection to a given URL.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util.http;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/package-info.java	(revision 24514)
@@ -0,0 +1,4 @@
+/**
+ * Contains the utility classes.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util;
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryAgent.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryAgent.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryAgent.java	(revision 24514)
@@ -0,0 +1,192 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util.retry;
+
+
+/**
+ * A <code>RetryAgent</code> attempts several times to execute a given
+ * operation. It can run in several modes (see {@link RetryMode} for details),
+ * but no matter what mode it is in, it will run at least once and it will stop
+ * trying after the first success. This class has two abstract methods which
+ * have to be implemented specifically by any instance: the target method and
+ * the cleanup method.
+ *
+ * @param <T> the type of the object returned by the target method
+ * @author rrainn
+ */
+public abstract class RetryAgent<T> {
+
+    /** The <code>RetrySetup</code> object  */
+    private RetrySetup setup;
+
+    /**
+     * Builds a new <code>RetryAgent</code> that will run as specified by a
+     * default setup.
+     */
+    public RetryAgent() {
+        this(RetrySetup.DEFAULT);
+    }
+
+    /**
+     * Builds a new <code>RetryAgent</code> that will run as specified by the
+     * given <code>RetrySetup</code>.
+     *
+     * @param setup the metadata specifying the running parameters for this
+     * <code>RetryAgent</code>
+     */
+    public RetryAgent(RetrySetup setup) {
+        this.setup = setup;
+    }
+
+    /**
+     * The target operation of the <code>RetryAgent</code>. This method will be
+     * called several times (until it returns successfully, or until the number
+     * of attempts has been exhausted).
+     *
+     * @return what this method returns must be defined by the implementer
+     * @throws Exception the cases in which this method returns this mode of
+     * exception must be defined by the implementer
+     */
+    protected abstract T target() throws Exception;
+
+    /**
+     * The cleanup operation of the <code>RetryAgent</code>. This method will be
+     * called after each call of the target method.
+     *
+     * @throws Exception the cases in which this method returns this mode of
+     * exception must be defined by the implementer
+     */
+    protected abstract void cleanup() throws Exception;
+
+    /**
+     * Launches the <code>RetryAgent</code>'s execution. This involves at least
+     * one run of the target and cleanup methods.
+     *
+     * @return whatever the target method is returning
+     * @throws Exception in case the target method failed on every attempt and
+     * the running conditions have been exhausted
+     */
+    public T run() throws Exception {
+        T result;
+        if (setup.getMode() == RetryMode.COUNTED) {
+            result = runCounted();
+        } else if (setup.getMode() == RetryMode.TIMED) {
+            result = runTimed();
+        } else {
+            throw new RuntimeException("Unsupported retry mode: '"
+                    + setup.getMode() + "'");
+        }
+        return result;
+    }
+
+    /**
+     * Launches the <code>RetryAgent</code>'s  counted execution.
+     *
+     * @return whatever the target method is returning
+     * @throws Exception in case the target method failed on every attempt and
+     * the running conditions have been exhausted
+     */
+    private T runCounted() throws Exception {
+        T result = null;
+        boolean success = false;
+        int attempts = setup.getStopCondition();
+        int delay = setup.getBaseDelay();
+        do {
+            attempts--;
+            try {
+                result = target();
+                success = true;
+            } catch (Exception e) {
+                if (attempts <= 0) {
+                    throw e;
+                }
+                    try {
+                        Thread.sleep(delay);
+                    } catch (InterruptedException e1) {
+                        // LOG.error(e1.getMessage(), e1);
+                        // throw e;
+                    }
+                    delay = delay * 3 / 2;
+
+            } finally {
+                try {
+                    cleanup();
+                } catch (Exception e) {
+                    /* if it can't be cleaned up, there's nothing to do */
+                    // LOG.error("Could not clean up", e);
+                }
+            }
+        } while (!success && attempts > 0);
+        return result;
+    }
+
+    /**
+     * Launches the <code>RetryAgent</code>'s  timed execution.
+     *
+     * @return whatever the target method is returning
+     * @throws Exception in case the target method failed on every attempt and
+     * the running conditions have been exhausted
+     */
+    private T runTimed() throws Exception {
+        T result = null;
+        boolean success = false;
+        int delay = setup.getBaseDelay();
+        int maxTime = setup.getStopCondition();
+        do {
+            long time = System.currentTimeMillis();
+            try {
+                result = target();
+                success = true;
+            } catch (Exception e) {
+                // LOG.debug("Attempt failed after "
+                // + (setup.getStopCondition() - maxTime) + " ms", e);
+                if (maxTime - delay <= 0) {
+                    throw e;
+                }
+                    try {
+                        Thread.sleep(delay);
+                    } catch (InterruptedException e1) {
+                        // LOG.error(e1.getMessage(), e1);
+                        throw e;
+                    }
+                    delay = delay * 3 / 2;
+
+            } finally {
+                try {
+                    cleanup();
+                } catch (Exception e) {
+                    /* if it can't be cleaned up, there's nothing to do */
+                    // LOG.error("Could not clean up", e);
+                }
+            }
+            time = System.currentTimeMillis() - time;
+            maxTime -= time;
+        } while (!success && maxTime > 0);
+        return result;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryMode.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryMode.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetryMode.java	(revision 24514)
@@ -0,0 +1,66 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util.retry;
+
+
+/**
+ * The mode in which the {@link RetryAgent} should work.
+ *
+ * @author rrainn
+ */
+public enum RetryMode {
+
+    /**
+     * In "counted" mode, the <code>RetryAgent</code> will run for at most a
+     * (defined) number of times before failing.
+     */
+    COUNTED("COUNTED"),
+
+    /**
+     * In "timed" mode, the <code>RetryAgent</code> will run for at most a
+     * (defined) number of milliseconds before failing.
+     */
+    TIMED("TIMED");
+
+    /** The name of the retry mode*/
+    private String name;
+
+    /**
+     * Builds a <code>RetryMode</code> object
+     * 
+     * @param name the name of the mode
+     */
+    private RetryMode(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetrySetup.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetrySetup.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/RetrySetup.java	(revision 24514)
@@ -0,0 +1,98 @@
+/* Copyright (c) 2010, skobbler GmbH
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.plugins.mapdust.util.retry;
+
+
+/**
+ * Defined metadata for the running method used by a {@link RetryAgent}.
+ *
+ * @author rrainn
+ */
+public class RetrySetup {
+
+    /** A default configuration for the {@link RetryAgent} */
+    public static final RetrySetup DEFAULT = new RetrySetup(RetryMode.COUNTED,
+            3, 500);
+
+    /** The retry mode */
+    private final RetryMode mode;
+
+    /** The stop condition */
+    private final int stopCondition;
+
+    /** The delay */
+    private final int baseDelay; // milliseconds
+
+    /**
+     * Builds a new <code>RetrySetup</code> with the specified values.
+     *
+     * @param mode the method for computing time intervals between attempts
+     * @param stopCondition the value at which to cease attempts
+     * @param baseDelay the base delay between attempts
+     * @see RetrySetup#getMode()
+     * @see RetrySetup#getStopCondition()
+     * @see RetrySetup#getBaseDelay()
+     */
+    public RetrySetup(RetryMode mode, int stopCondition, int baseDelay) {
+        this.mode = mode;
+        this.stopCondition = stopCondition;
+        this.baseDelay = baseDelay;
+    }
+
+    /**
+     * Returns the method for computing time intervals between attempts.
+     *
+     * @see RetryMode
+     * @return the retry mode
+     */
+    public RetryMode getMode() {
+        return mode;
+    }
+
+    /**
+     * Returns the value at which new attempts are ceased, intrerpreted either
+     * as 'maximum number of attempts' (for <code>COUNTED</code> mode) or as
+     * 'maximum number of milliseconds' (for <code>TIMED</code> mode).
+     *
+     * @return the stop condition
+     */
+    public int getStopCondition() {
+        return stopCondition;
+    }
+
+    /**
+     * Returns the base delay in milliseconds between attempts. Each delay will
+     * be computed based on this basic value, which will be augmented after each
+     * attempt.
+     *
+     * @return the base delay between attempts, in milliseconds
+     */
+    public int getBaseDelay() {
+        return baseDelay;
+    }
+}
Index: applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/package-info.java
===================================================================
--- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/package-info.java	(revision 24514)
+++ applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/util/retry/package-info.java	(revision 24514)
@@ -0,0 +1,2 @@
+/** contains the RetryAgent classes*/
+package org.openstreetmap.josm.plugins.mapdust.util.retry;
