directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r592087 [6/16] - in /directory/sandbox/felixk/studio-ldapbrowser-ui: ./ META-INF/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/studio/ src/...
Date Mon, 05 Nov 2007 17:01:46 GMT
Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,262 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.entry;
+
+
+import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserSelectionUtils;
+import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetUniversalListener;
+import org.apache.directory.studio.ldapbrowser.core.events.EntryModificationEvent;
+import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
+import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.INullSelectionListener;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.contexts.IContextActivation;
+import org.eclipse.ui.contexts.IContextService;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+
+/**
+ * The EntryEditorUniversalListener manages all events for the entry editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class EntryEditorUniversalListener extends EntryEditorWidgetUniversalListener
+{
+
+    /** The entry editor */
+    private EntryEditor entryEditor;
+
+    /** Token used to activate and deactivate shortcuts in the editor */
+    private IContextActivation contextActivation;
+
+    /** Listener that listens for selections of IEntry, ISeachResult and IBookmark objects. */
+    private INullSelectionListener entrySelectionListener = new INullSelectionListener()
+    {
+        /**
+         * {@inheritDoc}
+         * 
+         * This implementation sets the editor's input when a entry, search result or bookmark is selected.
+         */
+        public void selectionChanged( IWorkbenchPart part, ISelection selection )
+        {
+            if ( entryEditor != null && part != null )
+            {
+                if ( entryEditor.getSite().getWorkbenchWindow() == part.getSite().getWorkbenchWindow() )
+                {
+                    IEntry[] entries = BrowserSelectionUtils.getEntries( selection );
+                    ISearchResult[] searchResults = BrowserSelectionUtils.getSearchResults( selection );
+                    IBookmark[] bookmarks = BrowserSelectionUtils.getBookmarks( selection );
+                    Object[] objects = BrowserSelectionUtils.getObjects( selection );
+                    if ( entries.length + searchResults.length + bookmarks.length == 1 && objects.length == 1 )
+                    {
+                        if ( entries.length == 1 )
+                        {
+                            entryEditor.setInput( new EntryEditorInput( entries[0] ) );
+                        }
+                        else if ( searchResults.length == 1 )
+                        {
+                            entryEditor.setInput( new EntryEditorInput( searchResults[0] ) );
+                        }
+                        else if ( bookmarks.length == 1 )
+                        {
+                            entryEditor.setInput( new EntryEditorInput( bookmarks[0] ) );
+                        }
+                    }
+                    else
+                    {
+                        entryEditor.setInput( new EntryEditorInput( ( IEntry ) null ) );
+                    }
+                }
+            }
+        }
+    };
+
+    /** The part listener used to activate and deactivate the shortcuts */
+    private IPartListener2 partListener = new IPartListener2()
+    {
+        /**
+         * {@inheritDoc}
+         * 
+         * This implementation deactivates the shortcuts when the part is deactivated.
+         */
+        public void partDeactivated( IWorkbenchPartReference partRef )
+        {
+            if ( partRef.getPart( false ) == entryEditor && contextActivation != null )
+            {
+
+                entryEditor.getActionGroup().deactivateGlobalActionHandlers();
+
+                IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
+                    IContextService.class );
+                contextService.deactivateContext( contextActivation );
+                contextActivation = null;
+            }
+        }
+
+
+        /**
+         * {@inheritDoc}
+         * 
+         * This implementation activates the shortcuts when the part is activated.
+         */
+        public void partActivated( IWorkbenchPartReference partRef )
+        {
+            if ( partRef.getPart( false ) == entryEditor )
+            {
+
+                IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
+                    IContextService.class );
+                contextActivation = contextService
+                    .activateContext( BrowserCommonConstants.CONTEXT_WINDOWS );
+                // org.eclipse.ui.contexts.dialogAndWindow
+                // org.eclipse.ui.contexts.window
+                // org.eclipse.ui.text_editor_context
+
+                entryEditor.getActionGroup().activateGlobalActionHandlers();
+            }
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void partBroughtToTop( IWorkbenchPartReference partRef )
+        {
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void partClosed( IWorkbenchPartReference partRef )
+        {
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void partOpened( IWorkbenchPartReference partRef )
+        {
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void partHidden( IWorkbenchPartReference partRef )
+        {
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void partVisible( IWorkbenchPartReference partRef )
+        {
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void partInputChanged( IWorkbenchPartReference partRef )
+        {
+        }
+    };
+
+
+    /**
+     * Creates a new instance of EntryEditorUniversalListener.
+     *
+     * @param entryEditor the entry editor
+     */
+    public EntryEditorUniversalListener( EntryEditor entryEditor )
+    {
+        super( entryEditor.getMainWidget().getViewer(), entryEditor.getActionGroup().getOpenDefaultEditorAction() );
+        this.entryEditor = entryEditor;
+
+        // register listeners
+        entryEditor.getSite().getPage().addPartListener( partListener );
+        entryEditor.getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener( BrowserView.getId(),
+            entrySelectionListener );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void dispose()
+    {
+        if ( entryEditor != null )
+        {
+            // deregister listneners
+            entryEditor.getSite().getPage().removePartListener( partListener );
+            entryEditor.getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(
+                BrowserView.getId(), entrySelectionListener );
+            entryEditor = null;
+        }
+
+        super.dispose();
+    }
+
+
+    /**
+     * Sets the input to the viewer.
+     *
+     * @param entry the entry input
+     */
+    void setInput( IEntry entry )
+    {
+        if ( entry != viewer.getInput() )
+        {
+            viewer.setInput( entry );
+            entryEditor.getActionGroup().setInput( entry );
+        }
+
+    }
+
+
+    /**
+     * {@inheritDoc}
+     *
+     * This implementation updates the outline page when the entry is updated.
+     */
+    public void entryUpdated( EntryModificationEvent event )
+    {
+        super.entryUpdated( event );
+
+        EntryEditorOutlinePage outlinePage = ( EntryEditorOutlinePage ) entryEditor.getAdapter( IContentOutlinePage.class );
+        if ( outlinePage != null )
+        {
+            outlinePage.refresh();
+        }
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,63 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.entry;
+
+
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+
+/**
+ * This action opens the prefence page of the entry editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenEntryEditorPreferencePageAction extends Action
+{
+
+    /**
+     * Creates a new instance of OpenEntryEditorPreferencePageAction.
+     */
+    public OpenEntryEditorPreferencePageAction()
+    {
+        setText( "Preferences..." );
+        setToolTipText( "Preferences..." );
+        setEnabled( true );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        Shell shell = Display.getCurrent().getActiveShell();
+        String eePageId = BrowserUIConstants.PREFERENCEPAGEID_ENTRYEDITOR;
+        String attPageId = BrowserUIConstants.PREFERENCEPAGEID_ATTRIBUTES;
+        PreferencesUtil.createPreferenceDialogOn( shell, eePageId, new String[]
+            { eePageId, attPageId }, null ).open();
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/ShowOperationalAttributesAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/ShowOperationalAttributesAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/ShowOperationalAttributesAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/ShowOperationalAttributesAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,60 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.entry;
+
+
+import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
+import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.eclipse.jface.action.Action;
+
+
+/**
+ * This action is used to toggle the "show operational attributes" preference.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ShowOperationalAttributesAction extends Action
+{
+
+    /**
+     * Creates a new instance of ShowOperationalAttributesAction.
+     */
+    public ShowOperationalAttributesAction()
+    {
+        super( "Show Operational Attributes", AS_CHECK_BOX );
+        setToolTipText( getText() );
+        setEnabled( true );
+        setChecked( BrowserCommonActivator.getDefault().getPreferenceStore().getBoolean(
+            BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_SHOW_OPERATIONAL_ATTRIBUTES ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        BrowserCommonActivator.getDefault().getPreferenceStore().setValue(
+            BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_SHOW_OPERATIONAL_ATTRIBUTES, super.isChecked() );
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/ShowOperationalAttributesAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionDetailsPage.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionDetailsPage.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionDetailsPage.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,797 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.schemabrowser;
+
+
+import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.LdapSyntaxDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.MatchingRuleDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassDescription;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+/**
+ * The AttributeTypeDescriptionDetailsPage displays the details of an
+ * attribute type description.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class AttributeTypeDescriptionDetailsPage extends SchemaDetailsPage
+{
+
+    /** The main section, contains oid, names, desc and usage */
+    private Section mainSection;
+
+    /** The numeric oid field */
+    private Text numericOidText;
+
+    /** The names field */
+    private Text namesText;
+
+    /** The description field */
+    private Text descText;
+
+    /** The usage field */
+    private Text usageText;
+
+    /** The flag section, contains sv, obsolete, collective and read-only */
+    private Section flagSection;
+
+    /** The single-valued field */
+    private Label singleValuedText;
+
+    /** The obsolete field */
+    private Label isObsoleteText;
+
+    /** The collective field */
+    private Label collectiveText;
+
+    /** The no-user-modification field */
+    private Label noUserModificationText;
+
+    /** The syntax section, contains syntax description, lenth and a link to the syntax */ 
+    private Section syntaxSection;
+
+    /** The syntax description field */
+    private Text syntaxDescText;
+
+    /** The syntax length field */
+    private Text lengthText;
+
+    /** The link to the syntax */
+    private Hyperlink syntaxLink;
+
+    /** The matching rules section, contains links to matching rules */
+    private Section matchingRulesSection;
+
+    /** The link to the equality matching rule */
+    private Hyperlink equalityLink;
+
+    /** The link to the substring matching rule */
+    private Hyperlink substringLink;
+
+    /** The link to the ordering matching rule */
+    private Hyperlink orderingLink;
+
+    /** The section with other matching rules */
+    private Section otherMatchSection;
+
+    /** The links to other matching rules applicaple to the selected attribute */
+    private Hyperlink[] otherMatchLinks;
+
+    /** The section with links to object classes using the selected attribute as must */
+    private Section usedAsMustSection;
+
+    /** The links to object classes using the selected attribute as must */
+    private Hyperlink[] usedAsMustLinks;
+
+    /** The section with links to object classes using the selected attribute as may */
+    private Section usedAsMaySection;
+
+    /** The links to object classes using the selected attribute as may */
+    private Hyperlink[] usedAsMayLinks;
+
+    /** The section with a link to the superior attribute type */
+    private Section supertypeSection;
+
+    /** The link to the superior attribute type */
+    private Hyperlink superLink;
+
+    /** The section with links to the derived attribute types */
+    private Section subtypesSection;
+
+    /** The links to derived attribute types */
+    private Hyperlink[] subAttributeTypeLinks;
+
+
+    /**
+     * Creates a new instance of AttributeTypeDescriptionDetailsPage.
+     *
+     * @param schemaPage the master schema page
+     * @param toolkit the toolkit used to create controls
+     */
+    public AttributeTypeDescriptionDetailsPage( SchemaPage schemaPage, FormToolkit toolkit )
+    {
+        super( schemaPage, toolkit );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void createContents( final ScrolledForm detailForm )
+    {
+
+        this.detailForm = detailForm;
+        detailForm.getBody().setLayout( new GridLayout() );
+
+        // create main section
+        mainSection = toolkit.createSection( detailForm.getBody(), SWT.NONE );
+        mainSection.setText( "Details" );
+        mainSection.marginWidth = 0;
+        mainSection.marginHeight = 0;
+        mainSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( mainSection );
+
+        // create flag section
+        flagSection = toolkit.createSection( detailForm.getBody(), SWT.NONE );
+        flagSection.setText( "Flags" );
+        flagSection.marginWidth = 0;
+        flagSection.marginHeight = 0;
+        flagSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( flagSection );
+
+        // create flags content
+        Composite flagClient = toolkit.createComposite( flagSection, SWT.WRAP );
+        GridLayout flagLayout = new GridLayout();
+        flagLayout.numColumns = 4;
+        flagLayout.marginWidth = 0;
+        flagLayout.marginHeight = 0;
+        flagClient.setLayout( flagLayout );
+        flagSection.setClient( flagClient );
+
+        singleValuedText = toolkit.createLabel( flagClient, "Single valued", SWT.CHECK );
+        singleValuedText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        singleValuedText.setEnabled( false );
+
+        noUserModificationText = toolkit.createLabel( flagClient, "Read only", SWT.CHECK );
+        noUserModificationText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        noUserModificationText.setEnabled( false );
+
+        collectiveText = toolkit.createLabel( flagClient, "Collective", SWT.CHECK );
+        collectiveText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        collectiveText.setEnabled( false );
+
+        isObsoleteText = toolkit.createLabel( flagClient, "Obsolete", SWT.CHECK );
+        isObsoleteText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        isObsoleteText.setEnabled( false );
+
+        // create syntax section
+        syntaxSection = toolkit.createSection( detailForm.getBody(), SWT.NONE );
+        syntaxSection.setText( "Syntax" );
+        syntaxSection.marginWidth = 0;
+        syntaxSection.marginHeight = 0;
+        syntaxSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( syntaxSection );
+
+        // create syntax content
+        Composite syntaxClient = toolkit.createComposite( syntaxSection, SWT.WRAP );
+        GridLayout syntaxLayout = new GridLayout();
+        syntaxLayout.numColumns = 2;
+        syntaxLayout.marginWidth = 0;
+        syntaxLayout.marginHeight = 0;
+        syntaxClient.setLayout( syntaxLayout );
+        syntaxSection.setClient( syntaxClient );
+
+        toolkit.createLabel( syntaxClient, "Syntax OID:", SWT.NONE );
+        syntaxLink = toolkit.createHyperlink( syntaxClient, "", SWT.WRAP );
+        syntaxLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        syntaxLink.addHyperlinkListener( this );
+
+        toolkit.createLabel( syntaxClient, "Syntax Description:", SWT.NONE );
+        syntaxDescText = toolkit.createText( syntaxClient, "", SWT.NONE );
+        syntaxDescText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        syntaxDescText.setEditable( false );
+
+        toolkit.createLabel( syntaxClient, "Length:", SWT.NONE );
+        lengthText = toolkit.createText( syntaxClient, "", SWT.NONE );
+        lengthText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        lengthText.setEditable( false );
+
+        // create matching rules section
+        matchingRulesSection = toolkit.createSection( detailForm.getBody(), SWT.NONE );
+        matchingRulesSection.setText( "Matching Rules" );
+        matchingRulesSection.marginWidth = 0;
+        matchingRulesSection.marginHeight = 0;
+        matchingRulesSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( matchingRulesSection );
+
+        // create matching rules content
+        Composite matchClient = toolkit.createComposite( matchingRulesSection, SWT.WRAP );
+        GridLayout matchLayout = new GridLayout();
+        matchLayout.numColumns = 2;
+        matchLayout.marginWidth = 0;
+        matchLayout.marginHeight = 0;
+        matchClient.setLayout( matchLayout );
+        matchingRulesSection.setClient( matchClient );
+
+        toolkit.createLabel( matchClient, "Equality match:", SWT.NONE );
+        equalityLink = toolkit.createHyperlink( matchClient, "", SWT.WRAP );
+        equalityLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        equalityLink.addHyperlinkListener( this );
+
+        toolkit.createLabel( matchClient, "Substring match:", SWT.NONE );
+        substringLink = toolkit.createHyperlink( matchClient, "", SWT.WRAP );
+        substringLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        substringLink.addHyperlinkListener( this );
+
+        toolkit.createLabel( matchClient, "Ordering match:", SWT.NONE );
+        orderingLink = toolkit.createHyperlink( matchClient, "", SWT.WRAP );
+        orderingLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        orderingLink.addHyperlinkListener( this );
+
+        // create other matching rules section
+        otherMatchSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
+        otherMatchSection.setText( "Other Matching Rules" );
+        otherMatchSection.marginWidth = 0;
+        otherMatchSection.marginHeight = 0;
+        otherMatchSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( otherMatchSection );
+        otherMatchSection.addExpansionListener( new ExpansionAdapter()
+        {
+            public void expansionStateChanged( ExpansionEvent e )
+            {
+                detailForm.reflow( true );
+            }
+        } );
+
+        // create used as must section
+        usedAsMustSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
+        usedAsMustSection.setText( "Used as MUST" );
+        usedAsMustSection.marginWidth = 0;
+        usedAsMustSection.marginHeight = 0;
+        usedAsMustSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( usedAsMustSection );
+        usedAsMustSection.addExpansionListener( new ExpansionAdapter()
+        {
+            public void expansionStateChanged( ExpansionEvent e )
+            {
+                detailForm.reflow( true );
+            }
+        } );
+
+        // create used as may section
+        usedAsMaySection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
+        usedAsMaySection.setText( "Used as MAY" );
+        usedAsMaySection.marginWidth = 0;
+        usedAsMaySection.marginHeight = 0;
+        usedAsMaySection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( usedAsMaySection );
+        usedAsMaySection.addExpansionListener( new ExpansionAdapter()
+        {
+            public void expansionStateChanged( ExpansionEvent e )
+            {
+                detailForm.reflow( true );
+            }
+        } );
+
+        // create supertype section
+        supertypeSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
+        supertypeSection.setText( "Supertype" );
+        supertypeSection.marginWidth = 0;
+        supertypeSection.marginHeight = 0;
+        supertypeSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( supertypeSection );
+        supertypeSection.addExpansionListener( new ExpansionAdapter()
+        {
+            public void expansionStateChanged( ExpansionEvent e )
+            {
+                detailForm.reflow( true );
+            }
+        } );
+
+        // create subtypes section
+        subtypesSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
+        subtypesSection.setText( "Subtypes" );
+        subtypesSection.marginWidth = 0;
+        subtypesSection.marginHeight = 0;
+        subtypesSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( subtypesSection );
+        subtypesSection.addExpansionListener( new ExpansionAdapter()
+        {
+            public void expansionStateChanged( ExpansionEvent e )
+            {
+                detailForm.reflow( true );
+            }
+        } );
+
+        // create raw section
+        createRawSection();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setInput( Object input )
+    {
+        AttributeTypeDescription atd = null;
+        if ( input instanceof AttributeTypeDescription )
+        {
+            atd = ( AttributeTypeDescription ) input;
+        }
+
+        // create main content
+        createMainContent( atd );
+
+        // set flags
+        singleValuedText.setEnabled( atd != null && atd.isSingleValued() );
+        isObsoleteText.setEnabled( atd != null && atd.isObsolete() );
+        collectiveText.setEnabled( atd != null && atd.isCollective() );
+        noUserModificationText.setEnabled( atd != null && atd.isNoUserModification() );
+        flagSection.layout();
+
+        // set syntax content
+        String lsdOid = null;
+        LdapSyntaxDescription lsd = null;
+        String lsdLength = null;
+        if ( atd != null )
+        {
+            lsdOid = atd.getSyntaxDescriptionNumericOIDTransitive();
+            if ( lsdOid != null && atd.getSchema().hasLdapSyntaxDescription( lsdOid ) )
+            {
+                lsd = atd.getSchema().getLdapSyntaxDescription( lsdOid );
+            }
+            lsdLength = atd.getSyntaxDescriptionLengthTransitive();
+        }
+        syntaxLink.setText( getNonNullString( lsd != null ? lsd.getNumericOID() : lsdOid ) );
+        syntaxLink.setHref( lsd );
+        syntaxLink.setUnderlined( lsd != null );
+        syntaxLink.setEnabled( lsd != null );
+        syntaxDescText.setText( getNonNullString( lsd != null ? lsd.getDesc() : null ) );
+        lengthText.setText( getNonNullString( lsdLength ) );
+        syntaxSection.layout();
+
+        // set matching rules content
+        String emrOid = null;
+        MatchingRuleDescription emr = null;
+        if ( atd != null )
+        {
+            emrOid = atd.getEqualityMatchingRuleDescriptionOIDTransitive();
+            if ( emrOid != null && atd.getSchema().hasMatchingRuleDescription( emrOid ) )
+            {
+                emr = atd.getSchema().getMatchingRuleDescription( emrOid );
+            }
+        }
+        equalityLink.setText( getNonNullString( emr != null ? emr.toString() : emrOid ) );
+        equalityLink.setHref( emr );
+        equalityLink.setUnderlined( emr != null );
+        equalityLink.setEnabled( emr != null );
+
+        String smrOid = null;
+        MatchingRuleDescription smr = null;
+        if ( atd != null )
+        {
+            smrOid = atd.getSubstringMatchingRuleDescriptionOIDTransitive();
+            if ( smrOid != null && atd.getSchema().hasMatchingRuleDescription( smrOid ) )
+            {
+                smr = atd.getSchema().getMatchingRuleDescription( smrOid );
+            }
+        }
+        substringLink.setText( getNonNullString( smr != null ? smr.toString() : smrOid ) );
+        substringLink.setHref( smr );
+        substringLink.setUnderlined( smr != null );
+        substringLink.setEnabled( smr != null );
+
+        String omrOid = null;
+        MatchingRuleDescription omr = null;
+        if ( atd != null )
+        {
+            omrOid = atd.getOrderingMatchingRuleDescriptionOIDTransitive();
+            if ( omrOid != null && atd.getSchema().hasMatchingRuleDescription( omrOid ) )
+            {
+                omr = atd.getSchema().getMatchingRuleDescription( omrOid );
+            }
+        }
+        orderingLink.setText( getNonNullString( omr != null ? omr.toString() : omrOid ) );
+        orderingLink.setHref( omr );
+        orderingLink.setUnderlined( omr != null );
+        orderingLink.setEnabled( omr != null );
+        matchingRulesSection.layout();
+
+        // create contents of dynamic sections
+        createOtherMatchContent( atd );
+        createUsedAsMustContent( atd );
+        createUsedAsMayContent( atd );
+        createSupertypeContent( atd );
+        createSubtypesContent( atd );
+        createRawContents( atd );
+
+        detailForm.reflow( true );
+    }
+
+
+    /**
+     * Creates the content of the main section. It is newly created
+     * on every input change to ensure a proper layout of 
+     * multilined descriptions. 
+     *
+     * @param atd the attribute type description
+     */
+    private void createMainContent( AttributeTypeDescription atd )
+    {
+        // dispose old content
+        if ( mainSection.getClient() != null )
+        {
+            mainSection.getClient().dispose();
+        }
+
+        // create new client
+        Composite mainClient = toolkit.createComposite( mainSection, SWT.WRAP );
+        GridLayout mainLayout = new GridLayout( 2, false );
+        mainClient.setLayout( mainLayout );
+        mainSection.setClient( mainClient );
+
+        // create new content
+        if ( atd != null )
+        {
+            toolkit.createLabel( mainClient, "Numeric OID:", SWT.NONE );
+            numericOidText = toolkit.createText( mainClient, getNonNullString( atd.getNumericOID() ), SWT.NONE );
+            numericOidText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+            numericOidText.setEditable( false );
+
+            toolkit.createLabel( mainClient, "Attribute names:", SWT.NONE );
+            namesText = toolkit.createText( mainClient, getNonNullString( atd.toString() ), SWT.NONE );
+            namesText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+            namesText.setEditable( false );
+
+            toolkit.createLabel( mainClient, "Descripton:", SWT.WRAP );
+            descText = toolkit.createText( mainClient, getNonNullString( atd.getDesc() ), SWT.WRAP | SWT.MULTI );
+            GridData gd = new GridData( GridData.FILL_HORIZONTAL );
+            gd.widthHint = detailForm.getForm().getSize().x - 100 - 60;
+            descText.setLayoutData( gd );
+            descText.setEditable( false );
+
+            toolkit.createLabel( mainClient, "Usage:", SWT.NONE );
+            usageText = toolkit.createText( mainClient, getNonNullString( atd.getUsage() ), SWT.NONE );
+            usageText.setLayoutData( new GridData( GridData.GRAB_HORIZONTAL ) );
+            usageText.setEditable( false );
+
+        }
+
+        mainSection.layout();
+    }
+
+
+    /**
+     * Creates the content of the other matching rules section. 
+     * It is newly created on every input change because the content
+     * of this section is dynamic.
+     *
+     * @param atd the attribute type description
+     */
+    private void createOtherMatchContent( AttributeTypeDescription atd )
+    {
+        // dispose old content
+        if ( otherMatchSection.getClient() != null )
+        {
+            otherMatchSection.getClient().dispose();
+        }
+
+        // create new client
+        Composite otherMatchClient = toolkit.createComposite( otherMatchSection, SWT.WRAP );
+        otherMatchClient.setLayout( new GridLayout() );
+        otherMatchSection.setClient( otherMatchClient );
+
+        // create new content, either links to other matching rules 
+        // or a dash if no other matching rules exist.
+        if ( atd != null )
+        {
+            String[] names = atd.getOtherMatchingRuleDescriptionNames();
+            if ( names != null && names.length > 0 )
+            {
+                otherMatchSection.setText( "Other Matching Rules (" + names.length + ")" );
+                otherMatchLinks = new Hyperlink[names.length];
+                for ( int i = 0; i < names.length; i++ )
+                {
+                    if ( atd.getSchema().hasMatchingRuleDescription( names[i] ) )
+                    {
+                        MatchingRuleDescription mrd = atd.getSchema().getMatchingRuleDescription( names[i] );
+                        otherMatchLinks[i] = toolkit.createHyperlink( otherMatchClient, mrd.toString(), SWT.WRAP );
+                        otherMatchLinks[i].setHref( mrd );
+                        otherMatchLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                        otherMatchLinks[i].setUnderlined( true );
+                        otherMatchLinks[i].setEnabled( true );
+                        otherMatchLinks[i].addHyperlinkListener( this );
+                    }
+                    else
+                    {
+                        otherMatchLinks[i] = toolkit.createHyperlink( otherMatchClient, names[i], SWT.WRAP );
+                        otherMatchLinks[i].setHref( null );
+                        otherMatchLinks[i].setUnderlined( false );
+                        otherMatchLinks[i].setEnabled( false );
+                    }
+                }
+            }
+            else
+            {
+                otherMatchSection.setText( "Other Matching Rules (0)" );
+                otherMatchLinks = new Hyperlink[0];
+                Text otherText = toolkit.createText( otherMatchClient, getNonNullString( null ), SWT.NONE );
+                otherText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                otherText.setEditable( false );
+            }
+        }
+        else
+        {
+            otherMatchSection.setText( "Other Matching Rules" );
+        }
+
+        otherMatchSection.layout();
+    }
+
+
+    /**
+     * Creates the content of the supertype section. 
+     * It is newly created on every input change because the content
+     * of this section is dynamic.
+     *
+     * @param atd the attribute type description
+     */
+    private void createSupertypeContent( AttributeTypeDescription atd )
+    {
+        // dispose old content
+        if ( supertypeSection.getClient() != null )
+        {
+            supertypeSection.getClient().dispose();
+        }
+
+        // create new client
+        Composite superClient = toolkit.createComposite( supertypeSection, SWT.WRAP );
+        superClient.setLayout( new GridLayout() );
+        supertypeSection.setClient( superClient );
+
+        // create new content, either a link to the superior attribute type
+        // or a dash if no supertype exists.
+        if ( atd != null )
+        {
+            String superName = atd.getSuperiorAttributeTypeDescriptionName();
+            if ( superName != null )
+            {
+                supertypeSection.setText( "Supertype (" + "1" + ")" );
+                if ( atd.getSchema().hasAttributeTypeDescription( superName ) )
+                {
+                    AttributeTypeDescription supAtd = atd.getSchema().getAttributeTypeDescription( superName );
+                    superLink = toolkit.createHyperlink( superClient, supAtd.toString(), SWT.WRAP );
+                    superLink.setHref( supAtd );
+                    superLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                    superLink.setUnderlined( true );
+                    superLink.setEnabled( true );
+                    superLink.addHyperlinkListener( this );
+                }
+                else
+                {
+                    superLink = toolkit.createHyperlink( superClient, superName, SWT.WRAP );
+                    superLink.setHref( null );
+                    superLink.setUnderlined( false );
+                    superLink.setEnabled( false );
+                }
+            }
+            else
+            {
+                supertypeSection.setText( "Supertype (0)" );
+                superLink = null;
+                Text supText = toolkit.createText( superClient, getNonNullString( null ), SWT.NONE );
+                supText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                supText.setEditable( false );
+            }
+        }
+        else
+        {
+            supertypeSection.setText( "Supertype" );
+        }
+
+        supertypeSection.layout();
+    }
+
+
+    /**
+     * Creates the content of the subtypes. 
+     * It is newly created on every input change because the content
+     * of this section is dynamic.
+     *
+     * @param atd the attribute type description
+     */
+    private void createSubtypesContent( AttributeTypeDescription atd )
+    {
+        // dispose old content
+        if ( subtypesSection.getClient() != null )
+        {
+            subtypesSection.getClient().dispose();
+        }
+
+        // create new client
+        Composite subClient = toolkit.createComposite( subtypesSection, SWT.WRAP );
+        subClient.setLayout( new GridLayout() );
+        subtypesSection.setClient( subClient );
+
+        // create new content, either links to subtypes or a dash if no subtypes exist.
+        if ( atd != null )
+        {
+            AttributeTypeDescription[] subATDs = atd.getDerivedAttributeTypeDescriptions();
+            if ( subATDs != null && subATDs.length > 0 )
+            {
+                subtypesSection.setText( "Subtypes (" + subATDs.length + ")" );
+                subAttributeTypeLinks = new Hyperlink[subATDs.length];
+                for ( int i = 0; i < subATDs.length; i++ )
+                {
+                    subAttributeTypeLinks[i] = toolkit.createHyperlink( subClient, subATDs[i].toString(), SWT.WRAP );
+                    subAttributeTypeLinks[i].setHref( subATDs[i] );
+                    subAttributeTypeLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                    subAttributeTypeLinks[i].setUnderlined( true );
+                    subAttributeTypeLinks[i].setEnabled( true );
+                    subAttributeTypeLinks[i].addHyperlinkListener( this );
+                }
+            }
+            else
+            {
+                subtypesSection.setText( "Subtypes (0)" );
+                subAttributeTypeLinks = new Hyperlink[0];
+                Text subText = toolkit.createText( subClient, getNonNullString( null ), SWT.NONE );
+                subText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                subText.setEditable( false );
+            }
+        }
+        else
+        {
+            subtypesSection.setText( "Subtypes" );
+        }
+
+        subtypesSection.layout();
+
+    }
+
+
+    /**
+     * Creates the content of the used as must section. 
+     * It is newly created on every input change because the content
+     * of this section is dynamic.
+     *
+     * @param atd the attribute type description
+     */
+    private void createUsedAsMustContent( AttributeTypeDescription atd )
+    {
+        // dispose old content
+        if ( usedAsMustSection.getClient() != null )
+        {
+            usedAsMustSection.getClient().dispose();
+        }
+
+        // create new client
+        Composite mustClient = toolkit.createComposite( usedAsMustSection, SWT.WRAP );
+        mustClient.setLayout( new GridLayout() );
+        usedAsMustSection.setClient( mustClient );
+
+        // create new content, either links to objectclasses or a dash
+        if ( atd != null )
+        {
+            ObjectClassDescription[] usedAsMusts = atd.getUsedAsMust();
+            if ( usedAsMusts != null && usedAsMusts.length > 0 )
+            {
+                usedAsMustSection.setText( "Used as MUST (" + usedAsMusts.length + ")" );
+                usedAsMustLinks = new Hyperlink[usedAsMusts.length];
+                for ( int i = 0; i < usedAsMusts.length; i++ )
+                {
+                    usedAsMustLinks[i] = toolkit.createHyperlink( mustClient, usedAsMusts[i].toString(), SWT.WRAP );
+                    usedAsMustLinks[i].setHref( usedAsMusts[i] );
+                    usedAsMustLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                    usedAsMustLinks[i].setUnderlined( true );
+                    usedAsMustLinks[i].setEnabled( true );
+                    usedAsMustLinks[i].addHyperlinkListener( this );
+                }
+            }
+            else
+            {
+                usedAsMustSection.setText( "Used as MUST (0)" );
+                usedAsMustLinks = new Hyperlink[0];
+                Text mustText = toolkit.createText( mustClient, getNonNullString( null ), SWT.NONE );
+                mustText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                mustText.setEditable( false );
+            }
+        }
+        else
+        {
+            usedAsMustSection.setText( "Used as MUST" );
+        }
+
+        usedAsMustSection.layout();
+
+    }
+
+
+    /**
+     * Creates the content of the used as may section. 
+     * It is newly created on every input change because the content
+     * of this section is dynamic.
+     *
+     * @param atd the attribute type description
+     */
+    private void createUsedAsMayContent( AttributeTypeDescription atd )
+    {
+        // dispose old content
+        if ( usedAsMaySection.getClient() != null )
+        {
+            usedAsMaySection.getClient().dispose();
+        }
+
+        // create new client
+        Composite mayClient = toolkit.createComposite( usedAsMaySection, SWT.WRAP );
+        mayClient.setLayout( new GridLayout() );
+        usedAsMaySection.setClient( mayClient );
+
+        // create new content, either links to objectclasses or a dash
+        if ( atd != null )
+        {
+            ObjectClassDescription[] usedAsMays = atd.getUsedAsMay();
+            if ( usedAsMays != null && usedAsMays.length > 0 )
+            {
+                usedAsMaySection.setText( "Used as MAY (" + usedAsMays.length + ")" );
+                usedAsMayLinks = new Hyperlink[usedAsMays.length];
+                for ( int i = 0; i < usedAsMays.length; i++ )
+                {
+                    usedAsMayLinks[i] = toolkit.createHyperlink( mayClient, usedAsMays[i].toString(), SWT.WRAP );
+                    usedAsMayLinks[i].setHref( usedAsMays[i] );
+                    usedAsMayLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                    usedAsMayLinks[i].setUnderlined( true );
+                    usedAsMayLinks[i].setEnabled( true );
+                    usedAsMayLinks[i].addHyperlinkListener( this );
+                }
+            }
+            else
+            {
+                usedAsMaySection.setText( "Used as MAY (0)" );
+                usedAsMayLinks = new Hyperlink[0];
+                Text mayText = toolkit.createText( mayClient, getNonNullString( null ), SWT.NONE );
+                mayText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                mayText.setEditable( false );
+            }
+        }
+        else
+        {
+            usedAsMaySection.setText( "Used as MAY" );
+        }
+
+        usedAsMaySection.layout();
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionDetailsPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionPage.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionPage.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionPage.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,231 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.schemabrowser;
+
+
+import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * The AttributeTypeDescriptionPage displays a list with all
+ * attribute type descriptions and hosts the detail page.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class AttributeTypeDescriptionPage extends SchemaPage
+{
+
+    /**
+     * Creates a new instance of AttributeTypeDescriptionPage.
+     *
+     * @param schemaBrowser the schema browser
+     */
+    public AttributeTypeDescriptionPage( SchemaBrowser schemaBrowser )
+    {
+        super( schemaBrowser );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected String getTitle()
+    {
+        return "Attribute Types";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected String getFilterDescription()
+    {
+        return "Please select an attribute type. Enter a filter to restrict the list.";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected IStructuredContentProvider getContentProvider()
+    {
+        return new ATDContentProvider();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected ITableLabelProvider getLabelProvider()
+    {
+        return new ATDLabelProvider();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected ViewerSorter getSorter()
+    {
+        return new ATDViewerSorter();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected ViewerFilter getFilter()
+    {
+        return new ATDViewerFilter();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected SchemaDetailsPage getDetailsPage()
+    {
+        return new AttributeTypeDescriptionDetailsPage( this, this.toolkit );
+    }
+
+    /**
+     * The content provider used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class ATDContentProvider implements IStructuredContentProvider
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public Object[] getElements( Object inputElement )
+        {
+            if ( inputElement instanceof Schema )
+            {
+                Schema schema = ( Schema ) inputElement;
+                if ( schema != null )
+                {
+                    return schema.getAttributeTypeDescriptions();
+                }
+            }
+            return new Object[0];
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void dispose()
+        {
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void inputChanged( Viewer viewer, Object oldInput, Object newInput )
+        {
+        }
+    }
+
+    /**
+     * The label provider used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class ATDLabelProvider extends LabelProvider implements ITableLabelProvider
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public String getColumnText( Object obj, int index )
+        {
+            return obj.toString();
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public Image getColumnImage( Object obj, int index )
+        {
+            return null;
+        }
+    }
+
+    /**
+     * The sorter used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class ATDViewerSorter extends ViewerSorter
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public int compare( Viewer viewer, Object e1, Object e2 )
+        {
+            return e1.toString().compareTo( e2.toString() );
+        }
+    }
+
+    /**
+     * The filter used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class ATDViewerFilter extends ViewerFilter
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public boolean select( Viewer viewer, Object parentElement, Object element )
+        {
+            if ( element instanceof AttributeTypeDescription )
+            {
+                AttributeTypeDescription atd = ( AttributeTypeDescription ) element;
+                boolean matched = false;
+
+                if ( !matched )
+                    matched = atd.toString().toLowerCase().indexOf( filterText.getText().toLowerCase() ) != -1;
+                if ( !matched )
+                    matched = atd.getNumericOID().toLowerCase().indexOf( filterText.getText().toLowerCase() ) != -1;
+
+                return matched;
+            }
+            return false;
+        }
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,257 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.schemabrowser;
+
+
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionFolder;
+import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
+import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
+import org.apache.directory.studio.connection.ui.ConnectionUIPlugin;
+import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
+import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
+import org.apache.directory.studio.ldapbrowser.common.widgets.search.BrowserConnectionWidget;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.eclipse.jface.action.ContributionItem;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+
+/**
+ * A contribution item that adds a BrowserConnectionWidget with connections to the toolbar.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class BrowserConnectionWidgetContributionItem extends ContributionItem implements ConnectionUpdateListener
+{
+    /** The schema page */
+    private SchemaPage schemaPage;
+
+    /** The tool item */
+    private ToolItem toolitem;
+
+    /** The tool item composite */
+    private Composite toolItemComposite;
+    private BrowserConnectionWidget browserConnectionWidget;
+
+
+    /**
+     * Creates a new instance of ConnectionContributionItem.
+     *
+     * @param schemaPage the schema page
+     */
+    public BrowserConnectionWidgetContributionItem( SchemaPage schemaPage )
+    {
+        this.schemaPage = schemaPage;
+    }
+
+
+    /**
+     * Creates and returns the control for this contribution item
+     * under the given parent composite.
+     *
+     * @param parent the parent composite
+     * @return the new control
+     */
+    private Control createControl( Composite parent )
+    {
+        // Creating the ToolItem Composite
+        toolItemComposite = new Composite( parent, SWT.NONE );
+        GridLayout gridLayout = new GridLayout( 2, false );
+        gridLayout.marginWidth = 0;
+        gridLayout.marginHeight = 0;
+        toolItemComposite.setLayout( gridLayout );
+        toolItemComposite.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        // Creating the Browser Connection Widget
+        browserConnectionWidget = new BrowserConnectionWidget();
+        browserConnectionWidget.createWidget( toolItemComposite );
+        browserConnectionWidget.addWidgetModifyListener( new WidgetModifyListener()
+        {
+            public void widgetModified( WidgetModifyEvent event )
+            {
+                schemaPage.getSchemaBrowser().setInput( new SchemaBrowserInput( getConnection(), null ) );
+            }
+        } );
+
+        ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionUIPlugin.getDefault().getEventRunner() );
+
+        // Initializing the width for the toolbar item
+        toolitem.setWidth( 250 );
+
+        return toolItemComposite;
+    }
+
+
+    /**
+     * @see org.eclipse.jface.action.ContributionItem#dispose()
+     */
+    public void dispose()
+    {
+        ConnectionEventRegistry.removeConnectionUpdateListener( this );
+        toolItemComposite.dispose();
+        toolItemComposite = null;
+        browserConnectionWidget = null;
+    }
+
+
+    /**
+     * The control item implementation of this <code>IContributionItem</code>
+     * method calls the <code>createControl</code> method.
+     *
+     * @param parent the parent of the control to fill
+     */
+    public final void fill( Composite parent )
+    {
+        createControl( parent );
+    }
+
+
+    /**
+     * The control item implementation of this <code>IContributionItem</code>
+     * method throws an exception since controls cannot be added to menus.
+     *
+     * @param parent the menu
+     * @param index menu index
+     */
+    public final void fill( Menu parent, int index )
+    {
+        Assert.isTrue( false, "Can't add a control to a menu" );//$NON-NLS-1$
+    }
+
+
+    /**
+     * The control item implementation of this <code>IContributionItem</code>
+     * method calls the <code>createControl</code>  method to
+     * create a control under the given parent, and then creates
+     * a new tool item to hold it.
+     *
+     * @param parent the ToolBar to add the new control to
+     * @param index the index
+     */
+    public void fill( ToolBar parent, int index )
+    {
+        toolitem = new ToolItem( parent, SWT.SEPARATOR, index );
+        Control control = createControl( parent );
+        toolitem.setControl( control );
+    }
+
+
+    /**
+     * Gets the connection.
+     *
+     * @return the connection
+     */
+    public IBrowserConnection getConnection()
+    {
+        return browserConnectionWidget.getBrowserConnection();
+    }
+
+
+    /**
+     * Sets the connection.
+     *
+     * @param connection the connection
+     */
+    public void setConnection( IBrowserConnection connection )
+    {
+        browserConnectionWidget.setBrowserConnection( connection );
+    }
+
+
+    /**
+     * Updates the enabled state.
+     */
+    public void updateEnabledState()
+    {
+        browserConnectionWidget.setEnabled( !schemaPage.isShowDefaultSchema() );
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionUpdated(org.apache.directory.studio.connection.core.Connection)
+     */
+    public final void connectionUpdated( Connection connection )
+    {
+        IBrowserConnection selectedConnection = browserConnectionWidget.getBrowserConnection();
+        if ( connection.equals( selectedConnection.getConnection() ) )
+        {
+            browserConnectionWidget.setBrowserConnection( browserConnectionWidget.getBrowserConnection() );
+        }
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionAdded(org.apache.directory.studio.connection.core.Connection)
+     */
+    public void connectionAdded( Connection connection )
+    {
+        // Nothing to do
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRemoved(org.apache.directory.studio.connection.core.Connection)
+     */
+    public void connectionRemoved( Connection connection )
+    {
+        IBrowserConnection selectedConnection = browserConnectionWidget.getBrowserConnection();
+        if ( connection.equals( selectedConnection.getConnection() ) )
+        {
+            schemaPage.getSchemaBrowser().setInput( new SchemaBrowserInput( null, null ) );
+        }
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionOpened(org.apache.directory.studio.connection.core.Connection)
+     */
+    public void connectionOpened( Connection connection )
+    {
+        // Nothing to do
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionClosed(org.apache.directory.studio.connection.core.Connection)
+     */
+    public void connectionClosed( Connection connection )
+    {
+        // Nothing to do
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderModified(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderModified( ConnectionFolder connectionFolder )
+    {
+        // Nothing to do
+    }
+}
\ No newline at end of file

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionDetailsPage.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionDetailsPage.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionDetailsPage.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,229 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.schemabrowser;
+
+
+import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.LdapSyntaxDescription;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+/**
+ * The LdapSyntaxDescriptionDetailsPage displays the details of an
+ * syntax description.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LdapSyntaxDescriptionDetailsPage extends SchemaDetailsPage
+{
+
+    /** The main section, contains oid and desc */
+    private Section mainSection;
+
+    /** The numeric oid field */
+    private Text numericOidText;
+
+    /** The description field */
+    private Text descText;
+
+    /** The used from section, contains links to attribute types */
+    private Section usedFromSection;
+
+    /** The links to attributes using the syntax */
+    private Hyperlink[] usedFromLinks;
+
+
+    /**
+     * Creates a new instance of LdapSyntaxDescriptionDetailsPage.
+     *
+     * @param schemaPage the master schema page
+     * @param toolkit the toolkit used to create controls
+     */
+    public LdapSyntaxDescriptionDetailsPage( SchemaPage schemaPage, FormToolkit toolkit )
+    {
+        super( schemaPage, toolkit );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void createContents( final ScrolledForm detailForm )
+    {
+
+        this.detailForm = detailForm;
+        detailForm.getBody().setLayout( new GridLayout() );
+
+        // create main section
+        mainSection = toolkit.createSection( detailForm.getBody(), SWT.NONE );
+        mainSection.setText( "Details" );
+        mainSection.marginWidth = 0;
+        mainSection.marginHeight = 0;
+        mainSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( mainSection );
+
+        // create used from section
+        usedFromSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
+        usedFromSection.setText( "Used from" );
+        usedFromSection.marginWidth = 0;
+        usedFromSection.marginHeight = 0;
+        usedFromSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        toolkit.createCompositeSeparator( usedFromSection );
+        usedFromSection.addExpansionListener( new ExpansionAdapter()
+        {
+            public void expansionStateChanged( ExpansionEvent e )
+            {
+                detailForm.reflow( true );
+            }
+        } );
+
+        // create raw aection
+        createRawSection();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setInput( Object input )
+    {
+        LdapSyntaxDescription lsd = null;
+        if ( input instanceof LdapSyntaxDescription )
+        {
+            lsd = ( LdapSyntaxDescription ) input;
+        }
+
+        createMainContent( lsd );
+        createUsedFromContents( lsd );
+        createRawContents( lsd );
+
+        detailForm.reflow( true );
+    }
+
+
+    /**
+     * Creates the content of the main section. It is newly created
+     * on every input change to ensure a proper layout of 
+     * multilined descriptions. 
+     *
+     * @param lsd the syntax description
+     */
+    private void createMainContent( LdapSyntaxDescription lsd )
+    {
+        // dispose old content
+        if ( mainSection.getClient() != null )
+        {
+            mainSection.getClient().dispose();
+        }
+
+        // create new client
+        Composite mainClient = toolkit.createComposite( mainSection, SWT.WRAP );
+        GridLayout mainLayout = new GridLayout( 2, false );
+        mainClient.setLayout( mainLayout );
+        mainSection.setClient( mainClient );
+
+        // create new content
+        if ( lsd != null )
+        {
+            toolkit.createLabel( mainClient, "Numeric OID:", SWT.NONE );
+            numericOidText = toolkit.createText( mainClient, getNonNullString( lsd.getNumericOID() ), SWT.NONE );
+            numericOidText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+            numericOidText.setEditable( false );
+
+            toolkit.createLabel( mainClient, "Descripton:", SWT.NONE );
+            descText = toolkit.createText( mainClient, getNonNullString( lsd.getDesc() ), SWT.WRAP | SWT.MULTI );
+            GridData gd = new GridData( GridData.FILL_HORIZONTAL );
+            gd.widthHint = detailForm.getForm().getSize().x - 100 - 60;
+            descText.setLayoutData( gd );
+            descText.setEditable( false );
+        }
+
+        mainSection.layout();
+    }
+
+
+    /**
+     * Creates the content of the used from section. 
+     * It is newly created on every input change because the content
+     * of this section is dynamic.
+     *
+     * @param lsd the syntax description
+     */
+    private void createUsedFromContents( LdapSyntaxDescription lsd )
+    {
+        // dispose old content
+        if ( usedFromSection.getClient() != null && !usedFromSection.getClient().isDisposed() )
+        {
+            usedFromSection.getClient().dispose();
+        }
+
+        // create new client
+        Composite usedFromClient = toolkit.createComposite( usedFromSection, SWT.WRAP );
+        usedFromClient.setLayout( new GridLayout() );
+        usedFromSection.setClient( usedFromClient );
+
+        // create content
+        if ( lsd != null )
+        {
+            AttributeTypeDescription[] usedFromATDs = lsd.getUsedFromAttributeTypeDescription();
+            if ( usedFromATDs != null && usedFromATDs.length > 0 )
+            {
+                usedFromSection.setText( "Used from (" + usedFromATDs.length + ")" );
+                usedFromLinks = new Hyperlink[usedFromATDs.length];
+                for ( int i = 0; i < usedFromATDs.length; i++ )
+                {
+                    usedFromLinks[i] = toolkit.createHyperlink( usedFromClient, usedFromATDs[i].toString(), SWT.WRAP );
+                    usedFromLinks[i].setHref( usedFromATDs[i] );
+                    usedFromLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                    usedFromLinks[i].setUnderlined( true );
+                    usedFromLinks[i].setEnabled( true );
+                    usedFromLinks[i].addHyperlinkListener( this );
+                }
+            }
+            else
+            {
+                usedFromSection.setText( "Used from (0)" );
+                usedFromLinks = new Hyperlink[0];
+                Text usedFromText = toolkit.createText( usedFromClient, getNonNullString( null ), SWT.NONE );
+                usedFromText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+                usedFromText.setEditable( false );
+            }
+        }
+        else
+        {
+            usedFromSection.setText( "Used from" );
+        }
+
+        usedFromSection.layout();
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionDetailsPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionPage.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionPage.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionPage.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,235 @@
+/*
+ *  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.directory.studio.ldapbrowser.ui.editors.schemabrowser;
+
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.directory.studio.ldapbrowser.core.model.schema.LdapSyntaxDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * The LdapSyntaxDescriptionPage displays a list with all
+ * syntax descriptions and hosts the detail page.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LdapSyntaxDescriptionPage extends SchemaPage
+{
+
+    /**
+     * Creates a new instance of LdapSyntaxDescriptionPage.
+     *
+     * @param schemaBrowser the schema browser
+     */
+    public LdapSyntaxDescriptionPage( SchemaBrowser schemaBrowser )
+    {
+        super( schemaBrowser );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected String getTitle()
+    {
+        return "Syntaxes";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected String getFilterDescription()
+    {
+        return "Please select a syntax. Enter a filter to restrict the list.";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected IStructuredContentProvider getContentProvider()
+    {
+        return new LSDContentProvider();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected ITableLabelProvider getLabelProvider()
+    {
+        return new LSDLabelProvider();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected ViewerSorter getSorter()
+    {
+        return new LSDViewerSorter();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected ViewerFilter getFilter()
+    {
+        return new LSDViewerFilter();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected SchemaDetailsPage getDetailsPage()
+    {
+        return new LdapSyntaxDescriptionDetailsPage( this, this.toolkit );
+    }
+
+    /**
+     * The content provider used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class LSDContentProvider implements IStructuredContentProvider
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public Object[] getElements( Object inputElement )
+        {
+            if ( inputElement instanceof Schema )
+            {
+                Schema schema = ( Schema ) inputElement;
+                if ( schema != null && schema.getLsdMapByNumericOID() != null )
+                {
+                    Set<Object> set = new HashSet<Object>( schema.getLsdMapByNumericOID().values() );
+                    return set.toArray();
+                }
+            }
+            return new Object[0];
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void dispose()
+        {
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void inputChanged( Viewer viewer, Object oldInput, Object newInput )
+        {
+        }
+    }
+
+    /**
+     * The label provider used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class LSDLabelProvider extends LabelProvider implements ITableLabelProvider
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public String getColumnText( Object obj, int index )
+        {
+            return obj.toString();
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public Image getColumnImage( Object obj, int index )
+        {
+            return null;
+        }
+    }
+
+    /**
+     * The sorter used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class LSDViewerSorter extends ViewerSorter
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public int compare( Viewer viewer, Object e1, Object e2 )
+        {
+            return e1.toString().compareTo( e2.toString() );
+        }
+    }
+
+    /**
+     * The filter used by the viewer.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class LSDViewerFilter extends ViewerFilter
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public boolean select( Viewer viewer, Object parentElement, Object element )
+        {
+            if ( element instanceof LdapSyntaxDescription )
+            {
+                LdapSyntaxDescription lsd = ( LdapSyntaxDescription ) element;
+                boolean matched = false;
+
+                if ( !matched )
+                    matched = lsd.toString().toLowerCase().indexOf( filterText.getText().toLowerCase() ) != -1;
+                if ( !matched )
+                    matched = lsd.getNumericOID().toLowerCase().indexOf( filterText.getText().toLowerCase() ) != -1;
+
+                return matched;
+            }
+            return false;
+        }
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/LdapSyntaxDescriptionPage.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message