tmf/lttng: Remove unneeded (non-Javadoc) comments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / dialogs / FilterListDialog.java
index 376a3ce6405b76f6305dad5a178a7edcb6049722..bf01a9f649f9fed37607b432d5fdeec244368484 100755 (executable)
@@ -1,16 +1,15 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- * 
+ * Copyright (c) 2005, 2013 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
+ *
+ * Contributors:
+ *     IBM - Initial API and implementation
+ *     Bernd Hufmann - Updated for TMF
  **********************************************************************/
+
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs;
 
 import java.util.ArrayList;
@@ -39,7 +38,7 @@ import org.eclipse.ui.IViewPart;
 /**
  * This is the filters list dialog.<br>
  * It is associated to an SDView and to a ISDFilterProvider.<br>
- * 
+ *
  * @version 1.0
  * @author sveyrier
  */
@@ -96,7 +95,7 @@ public class FilterListDialog extends Dialog {
 
     /**
      * Standard constructor
-     * 
+     *
      * @param view The view reference
      * @param loader The filter provider implementation
      */
@@ -114,9 +113,9 @@ public class FilterListDialog extends Dialog {
     // ------------------------------------------------------------------------
     /**
      * Adds a criteria to the table
-     * 
+     *
      * @param criteria A criteria to add
-     * @param checked A flag whether criteria is checked (selected) or not 
+     * @param checked A flag whether criteria is checked (selected) or not
      * @param positive A flag whether criteria is for positive filter or not
      * @param loaderClassName A loader class name for the filters
      */
@@ -127,7 +126,7 @@ public class FilterListDialog extends Dialog {
 
     /**
      * Replaces a selected criteria with a new criteria.
-     * 
+     *
      * @param newCriteria A new criteria.
      */
     protected void replaceSelectedCriteria(Criteria newCriteria) {
@@ -144,10 +143,6 @@ public class FilterListDialog extends Dialog {
         fRemove.setEnabled(count > 0);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
-     */
     @Override
     public Control createDialogArea(Composite parent) {
 
@@ -169,10 +164,7 @@ public class FilterListDialog extends Dialog {
         fTable.setLayoutData(new RowData(220, 84));
         fTable.setHeaderVisible(false);
         fTable.addSelectionListener(new SelectionListener() {
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-             */
+
             @Override
             public void widgetDefaultSelected(SelectionEvent e) {
                 int count = fTable.getSelectionCount();
@@ -184,10 +176,6 @@ public class FilterListDialog extends Dialog {
                 }
             }
 
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
             @Override
             public void widgetSelected(SelectionEvent e) {
                 handleTableSelectionCount();
@@ -195,7 +183,7 @@ public class FilterListDialog extends Dialog {
         });
         if (fFilters != null) {
             for (Iterator<FilterCriteria> i = fFilters.iterator(); i.hasNext();) {
-                FilterCriteria filterCriteria = (FilterCriteria) i.next();
+                FilterCriteria filterCriteria = i.next();
                 addCriteria(filterCriteria.getCriteria(), filterCriteria.isActive(), filterCriteria.isPositive(), filterCriteria.getLoaderClassName());
             }
         }
@@ -215,19 +203,12 @@ public class FilterListDialog extends Dialog {
         fAdd = new Button(commands, SWT.NONE);
         fAdd.setText(SDMessages._61);
         fAdd.addSelectionListener(new SelectionListener() {
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-             */
+
             @Override
             public void widgetDefaultSelected(SelectionEvent e) {
                 // Nothing to do
             }
 
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
             @Override
             public void widgetSelected(SelectionEvent e) {
                 Criteria init = new Criteria();
@@ -241,19 +222,12 @@ public class FilterListDialog extends Dialog {
         fEdit = new Button(commands, SWT.NONE);
         fEdit.setText(SDMessages._60);
         fEdit.addSelectionListener(new SelectionListener() {
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-             */
+
             @Override
             public void widgetDefaultSelected(SelectionEvent e) {
                 // Nothing to do
             }
-            
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
+
             @Override
             public void widgetSelected(SelectionEvent e) {
                 Criteria c = openFilterDialog(((CriteriaTableItem) fTable.getSelection()[0].getData()).getCriteria(), SDMessages._63);
@@ -267,19 +241,12 @@ public class FilterListDialog extends Dialog {
         fRemove = new Button(commands, SWT.NONE);
         fRemove.setText(SDMessages._64);
         fRemove.addSelectionListener(new SelectionListener() {
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-             */
+
             @Override
             public void widgetDefaultSelected(SelectionEvent e) {
                 // Nothing to do
             }
 
-            /*
-             * (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
             @Override
             public void widgetSelected(SelectionEvent e) {
                 fTable.remove(fTable.getSelectionIndices());
@@ -298,7 +265,7 @@ public class FilterListDialog extends Dialog {
 
     /**
      * Opens the filter dialog box with given parameter.
-     * 
+     *
      * @param criteria The criteria reference to pass
      * @param action to distinguish between "Update" and "Create"
      * @return the criteria that has been updated or created
@@ -312,10 +279,6 @@ public class FilterListDialog extends Dialog {
         return filter.getCriteria();
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.jface.window.Window#open()
-     */
     @Override
     public int open() {
         create();
@@ -325,10 +288,6 @@ public class FilterListDialog extends Dialog {
         return super.open();
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.jface.dialogs.Dialog#okPressed()
-     */
     @Override
     public void okPressed() {
         if (fTable.getItemCount() > 0) {
@@ -354,7 +313,7 @@ public class FilterListDialog extends Dialog {
 
     /**
      * Sets the list of filters.
-     * 
+     *
      * @param filters The list of filters to set.
      */
     public void setFilters(List<FilterCriteria> filters) {
@@ -363,7 +322,7 @@ public class FilterListDialog extends Dialog {
 
     /**
      * Returns the filters list after editing.
-     * 
+     *
      * @return the filters list after editing
      */
     public List<FilterCriteria> getFilters() {
@@ -376,21 +335,23 @@ public class FilterListDialog extends Dialog {
     protected void loadFiltersCriteria() {
         List<FilterCriteria> globalFilters = getGlobalFilters();
         for (Iterator<FilterCriteria> i = globalFilters.iterator(); i.hasNext();) {
-            FilterCriteria filterCriteria = (FilterCriteria) i.next();
+            FilterCriteria filterCriteria = i.next();
             addCriteria(filterCriteria.getCriteria(), filterCriteria.isActive(), filterCriteria.isPositive(), filterCriteria.getLoaderClassName());
         }
     }
 
     /**
      * Returns the global filters which are saved in the dialog settings..
-     * 
+     *
      * @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);
@@ -399,16 +360,14 @@ public class FilterListDialog extends Dialog {
                 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;
@@ -416,7 +375,7 @@ public class FilterListDialog extends Dialog {
 
     /**
      * Saves the filter criteria in the dialog settings.
-     * 
+     *
      * @param globalFilters A list of filters to save.
      */
     public static void saveFiltersCriteria(List<FilterCriteria> globalFilters) {
@@ -436,11 +395,11 @@ public class FilterListDialog extends Dialog {
         FilterCriteria criteria;
 
         for (int j = 0; j < globalFilters.size(); j++) {
-            if (!(globalFilters.get(j) instanceof FilterCriteria)) {
+            if (globalFilters.get(j) == null) {
                 return;
             }
 
-            criteria = (FilterCriteria) globalFilters.get(j);
+            criteria = globalFilters.get(j);
             DialogSettings subSection = (DialogSettings) section.getSection(FILTERS_LIST_CRITERIA + j);
 
             if (subSection == null) {
@@ -449,7 +408,7 @@ public class FilterListDialog extends Dialog {
             criteria.save(subSection);
         }
     }
-    
+
     /**
      * Deactivates the saved global filters.
      */
@@ -490,9 +449,9 @@ public class FilterListDialog extends Dialog {
 
         /**
          * Constructor
-         * 
+         *
          * @param parent The parent table
-         * @param isActive <code>true</code> if filter criteria is active else <code>false</code> 
+         * @param isActive <code>true</code> if filter criteria is active else <code>false</code>
          * @param isPositive <code>true</code> for positive filter else <code>false</code>
          * @param loaderClassName The loader class name
          */
@@ -506,9 +465,9 @@ public class FilterListDialog extends Dialog {
 
         /**
          * Constructor
-         * 
+         *
          * @param parent The parent table
-         * @param isActive <code>true</code> if filter criteria is active else <code>false</code> 
+         * @param isActive <code>true</code> if filter criteria is active else <code>false</code>
          * @param isPositive <code>true</code> for positive filter else <code>false</code>
          * @param loaderClassName The loader class name
          * @param index The table item index
@@ -522,7 +481,7 @@ public class FilterListDialog extends Dialog {
 
         /**
          * Sets the criteria.
-         * 
+         *
          * @param criteria The criteria to set
          */
         public void setCriteria(Criteria criteria) {
@@ -540,7 +499,7 @@ public class FilterListDialog extends Dialog {
 
         /**
          * Returns whether positive filtering is active or not.
-         * 
+         *
          * @return <code>true</code> for positive filter else <code>false</code>
          */
         public boolean isPositive() {
@@ -549,7 +508,7 @@ public class FilterListDialog extends Dialog {
 
         /**
          * Returns the loader class name.
-         * 
+         *
          * @return the loader class name
          */
         public String getLoaderClassName() {
This page took 0.029126 seconds and 5 git commands to generate.