directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r491104 [3/3] - in /directory/trunks/ldapstudio/ldapstudio-browser-ui: ./ META-INF/ src/main/java/org/apache/directory/ldapstudio/browser/ui/ src/main/java/org/apache/directory/ldapstudio/browser/ui/actions/ src/main/java/org/apache/directo...
Date Fri, 29 Dec 2006 21:15:50 GMT
Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java Fri Dec 29 13:15:47 2006
@@ -0,0 +1,97 @@
+/*
+ *  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.ldapstudio.browser.ui.valueeditors.internal;
+
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
+import org.apache.directory.ldapstudio.browser.core.model.IValue;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.AbstractInPlaceStringValueEditor;
+
+
+public class InPlaceGeneralizedTimeValueEditor extends AbstractInPlaceStringValueEditor
+{
+
+    public InPlaceGeneralizedTimeValueEditor()
+    {
+        super();
+    }
+
+
+    public String getDisplayValue( AttributeHierarchy ah )
+    {
+        if ( ah == null )
+        {
+            return "NULL";
+        }
+        else if ( ah.size() == 1 && ah.getAttribute().getValueSize() == 1 )
+        {
+            return getDisplayValue( ah.getAttribute().getValues()[0] );
+        }
+        else
+        {
+            return "not displayable";
+        }
+    }
+
+
+    public String getDisplayValue( IValue value )
+    {
+        String displayValue = super.getDisplayValue( value );
+
+        if ( !showRawValues() )
+        {
+            DateFormat ldapFormat = new SimpleDateFormat( "yyyyMMddHHmmssZ" );
+            DateFormat activeDirectoryFormat = new SimpleDateFormat( "yyyyMMddHHmmss'.'SSSZ" );
+            DateFormat targetFormat = DateFormat.getDateTimeInstance( DateFormat.MEDIUM, DateFormat.LONG );
+
+            String s = displayValue;
+            if ( s.matches( "[\\.0-9]+Z" ) )
+            {
+                s = s.replaceAll( "Z", "GMT" );
+            }
+
+            try
+            {
+                Date date = ldapFormat.parse( s );
+                displayValue = targetFormat.format( date ) + " (" + displayValue + ")";
+            }
+            catch ( ParseException e1 )
+            {
+                try
+                {
+                    Date date = activeDirectoryFormat.parse( s );
+                    displayValue = targetFormat.format( date ) + " (" + displayValue + ")";
+                }
+                catch ( ParseException e2 )
+                {
+                }
+            }
+        }
+
+        return displayValue;
+    }
+
+}

Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java Fri Dec 29 13:15:47 2006
@@ -0,0 +1,35 @@
+/*
+ *  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.ldapstudio.browser.ui.valueeditors.internal;
+
+
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.AbstractInPlaceStringValueEditor;
+
+
+public class InPlaceTextValueEditor extends AbstractInPlaceStringValueEditor
+{
+
+    public InPlaceTextValueEditor()
+    {
+        super();
+    }
+
+}

Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java Fri Dec 29 13:15:47 2006
@@ -0,0 +1,214 @@
+/*
+ *  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.ldapstudio.browser.ui.valueeditors.internal;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.directory.ldapstudio.browser.core.events.ModelModifier;
+import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
+import org.apache.directory.ldapstudio.browser.core.model.IAttribute;
+import org.apache.directory.ldapstudio.browser.core.model.IConnection;
+import org.apache.directory.ldapstudio.browser.core.model.IEntry;
+import org.apache.directory.ldapstudio.browser.core.model.IValue;
+import org.apache.directory.ldapstudio.browser.core.model.ModelModificationException;
+import org.apache.directory.ldapstudio.browser.ui.dialogs.MultivaluedDialog;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+
+public class MultivaluedValueEditor extends CellEditor implements IValueEditor, ModelModifier
+{
+
+    /** The value to handle */
+    private Object value;
+
+    /** The parent composite, used to instanciate a new control */
+    private Composite parent;
+
+    /** The name of this value editor */
+    private String name;
+
+    /** The image of this value editor */
+    private ImageDescriptor imageDescriptor;
+
+    /** The value editor manager, used to get proper value editor */
+    protected ValueEditorManager valueEditorManager;
+
+
+    public MultivaluedValueEditor( Composite parent, ValueEditorManager valueEditorManager )
+    {
+        super( parent );
+        this.parent = parent;
+        this.valueEditorManager = valueEditorManager;
+    }
+
+
+    protected Control createControl( Composite parent )
+    {
+        return null;
+    }
+
+
+    protected Object doGetValue()
+    {
+        return this.value;
+    }
+
+
+    protected void doSetFocus()
+    {
+    }
+
+
+    protected void doSetValue( Object value )
+    {
+        this.value = value;
+    }
+
+
+    public void activate()
+    {
+        if ( this.getValue() != null && this.getValue() instanceof AttributeHierarchy )
+        {
+            AttributeHierarchy ah = ( AttributeHierarchy ) this.getValue();
+            if ( ah != null )
+            {
+                MultivaluedDialog dialog = new MultivaluedDialog( this.parent.getShell(), ah );
+                dialog.open();
+            }
+        }
+
+        fireCancelEditor();
+    }
+
+
+    public CellEditor getCellEditor()
+    {
+        return this;
+    }
+
+
+    public String getDisplayValue( AttributeHierarchy ah )
+    {
+
+        List<IValue> valueList = new ArrayList<IValue>();
+        for ( Iterator it = ah.iterator(); it.hasNext(); )
+        {
+            IAttribute attribute = ( IAttribute ) it.next();
+            valueList.addAll( Arrays.asList( attribute.getValues() ) );
+        }
+
+        StringBuffer sb = new StringBuffer();
+        if ( valueList.size() > 1 )
+            sb.append( valueList.size() + " values: " );
+        for ( Iterator it = valueList.iterator(); it.hasNext(); )
+        {
+            IValue value = ( IValue ) it.next();
+            IValueEditor vp = this.valueEditorManager.getCurrentValueEditor( value );
+            sb.append( vp.getDisplayValue( value ) );
+            if ( it.hasNext() )
+                sb.append( ", " );
+        }
+        return sb.toString();
+    }
+
+
+    public String getDisplayValue( IValue value )
+    {
+        return "";
+    }
+
+
+    public Object getRawValue( AttributeHierarchy ah )
+    {
+        return ah;
+    }
+
+
+    public Object getRawValue( IValue value )
+    {
+        return null;
+    }
+
+
+    public Object getRawValue( IConnection connection, Object value )
+    {
+        return null;
+    }
+
+
+    public void modifyValue( IValue oldValue, Object newRawValue ) throws ModelModificationException
+    {
+    }
+
+
+    public void createValue( IEntry entry, String attributeName, Object newRawValue ) throws ModelModificationException
+    {
+    }
+
+
+    public void deleteAttribute( AttributeHierarchy ah ) throws ModelModificationException
+    {
+    }
+
+
+    public void deleteValue( IValue oldValue ) throws ModelModificationException
+    {
+    }
+
+
+    public Object getStringOrBinaryValue( Object rawValue )
+    {
+        return null;
+    }
+
+
+    public void setValueEditorName( String name )
+    {
+        this.name = name;
+    }
+
+
+    public String getValueEditorName()
+    {
+        return name;
+    }
+
+
+    public void setValueEditorImageDescriptor( ImageDescriptor imageDescriptor )
+    {
+        this.imageDescriptor = imageDescriptor;
+    }
+
+
+    public ImageDescriptor getValueEditorImageDescriptor()
+    {
+        return imageDescriptor;
+    }
+
+}

Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java Fri Dec 29 13:15:47 2006
@@ -0,0 +1,149 @@
+/*
+ *  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.ldapstudio.browser.ui.valueeditors.internal;
+
+
+import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
+import org.apache.directory.ldapstudio.browser.core.model.IConnection;
+import org.apache.directory.ldapstudio.browser.core.model.IValue;
+import org.apache.directory.ldapstudio.browser.core.model.schema.ObjectClassDescription;
+import org.apache.directory.ldapstudio.browser.core.model.schema.Schema;
+import org.apache.directory.ldapstudio.browser.ui.dialogs.ObjectClassDialog;
+import org.apache.directory.ldapstudio.browser.ui.dialogs.TextDialog;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.AbstractDialogStringValueEditor;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class ObjectClassValueEditor extends AbstractDialogStringValueEditor 
+{
+
+    public ObjectClassValueEditor()
+    {
+        super();
+    }
+
+
+    public boolean openDialog( Shell shell )
+    {
+        Object value = getValue();
+        if ( value != null && value instanceof ObjectClassValueEditorRawValueWrapper )
+        {
+            ObjectClassValueEditorRawValueWrapper wrapper = ( ObjectClassValueEditorRawValueWrapper ) value;
+            ObjectClassDialog dialog = new ObjectClassDialog( shell, wrapper.schema,
+                wrapper.value );
+            if ( dialog.open() == TextDialog.OK && !"".equals( dialog.getObjectClass() ) )
+            {
+                setValue( dialog.getObjectClass() );
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    public String getDisplayValue( IValue value )
+    {
+        if(getRawValue( value ) == null)
+        {
+            return "NULL";
+        }
+        
+        String displayValue = value.getStringValue();
+        
+        if(!showRawValues())
+        {
+            Schema schema = value.getAttribute().getEntry().getConnection().getSchema();
+            ObjectClassDescription ocd = schema.getObjectClassDescription( displayValue );
+            if ( ocd.isStructural() )
+            {
+                displayValue = displayValue + " (structural)";
+            }
+            else if ( ocd.isAbstract() )
+            {
+                displayValue = displayValue + " (abstract)";
+            }
+            else if ( ocd.isAuxiliary() )
+            {
+                displayValue = displayValue + " (auxiliary)";
+            }
+            else if ( ocd.isObsolete() )
+            {
+                displayValue = displayValue + " (obsolete)";
+            }
+        }
+        
+        return displayValue;
+    }
+
+
+    public Object getRawValue( AttributeHierarchy ah )
+    {
+        return null;
+    }
+
+
+    public Object getRawValue( IValue value )
+    {
+        if ( value == null || !value.isString() || !value.getAttribute().isObjectClassAttribute() )
+        {
+            return null;
+        }
+        else
+        {
+            return getRawValue( value.getAttribute().getEntry().getConnection(), value.getStringValue() );
+        }
+    }
+
+
+    public Object getRawValue( IConnection connection, Object value )
+    {
+        Schema schema = null;
+        if ( connection != null )
+        {
+            schema = connection.getSchema();
+        }
+        if ( schema == null || value == null || !( value instanceof String ) )
+        {
+            return null;
+        }
+
+        String ocValue = ( String ) value;
+        ObjectClassValueEditorRawValueWrapper wrapper = new ObjectClassValueEditorRawValueWrapper( schema, ocValue );
+        return wrapper;
+    }
+
+
+    class ObjectClassValueEditorRawValueWrapper
+    {
+        Schema schema;
+
+        String value;
+
+
+        public ObjectClassValueEditorRawValueWrapper( Schema schema, String value )
+        {
+            super();
+            this.schema = schema;
+            this.value = value;
+        }
+    }
+
+}

Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java Fri Dec 29 13:15:47 2006
@@ -0,0 +1,144 @@
+/*
+ *  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.ldapstudio.browser.ui.valueeditors.internal;
+
+
+import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
+import org.apache.directory.ldapstudio.browser.core.model.IAttribute;
+import org.apache.directory.ldapstudio.browser.core.model.IConnection;
+import org.apache.directory.ldapstudio.browser.core.model.IEntry;
+import org.apache.directory.ldapstudio.browser.core.model.IValue;
+import org.apache.directory.ldapstudio.browser.ui.dialogs.PasswordDialog;
+import org.apache.directory.ldapstudio.browser.ui.dialogs.TextDialog;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.AbstractDialogBinaryValueEditor;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class PasswordValueEditor extends AbstractDialogBinaryValueEditor
+{
+
+    public PasswordValueEditor()
+    {
+        super();
+    }
+
+
+    protected boolean openDialog( Shell shell )
+    {
+        Object value = getValue();
+        if ( value != null && value instanceof PasswordValueEditorRawValueWrapper )
+        {
+            PasswordValueEditorRawValueWrapper wrapper = ( PasswordValueEditorRawValueWrapper ) value;
+            if ( wrapper.password != null && wrapper.password instanceof byte[] )
+            {
+                byte[] pw = ( byte[] ) wrapper.password;
+                PasswordDialog dialog = new PasswordDialog( shell, pw, wrapper.entry );
+                if ( dialog.open() == TextDialog.OK )
+                {
+                    setValue( dialog.getNewPassword() );
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+
+    public String getDisplayValue( IValue value )
+    {
+        if ( showRawValues() )
+        {
+            return getPrintableString( value );
+        }
+        else
+        {
+            if ( value == null )
+            {
+                return "NULL";
+            }
+
+            String password = value.getStringValue();;
+            if ( password == null )
+            {
+                return "NULL";
+            }
+            else
+            {
+                String text;
+                if ( "".equals( password ) )
+                {
+                    text = "Empty password";
+                }
+                else if ( password.indexOf( '{' ) == 0 && password.indexOf( '}' ) > 0 )
+                {
+                    String encryptionMethod = password.substring( password.indexOf( '{' ) + 1, password.indexOf( '}' ) );
+                    text = encryptionMethod + " encrypted password";
+                }
+                else
+                {
+                    text = "Plain text password";
+                }
+                return text;
+            }
+        }
+    }
+ 
+    
+    protected Object getEmptyRawValue( IAttribute attribute )
+    {
+        return new PasswordValueEditorRawValueWrapper( new byte[0], attribute.getEntry() );
+    }
+
+
+    public Object getRawValue( AttributeHierarchy ah )
+    {
+        Object wrapper = super.getRawValue( ah );
+        return wrapper;
+    }
+
+
+    public Object getRawValue( IValue value )
+    {
+        Object password = super.getRawValue( value );
+        return new PasswordValueEditorRawValueWrapper( password, value.getAttribute().getEntry() );
+    }
+
+
+    public Object getRawValue( IConnection connection, Object value )
+    {
+        Object password = super.getRawValue( connection, value );
+        return new PasswordValueEditorRawValueWrapper( password, null );
+    }
+
+    class PasswordValueEditorRawValueWrapper
+    {
+        Object password;
+        IEntry entry;
+
+
+        public PasswordValueEditorRawValueWrapper( Object password, IEntry entry )
+        {
+            this.password = password;
+            this.entry = entry;
+        }
+    }
+
+}

Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java Fri Dec 29 13:15:47 2006
@@ -0,0 +1,53 @@
+/*
+ *  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.ldapstudio.browser.ui.valueeditors.internal;
+
+
+import org.apache.directory.ldapstudio.browser.ui.dialogs.TextDialog;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.AbstractDialogStringValueEditor;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class TextValueEditor extends AbstractDialogStringValueEditor
+{
+
+    public TextValueEditor()
+    {
+        super();
+    }
+
+
+    public boolean openDialog( Shell shell )
+    {
+        Object value = getValue();
+        if ( value != null && value instanceof String )
+        {
+            TextDialog dialog = new TextDialog( shell, ( String ) value );
+            if ( dialog.open() == TextDialog.OK && !"".equals( dialog.getText() ) )
+            {
+                setValue( dialog.getText() );
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java Fri Dec 29 13:15:47 2006
@@ -0,0 +1,595 @@
+/*
+ *  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.ldapstudio.browser.ui.valueeditors.internal;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
+import org.apache.directory.ldapstudio.browser.core.model.IEntry;
+import org.apache.directory.ldapstudio.browser.core.model.IValue;
+import org.apache.directory.ldapstudio.browser.core.model.schema.AttributeTypeDescription;
+import org.apache.directory.ldapstudio.browser.core.model.schema.LdapSyntaxDescription;
+import org.apache.directory.ldapstudio.browser.core.model.schema.Schema;
+import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
+import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+
+/**
+ * A ValueEditorManager is used to manage value editors. It provides methods to get
+ * the best or alternative value editors for a given attribute or value. It takes
+ * user preferences into account when determine the best value editor. At least
+ * it provides default text and binary value editors. 
+ * 
+ * The available value editors are specified by the extension point
+ * <code>org.apache.directory.ldapstudio.browser.ui.valueEditors</code>. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ValueEditorManager
+{
+    /** The extension point ID for value editors */
+    private static final String EXTENSION_POINT = "org.apache.directory.ldapstudio.browser.ui.valueEditors";
+
+    /** The composite used to create the value editors **/
+    private Composite parent;
+
+    /** 
+     * The value editor explicitly selected by the user. If this
+     * member is not null it is always returned as current value editor.
+     */
+    private IValueEditor userSelectedValueEditor;
+
+    /** The special value editor for multi-valued attributes */
+    private MultivaluedValueEditor multiValuedValueEditor;
+
+    /** The default string editor for single-line values */
+    private IValueEditor defaultStringSingleLineValueEditor;
+
+    /** The default string editor for multi-line values */
+    private IValueEditor defaultStringMultiLineValueEditor;
+
+    /** The default binary editor */
+    private IValueEditor defaultBinaryValueEditor;
+
+    /** A Map wich all available value editors. */
+    private Map<String, IValueEditor> class2ValueEditors;
+
+
+    /**
+     * Creates a new instance of ValueEditorManager.
+     *
+     * @param parent the composite used to create the value editors
+     */
+    public ValueEditorManager( Composite parent )
+    {
+        this.parent = parent;
+        userSelectedValueEditor = null;
+
+        // init value editor map
+        class2ValueEditors = new HashMap<String, IValueEditor>();
+        Collection<IValueEditor> valueEditors = createValueEditors( parent );
+        for ( IValueEditor valueEditor : valueEditors )
+        {
+            class2ValueEditors.put( valueEditor.getClass().getName(), valueEditor );
+        }
+
+        // special case: multivalued editor
+        multiValuedValueEditor = new MultivaluedValueEditor( this.parent, this );
+        multiValuedValueEditor.setValueEditorName( "Mulitvalued Editor" );
+        multiValuedValueEditor.setValueEditorImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor(
+            BrowserUIConstants.IMG_MULTIVALUEDEDITOR ) );
+
+        // get default editors from value editor map
+        defaultStringSingleLineValueEditor = class2ValueEditors.get( InPlaceTextValueEditor.class.getName() );
+        defaultStringMultiLineValueEditor = class2ValueEditors.get( TextValueEditor.class.getName() );
+        defaultBinaryValueEditor = class2ValueEditors.get( HexValueEditor.class.getName() );
+    }
+
+
+    /**
+     * Disposes all value editors.
+     */
+    public void dispose()
+    {
+        if ( this.parent != null )
+        {
+            this.userSelectedValueEditor = null;
+            this.multiValuedValueEditor.dispose();
+            this.defaultStringSingleLineValueEditor.dispose();
+            this.defaultStringMultiLineValueEditor.dispose();
+            this.defaultBinaryValueEditor.dispose();
+
+            for ( Iterator it = this.class2ValueEditors.values().iterator(); it.hasNext(); )
+            {
+                IValueEditor vp = ( IValueEditor ) it.next();
+                vp.dispose();
+            }
+
+            this.parent = null;
+        }
+    }
+
+
+    /**
+     * Sets the value editor explicitly selected by the user. Set 
+     * userSelectedValueEditor to null to remove the selection.
+     *
+     * @param userSelectedValueEditor the user selected value editor, may be null.
+     */
+    public void setUserSelectedValueEditor( IValueEditor userSelectedValueEditor )
+    {
+        this.userSelectedValueEditor = userSelectedValueEditor;
+    }
+
+
+    /**
+     * Returns the current (best) value editor for the given attribute.
+     * 
+     * <ol>
+     *  <li>If a user selected value editor is selected, this is returned.
+     *  <li>If a specific value editor is defined for the attribute type this 
+     *      value editor is returned. See preferences. 
+     *  <li>If a specific value editor is defined for the attribute's syntax this 
+     *      value editor is returned. See preferences. 
+     *  <li>Otherwise a default value editor is returned. If the attribute is 
+     *      binary the default Hex Editor is returned. Otherwise the default 
+     *      Text Editor is returned.
+     * </ol>
+     *
+     * @param schema the schema
+     * @param attributeType the attribute type
+     * @return the current value editor
+     */
+    public IValueEditor getCurrentValueEditor( Schema schema, String attributeType )
+    {
+
+        // check user-selected (forced) value editor
+        if ( this.userSelectedValueEditor != null )
+        {
+            return this.userSelectedValueEditor;
+        }
+
+        // check attribute preferences
+        AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeType );
+        Map attributeValueEditorMap = BrowserUIPlugin.getDefault().getUIPreferences().getAttributeValueEditorMap();
+        if ( atd.getNumericOID() != null && attributeValueEditorMap.containsKey( atd.getNumericOID().toLowerCase() ) )
+        {
+            return ( IValueEditor ) this.class2ValueEditors.get( attributeValueEditorMap.get( atd.getNumericOID()
+                .toLowerCase() ) );
+        }
+        String[] names = atd.getNames();
+        for ( int i = 0; i < names.length; i++ )
+        {
+            if ( attributeValueEditorMap.containsKey( names[i].toLowerCase() ) )
+            {
+                return ( IValueEditor ) this.class2ValueEditors.get( attributeValueEditorMap.get( names[i]
+                    .toLowerCase() ) );
+            }
+        }
+
+        // check syntax preferences
+        LdapSyntaxDescription lsd = atd.getSyntaxDescription();
+        Map syntaxValueEditorMap = BrowserUIPlugin.getDefault().getUIPreferences().getSyntaxValueEditorMap();
+        if ( lsd.getNumericOID() != null && syntaxValueEditorMap.containsKey( lsd.getNumericOID().toLowerCase() ) )
+        {
+            return ( IValueEditor ) this.class2ValueEditors.get( syntaxValueEditorMap.get( lsd.getNumericOID()
+                .toLowerCase() ) );
+        }
+
+        // return default
+        if ( lsd.isBinary() )
+        {
+            return this.defaultBinaryValueEditor;
+        }
+        else
+        {
+            return this.defaultStringSingleLineValueEditor;
+        }
+
+    }
+
+
+    /**
+     * Returns the current (best) value editor for the given attribute.
+     * 
+     * @param entry the entry
+     * @param attributeType the attributge type
+     * @return the current value editor
+     * @see getCurrentValueEditor( Schema, String )
+     */
+    public IValueEditor getCurrentValueEditor( IEntry entry, String attributeType )
+    {
+        return getCurrentValueEditor( entry.getConnection().getSchema(), attributeType );
+    }
+
+
+    /**
+     * Returns the current (best) value editor for the given value.
+     * 
+     * @param value the value
+     * @return the current value editor
+     * @see getCurrentValueEditor( Schema, String )
+     */
+    public IValueEditor getCurrentValueEditor( IValue value )
+    {
+
+        IValueEditor ve = this.getCurrentValueEditor( value.getAttribute().getEntry(), value.getAttribute()
+            .getDescription() );
+
+        // here the value is known, we can check for single-line or multi-line
+        if ( ve == this.defaultStringSingleLineValueEditor )
+        {
+            if ( value.getStringValue().indexOf( '\n' ) == -1 && value.getStringValue().indexOf( '\r' ) == -1 )
+            {
+                ve = this.defaultStringSingleLineValueEditor;
+            }
+            else
+            {
+                ve = this.defaultStringMultiLineValueEditor;
+            }
+        }
+
+        return ve;
+    }
+
+
+    /**
+     * Returns the current (best) value editor for the given attribute.
+     * 
+     * @param attributeHierarchy the attribute hierarchy
+     * @return the current value editor
+     * @see getCurrentValueEditor( Schema, String )
+     */
+    public IValueEditor getCurrentValueEditor( AttributeHierarchy attributeHierarchy )
+    {
+        if ( attributeHierarchy == null )
+        {
+            return null;
+        }
+        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 0 )
+        {
+            return this.getCurrentValueEditor( attributeHierarchy.getAttribute().getEntry(), attributeHierarchy
+                .getAttribute().getDescription() );
+        }
+        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 1 )
+        {
+            // special case objectClass and RDN: always return MV-editor
+            // perhaps this should be moved somewhere else
+            if ( attributeHierarchy.getAttribute().isObjectClassAttribute() )
+            {
+                return this.multiValuedValueEditor;
+            }
+            if ( attributeHierarchy.getAttribute().getValues()[0].isRdnPart() )
+            {
+                return this.multiValuedValueEditor;
+            }
+
+            return this.getCurrentValueEditor( attributeHierarchy.getAttribute().getValues()[0] );
+        }
+        else
+        {
+            return this.multiValuedValueEditor;
+        }
+    }
+
+
+    /**
+     * Returns alternative value editors for the given attribute. For now these
+     * are the three default editors.
+     *
+     * @param entry the entry
+     * @param attributeName the attribute
+     * @return alternative value editors
+     */
+    public IValueEditor[] getAlternativeValueEditors( IEntry entry, String attributeName )
+    {
+        Schema schema = entry.getConnection().getSchema();
+        return getAlternativeValueEditors( schema, attributeName );
+    }
+
+
+    /**
+     * Returns alternative value editors for the given attribute. For now these
+     * are the three default editors.
+     * 
+     * @param schema the schema
+     * @param attributeName the attribute
+     * @return alternative value editors
+     */
+    public IValueEditor[] getAlternativeValueEditors( Schema schema, String attributeName )
+    {
+        List<IValueEditor> alternativeList = new ArrayList<IValueEditor>();
+
+        AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeName );
+
+        if ( atd.getSyntaxDescription().isBinary() )
+        {
+            alternativeList.add( this.defaultBinaryValueEditor );
+            alternativeList.add( this.defaultStringSingleLineValueEditor );
+            alternativeList.add( this.defaultStringMultiLineValueEditor );
+        }
+        else if ( atd.getSyntaxDescription().isString() )
+        {
+            alternativeList.add( this.defaultStringSingleLineValueEditor );
+            alternativeList.add( this.defaultStringMultiLineValueEditor );
+            alternativeList.add( this.defaultBinaryValueEditor );
+        }
+
+        alternativeList.add( this.multiValuedValueEditor );
+
+        alternativeList.remove( getCurrentValueEditor( schema, attributeName ) );
+
+        return ( IValueEditor[] ) alternativeList.toArray( new IValueEditor[alternativeList.size()] );
+    }
+
+
+    /**
+     * Returns alternative value editors for the given value. For now these
+     * are the three default editors.
+     *
+     * @param value the value
+     * @return lternative value editors
+     */
+    public IValueEditor[] getAlternativeValueEditors( IValue value )
+    {
+        List<IValueEditor> alternativeList = new ArrayList<IValueEditor>();
+
+        if ( value.isBinary() )
+        {
+            alternativeList.add( this.defaultBinaryValueEditor );
+            alternativeList.add( this.defaultStringSingleLineValueEditor );
+            alternativeList.add( this.defaultStringMultiLineValueEditor );
+        }
+        else if ( value.isString() )
+        {
+            alternativeList.add( this.defaultStringSingleLineValueEditor );
+            alternativeList.add( this.defaultStringMultiLineValueEditor );
+            alternativeList.add( this.defaultBinaryValueEditor );
+        }
+
+        alternativeList.add( this.multiValuedValueEditor );
+
+        alternativeList.remove( getCurrentValueEditor( value ) );
+
+        return ( IValueEditor[] ) alternativeList.toArray( new IValueEditor[alternativeList.size()] );
+    }
+
+
+    /**
+     * Returns alternative value editors for the given value. For now these
+     * are the three default editors.
+     *
+     * @param value the value
+     * @return lternative value editors
+     */
+    public IValueEditor[] getAlternativeValueEditors( AttributeHierarchy ah )
+    {
+        if ( ah == null )
+        {
+            return new IValueEditor[0];
+        }
+        else if ( ah.size() == 1 && ah.getAttribute().getValueSize() == 0 )
+        {
+            return this.getAlternativeValueEditors( ah.getAttribute().getEntry(), ah.getAttribute().getDescription() );
+        }
+        else if ( ah.size() == 1 && ah.getAttribute().getValueSize() == 1 )
+        {
+
+            // special case objectClass and RDN: no alternative to the MV-Editor
+            // perhaps this should be moved somewhere else
+            if ( ah.getAttribute().isObjectClassAttribute() )
+            {
+                return new IValueEditor[0];
+            }
+            if ( ah.getAttribute().getValues()[0].isRdnPart() )
+            {
+                return new IValueEditor[0];
+            }
+
+            return this.getAlternativeValueEditors( ah.getAttribute().getValues()[0] );
+        }
+        else
+        /* if(attribute.getValueSize() > 1) */{
+            return new IValueEditor[0];
+        }
+    }
+
+
+    /**
+     * Returns all available value editors.
+     *
+     * @return all available value editors
+     */
+    public IValueEditor[] getAllValueEditors()
+    {
+        // use a set to avoid double entries
+        Set<IValueEditor> list = new LinkedHashSet<IValueEditor>();
+
+        list.add( this.defaultStringSingleLineValueEditor );
+        list.add( this.defaultStringMultiLineValueEditor );
+        list.add( defaultBinaryValueEditor );
+
+        list.addAll( this.class2ValueEditors.values() );
+
+        list.add( this.multiValuedValueEditor );
+
+        return list.toArray( new IValueEditor[list.size()] );
+    }
+
+
+    /**
+     * Returns the default binary editor (a HexEditor).
+     *
+     * @return the default binary editor
+     */
+    public IValueEditor getDefaultBinaryValueEditor()
+    {
+        return defaultBinaryValueEditor;
+    }
+
+
+    /**
+     * Returns the default string editor (a TextEditor).
+     *
+     * @return the default string editor
+     */
+    public IValueEditor getDefaultStringValueEditor()
+    {
+        return defaultStringMultiLineValueEditor;
+    }
+
+
+    /**
+     * Returns the multi-valued editor.
+     *
+     * @return the multi-valued editor
+     */
+    public MultivaluedValueEditor getMultiValuedValueEditor()
+    {
+        return multiValuedValueEditor;
+    }
+
+
+    /**
+     * Creates and returns the value editors specified by value editors extensions.
+     *
+     * @param parent
+     * @return
+     */
+    private Collection<IValueEditor> createValueEditors( Composite parent )
+    {
+        Collection<IValueEditor> valueEditors = new ArrayList<IValueEditor>();
+
+        Collection<ValueEditorExtension> valueEditorProxys = getValueEditorProxys();
+        for ( ValueEditorExtension proxy : valueEditorProxys )
+        {
+            try
+            {
+                IValueEditor valueEditor = ( IValueEditor ) proxy.member.createExecutableExtension( "class" );
+                valueEditor.create( parent );
+                valueEditor.setValueEditorName( proxy.name );
+                valueEditor.setValueEditorImageDescriptor( proxy.icon );
+                valueEditors.add( valueEditor );
+            }
+            catch ( Exception e )
+            {
+                BrowserUIPlugin.getDefault().getLog().log(
+                    new Status( IStatus.ERROR, BrowserUIPlugin.PLUGIN_ID, 1, "Unable to create ValueEditor "
+                        + proxy.className, e ) );
+            }
+        }
+
+        return valueEditors;
+    }
+
+
+    /**
+     * Returns all value editor proxies specified by value editor extensions.
+     *
+     * @return
+     */
+    public static Collection<ValueEditorExtension> getValueEditorProxys()
+    {
+        Collection<ValueEditorExtension> valueEditorProxies = new ArrayList<ValueEditorExtension>();
+
+        IExtensionRegistry registry = Platform.getExtensionRegistry();
+        IExtensionPoint extensionPoint = registry.getExtensionPoint( EXTENSION_POINT );
+        IConfigurationElement[] members = extensionPoint.getConfigurationElements();
+
+        // For each extension:
+        for ( int m = 0; m < members.length; m++ )
+        {
+            ValueEditorExtension proxy = new ValueEditorExtension();
+            valueEditorProxies.add( proxy );
+
+            IConfigurationElement member = members[m];
+            IExtension extension = member.getDeclaringExtension();
+            String extendingPluginId = extension.getNamespaceIdentifier();
+
+            proxy.member = member;
+            proxy.name = member.getAttribute( "name" );
+            String iconPath = member.getAttribute( "icon" );
+            proxy.icon = AbstractUIPlugin.imageDescriptorFromPlugin( extendingPluginId, iconPath );
+            if ( proxy.icon == null )
+            {
+                proxy.icon = ImageDescriptor.getMissingImageDescriptor();
+            }
+            proxy.className = member.getAttribute( "class" );
+
+            IConfigurationElement[] children = member.getChildren();
+            for ( int c = 0; c < children.length; c++ )
+            {
+                IConfigurationElement element = children[c];
+                String type = element.getName();
+                if ( "syntax".equals( type ) )
+                {
+                    String syntaxOID = element.getAttribute( "syntaxOID" );
+                    proxy.syntaxOids.add( syntaxOID );
+                }
+                else if ( "attribute".equals( type ) )
+                {
+                    String attributeType = element.getAttribute( "attributeType" );
+                    proxy.attributeTypes.add( attributeType );
+                }
+            }
+        }
+
+        return valueEditorProxies;
+    }
+
+    /**
+     * This class is a bean to hold the data defined in value editor extension 
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    public static class ValueEditorExtension
+    {
+        public String name = null;
+        public ImageDescriptor icon = null;
+        public String className = null;
+        public Collection<String> syntaxOids = new ArrayList<String>( 3 );
+        public Collection<String> attributeTypes = new ArrayList<String>( 3 );
+
+        private IConfigurationElement member = null;
+    }
+
+}

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/AbstractOpenEditorAction.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/AbstractOpenEditorAction.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/AbstractOpenEditorAction.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/AbstractOpenEditorAction.java Fri Dec 29 13:15:47 2006
@@ -22,7 +22,7 @@
 
 
 import org.apache.directory.ldapstudio.browser.core.events.ModelModifier;
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProviderManager;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
 
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.TreeViewer;
@@ -39,7 +39,7 @@
 
     protected EntryEditorWidgetActionGroup actionGroup;
 
-    protected ValueProviderManager valueProviderManager;
+    protected ValueEditorManager valueEditorManager;
 
     protected TreeViewer viewer;
 
@@ -47,18 +47,18 @@
 
 
     protected AbstractOpenEditorAction( TreeViewer viewer, EntryEditorWidgetActionGroup actionGroup,
-        ValueProviderManager valueProviderManager )
+        ValueEditorManager valueEditorManager )
     {
         super( viewer, "Editor", null, null );
         this.viewer = viewer;
         this.actionGroup = actionGroup;
-        this.valueProviderManager = valueProviderManager;
+        this.valueEditorManager = valueEditorManager;
     }
 
 
     public void dispose()
     {
-        this.valueProviderManager = null;
+        this.valueEditorManager = null;
         this.actionGroup = null;
         this.viewer = null;
         this.cellEditor = null;
@@ -112,7 +112,7 @@
         }
         else
         {
-            this.valueProviderManager.setUserSelectedValueProvider( null );
+            this.valueEditorManager.setUserSelectedValueEditor( null );
         }
     }
 
@@ -137,10 +137,10 @@
         if ( this.actionGroup != null )
             this.actionGroup.activateGlobalActionHandlers();
 
-        // reset custom value provider and set selection to notify all
+        // reset custom value editor and set selection to notify all
         // openeditoractions to update their
         // enabled state.
-        this.valueProviderManager.setUserSelectedValueProvider( null );
+        this.valueEditorManager.setUserSelectedValueEditor( null );
         this.viewer.setSelection( this.viewer.getSelection() );
     }
 

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetActionGroup.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetActionGroup.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetActionGroup.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetActionGroup.java Fri Dec 29 13:15:47 2006
@@ -38,7 +38,7 @@
 import org.apache.directory.ldapstudio.browser.ui.actions.proxy.BrowserActionProxy;
 import org.apache.directory.ldapstudio.browser.ui.actions.proxy.EntryEditorActionProxy;
 import org.apache.directory.ldapstudio.browser.ui.editors.entry.ShowQuickFilterAction;
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProvider;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
@@ -101,14 +101,14 @@
         this.showQuickFilterAction = new ShowQuickFilterAction( mainWidget.getQuickFilterWidget() );
 
         this.openBestEditorAction = new OpenBestEditorAction( viewer, this, configuration
-            .getValueProviderManager( viewer ) );
+            .getValueEditorManager( viewer ) );
         this.openDefaultEditorAction = new OpenDefaultEditorAction( viewer, this.openBestEditorAction );
-        ValueProvider[] valueProviders = configuration.getValueProviderManager( viewer ).getAllValueProviders();
-        this.openEditorActions = new OpenEditorAction[valueProviders.length];
+        IValueEditor[] valueEditors = configuration.getValueEditorManager( viewer ).getAllValueEditors();
+        this.openEditorActions = new OpenEditorAction[valueEditors.length];
         for ( int i = 0; i < this.openEditorActions.length; i++ )
         {
             this.openEditorActions[i] = new OpenEditorAction( viewer, this, configuration
-                .getValueProviderManager( viewer ), valueProviders[i] );
+                .getValueEditorManager( viewer ), valueEditors[i] );
         }
         this.openValueEditorPreferencesAction = new ValueEditorPreferencesAction();
 
@@ -246,8 +246,8 @@
         for ( int i = 0; i < this.openEditorActions.length; i++ )
         {
             if ( this.openEditorActions[i].isEnabled()
-                && this.openEditorActions[i].getValueProvider().getClass() != this.openBestEditorAction
-                    .getBestValueProvider().getClass() )
+                && this.openEditorActions[i].getValueEditor().getClass() != this.openBestEditorAction
+                    .getBestValueEditor().getClass() )
             {
                 editorMenuManager.add( this.openEditorActions[i] );
             }

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java Fri Dec 29 13:15:47 2006
@@ -24,7 +24,7 @@
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
 import org.apache.directory.ldapstudio.browser.core.model.ModelModificationException;
 import org.apache.directory.ldapstudio.browser.core.model.schema.SchemaUtils;
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProviderManager;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
 
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ICellModifier;
@@ -35,18 +35,18 @@
 public class EntryEditorWidgetCellModifier implements ICellModifier
 {
 
-    private ValueProviderManager valueProviderManager;
+    private ValueEditorManager valueEditorManager;
 
 
-    public EntryEditorWidgetCellModifier( ValueProviderManager valueProviderManager )
+    public EntryEditorWidgetCellModifier( ValueEditorManager valueEditorManager )
     {
-        this.valueProviderManager = valueProviderManager;
+        this.valueEditorManager = valueEditorManager;
     }
 
 
     public void dispose()
     {
-        this.valueProviderManager = null;
+        this.valueEditorManager = null;
     }
 
 
@@ -70,7 +70,7 @@
             }
             if ( EntryEditorWidgetTableMetadata.VALUE_COLUMN_NAME.equals( property ) )
             {
-                return this.valueProviderManager.getCurrentValueProvider( attributeValue ).getRawValue( attributeValue ) != null;
+                return this.valueEditorManager.getCurrentValueEditor( attributeValue ).getRawValue( attributeValue ) != null;
             }
         }
 
@@ -90,7 +90,7 @@
             }
             else if ( EntryEditorWidgetTableMetadata.VALUE_COLUMN_NAME.equals( property ) )
             {
-                returnValue = this.valueProviderManager.getCurrentValueProvider( attributeValue ).getRawValue(
+                returnValue = this.valueEditorManager.getCurrentValueEditor( attributeValue ).getRawValue(
                     attributeValue );
             }
             else
@@ -126,7 +126,7 @@
             {
                 try
                 {
-                    this.valueProviderManager.getCurrentValueProvider( attributeValue ).modify( attributeValue,
+                    this.valueEditorManager.getCurrentValueEditor( attributeValue ).modifyValue( attributeValue,
                         newRawValue );
                 }
                 catch ( ModelModificationException mme )

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java Fri Dec 29 13:15:47 2006
@@ -21,7 +21,7 @@
 package org.apache.directory.ldapstudio.browser.ui.widgets.entryeditor;
 
 
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProviderManager;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
 import org.eclipse.jface.viewers.TreeViewer;
 
 
@@ -42,7 +42,7 @@
 
     protected EntryEditorWidgetCellModifier cellModifier;
 
-    protected ValueProviderManager valueProviderManager;
+    protected ValueEditorManager valueEditorManager;
 
 
     public EntryEditorWidgetConfiguration()
@@ -79,9 +79,9 @@
                 this.cellModifier.dispose();
             this.cellModifier = null;
 
-            if ( this.valueProviderManager != null )
-                this.valueProviderManager.dispose();
-            this.valueProviderManager = null;
+            if ( this.valueEditorManager != null )
+                this.valueEditorManager.dispose();
+            this.valueEditorManager = null;
 
             this.disposed = true;
         }
@@ -100,7 +100,7 @@
     public EntryEditorWidgetLabelProvider getLabelProvider( TreeViewer viewer )
     {
         if ( this.labelProvider == null )
-            this.labelProvider = new EntryEditorWidgetLabelProvider( this.getValueProviderManager( viewer ) );
+            this.labelProvider = new EntryEditorWidgetLabelProvider( this.getValueEditorManager( viewer ) );
 
         return labelProvider;
     }
@@ -109,18 +109,18 @@
     public EntryEditorWidgetCellModifier getCellModifier( TreeViewer viewer )
     {
         if ( this.cellModifier == null )
-            this.cellModifier = new EntryEditorWidgetCellModifier( this.getValueProviderManager( viewer ) );
+            this.cellModifier = new EntryEditorWidgetCellModifier( this.getValueEditorManager( viewer ) );
 
         return cellModifier;
     }
 
 
-    public ValueProviderManager getValueProviderManager( TreeViewer viewer )
+    public ValueEditorManager getValueEditorManager( TreeViewer viewer )
     {
-        if ( this.valueProviderManager == null )
-            this.valueProviderManager = new ValueProviderManager( viewer.getTree() );
+        if ( this.valueEditorManager == null )
+            this.valueEditorManager = new ValueEditorManager( viewer.getTree() );
 
-        return valueProviderManager;
+        return valueEditorManager;
     }
 
 

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java Fri Dec 29 13:15:47 2006
@@ -25,7 +25,7 @@
 import java.util.List;
 
 import org.apache.directory.ldapstudio.browser.core.jobs.InitializeAttributesJob;
-import org.apache.directory.ldapstudio.browser.core.model.AttributeHierachie;
+import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
 import org.apache.directory.ldapstudio.browser.core.model.IAttribute;
 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
@@ -62,9 +62,9 @@
             IEntry entry = ( IEntry ) newInput;
             dn = "DN: " + entry.getDn().toString();
         }
-        else if ( newInput != null && newInput instanceof AttributeHierachie )
+        else if ( newInput != null && newInput instanceof AttributeHierarchy )
         {
-            AttributeHierachie ah = ( AttributeHierachie ) newInput;
+            AttributeHierarchy ah = ( AttributeHierarchy ) newInput;
             dn = "DN: " + ah.getAttribute().getEntry().getDn().toString();
         }
         else
@@ -117,9 +117,9 @@
                 return values;
             }
         }
-        else if ( inputElement != null && inputElement instanceof AttributeHierachie )
+        else if ( inputElement != null && inputElement instanceof AttributeHierarchy )
         {
-            AttributeHierachie ah = ( AttributeHierachie ) inputElement;
+            AttributeHierarchy ah = ( AttributeHierarchy ) inputElement;
             IAttribute[] attributes = ah.getAttributes();
             Object[] values = getValues( attributes );
             return values;

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java Fri Dec 29 13:15:47 2006
@@ -25,8 +25,8 @@
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProvider;
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProviderManager;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
 
 import org.eclipse.jface.preference.PreferenceConverter;
 import org.eclipse.jface.viewers.IColorProvider;
@@ -44,19 +44,19 @@
     IColorProvider
 {
 
-    private ValueProviderManager valueProviderManager;
+    private ValueEditorManager valueEditorManager;
 
 
-    public EntryEditorWidgetLabelProvider( ValueProviderManager valueProviderManager )
+    public EntryEditorWidgetLabelProvider( ValueEditorManager valueEditorManager )
     {
-        this.valueProviderManager = valueProviderManager;
+        this.valueEditorManager = valueEditorManager;
     }
 
 
     public void dispose()
     {
         super.dispose();
-        this.valueProviderManager = null;
+        this.valueEditorManager = null;
     }
 
 
@@ -71,7 +71,7 @@
                 case EntryEditorWidgetTableMetadata.KEY_COLUMN_INDEX:
                     return value.getAttribute().getDescription();
                 case EntryEditorWidgetTableMetadata.VALUE_COLUMN_INDEX:
-                    ValueProvider vp = this.valueProviderManager.getCurrentValueProvider( value );
+                    IValueEditor vp = this.valueEditorManager.getCurrentValueEditor( value );
                     String dv = vp.getDisplayValue( value );
                     return dv;
                 default:

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenBestEditorAction.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenBestEditorAction.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenBestEditorAction.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenBestEditorAction.java Fri Dec 29 13:15:47 2006
@@ -21,27 +21,27 @@
 package org.apache.directory.ldapstudio.browser.ui.widgets.entryeditor;
 
 
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProvider;
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProviderManager;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
 import org.eclipse.jface.viewers.TreeViewer;
 
 
 public class OpenBestEditorAction extends AbstractOpenEditorAction
 {
 
-    private ValueProvider bestValueProvider;
+    private IValueEditor bestValueEditor;
 
 
     public OpenBestEditorAction( TreeViewer viewer, EntryEditorWidgetActionGroup actionGroup,
-        ValueProviderManager valueProviderManager )
+        ValueEditorManager valueEditorManager )
     {
-        super( viewer, actionGroup, valueProviderManager );
+        super( viewer, actionGroup, valueEditorManager );
     }
 
 
-    public ValueProvider getBestValueProvider()
+    public IValueEditor getBestValueEditor()
     {
-        return this.bestValueProvider;
+        return this.bestValueEditor;
     }
 
 
@@ -53,12 +53,12 @@
             && this.viewer.getCellModifier().canModify( this.selectedValues[0],
                 EntryEditorWidgetTableMetadata.VALUE_COLUMN_NAME ) )
         {
-            this.bestValueProvider = this.valueProviderManager.getCurrentValueProvider( this.selectedValues[0] );
-            super.cellEditor = this.bestValueProvider.getCellEditor();
+            this.bestValueEditor = this.valueEditorManager.getCurrentValueEditor( this.selectedValues[0] );
+            super.cellEditor = this.bestValueEditor.getCellEditor();
             this.setEnabled( true );
-            this.setText( "" + this.bestValueProvider.getCellEditorName() );
-            this.setToolTipText( "" + this.bestValueProvider.getCellEditorName() );
-            this.setImageDescriptor( this.bestValueProvider.getCellEditorImageDescriptor() );
+            this.setText( "" + this.bestValueEditor.getValueEditorName() );
+            this.setToolTipText( "" + this.bestValueEditor.getValueEditorName() );
+            this.setImageDescriptor( this.bestValueEditor.getValueEditorImageDescriptor() );
         }
         else
         {
@@ -73,7 +73,7 @@
 
     public void dispose()
     {
-        this.bestValueProvider = null;
+        this.bestValueEditor = null;
         super.dispose();
     }
 

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenEditorAction.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenEditorAction.java?view=diff&rev=491104&r1=491103&r2=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenEditorAction.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/OpenEditorAction.java Fri Dec 29 13:15:47 2006
@@ -23,33 +23,33 @@
 
 import java.util.Arrays;
 
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProvider;
-import org.apache.directory.ldapstudio.browser.ui.valueproviders.ValueProviderManager;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor;
+import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
 import org.eclipse.jface.viewers.TreeViewer;
 
 
 public class OpenEditorAction extends AbstractOpenEditorAction
 {
 
-    private ValueProvider valueProvider;
+    private IValueEditor valueEditor;
 
 
     public OpenEditorAction( TreeViewer viewer, EntryEditorWidgetActionGroup actionGroup,
-        ValueProviderManager valueProviderManager, ValueProvider valueProvider )
+        ValueEditorManager valueEditorManager, IValueEditor valueEditor )
     {
-        super( viewer, actionGroup, valueProviderManager );
-        super.cellEditor = valueProvider.getCellEditor();
-        this.valueProvider = valueProvider;
-
-        this.setText( "" + this.valueProvider.getCellEditorName() );
-        this.setToolTipText( "" + this.valueProvider.getCellEditorName() );
-        this.setImageDescriptor( this.valueProvider.getCellEditorImageDescriptor() );
+        super( viewer, actionGroup, valueEditorManager );
+        super.cellEditor = valueEditor.getCellEditor();
+        this.valueEditor = valueEditor;
+
+        this.setText( "" + this.valueEditor.getValueEditorName() );
+        this.setToolTipText( "" + this.valueEditor.getValueEditorName() );
+        this.setImageDescriptor( this.valueEditor.getValueEditorImageDescriptor() );
     }
 
 
-    public ValueProvider getValueProvider()
+    public IValueEditor getValueEditor()
     {
-        return this.valueProvider;
+        return this.valueEditor;
     }
 
 
@@ -60,10 +60,10 @@
             && this.viewer.getCellModifier().canModify( this.selectedValues[0],
                 EntryEditorWidgetTableMetadata.VALUE_COLUMN_NAME ) )
         {
-            ValueProvider[] alternativeVps = this.valueProviderManager
-                .getAlternativeValueProvider( this.selectedValues[0] );
-            this.setEnabled( Arrays.asList( alternativeVps ).contains( this.valueProvider )
-                && this.valueProvider.getRawValue( this.selectedValues[0] ) != null );
+            IValueEditor[] alternativeVps = this.valueEditorManager
+                .getAlternativeValueEditors( this.selectedValues[0] );
+            this.setEnabled( Arrays.asList( alternativeVps ).contains( this.valueEditor )
+                && this.valueEditor.getRawValue( this.selectedValues[0] ) != null );
         }
         else
         {
@@ -75,14 +75,14 @@
 
     public void run()
     {
-        this.valueProviderManager.setUserSelectedValueProvider( this.valueProvider );
+        this.valueEditorManager.setUserSelectedValueEditor( this.valueEditor );
         super.run();
     }
 
 
     public void dispose()
     {
-        this.valueProvider = null;
+        this.valueEditor = null;
         super.dispose();
     }
 

Added: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/resources/valueEditors.exsd
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/resources/valueEditors.exsd?view=auto&rev=491104
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/resources/valueEditors.exsd (added)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/resources/valueEditors.exsd Fri Dec 29 13:15:47 2006
@@ -0,0 +1,192 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.apache.directory.ldapstudio.browser.ui">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.apache.directory.ldapstudio.browser.ui" id="valueEditors" name="Value Editors"/>
+      </appInfo>
+      <documentation>
+         A ValueEditor knows how to display and edit values of a LDAP attribute.ValueEditors are used from the entry editor or search result editor  to display values to edit values in a user-friendly way.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="valueEditor" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The extension-point of this extension.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  Extension identifier.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  Name of this extension.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="valueEditor">
+      <annotation>
+         <appInfo>
+            <meta.element labelAttribute="name" icon="icon"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence minOccurs="1" maxOccurs="unbounded">
+            <choice>
+               <element ref="syntax"/>
+               <element ref="attribute"/>
+            </choice>
+         </sequence>
+         <attribute name="name" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The name of the function.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="icon" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="resource"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The specific class implementing the function.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="syntax">
+      <annotation>
+         <appInfo>
+            <meta.element labelAttribute="syntaxOID"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <attribute name="syntaxOID" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="attribute">
+      <annotation>
+         <appInfo>
+            <meta.element labelAttribute="attributeType"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <attribute name="attributeType" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         1.0.0
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         &lt;p&gt;
+&lt;pre&gt;
+   &lt;extension
+       point=&quot;org.apache.directory.ldapstudio.browser.ui.valueEditors&quot;&gt;
+
+    &lt;valueEditor
+          name=&quot;Text Editor&quot;
+          icon=&quot;icons/texteditor.gif&quot;
+          class=&quot;org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.TextValueEditor&quot;
+          /&gt;
+   &lt;/extension&gt;         
+&lt;/pre&gt;
+&lt;p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         Extension callback objects implement the org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor interface. There are also abstract base classes in org.apache.directory.ldapstudio.browser.ui.valueeditors package.
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+           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
+  &quot;License&quot;); 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
+  &quot;AS IS&quot; 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.
+
+      </documentation>
+   </annotation>
+
+</schema>



Mime
View raw message