replaced a lot of deprecated code; if someone runs into a commit conflict afterwards...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / filters / CustomFiltersDialog.java
index bef807a..3c20939 100644 (file)
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
+ * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/cpl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -47,8 +47,8 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.help.WorkbenchHelp;
 
 public class CustomFiltersDialog extends SelectionDialog {
 
@@ -67,10 +67,10 @@ public class CustomFiltersDialog extends SelectionDialog {
 
        private Stack fFilterDescriptorChangeHistory;
 
-       
+
        /**
         * Creates a dialog to customize Java element filters.
-        * 
+        *
         * @param shell the parent shell
         * @param viewId the id of the view
         * @param enablePatterns <code>true</code> if pattern filters are enabled
@@ -103,14 +103,14 @@ public class CustomFiltersDialog extends SelectionDialog {
                setTitle(FilterMessages.getString("CustomFiltersDialog.title"));  //$NON-NLS-1$
                setMessage(FilterMessages.getString("CustomFiltersDialog.filterList.label")); //$NON-NLS-1$
                super.configureShell(shell);
-               WorkbenchHelp.setHelp(shell, IJavaHelpContextIds.CUSTOM_FILTERS_DIALOG);
+               PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IJavaHelpContextIds.CUSTOM_FILTERS_DIALOG);
        }
 
        /**
         * Overrides method in Dialog
-        * 
+        *
         * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
-        */     
+        */
        protected Control createDialogArea(Composite parent) {
                initializeDialogUnits(parent);
                // create a composite with standard margins and spacing
@@ -124,12 +124,12 @@ public class CustomFiltersDialog extends SelectionDialog {
                composite.setLayoutData(new GridData(GridData.FILL_BOTH));
                composite.setFont(parent.getFont());
                Composite group= composite;
-               
+
                // Checkbox
                fEnableUserDefinedPatterns= new Button(group, SWT.CHECK);
                fEnableUserDefinedPatterns.setFocus();
                fEnableUserDefinedPatterns.setText(FilterMessages.getString("CustomFiltersDialog.enableUserDefinedPattern")); //$NON-NLS-1$
-               
+
                // Pattern      field
                fUserDefinedPatterns= new Text(group, SWT.SINGLE | SWT.BORDER);
                GridData  data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
@@ -159,18 +159,18 @@ public class CustomFiltersDialog extends SelectionDialog {
                // Filters provided by extension point
                if (fBuiltInFilters.length > 0)
                        createCheckBoxList(group);
-                               
-               applyDialogFont(parent);                
+
+               applyDialogFont(parent);
                return parent;
        }
 
        private void createCheckBoxList(Composite parent) {
                // Filler
                new Label(parent, SWT.NONE);
-               
+
                Label info= new Label(parent, SWT.LEFT);
                info.setText(FilterMessages.getString("CustomFiltersDialog.filterList.label"));  //$NON-NLS-1$
-               
+
                fCheckBoxList= CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
                GridData data= new GridData(GridData.FILL_BOTH);
                data.heightHint= fCheckBoxList.getTable().getItemHeight() * 10;
@@ -181,7 +181,7 @@ public class CustomFiltersDialog extends SelectionDialog {
 
                fCheckBoxList.setInput(fBuiltInFilters);
                setInitialSelections(getEnabledFilterDescriptors());
-               
+
                List initialSelection= getInitialElementSelections();
                if (initialSelection != null && !initialSelection.isEmpty())
                        checkInitialSelections();
@@ -275,9 +275,9 @@ public class CustomFiltersDialog extends SelectionDialog {
                }
                super.okPressed();
        }
-       
+
        private ILabelProvider createLabelPrivder() {
-               return 
+               return
                        new LabelProvider() {
                                public Image getImage(Object element) {
                                        return null;
@@ -292,7 +292,7 @@ public class CustomFiltersDialog extends SelectionDialog {
        }
 
        // ---------- result handling ----------
-       
+
        protected void setResult(List newResult) {
                super.setResult(newResult);
                if (fUserDefinedPatterns.getText().length() > 0) {
@@ -301,7 +301,7 @@ public class CustomFiltersDialog extends SelectionDialog {
                } else {
                        fEnablePatterns= false;
                        fPatterns= new String[0];
-               }                       
+               }
        }
 
 
@@ -329,7 +329,7 @@ public class CustomFiltersDialog extends SelectionDialog {
        public boolean areUserDefinedPatternsEnabled() {
                return fEnablePatterns;
        }
-       
+
        /**
         * @return a stack with the filter descriptor check history
         * @since 3.0
@@ -377,7 +377,7 @@ public class CustomFiltersDialog extends SelectionDialog {
                }
                return (String[])result.toArray(new String[result.size()]);
        }
-       
+
        private static void addPattern(List list, String pattern) {
                if (list.isEmpty())
                        list.add(pattern);
@@ -402,7 +402,7 @@ public class CustomFiltersDialog extends SelectionDialog {
                }
                return strBuf.toString();
        }
-       
+
        private static String escapeSeparator(String pattern, String separator) {
                int length= pattern.length();
                StringBuffer buf= new StringBuffer(length);
@@ -413,6 +413,6 @@ public class CustomFiltersDialog extends SelectionDialog {
                        buf.append(ch);
                }
                return buf.toString();
-               
+
        }
 }