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

COVERAGE SUMMARY FOR SOURCE FILE [InfrastructureSignaturesEditorSection.java]

nameclass, %method, %block, %line, %
InfrastructureSignaturesEditorSection.java0%   (0/2)0%   (0/16)0%   (0/151)0%   (0/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InfrastructureSignaturesEditorSection0%   (0/1)0%   (0/14)0%   (0/126)0%   (0/29)
<static initializer> 0%   (0/1)0%   (0/20)0%   (0/3)
InfrastructureSignaturesEditorSection (Composite): void 0%   (0/1)0%   (0/4)0%   (0/2)
access$0 (InfrastructureSignaturesEditorSection): TableViewer 0%   (0/1)0%   (0/3)0%   (0/1)
canAddButonCreated (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
canDeleteButonCreated (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
createAddButtonActionListener (): SelectionListener 0%   (0/1)0%   (0/8)0%   (0/2)
createDeleteButtonListener (): SelectionListener 0%   (0/1)0%   (0/4)0%   (0/1)
createTableColumns (Table): void 0%   (0/1)0%   (0/37)0%   (0/8)
createViewerCellEditors (Table): CellEditor [] 0%   (0/1)0%   (0/31)0%   (0/6)
createViewerCellModifier (): ObservableCellModifier 0%   (0/1)0%   (0/4)0%   (0/1)
getAddButtonListener (): InfrastructureSignatureAddActionListener 0%   (0/1)0%   (0/3)0%   (0/1)
getSelectedSignature (): Signature 0%   (0/1)0%   (0/4)0%   (0/1)
getTableColumnNames (): String [] 0%   (0/1)0%   (0/2)0%   (0/1)
inputValidation (EObject): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
     
class InfrastructureSignaturesEditorSection$10%   (0/1)0%   (0/2)0%   (0/25)0%   (0/7)
InfrastructureSignaturesEditorSection$1 (InfrastructureSignaturesEditorSectio... 0%   (0/1)0%   (0/7)0%   (0/2)
openDialogBox (Control): Object 0%   (0/1)0%   (0/18)0%   (0/5)

1package de.uka.ipd.sdq.pcmbench.tabs.operations;
2 
3 
4import org.eclipse.emf.ecore.EObject;
5import org.eclipse.jface.dialogs.Dialog;
6import org.eclipse.jface.viewers.CellEditor;
7import org.eclipse.jface.viewers.DialogCellEditor;
8import org.eclipse.jface.viewers.TextCellEditor;
9import org.eclipse.swt.SWT;
10import org.eclipse.swt.events.SelectionListener;
11import org.eclipse.swt.widgets.Composite;
12import org.eclipse.swt.widgets.Control;
13import org.eclipse.swt.widgets.Table;
14import org.eclipse.swt.widgets.TableColumn;
15 
16import de.uka.ipd.sdq.pcm.dialogs.parameters.ParametersDialog;
17import de.uka.ipd.sdq.pcm.repository.Signature;
18import de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection;
19import de.uka.ipd.sdq.pcmbench.tabs.generic.ObservableCellModifier;
20 
21/**Editor section for infrastructure signatures.
22 * Allows to display and edit the list of signatures for a given infrastructure interface.
23 * @author groenda
24 *
25 */
26public class InfrastructureSignaturesEditorSection extends EditorSection{
27 
28        /** Index of the icon column in the table. */
29        public static final int ICON_COLUMN_INDEX = 0;
30        /** Index of the signature column in the table. */
31        public static final int SIGNATURENAME_COLUMN_INDEX = 1;
32        /** Index of the parameter column in the table. */
33        public static final int PARAMETER_COLUMN_INDEX = 2;
34        /** Index of the exception column in the table. */
35        public static final int EXCEPTIONS_COLUMN_INDEX = 3;
36        
37        /**
38         * Columns of a table, which is used into operations table
39         */
40        public final static String OPERATIONS_ICON_COLUMN        = "";
41        public final static String OWNEDPARAMETER_COLUMN         = "Owned Parameter(s)";
42        public final static String SERVICENAME_COLUMN                 = "Signature Name";
43        public final static String EXEPTIONTYPE_COLUM                = "Exception Type";
44        
45        /** Column to name mapping. */
46        public static String[] columnNames = new String[] { OPERATIONS_ICON_COLUMN,
47                        SERVICENAME_COLUMN, OWNEDPARAMETER_COLUMN, EXEPTIONTYPE_COLUM };
48        
49        /** Define the Add-Button listener. Listener must by later initialized. */
50        private InfrastructureSignatureAddActionListener addButtonListener;
51 
52        /** Constructor */
53        public InfrastructureSignaturesEditorSection(Composite composite) {
54                super(composite);
55        }
56 
57        /* (non-Javadoc)
58         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#createViewerCellEditors(org.eclipse.swt.widgets.Table)
59         */
60        @Override
61        protected CellEditor[] createViewerCellEditors(Table table) {
62                CellEditor[] editors = new CellEditor[columnNames.length];
63 
64                editors[SIGNATURENAME_COLUMN_INDEX] = new TextCellEditor(table);
65 
66                // create 'DeleteCellValueListener' and as SelectionListener to the 'TableVewer'
67                InfrastructureSignatureDeleteCellValueListener cellValueListener = new InfrastructureSignatureDeleteCellValueListener(viewer);
68                viewer.addSelectionChangedListener(cellValueListener);
69 
70                editors[PARAMETER_COLUMN_INDEX] = new DialogCellEditor(table) {
71                        @Override
72                        protected Object openDialogBox(Control cellEditorWindow) {
73                                ParametersDialog dialog = new ParametersDialog(cellEditorWindow
74                                                .getShell(), getSelectedSignature());
75                                if (dialog.open() == Dialog.OK)
76                                        viewer.refresh();
77                                return null;
78                        }
79                };
80 
81                return editors;
82        }
83        
84        /* (non-Javadoc)
85         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#createViewerCellModifier()
86         */
87        @Override
88        protected ObservableCellModifier createViewerCellModifier() {
89                return new InfrastructureSignaturesCellModifier();
90        }
91 
92        /* (non-Javadoc)
93         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#createTableColumns(org.eclipse.swt.widgets.Table)
94         */
95        @Override
96        protected void createTableColumns(Table table) {
97                // 1st column
98                TableColumn column = new TableColumn(table, SWT.CENTER, 0);
99                column.setText("");
100                column.setWidth(25);
101 
102                for (int i = 1; i < columnNames.length; i++) {
103                        // n-te column with task Description
104                        column = new TableColumn(table, SWT.LEFT, i);
105                        column.setText((String) columnNames[i]);
106                        column.setWidth(140);
107                }
108        }
109        
110        /* (non-Javadoc)
111         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#createAddButtonActionListener()
112         */
113        @Override
114        protected SelectionListener createAddButtonActionListener() {
115                // the value must by initialized! (don't return new AddActionListener()) 
116                this.addButtonListener = new InfrastructureSignatureAddActionListener();
117                
118                return addButtonListener;
119        }
120 
121        /* (non-Javadoc)
122         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#createDeleteButtonListener()
123         */
124        @Override
125        protected SelectionListener createDeleteButtonListener() {
126                return new InfrastructureSignatureDeleteActionListener();
127        }
128 
129        /* (non-Javadoc)
130         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#getViewerColumnProperties()
131         */
132        @Override
133        protected String[] getTableColumnNames() {
134                return columnNames;
135        }
136        
137        /* (non-Javadoc)
138         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#canAddButonCreated()
139         */
140        @Override
141        protected boolean canAddButonCreated() {
142                return true;
143        }
144 
145        /* (non-Javadoc)
146         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#canDeleteButonCreated()
147         */
148        @Override
149        protected boolean canDeleteButonCreated() {
150                return true;
151        }
152        
153        /* (non-Javadoc)
154         * @see de.uka.ipd.sdq.pcmbench.tabs.generic.EditorSection#inputValidation(org.eclipse.emf.ecore.EObject)
155         */
156        @Override
157        protected boolean inputValidation(EObject object) {
158                return true;
159        }
160 
161        public Signature getSelectedSignature() {
162                return (Signature) getSelectedObject();
163        }
164 
165        /**
166         * @return the addButtonListener
167         */
168        public InfrastructureSignatureAddActionListener getAddButtonListener() {
169                return addButtonListener;
170        }
171}

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