callerList.removeFilter(filter[date]); filter[date] = new DateFilter(startDateChooser.getDate(), endDateChooser.getDate()); callerList.addFilter(filter[date]);
((DateFilter)filter[date]).setStartDate(startDateChooser.getDate()); ((DateFilter)filter[date]).setEndDate(endDateChooser.getDate());
	private void handleAction(String command) {		if(callerTable!=null){			CellEditor ce = callerTable.getCellEditor();			if(ce!=null){				ce.cancelCellEditing();			}		}		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() == ThreeStateButton3.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());				callerList.addFilter(filter[search]);				// do nothing				// if(searchFilterButton.getState()==ThreeStateButton.SELECTED)				if (searchFilterButton.getState() == ThreeStateButton3.INVERTED) {					filter[search].setInvert(true);				}			}			return;		}		if (command.equals(FILTER_DATE)) {			syncFilterWithButton(filter[date], dateFilterButton);			if (dateFilterButton.getState() == ThreeStateButton3.NOTHING) {				startDateChooser.setVisible(false);				endDateChooser.setVisible(false);			} else { //selected or inverted check if some rows are selected				if(callerTable != null && callerTable.getSelectedRowCount()!=0){					// some rows are selected so the the date according to the selected rows					int[] rows = callerTable.getSelectedRows();					// min und max bestimmen					Date min =  ((Call) callerList.getFilteredCallVector().get(rows[0])).getCalldate();					Date max =  ((Call) callerList.getFilteredCallVector().get(rows[0])).getCalldate();					Date current;					for(int i =0; i< rows.length; i++){						current = ((Call) callerList.getFilteredCallVector().get(rows[i])).getCalldate();						if(current.before(min)){min = current;}						if(current.after(max)){max = current;}						Debug.msg("currentDate: "+current);					}					Debug.msg("minDate: "+min);					Debug.msg("maxDate: "+max);										startDateChooser.setDate(min);					endDateChooser.setDate(max);				}else{//no rows selected so we only have the days and set the hours to min and max					startDateChooser.setDate(JFritzUtils.setStartOfDay(startDateChooser.getDate()));					endDateChooser.setDate(JFritzUtils.setEndOfDay(endDateChooser.getDate()));				}				callerList.removeFilter(filter[date]);				filter[date] = new DateFilter(startDateChooser.getDate(),					endDateChooser.getDate());				callerList.addFilter(filter[date]);								if (dateFilterButton.getState() == ThreeStateButton3.INVERTED) {					filter[date].setInvert(true);				}				startDateChooser.setVisible(true);				endDateChooser.setVisible(true);			}			dateSpecialSaveString ="";			return;		}		if (command.equals(THIS_DAY)) { //$NON-NLS-1$			setThisDayFilter();			return;		}		if (command.equals(LAST_DAY)) { //$NON-NLS-1$			setLastDayFilter();			return;		}		if (command.equals(THIS_WEEK)) { //$NON-NLS-1$			setThisWeekFilter();			return;		}		if (command.equals(LAST_WEEK)) { //$NON-NLS-1$			setLastWeekFilter();			return;		}				if (command.equals(THIS_MONTH)) { //$NON-NLS-1$			setThisMonthFilter();			return;		}		if (command.equals(LAST_MONTH)) { //$NON-NLS-1$			setLastMonthFilter();			return;		}		if (command.equals("filter_callinfailed_allWithoutComment")) { //$NON-NLS-1$			clearAllFilter();			callInFailedFilterButton.setState(ThreeStateButton3.SELECTED);			commentFilterButton.setState(ThreeStateButton3.INVERTED);			syncAllFilters();			return;		}		if (command.equals("filter_callinfailed_allWithoutCommentLastWeek")) { //$NON-NLS-1$			clearAllFilter();			callInFailedFilterButton.setState(ThreeStateButton3.SELECTED);			commentFilterButton.setState(ThreeStateButton3.INVERTED);			// dateFilter stuff for last week			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);			callerList.removeFilter(filter[date]);			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)) {			callerList.removeFilter(filter[sip]);			filter[sip] = createSipFilter(callerList);			callerList.addFilter(filter[sip]);						syncFilterWithButton(filter[sip], sipFilterButton);			return;		}		if (command.equals(FILTER_CALLBYCALL)) {			callerList.removeFilter(filter[callByCall]);			filter[callByCall] = createCallByCallFilter(callerList);			callerList.addFilter(filter[callByCall]);			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();		}		Debug.err("unknown command: "+command);	}