Use BaseWorkbenchContentProvider instead of ContainerTreeProvider as it provides the same/better functionality
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@830902 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ContainerTreeProvider.java b/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ContainerTreeProvider.java
deleted file mode 100644
index 1def990..0000000
--- a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ContainerTreeProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
-
-
-import org.apache.felix.sigil.ui.eclipse.ui.util.DefaultTreeContentProvider;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-
-
-public class ContainerTreeProvider extends DefaultTreeContentProvider
-{
-
- private static final Object[] EMPTY = new Object[]
- {};
-
-
- public Object[] getChildren( Object parentElement )
- {
- if ( parentElement instanceof IContainer )
- {
- IContainer f = ( IContainer ) parentElement;
- try
- {
- return f.members();
- }
- catch ( CoreException e )
- {
- DebugPlugin.log( e.getStatus() );
- }
- }
- return EMPTY;
- }
-
-
- public Object getParent( Object element )
- {
- IResource r = ( IResource ) element;
- return r.getParent();
- }
-
-
- public boolean hasChildren( Object element )
- {
- if ( element instanceof IContainer )
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
-
- public Object[] getElements( Object inputElement )
- {
- IContainer container = ( IContainer ) inputElement;
- return getChildren( container );
- }
-
-}
diff --git a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java b/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java
index 81f6f6d..0bd889c 100644
--- a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java
+++ b/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ResourceBuildSection.java
@@ -22,12 +22,12 @@
import java.util.concurrent.atomic.AtomicBoolean;
+
import org.apache.felix.sigil.eclipse.SigilCore;
import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
import org.apache.felix.sigil.model.eclipse.ISigilBundle;
import org.apache.felix.sigil.ui.eclipse.ui.SigilUI;
import org.apache.felix.sigil.ui.eclipse.ui.form.SigilPage;
-import org.apache.felix.sigil.ui.eclipse.ui.util.ModelLabelProvider;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeListener;
@@ -48,6 +48,8 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.model.BaseWorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
@@ -93,8 +95,8 @@
viewer = new CheckboxTreeViewer( tree );
IProject base = getProjectModel().getProject();
- viewer.setContentProvider( new ContainerTreeProvider() );
- viewer.setLabelProvider( new ModelLabelProvider() );
+ viewer.setContentProvider(new BaseWorkbenchContentProvider());
+ viewer.setLabelProvider(new WorkbenchLabelProvider());
viewer.addCheckStateListener( this );
resourcesFilter = new ExcludedResourcesFilter();
viewer.addFilter( resourcesFilter );