use of de.janrufmonitor.ui.jface.wizards.pages.FilterNamePage in project janrufmonitor by tbrandt77.
the class FilterWizard method performFinish.
public boolean performFinish() {
if (this.m_pages[0].isPageComplete() && this.m_pages[1].isPageComplete() && this.m_pages[2].isPageComplete() && this.m_pages[3].isPageComplete() && this.m_pages[4].isPageComplete() && this.m_pages[5].isPageComplete() && this.m_pages[6].isPageComplete()) {
List filterList = new ArrayList();
IPhonenumber[] phones = ((FilterPhonesPage) this.m_pages[3]).getResult();
if (phones != null) {
filterList.addAll(this.getCallerFilters(phones));
}
Date[] dates = ((FilterDatePage) this.m_pages[2]).getResult();
if (dates != null && dates.length > 0) {
filterList.add(this.getDateFilter(dates));
}
IMsn msn = ((FilterMsnPage) this.m_pages[0]).getResult();
if (msn != null) {
if (!msn.getMSN().equalsIgnoreCase("*"))
filterList.add(new MsnFilter(new IMsn[] { msn }));
}
int limit = ((FilterItemCountPage) this.m_pages[4]).getResult();
if (limit > 0) {
filterList.add(new ItemCountFilter(limit));
}
IAttributeMap m = ((FilterCallTypePage) this.m_pages[5]).getResult();
if (m != null && m.size() > 0) {
filterList.add(new AttributeFilter(m));
}
ICip cip = ((FilterCipPage) this.m_pages[1]).getResult();
if (cip != null)
if (!cip.getCIP().equalsIgnoreCase("*"))
filterList.add(new CipFilter(cip));
this.m_filters = new IFilter[filterList.size()];
for (int i = 0; i < filterList.size(); i++) {
this.m_filters[i] = (IFilter) filterList.get(i);
}
String name = ((FilterNamePage) this.m_pages[6]).getResult();
IFilterManager fm = new JournalFilterManager();
if (name != null && name.trim().length() > 0) {
this.getRuntime().getConfigManagerFactory().getConfigManager().setProperty(Journal.NAMESPACE, "filtername_" + fm.getFiltersToString(getResult()), name);
this.getRuntime().getConfigManagerFactory().getConfigManager().saveConfiguration();
} else {
this.getRuntime().getConfigManagerFactory().getConfigManager().removeProperty(Journal.NAMESPACE, "filtername_" + fm.getFiltersToString(getResult()));
this.getRuntime().getConfigManagerFactory().getConfigManager().saveConfiguration();
}
return true;
}
this.m_filters = null;
return false;
}
Aggregations