/**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- *
+ * Copyright (c) 2005, 2012 IBM Corporation, Ericsson
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ * IBM - Initial API and implementation
+ * Bernd Hufmann - Updated for TMF
**********************************************************************/
+
package org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs;
import java.util.ArrayList;
*
* @return the saved global filters
*/
+
public static List<FilterCriteria> getGlobalFilters() {
DialogSettings settings = (DialogSettings) Activator.getDefault().getDialogSettings().getSection(FILTERS_LIST_CRITERIA);
int i = 0;
DialogSettings section = null;
int size = 0;
+ List<FilterCriteria> globalFilters = new ArrayList<FilterCriteria>();
if (settings != null) {
try {
size = settings.getInt(FILTERS_LIST_SIZE);
size = 0;
}
section = (DialogSettings) settings.getSection(FILTERS_LIST_CRITERIA + i);
- }
-
- List<FilterCriteria> globalFilters = new ArrayList<FilterCriteria>();
- while ((section != null) && (i < size)) {
- FilterCriteria criteria = new FilterCriteria();
- criteria.setCriteria(new Criteria());
- criteria.load(section);
- globalFilters.add(criteria);
- section = (DialogSettings) settings.getSection(FILTERS_LIST_CRITERIA + (++i));
+ while ((section != null) && (i < size)) {
+ FilterCriteria criteria = new FilterCriteria();
+ criteria.setCriteria(new Criteria());
+ criteria.load(section);
+ globalFilters.add(criteria);
+ section = (DialogSettings) settings.getSection(FILTERS_LIST_CRITERIA + (++i));
+ }
}
return globalFilters;