aliasesText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
aliasesText.addModifyListener( new ModifyListener()
{
public void modifyText( ModifyEvent e )
{
AliasesStringParser parser = new AliasesStringParser();
parser.parse( aliasesText.getText() );
List<Alias> parsedAliases = parser.getAliases();
aliases.clear();
for ( Alias parsedAlias : parsedAliases )
{
aliases.add( parsedAlias );
}
dialogChanged();
}
} );
aliasesButton = new Button( namingDescriptionGroup, SWT.PUSH );
aliasesButton.setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.Edit" ) ); //$NON-NLS-1$
aliasesButton.addSelectionListener( new SelectionAdapter()
{
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
public void widgetSelected( SelectionEvent arg0 )
{
EditAliasesDialog dialog = new EditAliasesDialog( getAliasesValue() );
if ( ( dialog.open() == Dialog.OK ) && ( dialog.isDirty() ) )
{
String[] newAliases = dialog.getAliases();
StringBuffer sb = new StringBuffer();
for ( String newAlias : newAliases )
{
sb.append( newAlias );
sb.append( ", " ); //$NON-NLS-1$
}
sb.deleteCharAt( sb.length() - 1 );
sb.deleteCharAt( sb.length() - 1 );
AliasesStringParser parser = new AliasesStringParser();
parser.parse( sb.toString() );
List<Alias> parsedAliases = parser.getAliases();
aliases.clear();
for ( Alias parsedAlias : parsedAliases )
{
aliases.add( parsedAlias );
}