/TextEnlarger/src/com/ideal/textenlarger/ExtendedCheckBox.java
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 */ 16package com.ideal.textenlarger; 17 18 19/** 20 * Class needed by ApplicationsListActivity. 21 * 22 * This was taken from a checkbox list tutorial at anddev.org: 23 * http://www.anddev.org/extended_checkbox_list__extension_of_checkbox_text_list_tu-t5734.html 24 */ 25public class ExtendedCheckBox implements Comparable<ExtendedCheckBox> 26{ 27 private String mText = ""; 28 private boolean mChecked; 29 30 public ExtendedCheckBox(String text, boolean checked) 31 { 32 /* constructor */ 33 mText = text; 34 mChecked = checked; 35 } 36 public void setChecked(boolean value) 37 { 38 this.mChecked = value; 39 } 40 public boolean getChecked() 41 { 42 return this.mChecked; 43 } 44 45 public String getText() { 46 return mText; 47 } 48 49 public void setText(String text) { 50 mText = text; 51 } 52 53 /** Make CheckBoxifiedText comparable by its name */ 54 //@Override 55 public int compareTo(ExtendedCheckBox other) 56 { 57 if(this.mText != null) 58 return this.mText.compareTo(other.getText()); 59 else 60 throw new IllegalArgumentException(); 61 } 62}