EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcmbench.tabs.parameters]

COVERAGE SUMMARY FOR SOURCE FILE [StoExTextCellEditor.java]

nameclass, %method, %block, %line, %
StoExTextCellEditor.java0%   (0/2)0%   (0/5)0%   (0/68)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StoExTextCellEditor0%   (0/1)0%   (0/3)0%   (0/46)0%   (0/12)
StoExTextCellEditor (Composite): void 0%   (0/1)0%   (0/26)0%   (0/8)
access$0 (StoExTextCellEditor): ContentAssistant 0%   (0/1)0%   (0/3)0%   (0/1)
createControl (Composite): Control 0%   (0/1)0%   (0/17)0%   (0/3)
     
class StoExTextCellEditor$10%   (0/1)0%   (0/2)0%   (0/22)0%   (0/5)
StoExTextCellEditor$1 (StoExTextCellEditor): void 0%   (0/1)0%   (0/6)0%   (0/2)
handleEvent (Event): void 0%   (0/1)0%   (0/16)0%   (0/3)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.pcmbench.tabs.parameters;
5 
6import org.eclipse.jface.text.IDocument;
7import org.eclipse.jface.text.contentassist.ContentAssistant;
8import org.eclipse.jface.viewers.TextCellEditor;
9import org.eclipse.swt.SWT;
10import org.eclipse.swt.widgets.Composite;
11import org.eclipse.swt.widgets.Control;
12import org.eclipse.swt.widgets.Event;
13import org.eclipse.swt.widgets.Listener;
14import org.eclipse.swt.widgets.Text;
15 
16import de.uka.ipd.sdq.pcm.dialogs.stoex.StoExCompletionProcessor;
17import de.uka.ipd.sdq.pcm.repository.Parameter;
18 
19/**
20 * @author Roman Andrej
21 *
22 */
23public class StoExTextCellEditor extends TextCellEditor {
24        
25        /**
26         * The text control; initially <code>null</code>.
27         */
28    protected Text text;
29    
30    private ContentAssistant contentAssistant;
31    
32        public StoExTextCellEditor(Composite parent) {
33                super(parent);
34                contentAssistant = new ContentAssistant();
35                contentAssistant.setContentAssistProcessor(
36                                new StoExCompletionProcessor(new Parameter[0]),
37                                IDocument.DEFAULT_CONTENT_TYPE);
38                contentAssistant.setAutoActivationDelay(1);
39                contentAssistant.enableAutoActivation(true);
40        }
41 
42        /* (non-Javadoc)
43         * @see org.eclipse.jface.viewers.TextCellEditor#createControl(org.eclipse.swt.widgets.Composite)
44         */
45        @Override
46        protected Control createControl(Composite parent) {
47                // TODO Auto-generated method stub
48                text =  (Text) super.createControl(parent);
49                
50                
51                text.addListener(SWT.KeyDown, new Listener(){
52 
53                        public void handleEvent(Event event) {
54                                if (event.character == ' ' && (event.stateMask & SWT.CTRL) == SWT.CTRL){
55                                        contentAssistant.showPossibleCompletions();
56                                }
57                        }
58                        
59                });
60                
61                return text;
62        }
63}

[all classes][de.uka.ipd.sdq.pcmbench.tabs.parameters]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov