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 / preferences / TodoTaskInputDialog.java
index 68477dd..b95f478 100644 (file)
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2003 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
  *******************************************************************************/
@@ -29,27 +29,27 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.PlatformUI;
 
 /**
  * Dialog to enter a na new task tag
  */
 public class TodoTaskInputDialog extends StatusDialog {
-       
+
        private class CompilerTodoTaskInputAdapter implements IDialogFieldListener {
                public void dialogFieldChanged(DialogField field) {
                        doValidation();
-               }                       
+               }
        }
-       
+
        private StringDialogField fNameDialogField;
        private ComboDialogField fPriorityDialogField;
-       
+
        private List fExistingNames;
-               
+
        public TodoTaskInputDialog(Shell parent, TodoTask task, List existingEntries) {
                super(parent);
-               
+
                fExistingNames= new ArrayList(existingEntries.size());
                for (int i= 0; i < existingEntries.size(); i++) {
                        TodoTask curr= (TodoTask) existingEntries.get(i);
@@ -57,7 +57,7 @@ public class TodoTaskInputDialog extends StatusDialog {
                                fExistingNames.add(curr.name);
                        }
                }
-               
+
                if (task == null) {
                        setTitle(PreferencesMessages.getString("TodoTaskInputDialog.new.title")); //$NON-NLS-1$
                } else {
@@ -69,15 +69,15 @@ public class TodoTaskInputDialog extends StatusDialog {
                fNameDialogField= new StringDialogField();
                fNameDialogField.setLabelText(PreferencesMessages.getString("TodoTaskInputDialog.name.label")); //$NON-NLS-1$
                fNameDialogField.setDialogFieldListener(adapter);
-               
+
                fNameDialogField.setText((task != null) ? task.name : ""); //$NON-NLS-1$
-               
+
                String[] items= new String[] {
                        PreferencesMessages.getString("TodoTaskInputDialog.priority.high"), //$NON-NLS-1$
                        PreferencesMessages.getString("TodoTaskInputDialog.priority.normal"), //$NON-NLS-1$
                        PreferencesMessages.getString("TodoTaskInputDialog.priority.low") //$NON-NLS-1$
                };
-               
+
                fPriorityDialogField= new ComboDialogField(SWT.READ_ONLY);
                fPriorityDialogField.setLabelText(PreferencesMessages.getString("TodoTaskInputDialog.priority.label")); //$NON-NLS-1$
                fPriorityDialogField.setItems(items);
@@ -93,7 +93,7 @@ public class TodoTaskInputDialog extends StatusDialog {
                        fPriorityDialogField.selectItem(1);
                }
        }
-       
+
        public TodoTask getResult() {
                TodoTask task= new TodoTask();
                task.name= fNameDialogField.getText().trim();
@@ -106,33 +106,33 @@ public class TodoTaskInputDialog extends StatusDialog {
                                break;
                        default :
                                        task.priority= JavaCore.COMPILER_TASK_PRIORITY_LOW;
-                               break;                          
+                               break;
                }
                return task;
        }
-       
+
        protected Control createDialogArea(Composite parent) {
                Composite composite= (Composite) super.createDialogArea(parent);
-               
+
                Composite inner= new Composite(composite, SWT.NONE);
                GridLayout layout= new GridLayout();
                layout.marginHeight= 0;
                layout.marginWidth= 0;
                layout.numColumns= 2;
                inner.setLayout(layout);
-               
+
                fNameDialogField.doFillIntoGrid(inner, 2);
                fPriorityDialogField.doFillIntoGrid(inner, 2);
-               
+
                LayoutUtil.setHorizontalGrabbing(fNameDialogField.getTextControl(null));
                LayoutUtil.setWidthHint(fNameDialogField.getTextControl(null), convertWidthInCharsToPixels(45));
-               
+
                fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());
-               
-               applyDialogFont(composite);             
+
+               applyDialogFont(composite);
                return composite;
        }
-               
+
        private void doValidation() {
                StatusInfo status= new StatusInfo();
                String newText= fNameDialogField.getText();
@@ -155,6 +155,6 @@ public class TodoTaskInputDialog extends StatusDialog {
         */
        protected void configureShell(Shell newShell) {
                super.configureShell(newShell);
-               WorkbenchHelp.setHelp(newShell, IJavaHelpContextIds.TODO_TASK_INPUT_DIALOG);
+               PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.TODO_TASK_INPUT_DIALOG);
        }
 }