// Path: ca.edchipman.silverStripePDT/src/ca/edchipman/silverstripepdt/SilverStripeNature.java
// public class SilverStripeNature extends ScriptNature {
//     public static final String ID = SilverStripePDTPlugin.PLUGIN_ID.toLowerCase() + ".SilverStripeNature"; //$NON-NLS-1$
// }
// 
// Path: ca.edchipman.silverStripePDT/src/ca/edchipman/silverstripepdt/SilverStripePluginImages.java
// public class SilverStripePluginImages {
//     public static final ImageDescriptor DESC_ADD_SS_FILE = create("newssfile_wiz.gif", "wizban");//$NON-NLS-1$
//     public static final ImageDescriptor DESC_NEW_SS_PROJECT = create("newssprj_wiz.png", "wizban");//$NON-NLS-1$
//     public static final ImageDescriptor IMG_REFRESH = create("refresh.gif", "actions");//$NON-NLS-1$
//     
//     private static ImageDescriptor create(String name, String type) {
//         try {
//             return ImageDescriptor.createFromURL(makeIconFileURL(name, type));
//         } catch (MalformedURLException e) {
//             return ImageDescriptor.getMissingImageDescriptor();
//         }
//     }
// 
//     private static URL makeIconFileURL(String name, String type)
//         throws MalformedURLException {
//             URL fgIconBaseURL=Platform.getBundle(SilverStripePDTPlugin.PLUGIN_ID).getEntry("/icons/full/"+type+"/");
//             if (fgIconBaseURL == null)
//                 throw new MalformedURLException();
//     
//             return new URL(fgIconBaseURL, name);
//         }
// }


