/TextEnlarger/src/com/ideal/textenlarger/ExtendedCheckBox.java

http://eyes-free.googlecode.com/ · Java · 62 lines · 32 code · 6 blank · 24 comment · 2 complexity · c17c88116439dc7cfc28e8cd02c73960 MD5 · raw file

  1. /*
  2. * Copyright (C) 2010 The IDEAL Group
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.ideal.textenlarger;
  17. /**
  18. * Class needed by ApplicationsListActivity.
  19. *
  20. * This was taken from a checkbox list tutorial at anddev.org:
  21. * http://www.anddev.org/extended_checkbox_list__extension_of_checkbox_text_list_tu-t5734.html
  22. */
  23. public class ExtendedCheckBox implements Comparable<ExtendedCheckBox>
  24. {
  25. private String mText = "";
  26. private boolean mChecked;
  27. public ExtendedCheckBox(String text, boolean checked)
  28. {
  29. /* constructor */
  30. mText = text;
  31. mChecked = checked;
  32. }
  33. public void setChecked(boolean value)
  34. {
  35. this.mChecked = value;
  36. }
  37. public boolean getChecked()
  38. {
  39. return this.mChecked;
  40. }
  41. public String getText() {
  42. return mText;
  43. }
  44. public void setText(String text) {
  45. mText = text;
  46. }
  47. /** Make CheckBoxifiedText comparable by its name */
  48. //@Override
  49. public int compareTo(ExtendedCheckBox other)
  50. {
  51. if(this.mText != null)
  52. return this.mText.compareTo(other.getText());
  53. else
  54. throw new IllegalArgumentException();
  55. }
  56. }