copyAction = new TextViewerAction(textViewer, ITextOperationTarget.COPY); copyAction.setText(Policy.bind("HistoryView.copy")); actionBars.setGlobalActionHandler(ITextEditorActionConstants.COPY, copyAction);  selectAllAction = new TextViewerAction(textViewer, ITextOperationTarget.SELECT_ALL); selectAllAction.setText(Policy.bind("HistoryView.selectAll")); actionBars.setGlobalActionHandler(ITextEditorActionConstants.SELECT_ALL, selectAllAction);  actionBars.updateActionBars();   { MenuManager menuMgr = new MenuManager(); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager menuMgr) { fillTextMenu(menuMgr); } });  StyledText text = textViewer.getTextWidget(); Menu menu = menuMgr.createContextMenu(text); text.setMenu(menu); }
	protected void contributeActions() {		// Double click open action		tableHistoryViewer.getTable().addListener(SWT.DefaultSelection, new Listener() {			public void handleEvent(Event e) {				getOpenRemoteFileAction().run();			}		});        tableChangePathViewer.getTable().addListener(SWT.DefaultSelection, new Listener() {            public void handleEvent(Event e) {                getOpenChangedPathAction().run();            }        });                // Contribute actions to popup menu for the table        {            MenuManager menuMgr = new MenuManager();    		 		 Menu menu = menuMgr.createContextMenu(tableHistoryViewer.getTable());    		 		 menuMgr.addMenuListener(new IMenuListener() {    		 		 		 public void menuAboutToShow(IMenuManager menuMgr) {    		 		 		 		 fillTableMenu(menuMgr);    		 		 		 }    		 		 });    		 		 menuMgr.setRemoveAllWhenShown(true);    		 		 tableHistoryViewer.getTable().setMenu(menu);    		 		 getSite().registerContextMenu(menuMgr, tableHistoryViewer);        }                final IPreferenceStore store = SVNUIPlugin.getPlugin().getPreferenceStore();        toggleShowComments = new Action(Policy.bind("HistoryView.showComments")) { //$NON-NLS-1$            public void run() {                setViewerVisibility();                store.setValue(ISVNUIConstants.PREF_SHOW_COMMENTS, toggleShowComments.isChecked());            }        };        toggleShowComments.setChecked(store.getBoolean(ISVNUIConstants.PREF_SHOW_COMMENTS));        // PlatformUI.getWorkbench().getHelpSystem().setHelp(toggleTextAction, IHelpContextIds.SHOW_COMMENT_IN_HISTORY_ACTION);            // Toggle wrap comments action        toggleWrapCommentsAction = new Action(Policy.bind("HistoryView.wrapComments")) { //$NON-NLS-1$          public void run() {            setViewerVisibility();            store.setValue(ISVNUIConstants.PREF_WRAP_COMMENTS, toggleWrapCommentsAction.isChecked());          }        };        toggleWrapCommentsAction.setChecked(store.getBoolean(ISVNUIConstants.PREF_WRAP_COMMENTS));        //PlatformUI.getWorkbench().getHelpSystem().setHelp(toggleTextWrapAction, IHelpContextIds.SHOW_TAGS_IN_HISTORY_ACTION);                   // Toggle path visible action        toggleShowAffectedPathsAction = new Action(Policy.bind("HistoryView.showAffectedPaths")) { //$NON-NLS-1$            public void run() {                setViewerVisibility();                store.setValue(ISVNUIConstants.PREF_SHOW_PATHS, toggleShowAffectedPathsAction.isChecked());            }        };        toggleShowAffectedPathsAction.setChecked(store.getBoolean(ISVNUIConstants.PREF_SHOW_PATHS));        // PlatformUI.getWorkbench().getHelpSystem().setHelp(toggleListAction, IHelpContextIds.SHOW_TAGS_IN_HISTORY_ACTION);           // Toggle stop on copy action        toggleStopOnCopyAction = new Action(Policy.bind("HistoryView.stopOnCopy")) { //$NON-NLS-1$            public void run() {                setStopOnCopy();                store.setValue(ISVNUIConstants.PREF_STOP_ON_COPY, toggleStopOnCopyAction.isChecked());            }        };        toggleStopOnCopyAction.setChecked(store.getBoolean(ISVNUIConstants.PREF_STOP_ON_COPY));                IActionBars actionBars = getViewSite().getActionBars();        // Contribute toggle text visible to the toolbar drop-down        IMenuManager actionBarsMenu = actionBars.getMenuManager();        actionBarsMenu.add(toggleWrapCommentsAction);        actionBarsMenu.add(new Separator());        actionBarsMenu.add(toggleShowComments);        actionBarsMenu.add(toggleShowAffectedPathsAction);        actionBarsMenu.add(toggleStopOnCopyAction);                // Create the local tool bar        IToolBarManager tbm = actionBars.getToolBarManager();		tbm.add(getRefreshAction());		tbm.add(getGetNextAction());		tbm.add(getGetAllAction());		tbm.add(getLinkWithEditorAction());		tbm.update(false);        		// Create actions for the text editor (copy and select all)		copyAction = new TextViewerAction(textViewer, ITextOperationTarget.COPY);		copyAction.setText(Policy.bind("HistoryView.copy")); //$NON-NLS-1$		actionBars.setGlobalActionHandler(ITextEditorActionConstants.COPY, copyAction);				selectAllAction = new TextViewerAction(textViewer, ITextOperationTarget.SELECT_ALL);		selectAllAction.setText(Policy.bind("HistoryView.selectAll")); //$NON-NLS-1$		actionBars.setGlobalActionHandler(ITextEditorActionConstants.SELECT_ALL, selectAllAction);		actionBars.updateActionBars();        // Contribute actions to popup menu for the comments area        {	 		 MenuManager menuMgr = new MenuManager();	 		 menuMgr.setRemoveAllWhenShown(true);	 		 menuMgr.addMenuListener(new IMenuListener() {	 		 		 public void menuAboutToShow(IMenuManager menuMgr) {	 		 		 		 fillTextMenu(menuMgr);	 		 		 }	 		 });		 		 StyledText text = textViewer.getTextWidget();	 		 Menu menu = menuMgr.createContextMenu(text);	 		 text.setMenu(menu);        }	}