import java.lang.reflect.Array;
import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.dltk.core.DLTKCore;
import org.eclipse.dltk.core.IField;
import org.eclipse.dltk.core.IModelElement;
import org.eclipse.dltk.core.IScriptProject;
import org.eclipse.dltk.core.IType;
import org.eclipse.dltk.core.ModelException;
import org.eclipse.dltk.core.index2.search.ISearchEngine.MatchRule;
import org.eclipse.dltk.core.search.IDLTKSearchScope;
import org.eclipse.dltk.core.search.SearchEngine;
import org.eclipse.dltk.internal.ui.typehierarchy.SubTypeHierarchyViewer.SubTypeHierarchyContentProvider;
import org.eclipse.dltk.internal.ui.typehierarchy.TypeHierarchyLifeCycle;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.php.internal.core.documentModel.dom.ElementImplForPHP;
import org.eclipse.php.internal.core.model.PHPModelAccess;
import org.eclipse.php.internal.core.preferences.CorePreferencesSupport;
import org.eclipse.php.internal.core.typeinference.PHPModelUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.custom.ScrolledComposite;
import ca.edchipman.silverstripepdt.SilverStripeNature;
import ca.edchipman.silverstripepdt.SilverStripePluginImages;
            
            fTasksBrowser = null;
            browserInitError=true;
        }
        
        fErrorView = new Composite(fViewStack, SWT.NONE);
        fErrorView.setLayout(new GridLayout(1, false));
        
        fErrorLabel = new Label(fErrorView, SWT.CENTER);
        fErrorLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true, 1, 1));
        fErrorLabel.setAlignment(SWT.CENTER);
        
        if(browserInitError) {
            fErrorLabel.setText("SWT Browser control is not available. Please refer to: http://www.eclipse.org/swt/faq.php#whatisbrowser for more information.");
        }else {
            fErrorLabel.setText("No project is selected");
        }
        
        
        ControlDecoration controlDecoration = new ControlDecoration(fErrorLabel, SWT.LEFT | SWT.TOP);
        controlDecoration.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
        
        createActions();
        initializeToolBar();
        
        //Find the current project
        IResource currentSelection=extractSelection(getSite().getWorkbenchWindow().getSelectionService().getSelection());
        if(currentSelection!=null) {
            IProject project=currentSelection.getProject();
            try {
// Path: ca.edchipman.silverStripePDT/src/ca/edchipman/silverstripepdt/SilverStripeNature.java
// public class SilverStripeNature extends ScriptNature {
//     public static final String ID = SilverStripePDTPlugin.PLUGIN_ID.toLowerCase() + ".SilverStripeNature"; //$NON-NLS-1$
// }
// 
// Path: ca.edchipman.silverStripePDT/src/ca/edchipman/silverstripepdt/SilverStripePluginImages.java
// public class SilverStripePluginImages {
//     public static final ImageDescriptor DESC_ADD_SS_FILE = create("newssfile_wiz.gif", "wizban");//$NON-NLS-1$
//     public static final ImageDescriptor DESC_NEW_SS_PROJECT = create("newssprj_wiz.png", "wizban");//$NON-NLS-1$
//     public static final ImageDescriptor IMG_REFRESH = create("refresh.gif", "actions");//$NON-NLS-1$
//     
//     private static ImageDescriptor create(String name, String type) {
//         try {
//             return ImageDescriptor.createFromURL(makeIconFileURL(name, type));
//         } catch (MalformedURLException e) {
//             return ImageDescriptor.getMissingImageDescriptor();
//         }
//     }
// 
//     private static URL makeIconFileURL(String name, String type)
//         throws MalformedURLException {
//             URL fgIconBaseURL=Platform.getBundle(SilverStripePDTPlugin.PLUGIN_ID).getEntry("/icons/full/"+type+"/");
//             if (fgIconBaseURL == null)
//                 throw new MalformedURLException();
//     
//             return new URL(fgIconBaseURL, name);
//         }
// }


// Path: ca.edchipman.silverStripePDT/src/ca/edchipman/silverstripepdt/views/TasksViewer.java
import java.lang.reflect.Array;
import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.dltk.core.DLTKCore;
import org.eclipse.dltk.core.IField;
import org.eclipse.dltk.core.IModelElement;
import org.eclipse.dltk.core.IScriptProject;
import org.eclipse.dltk.core.IType;
import org.eclipse.dltk.core.ModelException;
import org.eclipse.dltk.core.index2.search.ISearchEngine.MatchRule;
import org.eclipse.dltk.core.search.IDLTKSearchScope;
import org.eclipse.dltk.core.search.SearchEngine;
import org.eclipse.dltk.internal.ui.typehierarchy.SubTypeHierarchyViewer.SubTypeHierarchyContentProvider;
import org.eclipse.dltk.internal.ui.typehierarchy.TypeHierarchyLifeCycle;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.php.internal.core.documentModel.dom.ElementImplForPHP;
import org.eclipse.php.internal.core.model.PHPModelAccess;
import org.eclipse.php.internal.core.preferences.CorePreferencesSupport;
import org.eclipse.php.internal.core.typeinference.PHPModelUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.custom.ScrolledComposite;
import ca.edchipman.silverstripepdt.SilverStripeNature;
import ca.edchipman.silverstripepdt.SilverStripePluginImages;

            
            fTasksBrowser = null;
            browserInitError=true;
        }
        
        fErrorView = new Composite(fViewStack, SWT.NONE);
        fErrorView.setLayout(new GridLayout(1, false));
        
        fErrorLabel = new Label(fErrorView, SWT.CENTER);
        fErrorLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true, 1, 1));
        fErrorLabel.setAlignment(SWT.CENTER);
        
        if(browserInitError) {
            fErrorLabel.setText("SWT Browser control is not available. Please refer to: http://www.eclipse.org/swt/faq.php#whatisbrowser for more information.");
        }else {
            fErrorLabel.setText("No project is selected");
        }
        
        
        ControlDecoration controlDecoration = new ControlDecoration(fErrorLabel, SWT.LEFT | SWT.TOP);
        controlDecoration.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
        
        createActions();
        initializeToolBar();
        
        //Find the current project
        IResource currentSelection=extractSelection(getSite().getWorkbenchWindow().getSelectionService().getSelection());
        if(currentSelection!=null) {
            IProject project=currentSelection.getProject();
            try {
                if(project.hasNature(SilverStripeNature.ID)) {