felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r814604 - in /felix/trunk/sigil/eclipse/ui: ./ src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ src/org/apache/felix/sigil/ui/eclipse/ui/util/
Date Mon, 14 Sep 2009 12:20:05 GMT
Author: dsavage
Date: Mon Sep 14 12:20:05 2009
New Revision: 814604

URL: http://svn.apache.org/viewvc?rev=814604&view=rev
Log:
+     */
move classes related to util functions to util package
add UIHelper class for trivial filter and label provider impls

Added:
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/IElementDescriptor.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/UIHelper.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposal.java
      - copied, changed from r805364, felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/WrappedContentProposal.java
Removed:
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/IElementDescriptor.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/WrappedContentProposal.java
Modified:
    felix/trunk/sigil/eclipse/ui/sigil.properties
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ClasspathSection.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewPackageExportDialog.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/BackgroundLoadingSelectionDialog.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ExclusionContentProposalProvider.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ResourcesDialogHelper.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposalLabelProvider.java

Modified: felix/trunk/sigil/eclipse/ui/sigil.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/sigil.properties?rev=814604&r1=814603&r2=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/sigil.properties (original)
+++ felix/trunk/sigil/eclipse/ui/sigil.properties Mon Sep 14 12:20:05 2009
@@ -19,6 +19,8 @@
 
 -exports: \
 	org.apache.felix.sigil.ui.eclipse.actions, \
+	org.apache.felix.sigil.ui.eclipse.ui, \
+	org.apache.felix.sigil.ui.eclipse.ui.util, \
 	org.apache.felix.sigil.ui.eclipse.ui.wizard.project, \
 	org.apache.felix.sigil.ui.eclipse.ui.wizard.repository, \
 
@@ -37,6 +39,8 @@
 	org.apache.felix.sigil.repository, \
 	org.apache.felix.sigil.search, \
 	org.apache.felix.sigil.ui.eclipse.actions, \
+	org.apache.felix.sigil.ui.eclipse.ui, \
+	org.apache.felix.sigil.ui.eclipse.ui.util, \
 	org.apache.felix.sigil.ui.eclipse.ui.wizard.project, \
 	org.apache.felix.sigil.ui.eclipse.ui.wizard.repository, \
 	org.apache.felix.sigil.utils, \

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ClasspathSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ClasspathSection.java?rev=814604&r1=814603&r2=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ClasspathSection.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ClasspathSection.java
Mon Sep 14 12:20:05 2009
@@ -34,6 +34,7 @@
 import org.apache.felix.sigil.ui.eclipse.ui.form.SigilSection;
 import org.apache.felix.sigil.ui.eclipse.ui.util.BackgroundLoadingSelectionDialog;
 import org.apache.felix.sigil.ui.eclipse.ui.util.DefaultTableProvider;
+import org.apache.felix.sigil.ui.eclipse.ui.util.IElementDescriptor;
 import org.apache.felix.sigil.ui.eclipse.ui.util.IFilter;
 import org.apache.felix.sigil.ui.eclipse.ui.util.ModelLabelProvider;
 import org.eclipse.core.runtime.CoreException;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewPackageExportDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewPackageExportDialog.java?rev=814604&r1=814603&r2=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewPackageExportDialog.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/NewPackageExportDialog.java
Mon Sep 14 12:20:05 2009
@@ -23,6 +23,7 @@
 import java.util.Comparator;
 
 import org.apache.felix.sigil.ui.eclipse.ui.util.BackgroundLoadingSelectionDialog;
+import org.apache.felix.sigil.ui.eclipse.ui.util.IElementDescriptor;
 import org.eclipse.jdt.core.IPackageFragment;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/BackgroundLoadingSelectionDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/BackgroundLoadingSelectionDialog.java?rev=814604&r1=814603&r2=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/BackgroundLoadingSelectionDialog.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/BackgroundLoadingSelectionDialog.java
Mon Sep 14 12:20:05 2009
@@ -30,8 +30,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.IElementDescriptor;
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.WrappedContentProposal;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.jobs.Job;
@@ -85,7 +83,7 @@
             String result;
             if ( element instanceof WrappedContentProposal<?> )
             {
-                WrappedContentProposal<E> contentProposal = ( WrappedContentProposal<E>
) element;
+                WrappedContentProposal<E> contentProposal = (org.apache.felix.sigil.ui.eclipse.ui.util.WrappedContentProposal<E>
) element;
                 result = contentProposal.getLabel();
             }
             else
