directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1421971 - in /directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry: EntryEditor.java EntryEditorOutlinePage.java messages.properties messages_de.properties messages_fr.properties
Date Fri, 14 Dec 2012 16:42:01 GMT
Author: pamarcelot
Date: Fri Dec 14 16:41:59 2012
New Revision: 1421971

URL: http://svn.apache.org/viewvc?rev=1421971&view=rev
Log:
Fix for DIRSTUDIO-858 (The Entry Editor's Outline view should be unavailable when the selection
isn't an entry or a bookmark).

Modified:
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditor.java
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditor.java?rev=1421971&r1=1421970&r2=1421971&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditor.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditor.java
Fri Dec 14 16:41:59 2012
@@ -180,6 +180,7 @@ public abstract class EntryEditor extend
             {
                 outlinePage = new EntryEditorOutlinePage( this );
             }
+            
             return outlinePage;
         }
 

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java?rev=1421971&r1=1421970&r2=1421971&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
Fri Dec 14 16:41:59 2012
@@ -46,8 +46,12 @@ import org.eclipse.jface.viewers.Selecti
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
 
 
@@ -71,6 +75,12 @@ public class EntryEditorOutlinePage exte
         }
     };
 
+    private Composite noOutlineComposite;
+
+    private Composite composite;
+
+    private Composite fakeComposite;
+
 
     /**
      * Creates a new instance of EntryEditorOutlinePage.
@@ -85,11 +95,30 @@ public class EntryEditorOutlinePage exte
     }
 
 
+    public Control getControl()
+    {
+        return composite;
+    }
+
+
     /**
      * {@inheritDoc}
      */
     public void createControl( Composite parent )
     {
+        // Creating the composite and fake composite
+        this.composite = new Composite( parent, SWT.NONE );
+        composite.setLayout( new FillLayout() );
+        this.fakeComposite = new Composite( parent, SWT.NONE );
+
+        // Creating the No Outline composite
+        noOutlineComposite = new Composite( composite, SWT.NONE );
+        noOutlineComposite.setLayout( new FillLayout() );
+
+        Label label = new Label( noOutlineComposite, SWT.WRAP );
+        label.setText( Messages.getString( "EntryEditorOutlinePage.NoOutline" ) ); //$NON-NLS-1$
+
+        // Creating the Outline tree viewer
         super.createControl( parent );
 
         final TreeViewer treeViewer = getTreeViewer();
@@ -186,6 +215,19 @@ public class EntryEditorOutlinePage exte
      */
     public void refresh()
     {
+        if ( hasAnOutline() )
+        {
+            getTreeViewer().getControl().setParent( composite );
+            noOutlineComposite.setParent( fakeComposite );
+        }
+        else
+        {
+            getTreeViewer().getControl().setParent( fakeComposite );
+            noOutlineComposite.setParent( composite );
+        }
+
+        composite.layout();
+
         final TreeViewer treeViewer = getTreeViewer();
 
         if ( treeViewer != null && treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()
)
@@ -456,7 +498,19 @@ public class EntryEditorOutlinePage exte
                 return false;
             return true;
         }
-
     }
 
+
+    /**
+     * Indicates if the entry has an outline.
+     *
+     * @return <code>true</code> if the entry editor has an outline,
+     *         <code>false</code> if not.
+     */
+    public boolean hasAnOutline()
+    {
+        Object o = entryEditor.getMainWidget().getViewer().getInput();
+
+        return ( o != null && o instanceof IEntry );
+    }
 }

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties?rev=1421971&r1=1421970&r2=1421971&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages.properties
Fri Dec 14 16:41:59 2012
@@ -18,6 +18,7 @@
 ToggleAutosaveAction.Autosave=Save Automatically
 EntryEditorActionGroup.Advanced=Advanced
 EntryEditorActionGroup.OpenSchemaBrowser=Open Schema Browser
+EntryEditorOutlinePage.NoOutline=An outline is not available.
 EntryEditorShowInMenuManager.ShowIn=Show In
 LdifEntryEditorDocumentProvider.InvalidDN=Invalid Distinguished Name.
 LdifEntryEditorDocumentProvider.InvalidLdif=Invalid LDIF: {0}

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties?rev=1421971&r1=1421970&r2=1421971&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_de.properties
Fri Dec 14 16:41:59 2012
@@ -18,6 +18,7 @@
 ToggleAutosaveAction.Autosave=Automatisch speichern
 EntryEditorActionGroup.Advanced=Erweitert
 EntryEditorActionGroup.OpenSchemaBrowser=\u00D6ffne Schema Browser
+EntryEditorOutlinePage.NoOutline=Es ist keine Gliederung verf\u00fcgbar.
 EntryEditorShowInMenuManager.ShowIn=Anzeigen in
 LdifEntryEditorDocumentProvider.InvalidDN=Ung\u00fcltiger Distinguished Name.
 LdifEntryEditorDocumentProvider.InvalidLdif=Ung\u00fcltiges LDIF: {0}

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties?rev=1421971&r1=1421970&r2=1421971&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/messages_fr.properties
Fri Dec 14 16:41:59 2012
@@ -18,6 +18,7 @@
 ToggleAutosaveAction.Autosave=Sauvegarder automatiquement
 EntryEditorActionGroup.Advanced=Avanc\u00E9
 EntryEditorActionGroup.OpenSchemaBrowser=Ouvrir le navigateur de sch\u00E9ma
+EntryEditorOutlinePage.NoOutline=Structure non disponible.
 EntryEditorShowInMenuManager.ShowIn=Afficher dans
 LdifEntryEditorDocumentProvider.InvalidDN=Distinguished Name invalide.
 LdifEntryEditorDocumentProvider.InvalidLdif=LDIF invalide: {0}



Mime
View raw message