{
super.createActions();
// add content assistant
ResourceBundle bundle = LdifEditorActivator.getDefault().getResourceBundle();
IAction action = new ContentAssistAction( bundle, "ldifeditor__contentassistproposal_", this ); //$NON-NLS-1$
action.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
setAction( "ContentAssistProposal", action ); //$NON-NLS-1$
// add execute action (for tool bar)
if ( actionToolBarManager != null )
{
ExecuteLdifAction executeLdifAction = new ExecuteLdifAction( this );
actionToolBarManager.add( executeLdifAction );
setAction( LdifEditorConstants.ACTION_ID_EXECUTE_LDIF, executeLdifAction );
actionToolBarManager.update( true );
}
// add context menu edit actions
EditLdifAttributeAction editLdifAttributeAction = new EditLdifAttributeAction( this );
setAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION, editLdifAttributeAction );
openBestValueEditorAction = new OpenBestValueEditorAction( this );
IValueEditor[] valueEditors = valueEditorManager.getAllValueEditors();
openValueEditorActions = new OpenValueEditorAction[valueEditors.length];
for ( int i = 0; i < this.openValueEditorActions.length; i++ )
{
openValueEditorActions[i] = new OpenValueEditorAction( this, valueEditors[i] );
}
valueEditorPreferencesAction = new ValueEditorPreferencesAction();
OpenDefaultValueEditorAction openDefaultValueEditorAction = new OpenDefaultValueEditorAction( this,
openBestValueEditorAction );
setAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE, openDefaultValueEditorAction );
EditLdifRecordAction editRecordAction = new EditLdifRecordAction( this );
setAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD, editRecordAction );
// add context menu format actions
FormatLdifDocumentAction formatDocumentAction = new FormatLdifDocumentAction( this );
setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_DOCUMENT, formatDocumentAction );
FormatLdifRecordAction formatRecordAction = new FormatLdifRecordAction( this );
setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_RECORD, formatRecordAction );
// update cut, copy, paste
IAction cutAction = getAction( ITextEditorActionConstants.CUT );
if ( cutAction != null )
{
cutAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
ISharedImages.IMG_TOOL_CUT ) );
}
IAction copyAction = getAction( ITextEditorActionConstants.COPY );
if ( copyAction != null )
{
copyAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
ISharedImages.IMG_TOOL_COPY ) );
}
IAction pasteAction = getAction( ITextEditorActionConstants.PASTE );
if ( pasteAction != null )
{
pasteAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
ISharedImages.IMG_TOOL_PASTE ) );
}
activateGlobalActionHandlers();
}