@@ -321,7 +319,7 @@
                 public void proposalAccepted( IContentProposal proposal )
                 {
                     @SuppressWarnings("unchecked")
-                    WrappedContentProposal<E> valueProposal = ( WrappedContentProposal<E>
) proposal;
+                    WrappedContentProposal<E> valueProposal = (org.apache.felix.sigil.ui.eclipse.ui.util.WrappedContentProposal<E>
) proposal;
                     E selected = valueProposal.getElement();
                     selection = new ArrayList<E>( 1 );
                     selection.add( selected );

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ExclusionContentProposalProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ExclusionContentProposalProvider.java?rev=814604&r1=814603&r2=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ExclusionContentProposalProvider.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ExclusionContentProposalProvider.java
Mon Sep 14 12:20:05 2009
@@ -26,8 +26,7 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.IElementDescriptor;
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.WrappedContentProposal;
+import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.utils.GlobCompiler;
 import org.eclipse.jface.fieldassist.IContentProposal;
 import org.eclipse.jface.fieldassist.IContentProposalProvider;
@@ -68,7 +67,7 @@
 
         for ( T element : elementArray )
         {
-            if ( filter != null && filter.select( element ) )
+            if ( filter == null || filter.select( element ) )
             {
                 IContentProposal proposal = WrappedContentProposal.newInstance( element,
descriptor );
                 Matcher matcher = pattern.matcher( proposal.getContent() );

Added: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/IElementDescriptor.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/IElementDescriptor.java?rev=814604&view=auto
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/IElementDescriptor.java
(added)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/IElementDescriptor.java
Mon Sep 14 12:20:05 2009
@@ -0,0 +1,39 @@
+/*
+ * 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.util;
+
+
+public interface IElementDescriptor<E>
+{
+    /**
+     * Return the short identifying name of the element.
+     */
+    String getName( E element );
+
+
+    /**
+     * Return a label for the element, including the name but possibly supplying
+     * additional information.
+     * 
+     * @param element
+     * @return
+     */
+    String getLabel( E element );
+}

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ResourcesDialogHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ResourcesDialogHelper.java?rev=814604&r1=814603&r2=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ResourcesDialogHelper.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ResourcesDialogHelper.java
Mon Sep 14 12:20:05 2009
@@ -37,7 +37,6 @@
 import org.apache.felix.sigil.model.osgi.IPackageImport;
 import org.apache.felix.sigil.model.osgi.IPackageModelElement;
 import org.apache.felix.sigil.model.osgi.IRequiredBundle;
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.IElementDescriptor;
 import org.apache.felix.sigil.ui.eclipse.ui.editors.project.NewPackageExportDialog;
 import org.apache.felix.sigil.ui.eclipse.ui.editors.project.NewResourceSelectionDialog;
 import org.eclipse.core.runtime.IProgressMonitor;

Added: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/UIHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/UIHelper.java?rev=814604&view=auto
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/UIHelper.java
(added)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/UIHelper.java
Mon Sep 14 12:20:05 2009
@@ -0,0 +1,29 @@
+package org.apache.felix.sigil.ui.eclipse.ui.util;
+
+public class UIHelper
+{
+    public static <T> IElementDescriptor<T> getDefaultElementDescriptor() {
+        return new IElementDescriptor<T>()
+        {
+            public String getLabel( T element )
+            {
+                return element == null ? "null" : element.toString();
+            }
+
+
+            public String getName( T element )
+            {
+                return getLabel( element );
+            }
+        };
+    }
+    
+    public static <T> IFilter<T> getDefaultFilter() {
+        return new IFilter<T> () {
+            public boolean select( T element )
+            {
+                return true;
+            }
+        };
+    }
+}

Copied: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposal.java
(from r805364, felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/WrappedContentProposal.java)
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposal.java?p2=felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposal.java&p1=felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/WrappedContentProposal.java&r1=805364&r2=814604&rev=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/WrappedContentProposal.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposal.java
Mon Sep 14 12:20:05 2009
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
+package org.apache.felix.sigil.ui.eclipse.ui.util;
 
 
 import org.eclipse.jface.fieldassist.IContentProposal;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposalLabelProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposalLabelProvider.java?rev=814604&r1=814603&r2=814604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposalLabelProvider.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/WrappedContentProposalLabelProvider.java
Mon Sep 14 12:20:05 2009
@@ -20,8 +20,6 @@
 package org.apache.felix.sigil.ui.eclipse.ui.util;
 
 
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.IElementDescriptor;
-import org.apache.felix.sigil.ui.eclipse.ui.editors.project.WrappedContentProposal;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.graphics.Image;
 
@@ -46,7 +44,7 @@
         E result;
         if ( element instanceof WrappedContentProposal<?> )
         {
-            WrappedContentProposal<?> proposal = ( WrappedContentProposal<?>
) element;
+            WrappedContentProposal<?> proposal = (org.apache.felix.sigil.ui.eclipse.ui.util.WrappedContentProposal<?>
) element;
             result = ( E ) proposal.getElement();
         }
         else



Mime
View raw message