* @return
* the Search In menu
*/
public Menu createSearchInMenu()
{
final IDialogSettings settings = Activator.getDefault().getDialogSettings();
// Creating the associated Menu
Menu searchInMenu = new Menu( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.POP_UP );
// Filling the menu
// Aliases
final MenuItem aliasesMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
aliasesMenuItem.setText( Messages.getString( "SearchView.Aliases" ) ); //$NON-NLS-1$
aliasesMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_ALIASES, aliasesMenuItem.getSelection() );
}
} );
// OID
final MenuItem oidMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
oidMenuItem.setText( Messages.getString( "SearchView.OID" ) ); //$NON-NLS-1$
oidMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_OID, oidMenuItem.getSelection() );
}
} );
// Description
final MenuItem descriptionMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
descriptionMenuItem.setText( Messages.getString( "SearchView.Description" ) ); //$NON-NLS-1$
descriptionMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_DESCRIPTION, descriptionMenuItem
.getSelection() );
}
} );
// Separator
new MenuItem( searchInMenu, SWT.SEPARATOR );
// Superior
final MenuItem superiorMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
superiorMenuItem.setText( Messages.getString( "SearchView.Superior" ) ); //$NON-NLS-1$
superiorMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_SUPERIOR, superiorMenuItem.getSelection() );
}
} );
// Syntax
final MenuItem syntaxMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
syntaxMenuItem.setText( Messages.getString( "SearchView.Syntax" ) ); //$NON-NLS-1$
syntaxMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_SYNTAX, syntaxMenuItem.getSelection() );
}
} );
// Matching Rules
final MenuItem matchingRulesMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
matchingRulesMenuItem.setText( Messages.getString( "SearchView.MatchingRules" ) ); //$NON-NLS-1$
matchingRulesMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_MATCHING_RULES, matchingRulesMenuItem
.getSelection() );
}
} );
// Separator
new MenuItem( searchInMenu, SWT.SEPARATOR );
// Superiors
final MenuItem superiorsMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
superiorsMenuItem.setText( Messages.getString( "SearchView.Superiors" ) ); //$NON-NLS-1$
superiorsMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_SUPERIORS, superiorsMenuItem.getSelection() );
}
} );
// Mandatory Attributes
final MenuItem mandatoryAttributesMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
mandatoryAttributesMenuItem.setText( Messages.getString( "SearchView.MandatoryAttributes" ) ); //$NON-NLS-1$
mandatoryAttributesMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_MANDATORY_ATTRIBUTES,
mandatoryAttributesMenuItem.getSelection() );
}
} );
// Optional Attributes
final MenuItem optionalAttributesMenuItem = new MenuItem( searchInMenu, SWT.CHECK );
optionalAttributesMenuItem.setText( Messages.getString( "SearchView.OptionalAttributes" ) ); //$NON-NLS-1$
optionalAttributesMenuItem.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
settings.put( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_OPTIONAL_ATTRIBUTES,
optionalAttributesMenuItem.getSelection() );
}
} );
if ( settings.get( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_ALIASES ) == null )
{
aliasesMenuItem.setSelection( true );
}
else
{
aliasesMenuItem.setSelection( settings.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_ALIASES ) );
}
if ( settings.get( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_OID ) == null )
{
oidMenuItem.setSelection( true );
}
else
{
oidMenuItem.setSelection( settings.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_OID ) );
}
if ( settings.get( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_DESCRIPTION ) == null )
{
descriptionMenuItem.setSelection( true );
}
else
{
descriptionMenuItem.setSelection( settings
.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_DESCRIPTION ) );
}
superiorMenuItem.setSelection( settings.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_SUPERIOR ) );
syntaxMenuItem.setSelection( settings.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_SYNTAX ) );
matchingRulesMenuItem.setSelection( settings
.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_MATCHING_RULES ) );
superiorsMenuItem.setSelection( settings.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_SUPERIORS ) );
mandatoryAttributesMenuItem.setSelection( settings
.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_MANDATORY_ATTRIBUTES ) );
optionalAttributesMenuItem.setSelection( settings
.getBoolean( PluginConstants.PREFS_SEARCH_PAGE_SEARCH_IN_OPTIONAL_ATTRIBUTES ) );
return searchInMenu;
}