Author: pamarcelot
Date: Thu Jul 8 15:01:13 2010
New Revision: 961793
URL: http://svn.apache.org/viewvc?rev=961793&view=rev
Log:
Created a new 'LDAP Servers' plugin.
Added:
directory/studio/trunk/ldapservers/
directory/studio/trunk/ldapservers/plugin.properties
directory/studio/trunk/ldapservers/plugin.xml
directory/studio/trunk/ldapservers/pom.xml
directory/studio/trunk/ldapservers/resources/
directory/studio/trunk/ldapservers/resources/org/
directory/studio/trunk/ldapservers/resources/org/apache/
directory/studio/trunk/ldapservers/resources/org/apache/directory/
directory/studio/trunk/ldapservers/resources/org/apache/directory/studio/
directory/studio/trunk/ldapservers/resources/org/apache/directory/studio/ldapservers/
directory/studio/trunk/ldapservers/src/
directory/studio/trunk/ldapservers/src/main/
directory/studio/trunk/ldapservers/src/main/java/
directory/studio/trunk/ldapservers/src/main/java/org/
directory/studio/trunk/ldapservers/src/main/java/org/apache/
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPlugin.java
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/Messages.java
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties
directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties
directory/studio/trunk/ldapservers/src/main/resources/
directory/studio/trunk/ldapservers/src/test/
directory/studio/trunk/ldapservers/src/test/java/
directory/studio/trunk/ldapservers/src/test/java/org/
directory/studio/trunk/ldapservers/src/test/java/org/apache/
directory/studio/trunk/ldapservers/src/test/java/org/apache/directory/
directory/studio/trunk/ldapservers/src/test/java/org/apache/directory/studio/
directory/studio/trunk/ldapservers/src/test/java/org/apache/directory/studio/ldapservers/
directory/studio/trunk/ldapservers/src/test/resources/
directory/studio/trunk/ldapservers/src/test/resources/org/
directory/studio/trunk/ldapservers/src/test/resources/org/apache/
directory/studio/trunk/ldapservers/src/test/resources/org/apache/directory/
directory/studio/trunk/ldapservers/src/test/resources/org/apache/directory/studio/
directory/studio/trunk/ldapservers/src/test/resources/org/apache/directory/studio/ldapservers/
Added: directory/studio/trunk/ldapservers/plugin.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/plugin.properties?rev=961793&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/plugin.properties (added)
+++ directory/studio/trunk/ldapservers/plugin.properties Thu Jul 8 15:01:13 2010
@@ -0,0 +1,18 @@
+# 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.
+
+Plugin_id=org.apache.directory.studio.ldapservers
\ No newline at end of file
Added: directory/studio/trunk/ldapservers/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/plugin.xml?rev=961793&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/plugin.xml (added)
+++ directory/studio/trunk/ldapservers/plugin.xml Thu Jul 8 15:01:13 2010
@@ -0,0 +1,4 @@
+
+
+
+ * Note: Don't dispose the returned SWT Image. It is disposed + * automatically when the plugin is stopped. + * + * @param key + * The key (relative path to the image in filesystem) + * @return The SWT Image or null + */ + public Image getImage( String key ) + { + Image image = getImageRegistry().get( key ); + if ( image == null ) + { + ImageDescriptor id = getImageDescriptor( key ); + if ( id != null ) + { + image = id.createImage(); + getImageRegistry().put( key, image ); + } + } + return image; + } + + + /** + * Gets the plugin properties. + * + * @return + * the plugin properties + */ + public PropertyResourceBundle getPluginProperties() + { + if ( properties == null ) + { + try + { + properties = new PropertyResourceBundle( FileLocator.openStream( this.getBundle(), new Path( + "plugin.properties" ), false ) ); //$NON-NLS-1$ + } + catch ( IOException e ) + { + // We can't use the PLUGIN_ID constant since loading the plugin.properties file has failed, + // So we're using a default plugin id. + getLog().log( new Status( Status.ERROR, "org.apache.directory.studio.ldapservers", Status.OK, //$NON-NLS-1$ + Messages.getString( "LdapServersPlugin.UnableGetPluginProperties" ), e ) ); //$NON-NLS-1$ + } + } + + return properties; + } +} Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java?rev=961793&view=auto ============================================================================== --- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java (added) +++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java Thu Jul 8 15:01:13 2010 @@ -0,0 +1,34 @@ +/* + * 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.ldapservers; + + +/** + * Constants used in the LDAP Servers plugin. + * + * @author Apache Directory Project + */ +public interface LdapServersPluginConstants +{ + /** The plug-in ID */ + public static final String PLUGIN_ID = LdapServersPlugin.getDefault().getPluginProperties().getString( "Plugin_id" ); //$NON-NLS-1$ + +} Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/Messages.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/Messages.java?rev=961793&view=auto ============================================================================== --- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/Messages.java (added) +++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/Messages.java Thu Jul 8 15:01:13 2010 @@ -0,0 +1,50 @@ +/* + * 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.ldapservers; + + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + + +public class Messages +{ + private static final String BUNDLE_NAME = "org.apache.directory.studio.connection.ui.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME ); + + + private Messages() + { + } + + + public static String getString( String key ) + { + try + { + return RESOURCE_BUNDLE.getString( key ); + } + catch ( MissingResourceException e ) + { + return '!' + key + '!'; + } + } +} Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties?rev=961793&view=auto ============================================================================== --- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties (added) +++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties Thu Jul 8 15:01:13 2010 @@ -0,0 +1,18 @@ +# 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. + +LdapServersPlugin.UnableGetPluginProperties=Unable to get the plugin properties. Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties?rev=961793&view=auto ============================================================================== --- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties (added) +++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties Thu Jul 8 15:01:13 2010 @@ -0,0 +1,18 @@ +# 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. + +LdapServersPlugin.UnableGetPluginProperties=Die Plugin Eigenschaften k\u00F6nnen nicht geladen werden. Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties?rev=961793&view=auto ============================================================================== --- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties (added) +++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties Thu Jul 8 15:01:13 2010 @@ -0,0 +1,18 @@ +# 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. + +LdapServersPlugin.UnableGetPluginProperties=Impossible de r\u00E9cup\u00E9rer les propri\u00E9t\u00E9s de ce plugin