Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-patch] Partial fix for C-Build Console inability to copy contents to the

> 
> 
> Added a selection changed listener to the textViewer managed by the C Build
> View (BuildConsoleView.java).
> This updates the state read by the tool bar menu items and now enables the
> copy action when there is a selection made in the C-Build console.
> 
> Ctrl + A, now selects all text in the C-Build View
> Ctrl + C, now copies the selection to the clipboard
> 
> Still working on enabling the popup menu.
> 

Judy,

  You will have to provide ChangeLog entries for your changes.
So put your comments in: org.eclipse.cdt.ui/ChangeLog

See my previous email on cdt-dev about the format, all modifications
should have proper ChangeLogs.

 -1 for you 8-)



> 
> 
> First diff ...
> ***
> cvs diff -N -u "BuildConsoleAction.java"
>   Index: BuildConsoleAction.java
>   ===================================================================
>   RCS file:
> /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleA
> ction.java,v
>   retrieving revision 1.1
>   diff -u -r1.1 BuildConsoleAction.java
>   --- BuildConsoleAction.java	26 Jun 2002 20:55:44 -0000	1.1
>   +++ BuildConsoleAction.java	21 Oct 2002 20:18:39 -0000
>   @@ -41,15 +41,12 @@
>    	 * @see TextEditorAction
>    	 */
>    	public void update() {
>   -
>   -
>   -		//boolean wasEnabled= isEnabled();
>   +				
>   +		boolean wasEnabled= isEnabled();
>    		boolean isEnabled= (fOperationTarget != null &&
> fOperationTarget.canDoOperation(fOperationCode));
>   -		setEnabled(isEnabled);
>   -
>    
>   -		/*if (wasEnabled != isEnabled) {
>   -			firePropertyChange(ENABLED, wasEnabled ?
> Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE);
>   -		}*/
>   +		if (wasEnabled != isEnabled) {
>   +			setEnabled(isEnabled);
>   +		}
>    	}
>    }
> 
> Second diff ...
> 
> 
> ***
> cvs diff -N -u "BuildConsoleView.java"
>   Index: BuildConsoleView.java
>   ===================================================================
>   RCS file:
> /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleV
> iew.java,v
>   retrieving revision 1.4
>   diff -u -r1.4 BuildConsoleView.java
>   --- BuildConsoleView.java	16 Oct 2002 20:14:22 -0000	1.4
>   +++ BuildConsoleView.java	21 Oct 2002 20:19:36 -0000
>   @@ -21,6 +21,8 @@
>    import org.eclipse.jface.text.TextViewer;
>    import org.eclipse.jface.util.IPropertyChangeListener;
>    import org.eclipse.jface.util.PropertyChangeEvent;
>   +import org.eclipse.jface.viewers.ISelectionChangedListener;
>   +import org.eclipse.jface.viewers.SelectionChangedEvent;
>    import org.eclipse.swt.SWT;
>    import org.eclipse.swt.custom.StyledText;
>    import org.eclipse.swt.graphics.Font;
>   @@ -74,13 +76,25 @@
>    
>  
> actionBars.setGlobalActionHandler(ITextEditorActionConstants.COPY,
> fCopyAction);
>  
> actionBars.setGlobalActionHandler(ITextEditorActionConstants.SELECT_ALL,
> fSelectAllAction);
>   +		
>   +		fTextViewer.addSelectionChangedListener(new
> ISelectionChangedListener() {
>   +            public void selectionChanged(SelectionChangedEvent e) {
>   +                // ensures that the copyAction updates is doability when
> the selections tate changes
>   +                fCopyAction.update();
>   +            }
>   +        });
>   +//		addTextListener(new ITextListener() {
>   +//			public void textChanged(TextEvent event) {
>   +//				fCopyAction.update();
>   +//				fSelectAllAction.update();
>   +//			}
>   +//		});
>    	}	
>    		
>    	/**
>    	 * @see ViewPart#createPartControl
>    	 */
>    	public void createPartControl(Composite parent) {
>   -		//fTextViewer= new TextViewer(parent,
> SWT.V_SCROLL|SWT.H_SCROLL);
>    		fTextViewer= new TextViewer(parent,
> SWT.V_SCROLL|SWT.H_SCROLL|SWT.WRAP|SWT.MULTI);
>  
> fTextViewer.setDocument(CPlugin.getDefault().getConsoleDocument());
>    		fTextViewer.addTextListener(new ITextListener() {
> _______________________________________________
> cdt-patch mailing list
> cdt-patch@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/cdt-patch
> 


-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!



Back to the top