PageRenderTime 52ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/bundles/plugins-trunk/SideKick/sidekick/util/SideKickAsset.java

#
Java | 74 lines | 31 code | 11 blank | 32 comment | 1 complexity | c1e278c070e55cd74b698c151481500e MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /*
  2. Copyright (c) 2006, Dale Anson
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without modification,
  5. are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright notice,
  7. this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright notice,
  9. this list of conditions and the following disclaimer in the documentation
  10. and/or other materials provided with the distribution.
  11. * Neither the name of the <ORGANIZATION> nor the names of its contributors
  12. may be used to endorse or promote products derived from this software without
  13. specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  18. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  21. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. package sidekick.util;
  26. import sidekick.Asset;
  27. import javax.swing.Icon;
  28. /**
  29. * danson: simple concrete implementation of an Asset that wraps some sort of
  30. * SideKickElement. A SideKickElement provides both Location and Position
  31. * information.
  32. */
  33. public class SideKickAsset extends Asset {
  34. private SideKickElement element = null;
  35. private String name = "";
  36. private String longString = null;
  37. public SideKickAsset(SideKickElement element) {
  38. super(element.toString());
  39. this.element = element;
  40. this.name = element.toString();
  41. }
  42. public SideKickElement getElement() {
  43. return element;
  44. }
  45. public Icon getIcon() {
  46. return null;
  47. }
  48. public String getShortString() {
  49. return name;
  50. }
  51. public String toString() {
  52. return name;
  53. }
  54. public String getLongString() {
  55. return longString == null ? name : longString;
  56. }
  57. public void setLongString(String s) {
  58. longString = s;
  59. }
  60. }