You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2010/10/07 16:10:27 UTC
svn commit: r1005455 [4/5] - in
/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor: ./
src/main/java/org/apache/directory/studio/schemaeditor/
src/main/java/org/apache/directory/studio/schemaeditor/controller/
src/main/java/org/apache/d...
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchViewLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchViewLabelProvider.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchViewLabelProvider.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchViewLabelProvider.java Thu Oct 7 14:10:24 2010
@@ -20,6 +20,8 @@
package org.apache.directory.studio.schemaeditor.view.views;
+import java.util.List;
+
import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.studio.schemaeditor.Activator;
import org.apache.directory.studio.schemaeditor.PluginConstants;
@@ -76,10 +78,10 @@ public class SearchViewLabelProvider ext
// Label
if ( labelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_FIRST_NAME )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -88,8 +90,8 @@ public class SearchViewLabelProvider ext
}
else if ( labelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
label = ViewUtils.concateAliases( names );
}
@@ -105,10 +107,10 @@ public class SearchViewLabelProvider ext
else
// Default
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -129,10 +131,10 @@ public class SearchViewLabelProvider ext
// Label
if ( labelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_FIRST_NAME )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -141,8 +143,8 @@ public class SearchViewLabelProvider ext
}
else if ( labelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
label = ViewUtils.concateAliases( names );
}
@@ -158,10 +160,10 @@ public class SearchViewLabelProvider ext
else
// Default
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -186,10 +188,10 @@ public class SearchViewLabelProvider ext
if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_FIRST_NAME )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- secondaryLabel = names[0];
+ secondaryLabel = names.get( 0 );
}
else
{
@@ -198,8 +200,8 @@ public class SearchViewLabelProvider ext
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
@@ -219,10 +221,10 @@ public class SearchViewLabelProvider ext
if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_FIRST_NAME )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- secondaryLabel = names[0];
+ secondaryLabel = names.get( 0 );
}
else
{
@@ -231,8 +233,8 @@ public class SearchViewLabelProvider ext
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
@@ -262,7 +264,7 @@ public class SearchViewLabelProvider ext
{
SchemaObject object = ( SchemaObject ) element;
- label += " " + Messages.getString( "SearchViewLabelProvider.FromSchema" ) + " \"" + object.getSchema() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+ label += " " + Messages.getString( "SearchViewLabelProvider.FromSchema" ) + " \"" + object.getSchemaName() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/DifferencesWidgetSchemaLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/DifferencesWidgetSchemaLabelProvider.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/DifferencesWidgetSchemaLabelProvider.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/DifferencesWidgetSchemaLabelProvider.java Thu Oct 7 14:10:24 2010
@@ -20,6 +20,8 @@
package org.apache.directory.studio.schemaeditor.view.widget;
+import java.util.List;
+
import org.apache.directory.studio.schemaeditor.Activator;
import org.apache.directory.studio.schemaeditor.PluginConstants;
import org.apache.directory.studio.schemaeditor.model.AttributeTypeImpl;
@@ -112,10 +114,10 @@ public class DifferencesWidgetSchemaLabe
// Label
if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -124,8 +126,8 @@ public class DifferencesWidgetSchemaLabe
}
else if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
label = ViewUtils.concateAliases( names );
}
@@ -141,10 +143,10 @@ public class DifferencesWidgetSchemaLabe
else
// Default
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -183,10 +185,10 @@ public class DifferencesWidgetSchemaLabe
// Label
if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -195,8 +197,8 @@ public class DifferencesWidgetSchemaLabe
}
else if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
label = ViewUtils.concateAliases( names );
}
@@ -212,10 +214,10 @@ public class DifferencesWidgetSchemaLabe
else
// Default
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- label = names[0];
+ label = names.get( 0 );
}
else
{
@@ -264,10 +266,10 @@ public class DifferencesWidgetSchemaLabe
if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- secondaryLabel = names[0];
+ secondaryLabel = names.get( 0 );
}
else
{
@@ -276,8 +278,8 @@ public class DifferencesWidgetSchemaLabe
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
@@ -315,10 +317,10 @@ public class DifferencesWidgetSchemaLabe
if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- secondaryLabel = names[0];
+ secondaryLabel = names.get( 0 );
}
else
{
@@ -327,8 +329,8 @@ public class DifferencesWidgetSchemaLabe
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
{
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/FirstNameSorter.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/FirstNameSorter.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/FirstNameSorter.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/FirstNameSorter.java Thu Oct 7 14:10:24 2010
@@ -22,6 +22,7 @@ package org.apache.directory.studio.sche
import java.util.Comparator;
+import java.util.List;
import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.studio.schemaeditor.model.difference.AttributeTypeDifference;
@@ -38,8 +39,8 @@ public class FirstNameSorter implements
*/
public int compare( Object o1, Object o2 )
{
- String[] o1Names = null;
- String[] o2Names = null;
+ List<String> o1Names = null;
+ List<String> o2Names = null;
if ( ( o1 instanceof AttributeTypeDifference ) && ( o2 instanceof AttributeTypeDifference ) )
{
@@ -49,32 +50,32 @@ public class FirstNameSorter implements
switch ( atd1.getType() )
{
case ADDED:
- o1Names = ( ( SchemaObject ) atd1.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd1.getDestination() ).getNames();
break;
case MODIFIED:
- o1Names = ( ( SchemaObject ) atd1.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd1.getDestination() ).getNames();
break;
case REMOVED:
- o1Names = ( ( SchemaObject ) atd1.getSource() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd1.getSource() ).getNames();
break;
case IDENTICAL:
- o1Names = ( ( SchemaObject ) atd1.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd1.getDestination() ).getNames();
break;
}
switch ( atd2.getType() )
{
case ADDED:
- o2Names = ( ( SchemaObject ) atd2.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd2.getDestination() ).getNames();
break;
case MODIFIED:
- o2Names = ( ( SchemaObject ) atd2.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd2.getDestination() ).getNames();
break;
case REMOVED:
- o2Names = ( ( SchemaObject ) atd2.getSource() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd2.getSource() ).getNames();
break;
case IDENTICAL:
- o2Names = ( ( SchemaObject ) atd2.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd2.getDestination() ).getNames();
break;
}
}
@@ -86,32 +87,32 @@ public class FirstNameSorter implements
switch ( ocd1.getType() )
{
case ADDED:
- o1Names = ( ( SchemaObject ) ocd1.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd1.getDestination() ).getNames();
break;
case MODIFIED:
- o1Names = ( ( SchemaObject ) ocd1.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd1.getDestination() ).getNames();
break;
case REMOVED:
- o1Names = ( ( SchemaObject ) ocd1.getSource() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd1.getSource() ).getNames();
break;
case IDENTICAL:
- o1Names = ( ( SchemaObject ) ocd1.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd1.getDestination() ).getNames();
break;
}
switch ( ocd2.getType() )
{
case ADDED:
- o2Names = ( ( SchemaObject ) ocd2.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd2.getDestination() ).getNames();
break;
case MODIFIED:
- o2Names = ( ( SchemaObject ) ocd2.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd2.getDestination() ).getNames();
break;
case REMOVED:
- o2Names = ( ( SchemaObject ) ocd2.getSource() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd2.getSource() ).getNames();
break;
case IDENTICAL:
- o2Names = ( ( SchemaObject ) ocd2.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd2.getDestination() ).getNames();
break;
}
}
@@ -123,32 +124,32 @@ public class FirstNameSorter implements
switch ( atd.getType() )
{
case ADDED:
- o1Names = ( ( SchemaObject ) atd.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd.getDestination() ).getNames();
break;
case MODIFIED:
- o1Names = ( ( SchemaObject ) atd.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd.getDestination() ).getNames();
break;
case REMOVED:
- o1Names = ( ( SchemaObject ) atd.getSource() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd.getSource() ).getNames();
break;
case IDENTICAL:
- o1Names = ( ( SchemaObject ) atd.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) atd.getDestination() ).getNames();
break;
}
switch ( ocd.getType() )
{
case ADDED:
- o2Names = ( ( SchemaObject ) ocd.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd.getDestination() ).getNames();
break;
case MODIFIED:
- o2Names = ( ( SchemaObject ) ocd.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd.getDestination() ).getNames();
break;
case REMOVED:
- o2Names = ( ( SchemaObject ) ocd.getSource() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd.getSource() ).getNames();
break;
case IDENTICAL:
- o2Names = ( ( SchemaObject ) ocd.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) ocd.getDestination() ).getNames();
break;
}
}
@@ -160,32 +161,32 @@ public class FirstNameSorter implements
switch ( ocd.getType() )
{
case ADDED:
- o1Names = ( ( SchemaObject ) ocd.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd.getDestination() ).getNames();
break;
case MODIFIED:
- o1Names = ( ( SchemaObject ) ocd.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd.getDestination() ).getNames();
break;
case REMOVED:
- o1Names = ( ( SchemaObject ) ocd.getSource() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd.getSource() ).getNames();
break;
case IDENTICAL:
- o1Names = ( ( SchemaObject ) ocd.getDestination() ).getNamesRef();
+ o1Names = ( ( SchemaObject ) ocd.getDestination() ).getNames();
break;
}
switch ( atd.getType() )
{
case ADDED:
- o2Names = ( ( SchemaObject ) atd.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd.getDestination() ).getNames();
break;
case MODIFIED:
- o2Names = ( ( SchemaObject ) atd.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd.getDestination() ).getNames();
break;
case REMOVED:
- o2Names = ( ( SchemaObject ) atd.getSource() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd.getSource() ).getNames();
break;
case IDENTICAL:
- o2Names = ( ( SchemaObject ) atd.getDestination() ).getNamesRef();
+ o2Names = ( ( SchemaObject ) atd.getDestination() ).getNames();
break;
}
}
@@ -193,17 +194,17 @@ public class FirstNameSorter implements
// Comparing the First Name
if ( ( o1Names != null ) && ( o2Names != null ) )
{
- if ( ( o1Names.length > 0 ) && ( o2Names.length > 0 ) )
+ if ( ( o1Names.size() > 0 ) && ( o2Names.size() > 0 ) )
{
- return o1Names[0].compareToIgnoreCase( o2Names[0] );
+ return o1Names.get( 0 ).compareToIgnoreCase( o2Names.get( 0 ) );
}
- else if ( ( o1Names.length == 0 ) && ( o2Names.length > 0 ) )
+ else if ( ( o1Names.size() == 0 ) && ( o2Names.size() > 0 ) )
{
- return "".compareToIgnoreCase( o2Names[0] ); //$NON-NLS-1$
+ return "".compareToIgnoreCase( o2Names.get( 0 ) ); //$NON-NLS-1$
}
- else if ( ( o1Names.length > 0 ) && ( o2Names.length == 0 ) )
+ else if ( ( o1Names.size() > 0 ) && ( o2Names.size() == 0 ) )
{
- return o1Names[0].compareToIgnoreCase( "" ); //$NON-NLS-1$
+ return o1Names.get( 0 ).compareToIgnoreCase( "" ); //$NON-NLS-1$
}
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java Thu Oct 7 14:10:24 2010
@@ -36,6 +36,7 @@ import javax.naming.NamingException;
import org.apache.directory.shared.converter.schema.AttributeTypeHolder;
import org.apache.directory.shared.converter.schema.ObjectClassHolder;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.studio.schemaeditor.Activator;
import org.apache.directory.studio.schemaeditor.PluginUtils;
import org.apache.directory.studio.schemaeditor.controller.SchemaHandler;
@@ -123,18 +124,7 @@ public class ExportSchemasForADSWizard e
buffWriter.write( sb.toString() );
buffWriter.close();
}
- catch ( IOException e )
- {
- PluginUtils
- .logError(
- NLS
- .bind(
- Messages.getString( "ExportSchemasForADSWizard.ErrorSavingSchema" ), new String[] { schema.getName() } ), e ); //$NON-NLS-1$
- ViewUtils
- .displayErrorMessageBox(
- Messages.getString( "ExportSchemasForADSWizard.Error" ), NLS.bind( Messages.getString( "ExportSchemasForADSWizard.ErrorSavingSchema" ), new String[] { schema.getName() } ) ); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch ( NamingException e )
+ catch ( Exception e )
{
PluginUtils
.logError(
@@ -185,7 +175,7 @@ public class ExportSchemasForADSWizard e
{
toLdif( schema, sb );
}
- catch ( NamingException e )
+ catch ( Exception e )
{
PluginUtils
.logError(
@@ -240,8 +230,9 @@ public class ExportSchemasForADSWizard e
* the StringBuffer
* @throws NamingException
* if an error occurs during the conversion
+ * @throws LdapException
*/
- private void toLdif( Schema schema, StringBuffer sb ) throws NamingException
+ private void toLdif( Schema schema, StringBuffer sb ) throws NamingException, LdapException
{
sb
.append( NLS
@@ -272,21 +263,21 @@ public class ExportSchemasForADSWizard e
AttributeTypeHolder holder = new AttributeTypeHolder( at.getOid() );
holder.setCollective( at.isCollective() );
holder.setDescription( at.getDescription() );
- holder.setEquality( at.getEqualityName() );
+ holder.setEquality( at.getEqualityOid() );
List<String> names = new ArrayList<String>();
- for ( String name : at.getNamesRef() )
+ for ( String name : at.getNames() )
{
names.add( name );
}
holder.setNames( names );
- holder.setNoUserModification( !at.isCanUserModify() );
+ holder.setNoUserModification( !at.isUserModifiable() );
holder.setObsolete( at.isObsolete() );
- holder.setOrdering( at.getOrderingName() );
- holder.setSingleValue( at.isSingleValue() );
- holder.setSubstr( at.getSubstrName() );
- holder.setSuperior( at.getSuperiorName() );
+ holder.setOrdering( at.getOrderingOid() );
+ holder.setSingleValue( at.isSingleValued() );
+ holder.setSubstr( at.getSubstringOid() );
+ holder.setSuperior( at.getSuperiorOid() );
holder.setSyntax( at.getSyntaxOid() );
- holder.setOidLen( at.getLength() );
+ holder.setOidLen( new Long( at.getSyntaxLength() ).intValue() );
holder.setUsage( at.getUsage() );
sb.append( holder.toLdif( schema.getName() ) + "\n" ); //$NON-NLS-1$
@@ -356,25 +347,25 @@ public class ExportSchemasForADSWizard e
holder.setClassType( oc.getType() );
holder.setDescription( oc.getDescription() );
List<String> mayList = new ArrayList<String>();
- for ( String may : oc.getMayNamesList() )
+ for ( String may : oc.getMayAttributeTypeOids() )
{
mayList.add( may );
}
holder.setMay( mayList );
List<String> mustList = new ArrayList<String>();
- for ( String must : oc.getMustNamesList() )
+ for ( String must : oc.getMustAttributeTypeOids())
{
mustList.add( must );
}
holder.setMust( mustList );
List<String> names = new ArrayList<String>();
- for ( String name : oc.getNamesRef() )
+ for ( String name : oc.getNames() )
{
names.add( name );
}
holder.setNames( names );
List<String> superiorList = new ArrayList<String>();
- for ( String superior : oc.getSuperClassesNames() )
+ for ( String superior : oc.getSuperiorOids() )
{
superiorList.add( superior );
}
@@ -415,7 +406,7 @@ public class ExportSchemasForADSWizard e
Set<String> objectClassNames = new HashSet<String>();
for ( ObjectClassImpl oc : unsortedObjectClasses )
{
- for ( String name : oc.getNamesRef() )
+ for ( String name : oc.getNames() )
{
objectClassNames.add( name.toLowerCase() );
}
@@ -432,14 +423,14 @@ public class ExportSchemasForADSWizard e
while ( unsortedIterator.hasNext() )
{
ObjectClassImpl oc = unsortedIterator.next();
- for ( String superName : oc.getSuperClassesNames() )
+ for ( String superName : oc.getSuperiorOids() )
{
if ( !objectClassNames.contains( superName.toLowerCase() )
|| movedObjectClasses.contains( superName.toLowerCase() ) )
{
unsortedIterator.remove();
sortedObjectClasses.add( oc );
- for ( String name : oc.getNamesRef() )
+ for ( String name : oc.getNames() )
{
movedObjectClasses.add( name.toLowerCase() );
}
@@ -484,9 +475,9 @@ public class ExportSchemasForADSWizard e
AttributeTypeImpl sup = schemaHandler.getAttributeType( supName );
if ( sup != null )
{
- if ( !schema.getName().toLowerCase().equals( sup.getSchema().toLowerCase() ) )
+ if ( !schema.getName().toLowerCase().equals( sup.getSchemaName().toLowerCase() ) )
{
- schemaNames.add( sup.getSchema() );
+ schemaNames.add( sup.getSchemaName() );
}
}
}
@@ -496,24 +487,24 @@ public class ExportSchemasForADSWizard e
for ( ObjectClassImpl oc : schema.getObjectClasses() )
{
// Superiors
- String[] supNames = oc.getSuperClassesNames();
+ List<String> supNames = oc.getSuperiorOids();
if ( supNames != null )
{
- for ( String supName : oc.getSuperClassesNames() )
+ for ( String supName : oc.getSuperiorOids() )
{
ObjectClassImpl sup = schemaHandler.getObjectClass( supName );
if ( sup != null )
{
- if ( !schema.getName().toLowerCase().equals( sup.getSchema().toLowerCase() ) )
+ if ( !schema.getName().toLowerCase().equals( sup.getSchemaName().toLowerCase() ) )
{
- schemaNames.add( sup.getSchema() );
+ schemaNames.add( sup.getSchemaName() );
}
}
}
}
// Mays
- String[] mayNames = oc.getMayNamesList();
+ List<String> mayNames = oc.getMayAttributeTypeOids();
if ( mayNames != null )
{
for ( String mayName : mayNames )
@@ -521,9 +512,9 @@ public class ExportSchemasForADSWizard e
AttributeTypeImpl may = schemaHandler.getAttributeType( mayName );
if ( may != null )
{
- if ( !schema.getName().toLowerCase().equals( may.getSchema().toLowerCase() ) )
+ if ( !schema.getName().toLowerCase().equals( may.getSchemaName().toLowerCase() ) )
{
- schemaNames.add( may.getSchema() );
+ schemaNames.add( may.getSchemaName() );
}
}
}
@@ -531,17 +522,17 @@ public class ExportSchemasForADSWizard e
}
// Musts
- String[] mustNames = oc.getMustNamesList();
+ List<String> mustNames = oc.getMustAttributeTypeOids();
if ( mustNames != null )
{
- for ( String mustName : oc.getMustNamesList() )
+ for ( String mustName : oc.getMustAttributeTypeOids() )
{
AttributeTypeImpl must = schemaHandler.getAttributeType( mustName );
if ( must != null )
{
- if ( !schema.getName().toLowerCase().equals( must.getSchema().toLowerCase() ) )
+ if ( !schema.getName().toLowerCase().equals( must.getSchemaName().toLowerCase() ) )
{
- schemaNames.add( must.getSchema() );
+ schemaNames.add( must.getSchemaName() );
}
}
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasSelectionWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasSelectionWizardPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasSelectionWizardPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasSelectionWizardPage.java Thu Oct 7 14:10:24 2010
@@ -182,10 +182,10 @@ public class MergeSchemasSelectionWizard
else if ( element instanceof AttributeType )
{
AttributeType at = ( ( AttributeType ) element );
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- return names[0];
+ return names.get(0);
}
else
{
@@ -195,10 +195,10 @@ public class MergeSchemasSelectionWizard
else if ( element instanceof ObjectClass )
{
ObjectClass oc = ( ( ObjectClass ) element );
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
- return names[0];
+ return names.get(0);
}
else
{
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasWizard.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasWizard.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/MergeSchemasWizard.java Thu Oct 7 14:10:24 2010
@@ -21,7 +21,6 @@ package org.apache.directory.studio.sche
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -248,7 +247,7 @@ public class MergeSchemasWizard extends
sourceAttributeType.getOid() );
if ( targetAttributeType == null )
{
- for ( String name : sourceAttributeType.getNamesRef() )
+ for ( String name : sourceAttributeType.getNames() )
{
targetAttributeType = targetProject.getSchemaHandler().getAttributeType( name );
if ( targetAttributeType != null )
@@ -263,7 +262,7 @@ public class MergeSchemasWizard extends
sourceAttributeType.getOid() );
if ( !oidOrAliasAlreadyTaken )
{
- for ( String name : sourceAttributeType.getNamesRef() )
+ for ( String name : sourceAttributeType.getNames() )
{
oidOrAliasAlreadyTaken = targetProject.getSchemaHandler().isAliasOrOidAlreadyTaken( name );
if ( oidOrAliasAlreadyTaken )
@@ -296,21 +295,20 @@ public class MergeSchemasWizard extends
// clone attribute type
AttributeTypeImpl clonedAttributeType = new AttributeTypeImpl( sourceAttributeType.getOid() );
- clonedAttributeType.setOid( sourceAttributeType.getOid() );
- clonedAttributeType.setNames( sourceAttributeType.getNamesRef() );
+ clonedAttributeType.setNames( sourceAttributeType.getNames() );
clonedAttributeType.setDescription( sourceAttributeType.getDescription() );
- clonedAttributeType.setSuperiorName( sourceAttributeType.getSuperiorName() );
+ clonedAttributeType.setSuperiorOid( sourceAttributeType.getSuperiorOid() );
clonedAttributeType.setUsage( sourceAttributeType.getUsage() );
clonedAttributeType.setSyntaxOid( sourceAttributeType.getSyntaxOid() );
- clonedAttributeType.setLength( sourceAttributeType.getLength() );
+ clonedAttributeType.setSyntaxLength( sourceAttributeType.getSyntaxLength() );
clonedAttributeType.setObsolete( sourceAttributeType.isObsolete() );
clonedAttributeType.setCollective( sourceAttributeType.isCollective() );
- clonedAttributeType.setSingleValue( sourceAttributeType.isSingleValue() );
- clonedAttributeType.setCanUserModify( sourceAttributeType.isCanUserModify() );
- clonedAttributeType.setEqualityName( sourceAttributeType.getEqualityName() );
- clonedAttributeType.setOrderingName( sourceAttributeType.getOrderingName() );
- clonedAttributeType.setSubstrName( sourceAttributeType.getSubstrName() );
- clonedAttributeType.setSchema( targetSchema.getName() );
+ clonedAttributeType.setSingleValued( sourceAttributeType.isSingleValued() );
+ clonedAttributeType.setUserModifiable( sourceAttributeType.isUserModifiable() );
+ clonedAttributeType.setEqualityOid( sourceAttributeType.getEqualityOid() );
+ clonedAttributeType.setOrderingOid( sourceAttributeType.getOrderingOid() );
+ clonedAttributeType.setSubstringOid( sourceAttributeType.getSubstringOid() );
+ clonedAttributeType.setSchemaName( targetSchema.getName() );
clonedAttributeType.setSchemaObject( targetSchema );
// if no/unknown syntax: set "Directory String" syntax and appropriate matching rules
@@ -321,12 +319,14 @@ public class MergeSchemasWizard extends
{
errorMessages.add( NLS.bind( Messages.getString( "MergeSchemasWizard.ReplacedSyntax" ), //$NON-NLS-1$
new String[]
- { getIdString( sourceAttributeType ), clonedAttributeType.getSyntaxOid(),
+ {
+ getIdString( sourceAttributeType ),
+ clonedAttributeType.getSyntaxOid(),
"1.3.6.1.4.1.1466.115.121.1.15 (Directory String)" } ) ); //$NON-NLS-1$
clonedAttributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.15" );
- clonedAttributeType.setEqualityName( "caseIgnoreMatch" );
- clonedAttributeType.setOrderingName( null );
- clonedAttributeType.setSubstrName( "caseIgnoreSubstringsMatch" );
+ clonedAttributeType.setEqualityOid( "caseIgnoreMatch" );
+ clonedAttributeType.setOrderingOid( null );
+ clonedAttributeType.setSubstringOid( "caseIgnoreSubstringsMatch" );
}
}
// TODO: if unknown (single) matching rule: set appropriate matching rule according to syntax
@@ -372,7 +372,7 @@ public class MergeSchemasWizard extends
.getObjectClass( sourceObjectClass.getOid() );
if ( targetObjectClass == null )
{
- for ( String name : sourceObjectClass.getNamesRef() )
+ for ( String name : sourceObjectClass.getNames() )
{
targetObjectClass = targetProject.getSchemaHandler().getObjectClass( name );
if ( targetObjectClass != null )
@@ -387,7 +387,7 @@ public class MergeSchemasWizard extends
sourceObjectClass.getOid() );
if ( !oidOrAliasAlreadyTaken )
{
- for ( String name : sourceObjectClass.getNamesRef() )
+ for ( String name : sourceObjectClass.getNames() )
{
oidOrAliasAlreadyTaken = targetProject.getSchemaHandler().isAliasOrOidAlreadyTaken( name );
if ( oidOrAliasAlreadyTaken )
@@ -421,20 +421,20 @@ public class MergeSchemasWizard extends
// create object class
ObjectClassImpl clonedObjectClass = new ObjectClassImpl( sourceObjectClass.getOid() );
clonedObjectClass.setOid( sourceObjectClass.getOid() );
- clonedObjectClass.setNames( sourceObjectClass.getNamesRef() );
+ clonedObjectClass.setNames( sourceObjectClass.getNames() );
clonedObjectClass.setDescription( sourceObjectClass.getDescription() );
- clonedObjectClass.setSuperClassesNames( sourceObjectClass.getSuperClassesNames() );
+ clonedObjectClass.setSuperiorOids( sourceObjectClass.getSuperiorOids() );
clonedObjectClass.setType( sourceObjectClass.getType() );
clonedObjectClass.setObsolete( sourceObjectClass.isObsolete() );
- clonedObjectClass.setMustNamesList( sourceObjectClass.getMustNamesList() );
- clonedObjectClass.setMayNamesList( sourceObjectClass.getMayNamesList() );
- clonedObjectClass.setSchema( targetSchema.getName() );
+ clonedObjectClass.setMustAttributeTypeOids( sourceObjectClass.getMustAttributeTypeOids() );
+ clonedObjectClass.setMayAttributeTypeOids( sourceObjectClass.getMayAttributeTypeOids() );
+ clonedObjectClass.setSchemaName( targetSchema.getName() );
clonedObjectClass.setSchemaObject( targetSchema );
// merge dependencies: super object classes and must/may attributes
if ( mergeDependencies )
{
- String[] superClassesNames = clonedObjectClass.getSuperClassesNames();
+ List<String> superClassesNames = clonedObjectClass.getSuperiorOids();
if ( superClassesNames != null )
{
for ( String superClassName : superClassesNames )
@@ -467,16 +467,16 @@ public class MergeSchemasWizard extends
}
}
- String[] mustNamesList = clonedObjectClass.getMustNamesList();
- String[] mayNamesList = clonedObjectClass.getMayNamesList();
+ List<String> mustNamesList = clonedObjectClass.getMustAttributeTypeOids();
+ List<String> mayNamesList = clonedObjectClass.getMayAttributeTypeOids();
List<String> attributeNames = new ArrayList<String>();
if ( mustNamesList != null )
{
- attributeNames.addAll( Arrays.asList( mustNamesList ) );
+ attributeNames.addAll( mustNamesList );
}
if ( mayNamesList != null )
{
- attributeNames.addAll( Arrays.asList( mayNamesList ) );
+ attributeNames.addAll( mayNamesList );
}
for ( String attributeName : attributeNames )
{
@@ -510,8 +510,8 @@ public class MergeSchemasWizard extends
sourceMustAttributeNames.removeAll( targetMustAttributeNames );
if ( !sourceMustAttributeNames.isEmpty() )
{
- sourceMustAttributeNames.addAll( Arrays.asList( targetObjectClass.getMustNamesList() ) );
- targetObjectClass.setMustNamesList( sourceMustAttributeNames.toArray( new String[0] ) );
+ sourceMustAttributeNames.addAll( targetObjectClass.getMustAttributeTypeOids() );
+ targetObjectClass.setMustAttributeTypeOids( new ArrayList<String>( sourceMustAttributeNames ) );
}
// may
@@ -522,18 +522,18 @@ public class MergeSchemasWizard extends
sourceMayAttributeNames.removeAll( targetMayAttributeNames );
if ( !sourceMayAttributeNames.isEmpty() )
{
- sourceMayAttributeNames.addAll( Arrays.asList( targetObjectClass.getMayNamesList() ) );
- targetObjectClass.setMayNamesList( sourceMayAttributeNames.toArray( new String[0] ) );
+ sourceMayAttributeNames.addAll( targetObjectClass.getMayAttributeTypeOids() );
+ targetObjectClass.setMayAttributeTypeOids( new ArrayList<String>( sourceMayAttributeNames ) );
}
}
private void fetchAttributes( Set<String> attributeNameList, ObjectClassImpl oc, boolean must )
{
- String[] attributeNames = must ? oc.getMustNamesList() : oc.getMayNamesList();
- attributeNameList.addAll( Arrays.asList( attributeNames ) );
+ List<String> attributeNames = must ? oc.getMustAttributeTypeOids() : oc.getMayAttributeTypeOids();
+ attributeNameList.addAll( attributeNames );
- for ( String superClassName : oc.getSuperClassesNames() )
+ for ( String superClassName : oc.getSuperiorOids() )
{
ObjectClassImpl superObjectClass = oc.getSchemaObject().getProject().getSchemaHandler().getObjectClass(
superClassName );
@@ -546,9 +546,9 @@ public class MergeSchemasWizard extends
{
StringBuilder sb = new StringBuilder();
sb.append( '[' );
- if ( schemaObject.getNamesRef() != null )
+ if ( schemaObject.getNames() != null )
{
- for ( String name : schemaObject.getNamesRef() )
+ for ( String name : schemaObject.getNames() )
{
sb.append( name );
sb.append( ',' );
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java Thu Oct 7 14:10:24 2010
@@ -130,10 +130,10 @@ public class NewAttributeTypeContentWiza
if ( dialog.open() == Dialog.OK )
{
AttributeTypeImpl selectedAT = dialog.getSelectedAttributeType();
- String[] aliases = selectedAT.getNamesRef();
- if ( ( aliases != null ) && ( aliases.length > 0 ) )
+ List<String> aliases = selectedAT.getNames();
+ if ( ( aliases != null ) && ( aliases.size() > 0 ) )
{
- superiorText.setText( aliases[0] );
+ superiorText.setText( aliases.get( 0 ) );
}
else
{
@@ -263,23 +263,23 @@ public class NewAttributeTypeContentWiza
{
if ( ( o1 instanceof SyntaxImpl ) && ( o2 instanceof SyntaxImpl ) )
{
- String[] o1Names = ( ( SyntaxImpl ) o1 ).getNamesRef();
- String[] o2Names = ( ( SyntaxImpl ) o2 ).getNamesRef();
+ List<String> o1Names = ( ( SyntaxImpl ) o1 ).getNames();
+ List<String> o2Names = ( ( SyntaxImpl ) o2 ).getNames();
// Comparing the First Name
if ( ( o1Names != null ) && ( o2Names != null ) )
{
- if ( ( o1Names.length > 0 ) && ( o2Names.length > 0 ) )
+ if ( ( o1Names.size() > 0 ) && ( o2Names.size() > 0 ) )
{
- return o1Names[0].compareToIgnoreCase( o2Names[0] );
+ return o1Names.get( 0 ).compareToIgnoreCase( o2Names.get( 0 ) );
}
- else if ( ( o1Names.length == 0 ) && ( o2Names.length > 0 ) )
+ else if ( ( o1Names.size() == 0 ) && ( o2Names.size() > 0 ) )
{
- return "".compareToIgnoreCase( o2Names[0] ); //$NON-NLS-1$
+ return "".compareToIgnoreCase( o2Names.get( 0 ) ); //$NON-NLS-1$
}
- else if ( ( o1Names.length > 0 ) && ( o2Names.length == 0 ) )
+ else if ( ( o1Names.size() > 0 ) && ( o2Names.size() == 0 ) )
{
- return o1Names[0].compareToIgnoreCase( "" ); //$NON-NLS-1$
+ return o1Names.get( 0 ).compareToIgnoreCase( "" ); //$NON-NLS-1$
}
}
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java Thu Oct 7 14:10:24 2010
@@ -431,7 +431,7 @@ public class NewAttributeTypeGeneralWiza
* @return
* the value of the aliases
*/
- public String[] getAliasesValue()
+ public List<String> getAliasesValue()
{
List<String> aliasesValue = new ArrayList<String>();
@@ -440,7 +440,7 @@ public class NewAttributeTypeGeneralWiza
aliasesValue.add( alias.toString() );
}
- return aliasesValue.toArray( new String[0] );
+ return aliasesValue;
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java Thu Oct 7 14:10:24 2010
@@ -178,23 +178,23 @@ public class NewAttributeTypeMatchingRul
{
if ( ( o1 instanceof MatchingRuleImpl ) && ( o2 instanceof MatchingRuleImpl ) )
{
- String[] o1Names = ( ( MatchingRuleImpl ) o1 ).getNamesRef();
- String[] o2Names = ( ( MatchingRuleImpl ) o2 ).getNamesRef();
+ List<String> o1Names = ( ( MatchingRuleImpl ) o1 ).getNames();
+ List<String> o2Names = ( ( MatchingRuleImpl ) o2 ).getNames();
// Comparing the First Name
if ( ( o1Names != null ) && ( o2Names != null ) )
{
- if ( ( o1Names.length > 0 ) && ( o2Names.length > 0 ) )
+ if ( ( o1Names.size() > 0 ) && ( o2Names.size() > 0 ) )
{
- return o1Names[0].compareToIgnoreCase( o2Names[0] );
+ return o1Names.get( 0 ).compareToIgnoreCase( o2Names.get( 0 ) );
}
- else if ( ( o1Names.length == 0 ) && ( o2Names.length > 0 ) )
+ else if ( ( o1Names.size() == 0 ) && ( o2Names.size() > 0 ) )
{
- return "".compareToIgnoreCase( o2Names[0] ); //$NON-NLS-1$
+ return "".compareToIgnoreCase( o2Names.get( 0 ) ); //$NON-NLS-1$
}
- else if ( ( o1Names.length > 0 ) && ( o2Names.length == 0 ) )
+ else if ( ( o1Names.size() > 0 ) && ( o2Names.size() == 0 ) )
{
- return o1Names[0].compareToIgnoreCase( "" ); //$NON-NLS-1$
+ return o1Names.get( 0 ).compareToIgnoreCase( "" ); //$NON-NLS-1$
}
}
else if ( ( o1 instanceof String ) && ( o2 instanceof MatchingRuleImpl ) )
@@ -239,8 +239,8 @@ public class NewAttributeTypeMatchingRul
{
MatchingRuleImpl mr = ( ( MatchingRuleImpl ) selection );
- String[] names = mr.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = mr.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
return mr.getName();
}
@@ -268,8 +268,8 @@ public class NewAttributeTypeMatchingRul
{
MatchingRuleImpl mr = ( ( MatchingRuleImpl ) selection );
- String[] names = mr.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = mr.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
return mr.getName();
}
@@ -297,8 +297,8 @@ public class NewAttributeTypeMatchingRul
{
MatchingRuleImpl mr = ( ( MatchingRuleImpl ) selection );
- String[] names = mr.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = mr.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
return mr.getName();
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeWizard.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeWizard.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeWizard.java Thu Oct 7 14:10:24 2010
@@ -74,21 +74,21 @@ public class NewAttributeTypeWizard exte
{
// Creating the new attribute type
AttributeTypeImpl newAT = new AttributeTypeImpl( generalPage.getOidValue() );
- newAT.setSchema( generalPage.getSchemaValue() );
+ newAT.setSchemaName( generalPage.getSchemaValue() );
newAT.setSchemaObject( Activator.getDefault().getSchemaHandler().getSchema( generalPage.getSchemaValue() ) );
newAT.setNames( generalPage.getAliasesValue() );
newAT.setDescription( generalPage.getDescriptionValue() );
- newAT.setSuperiorName( contentPage.getSuperiorValue() );
+ newAT.setSuperiorOid( contentPage.getSuperiorValue() );
newAT.setUsage( contentPage.getUsageValue() );
newAT.setSyntaxOid( contentPage.getSyntax() );
- newAT.setLength( contentPage.getSyntaxLengthValue() );
+ newAT.setSyntaxLength( contentPage.getSyntaxLengthValue() );
newAT.setObsolete( contentPage.getObsoleteValue() );
- newAT.setSingleValue( contentPage.getSingleValueValue() );
+ newAT.setSingleValued( contentPage.getSingleValueValue() );
newAT.setCollective( contentPage.getCollectiveValue() );
- newAT.setCanUserModify( !contentPage.getNoUserModificationValue() );
- newAT.setEqualityName( matchingRulesPage.getEqualityMatchingRuleValue() );
- newAT.setOrderingName( matchingRulesPage.getOrderingMatchingRuleValue() );
- newAT.setSubstrName( matchingRulesPage.getSubstringMatchingRuleValue() );
+ newAT.setUserModifiable( !contentPage.getNoUserModificationValue() );
+ newAT.setEqualityOid( matchingRulesPage.getEqualityMatchingRuleValue() );
+ newAT.setOrderingOid( matchingRulesPage.getOrderingMatchingRuleValue() );
+ newAT.setSubstringOid( matchingRulesPage.getSubstringMatchingRuleValue() );
// Adding the new attribute type
Activator.getDefault().getSchemaHandler().addAttributeType( newAT );
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java Thu Oct 7 14:10:24 2010
@@ -133,8 +133,8 @@ public class NewObjectClassContentWizard
{
ObjectClassImpl oc = ( ObjectClassImpl ) element;
- String[] names = oc.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = oc.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
return NLS
.bind(
@@ -284,12 +284,12 @@ public class NewObjectClassContentWizard
{
public int compare( ObjectClassImpl o1, ObjectClassImpl o2 )
{
- String[] at1Names = o1.getNamesRef();
- String[] at2Names = o2.getNamesRef();
+ List<String> at1Names = o1.getNames();
+ List<String> at2Names = o2.getNames();
- if ( ( at1Names != null ) && ( at2Names != null ) && ( at1Names.length > 0 ) && ( at2Names.length > 0 ) )
+ if ( ( at1Names != null ) && ( at2Names != null ) && ( at1Names.size() > 0 ) && ( at2Names.size() > 0 ) )
{
- return at1Names[0].compareToIgnoreCase( at2Names[0] );
+ return at1Names.get( 0 ).compareToIgnoreCase( at2Names.get( 0 ) );
}
// Default
@@ -307,16 +307,16 @@ public class NewObjectClassContentWizard
* @return
* the value of the superiors
*/
- public String[] getSuperiorsNameValue()
+ public List<String> getSuperiorsNameValue()
{
List<String> names = new ArrayList<String>();
for ( ObjectClassImpl oc : superiorsList )
{
- String[] aliases = oc.getNamesRef();
+ List<String> aliases = oc.getNames();
- if ( ( aliases != null ) && ( aliases.length > 0 ) )
+ if ( ( aliases != null ) && ( aliases.size() > 0 ) )
{
- names.add( aliases[0] );
+ names.add( aliases.get( 0 ) );
}
else
{
@@ -324,7 +324,7 @@ public class NewObjectClassContentWizard
}
}
- return names.toArray( new String[0] );
+ return names;
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java Thu Oct 7 14:10:24 2010
@@ -432,7 +432,7 @@ public class NewObjectClassGeneralPageWi
* @return
* the value of the aliases
*/
- public String[] getAliasesValue()
+ public List<String> getAliasesValue()
{
List<String> aliasesValue = new ArrayList<String>();
@@ -441,7 +441,7 @@ public class NewObjectClassGeneralPageWi
aliasesValue.add( alias.toString() );
}
- return aliasesValue.toArray( new String[0] );
+ return aliasesValue;
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java Thu Oct 7 14:10:24 2010
@@ -126,8 +126,8 @@ public class NewObjectClassMandatoryAttr
{
AttributeTypeImpl at = ( AttributeTypeImpl ) element;
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
return NLS
.bind(
@@ -221,12 +221,12 @@ public class NewObjectClassMandatoryAttr
{
public int compare( AttributeTypeImpl o1, AttributeTypeImpl o2 )
{
- String[] at1Names = o1.getNamesRef();
- String[] at2Names = o2.getNamesRef();
+ List<String> at1Names = o1.getNames();
+ List<String> at2Names = o2.getNames();
- if ( ( at1Names != null ) && ( at2Names != null ) && ( at1Names.length > 0 ) && ( at2Names.length > 0 ) )
+ if ( ( at1Names != null ) && ( at2Names != null ) && ( at1Names.size() > 0 ) && ( at2Names.size() > 0 ) )
{
- return at1Names[0].compareToIgnoreCase( at2Names[0] );
+ return at1Names.get( 0 ).compareToIgnoreCase( at2Names.get( 0 ) );
}
// Default
@@ -256,13 +256,13 @@ public class NewObjectClassMandatoryAttr
* @return
* the names of the mandatory attributes types
*/
- public String[] getMandatoryAttributeTypesNames()
+ public List<String> getMandatoryAttributeTypesNames()
{
List<String> names = new ArrayList<String>();
for ( AttributeTypeImpl at : mandatoryAttributeTypesList )
{
names.add( at.getName() );
}
- return names.toArray( new String[0] );
+ return names;
}
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java Thu Oct 7 14:10:24 2010
@@ -126,8 +126,8 @@ public class NewObjectClassOptionalAttri
{
AttributeTypeImpl at = ( AttributeTypeImpl ) element;
- String[] names = at.getNamesRef();
- if ( ( names != null ) && ( names.length > 0 ) )
+ List<String> names = at.getNames();
+ if ( ( names != null ) && ( names.size() > 0 ) )
{
return NLS
.bind(
@@ -221,12 +221,12 @@ public class NewObjectClassOptionalAttri
{
public int compare( AttributeTypeImpl o1, AttributeTypeImpl o2 )
{
- String[] at1Names = o1.getNamesRef();
- String[] at2Names = o2.getNamesRef();
+ List<String> at1Names = o1.getNames();
+ List<String> at2Names = o2.getNames();
- if ( ( at1Names != null ) && ( at2Names != null ) && ( at1Names.length > 0 ) && ( at2Names.length > 0 ) )
+ if ( ( at1Names != null ) && ( at2Names != null ) && ( at1Names.size() > 0 ) && ( at2Names.size() > 0 ) )
{
- return at1Names[0].compareToIgnoreCase( at2Names[0] );
+ return at1Names.get( 0 ).compareToIgnoreCase( at2Names.get( 0 ) );
}
// Default
@@ -256,13 +256,13 @@ public class NewObjectClassOptionalAttri
* @return
* the names of the optional attributes types
*/
- public String[] getOptionalAttributeTypesNames()
+ public List<String> getOptionalAttributeTypesNames()
{
List<String> names = new ArrayList<String>();
for ( AttributeTypeImpl at : optionalAttributeTypesList )
{
names.add( at.getName() );
}
- return names.toArray( new String[0] );
+ return names;
}
}
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassWizard.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassWizard.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassWizard.java Thu Oct 7 14:10:24 2010
@@ -77,15 +77,15 @@ public class NewObjectClassWizard extend
{
// Creating the new object class
ObjectClassImpl newOC = new ObjectClassImpl( generalPage.getOidValue() );
- newOC.setSchema( generalPage.getSchemaValue() );
+ newOC.setSchemaName( generalPage.getSchemaValue() );
newOC.setSchemaObject( Activator.getDefault().getSchemaHandler().getSchema( generalPage.getSchemaValue() ) );
newOC.setNames( generalPage.getAliasesValue() );
newOC.setDescription( generalPage.getDescriptionValue() );
- newOC.setSuperClassesNames( contentPage.getSuperiorsNameValue() );
+ newOC.setSuperiorOids( contentPage.getSuperiorsNameValue() );
newOC.setType( contentPage.getClassTypeValue() );
newOC.setObsolete( contentPage.getObsoleteValue() );
- newOC.setMustNamesList( mandatoryAttributesPage.getMandatoryAttributeTypesNames() );
- newOC.setMayNamesList( optionalAttributesPage.getOptionalAttributeTypesNames() );
+ newOC.setMustAttributeTypeOids( mandatoryAttributesPage.getMandatoryAttributeTypesNames() );
+ newOC.setMayAttributeTypeOids( optionalAttributesPage.getOptionalAttributeTypesNames() );
// Adding the new object class
Activator.getDefault().getSchemaHandler().addObjectClass( newOC );
Modified: directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/FirstNameSorter.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/FirstNameSorter.java?rev=1005455&r1=1005454&r2=1005455&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/FirstNameSorter.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/FirstNameSorter.java Thu Oct 7 14:10:24 2010
@@ -22,6 +22,7 @@ package org.apache.directory.studio.sche
import java.util.Comparator;
+import java.util.List;
import org.apache.directory.studio.schemaeditor.model.AttributeTypeImpl;
import org.apache.directory.studio.schemaeditor.model.ObjectClassImpl;
@@ -37,56 +38,56 @@ public class FirstNameSorter implements
*/
public int compare( TreeNode o1, TreeNode o2 )
{
- String[] o1Names = null;
- String[] o2Names = null;
+ List<String> o1Names = null;
+ List<String> o2Names = null;
if ( ( o1 instanceof AttributeTypeWrapper ) && ( o2 instanceof AttributeTypeWrapper ) )
{
AttributeTypeImpl at1 = ( ( AttributeTypeWrapper ) o1 ).getAttributeType();
AttributeTypeImpl at2 = ( ( AttributeTypeWrapper ) o2 ).getAttributeType();
- o1Names = at1.getNamesRef();
- o2Names = at2.getNamesRef();
+ o1Names = at1.getNames();
+ o2Names = at2.getNames();
}
else if ( ( o1 instanceof ObjectClassWrapper ) && ( o2 instanceof ObjectClassWrapper ) )
{
ObjectClassImpl oc1 = ( ( ObjectClassWrapper ) o1 ).getObjectClass();
ObjectClassImpl oc2 = ( ( ObjectClassWrapper ) o2 ).getObjectClass();
- o1Names = oc1.getNamesRef();
- o2Names = oc2.getNamesRef();
+ o1Names = oc1.getNames();
+ o2Names = oc2.getNames();
}
else if ( ( o1 instanceof AttributeTypeWrapper ) && ( o2 instanceof ObjectClassWrapper ) )
{
AttributeTypeImpl at = ( ( AttributeTypeWrapper ) o1 ).getAttributeType();
ObjectClassImpl oc = ( ( ObjectClassWrapper ) o2 ).getObjectClass();
- o1Names = at.getNamesRef();
- o2Names = oc.getNamesRef();
+ o1Names = at.getNames();
+ o2Names = oc.getNames();
}
else if ( ( o1 instanceof ObjectClassWrapper ) && ( o2 instanceof AttributeTypeWrapper ) )
{
ObjectClassImpl oc = ( ( ObjectClassWrapper ) o1 ).getObjectClass();
AttributeTypeImpl at = ( ( AttributeTypeWrapper ) o2 ).getAttributeType();
- o1Names = oc.getNamesRef();
- o2Names = at.getNamesRef();
+ o1Names = oc.getNames();
+ o2Names = at.getNames();
}
// Comparing the First Name
if ( ( o1Names != null ) && ( o2Names != null ) )
{
- if ( ( o1Names.length > 0 ) && ( o2Names.length > 0 ) )
+ if ( ( o1Names.size() > 0 ) && ( o2Names.size() > 0 ) )
{
- return o1Names[0].compareToIgnoreCase( o2Names[0] );
+ return o1Names.get( 0 ).compareToIgnoreCase( o2Names.get( 0 ) );
}
- else if ( ( o1Names.length == 0 ) && ( o2Names.length > 0 ) )
+ else if ( ( o1Names.size() == 0 ) && ( o2Names.size() > 0 ) )
{
- return "".compareToIgnoreCase( o2Names[0] ); //$NON-NLS-1$
+ return "".compareToIgnoreCase( o2Names.get( 0 ) ); //$NON-NLS-1$
}
- else if ( ( o1Names.length > 0 ) && ( o2Names.length == 0 ) )
+ else if ( ( o1Names.size() > 0 ) && ( o2Names.size() == 0 ) )
{
- return o1Names[0].compareToIgnoreCase( "" ); //$NON-NLS-1$
+ return o1Names.get( 0 ).compareToIgnoreCase( "" ); //$NON-NLS-1$
}
}