GridData gridData = new GridData();
gridData.horizontalSpan = 1;
gridData.widthHint = 9 * 3;
lengthText.setLayoutData( gridData );
lengthText.setTextLimit( 3 );
lengthText.addVerifyListener( new VerifyListener()
{
public void verifyText( VerifyEvent e )
{
if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
{
e.doit = false;
}
if ( "".equals( lengthText.getText() ) && e.text.matches( "[0]" ) ) //$NON-NLS-1$ //$NON-NLS-2$
{
e.doit = false;
}
}
} );
// Characters Label
Label charactersLabel = new Label( abbreviateComposite, SWT.NONE );
charactersLabel.setText( Messages.getString( "HierarchyViewPreferencePage.characters." ) ); //$NON-NLS-1$
// Secondary Label Group
Group secondaryLabelGroup = new Group( composite, SWT.NONE );
secondaryLabelGroup.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
secondaryLabelGroup.setText( Messages.getString( "HierarchyViewPreferencePage.Secondary_label" ) ); //$NON-NLS-1$
secondaryLabelGroup.setLayout( new GridLayout() );
Composite secondaryLabelGroupComposite = new Composite( secondaryLabelGroup, SWT.NONE );
gl = new GridLayout( 1, false );
gl.marginHeight = gl.marginWidth = 0;
secondaryLabelGroupComposite.setLayout( gl );
secondaryLabelGroupComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
secondaryLabelButtonDisplay = new Button( secondaryLabelGroupComposite, SWT.CHECK );
secondaryLabelButtonDisplay.setText( Messages
.getString( "HierarchyViewPreferencePage.Display_secondary_label." ) ); //$NON-NLS-1$
// Label row composite
Composite secondaryLabelComposite = new Composite( secondaryLabelGroupComposite, SWT.NONE );
gl = new GridLayout( 3, false );
gl.marginHeight = gl.marginWidth = 0;
secondaryLabelComposite.setLayout( gl );
gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = 1;
secondaryLabelComposite.setLayoutData( gd );
// Use Label
Label useLabel2 = new Label( secondaryLabelComposite, SWT.NONE );
useLabel2.setText( Messages.getString( "HierarchyViewPreferencePage.Use" ) ); //$NON-NLS-1$
// Label Combo
secondaryLabelCombo = new Combo( secondaryLabelComposite, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER );
secondaryLabelCombo.setLayoutData( new GridData() );
secondaryLabelCombo.setItems( new String[]
{ FIRST_NAME, ALL_ALIASES, OID } );
secondaryLabelCombo.setEnabled( true );
// As label Label
Label asLabel2 = new Label( secondaryLabelComposite, SWT.NONE );
asLabel2.setText( Messages.getString( "HierarchyViewPreferencePage.as_secondary_label." ) ); //$NON-NLS-1$
// Abbreviate row composite
Composite abbreviateComposite2 = new Composite( secondaryLabelGroup, SWT.NONE );
gl = new GridLayout( 3, false );
gl.marginHeight = gl.marginWidth = 0;
abbreviateComposite2.setLayout( gl );
gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = 1;
abbreviateComposite2.setLayoutData( gd );
// Limit label lenght to Label
secondaryLabelLimitButton = new Button( abbreviateComposite2, SWT.CHECK );
secondaryLabelLimitButton.setText( Messages
.getString( "HierarchyViewPreferencePage.Limit_secondary_label_length_to" ) ); //$NON-NLS-1$
gd = new GridData();
gd.horizontalSpan = 1;
secondaryLabelLimitButton.setLayoutData( gd );
// Lenght Text
secondaryLabelLengthText = new Text( abbreviateComposite2, SWT.NONE | SWT.BORDER );
gridData = new GridData();
gridData.horizontalSpan = 1;
gridData.widthHint = 9 * 3;
secondaryLabelLengthText.setLayoutData( gridData );
secondaryLabelLengthText.setTextLimit( 3 );
secondaryLabelLengthText.addVerifyListener( new VerifyListener()
{
public void verifyText( VerifyEvent e )
{
if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
{