directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r583729 - in /directory/studio/trunk/studio-ldapbrowser-ui: resources/icons/ src/main/java/org/apache/directory/studio/ldapbrowser/ui/ src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/
Date Thu, 11 Oct 2007 08:30:39 GMT
Author: pamarcelot
Date: Thu Oct 11 01:30:38 2007
New Revision: 583729

URL: http://svn.apache.org/viewvc?rev=583729&view=rev
Log:
Part of a fix for DIRSTUDIO-221 (Improve Object Class selection in the New Entry Wizard).
Added the new LabelProvider indicating with an icon whether the object class is abstract,
auxiliary or structural.

Added:
    directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_abstract.gif   (with
props)
    directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_auxiliary.gif   (with
props)
    directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_structural.gif   (with
props)
Modified:
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java

Added: directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_abstract.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_abstract.gif?rev=583729&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_abstract.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_auxiliary.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_auxiliary.gif?rev=583729&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_auxiliary.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_structural.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_structural.gif?rev=583729&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/studio-ldapbrowser-ui/resources/icons/ocd_structural.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java?rev=583729&r1=583728&r2=583729&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
Thu Oct 11 01:30:38 2007
@@ -203,6 +203,12 @@
 
     public static final String IMG_OCD = "resources/icons/ocd.png";
 
+    public static final String IMG_OCD_ABSTRACT = "resources/icons/ocd_abstract.gif";
+
+    public static final String IMG_OCD_AUXILIARY = "resources/icons/ocd_auxiliary.gif";
+
+    public static final String IMG_OCD_STRUCTURAL = "resources/icons/ocd_structural.gif";
+
     public static final String IMG_MRD = "resources/icons/mrd.png";
 
     public static final String IMG_MRUD = "resources/icons/mrud.png";

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java?rev=583729&r1=583728&r2=583729&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
Thu Oct 11 01:30:38 2007
@@ -48,8 +48,8 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerFilter;
 import org.eclipse.jface.viewers.ViewerSorter;
@@ -59,6 +59,7 @@
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -93,13 +94,13 @@
     private Text availableObjectClassesInstantSearch;
 
     /** The available object classes viewer. */
-    private ListViewer availableObjectClassesViewer;
+    private TableViewer availableObjectClassesViewer;
 
     /** The selected object classes. */
     private List<ObjectClassDescription> selectedObjectClasses;
 
     /** The selected object classes viewer. */
-    private ListViewer selectedObjectClassesViewer;
+    private TableViewer selectedObjectClassesViewer;
 
     /** The add button. */
     private Button addButton;
@@ -107,6 +108,43 @@
     /** The remove button. */
     private Button removeButton;
 
+    private LabelProvider labelProvider = new LabelProvider()
+    {
+        /* (non-Javadoc)
+         * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+         */
+        public Image getImage( Object element )
+        {
+            if ( element instanceof ObjectClassDescription )
+            {
+                ObjectClassDescription ocd = ( ObjectClassDescription ) element;
+
+                if ( ocd.isAbstract() )
+                {
+                    return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_OCD_ABSTRACT
)
+                        .createImage();
+                }
+                else if ( ocd.isAuxiliary() )
+                {
+                    return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_OCD_AUXILIARY
)
+                        .createImage();
+                }
+                else if ( ocd.isStructural() )
+                {
+                    return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_OCD_STRUCTURAL
)
+                        .createImage();
+                }
+                else
+                {
+                    return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_OCD
).createImage();
+                }
+            }
+
+            // Default
+            return super.getImage( element );
+        }
+    };
+
 
     /**
      * Creates a new instance of NewEntryObjectclassWizardPage.
@@ -156,12 +194,12 @@
 
         if ( wizard.getSelectedConnection() != null )
         {
-//            if ( !wizard.getSelectedConnection().isOpened() )
-//            {
-//                OpenConnectionsJob job = new OpenConnectionsJob( wizard.getSelectedConnection().getConnection()
);
-//                RunnableContextJobAdapter.execute( job, getContainer() );
-//            }
-            
+            //            if ( !wizard.getSelectedConnection().isOpened() )
+            //            {
+            //                OpenConnectionsJob job = new OpenConnectionsJob( wizard.getSelectedConnection().getConnection()
);
+            //                RunnableContextJobAdapter.execute( job, getContainer() );
+            //            }
+
             availableObjectClasses.addAll( Arrays.asList( wizard.getSelectedConnection().getSchema()
                 .getObjectClassDescriptions() ) );
 
@@ -291,7 +329,7 @@
             public void modifyText( ModifyEvent e )
             {
                 availableObjectClassesViewer.refresh();
-                if ( availableObjectClassesViewer.getList().getItemCount() == 1 )
+                if ( availableObjectClassesViewer.getTable().getItemCount() == 1 )
                 {
                     Object item = availableObjectClassesViewer.getElementAt( 0 );
                     availableObjectClassesViewer.setSelection( new StructuredSelection( item
) );
@@ -299,13 +337,13 @@
             }
         } );
 
-        availableObjectClassesViewer = new ListViewer( availableObjectClassesComposite );
+        availableObjectClassesViewer = new TableViewer( availableObjectClassesComposite );
         GridData data = new GridData( GridData.FILL_BOTH );
         data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT;
         data.widthHint = ( int ) ( SIZING_SELECTION_WIDGET_WIDTH * 0.4 );
-        availableObjectClassesViewer.getList().setLayoutData( data );
+        availableObjectClassesViewer.getTable().setLayoutData( data );
         availableObjectClassesViewer.setContentProvider( new ArrayContentProvider() );
-        availableObjectClassesViewer.setLabelProvider( new LabelProvider() );
+        availableObjectClassesViewer.setLabelProvider( labelProvider );
         availableObjectClassesViewer.setSorter( new ViewerSorter() );
         availableObjectClassesViewer.addFilter( new InstantSearchFilter( availableObjectClassesInstantSearch
) );
         availableObjectClassesViewer.setInput( availableObjectClasses );
@@ -354,13 +392,13 @@
             }
         } );
 
-        selectedObjectClassesViewer = new ListViewer( composite );
+        selectedObjectClassesViewer = new TableViewer( composite );
         data = new GridData( GridData.FILL_BOTH );
         data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT;
         data.widthHint = ( int ) ( SIZING_SELECTION_WIDGET_WIDTH * 0.4 );
-        selectedObjectClassesViewer.getList().setLayoutData( data );
+        selectedObjectClassesViewer.getTable().setLayoutData( data );
         selectedObjectClassesViewer.setContentProvider( new ArrayContentProvider() );
-        selectedObjectClassesViewer.setLabelProvider( new LabelProvider() );
+        selectedObjectClassesViewer.setLabelProvider( labelProvider );
         selectedObjectClassesViewer.setSorter( new ViewerSorter() );
         selectedObjectClassesViewer.setInput( selectedObjectClasses );
         selectedObjectClassesViewer.addDoubleClickListener( new IDoubleClickListener()



Mime
View raw message