callInFailedFilterButton.setState(ThreeStateButton.SELECTED); commentFilterButton.setState(ThreeStateButton.INVERTED);
callInFailedFilterButton.setState(ThreeStateButton3.SELECTED); commentFilterButton.setState(ThreeStateButton3.INVERTED);
	private void handleAction(String command) {		// int[] rows = callerTable.getSelectedRows();		// if(rows.length ==0){		if (command.equals(FILTER_CALLIN)) {			syncFilterWithButton(filter[callIn], callInFilterButton);			return;		}		if (command.equals(FILTER_CALLINFAILED)) {			syncFilterWithButton(filter[callInFailed], callInFailedFilterButton);			return;		}		if (command.equals(FILTER_CALLOUT)) {			syncFilterWithButton(filter[callOut], callOutFilterButton);			return;		}		if (command.equals(FILTER_COMMENT)) {			syncFilterWithButton(filter[comment], commentFilterButton);			return;		}		if (command.equals(FILTER_ANONYM)) {			syncFilterWithButton(filter[anonym], anonymFilterButton);			return;		}		if (command.equals(FILTER_FIXED)) {			syncFilterWithButton(filter[fixed], fixedFilterButton);			return;		}		if (command.equals(FILTER_HANDY)) {			syncFilterWithButton(filter[handy], handyFilterButton);			return;		}		if (command.equals(FILTER_SEARCH)) {			if (searchFilterButton.getState() == ThreeStateButton.NOTHING) {				searchFilterTextField.setVisible(false);				searchLabel.setVisible(false);				filter[search].setEnabled(false);			} else {				searchFilterTextField.setVisible(true);				searchLabel.setVisible(true);				callerList.removeFilter(filter[search]);				filter[search] = new SearchFilter(searchFilterTextField.getText());				// do nothing				// if(searchFilterButton.getState()==ThreeStateButton.SELECTED)				if (searchFilterButton.getState() == ThreeStateButton.INVERTED) {					filter[search].setInvert(true);				}				callerList.addFilter(filter[search]);			}			return;		}		if (command.equals(FILTER_DATE)) {			syncFilterWithButton(filter[date], dateFilterButton);			if (dateFilterButton.getState() == ThreeStateButton.NOTHING) {				startDateChooser.setVisible(false);				endDateChooser.setVisible(false);			} else {				callerList.removeFilter(filter[date]);				filter[date] = new DateFilter(startDateChooser.getDate(),						endDateChooser.getDate());				startDateChooser.setVisible(true);				endDateChooser.setVisible(true);				if (dateFilterButton.getState() == ThreeStateButton.INVERTED) {					filter[date].setInvert(true);				}				callerList.addFilter(filter[date]);			}			return;		}		if (command.equals("setdatefilter_thisday")) { //$NON-NLS-1$			callerList.removeFilter(filter[date]);			dateFilterButton.setSelected(false);			Date start = Calendar.getInstance().getTime();			Date end = Calendar.getInstance().getTime();			JFritzUtils.setStartOfDay(start);			JFritzUtils.setEndOfDay(end);			filter[date] = new DateFilter(start, end);			callerList.addFilter(filter[date]);			startDateChooser.setDate(start);			endDateChooser.setDate(end);			startDateChooser.setVisible(true);			endDateChooser.setVisible(true);		}		if (command.equals("setdatefilter_yesterday")) { //$NON-NLS-1$			callerList.removeFilter(filter[date]);			dateFilterButton.setSelected(false);			Calendar cal = Calendar.getInstance();			Date start = cal.getTime();			cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 1);			Date end = cal.getTime();			JFritzUtils.setStartOfDay(start);			JFritzUtils.setEndOfDay(end);			filter[date] = new DateFilter(start, end);			callerList.addFilter(filter[date]);			startDateChooser.setDate(start);			endDateChooser.setDate(end);			startDateChooser.setVisible(true);			endDateChooser.setVisible(true);		}		if (command.equals("setdatefilter_thismonth")) { //$NON-NLS-1$			callerList.removeFilter(filter[date]);			dateFilterButton.setSelected(false);			Calendar cal = Calendar.getInstance();			cal.set(Calendar.DAY_OF_MONTH, 1);			Date start = cal.getTime();			cal.set(Calendar.DAY_OF_MONTH, cal					.getActualMaximum(Calendar.DAY_OF_MONTH));			Date end = cal.getTime();			JFritzUtils.setStartOfDay(start);			JFritzUtils.setEndOfDay(end);			filter[date] = new DateFilter(start, end);			// callerList.addFilter(dateFilter);			startDateChooser.setDate(start);			endDateChooser.setDate(end);			startDateChooser.setVisible(true);			endDateChooser.setVisible(true);		}		if (command.equals("setdatefilter_lastmonth")) { //$NON-NLS-1$			callerList.removeFilter(filter[date]);			dateFilterButton.setSelected(false);			Calendar cal = Calendar.getInstance();			cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) - 1); // last			cal.set(Calendar.DAY_OF_MONTH, 1);			Date start = cal.getTime();			cal.set(Calendar.DAY_OF_MONTH, cal					.getActualMaximum(Calendar.DAY_OF_MONTH));			Date end = cal.getTime();			JFritzUtils.setStartOfDay(start);			JFritzUtils.setEndOfDay(end);			filter[date] = new DateFilter(start, end);			callerList.addFilter(filter[date]);			startDateChooser.setDate(start);			endDateChooser.setDate(end);			startDateChooser.setVisible(true);			endDateChooser.setVisible(true);		}		if (command.equals("filter_callinfailed_allWithoutComment")) { //$NON-NLS-1$			clearAllFilter();			callInFailedFilterButton.setState(ThreeStateButton.SELECTED);			commentFilterButton.setState(ThreeStateButton.INVERTED);			syncAllFilters();			return;		}		if (command.equals("filter_callinfailed_allWithoutCommentLastWeek")) { //$NON-NLS-1$			clearAllFilter();			callInFailedFilterButton.setState(ThreeStateButton.SELECTED);			commentFilterButton.setState(ThreeStateButton.INVERTED);			// dateFilter stuff for last week			callerList.removeFilter(filter[date]);			Calendar cal = Calendar.getInstance();			Date start = cal.getTime();			cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - 7);			Date end = cal.getTime();			JFritzUtils.setStartOfDay(start);			JFritzUtils.setEndOfDay(end);			filter[date] = new DateFilter(end, start);			callerList.addFilter(filter[date]);			startDateChooser.setDate(end);			endDateChooser.setDate(start);			startDateChooser.setVisible(true);			endDateChooser.setVisible(true);			syncAllFilters();			return;		}		if (command.equals(FILTER_SIP)) {			filter[sip] = createSipFilter(callerList);			syncFilterWithButton(filter[sip], sipFilterButton);			return;		}		if (command.equals(FILTER_CALLBYCALL)) {			filter[callByCall] = createCallByCallFilter(callerList);			syncFilterWithButton(filter[callByCall], callByCallFilterButton);			return;		}		if (command.equals("clearFilter")) { //$NON-NLS-1$			clearAllFilter();			return;		}		if (command.equals(DELETE_ENTRY)) {			callerList.removeEntries();			return;		}		if (command.equals("reverselookup")) { //$NON-NLS-1$			doReverseLookup(callerTable.getSelectedRows());			return;		}		if (command.equals("export_csv")) { //$NON-NLS-1$			JFritz.getJframe().exportCallerListToCSV();			return;		}		if (command.equals("export_xml")) { //$NON-NLS-1$			JFritz.getJframe().exportCallerListToXML();			return;		}		if (command.equals("import_callerlist_csv")) { //$NON-NLS-1$			JFritz.getJframe().importCallerlistCSV();			return;		}		if (command.equals("clipboard_number")) { //$NON-NLS-1$			Call call = callerList.getSelectedCall();			if (call != null) {				PhoneNumber number = call.getPhoneNumber();				if ((number != null) && (call != null)) {					JFritzClipboard.copy(number.convertToNationalNumber());				}			}			// JFritz.getJframe().copyNumberToClipboard();			return;		}		if (command.equals("clipboard_adress")) { //$NON-NLS-1$			Call call = callerList.getSelectedCall();			if (call != null) {				Person person = call.getPerson();				if (person != null) {					JFritzClipboard.copy(person.getAddress());				}			}			// JFritz.getJframe().copyAddressToClipboard();		}	}