Skip to content

Package: TableColumnConfiguration

TableColumnConfiguration

nameinstructionbranchcomplexitylinemethod
TableColumnConfiguration(boolean, EAttribute)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
equals(Object)
M: 44 C: 0
0%
M: 14 C: 0
0%
M: 8 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%
getColumnAttribute()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hashCode()
M: 30 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
isReadOnly()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: *******************************************************************************/
14: package org.eclipse.emf.ecp.edit.internal.swt.table;
15:
16: import org.eclipse.emf.ecore.EAttribute;
17:
18: /**
19: * The table column configuration defines whether a column is visible and what attribute should be bound to the column.
20: *
21: * @deprecated This is used only in the deprecated TableControl and the TableControlConfiguration
22: * @author Eugen Neufeld
23: *
24: */
25: @Deprecated
26: public class TableColumnConfiguration {
27:         private final boolean readOnly;
28:         private final EAttribute columnAttribute;
29:
30:         /**
31:          * @param readOnly whether the column is read-only
32:          * @param columnAttribute the {@link EAttribute} to be displayed in this column
33:          */
34:         public TableColumnConfiguration(boolean readOnly, EAttribute columnAttribute) {
35:                 super();
36:                 this.readOnly = readOnly;
37:                 this.columnAttribute = columnAttribute;
38:         }
39:
40:         /**
41:          * Whether the column is read only.
42:          *
43:          * @return if the column is read-only
44:          */
45:         public boolean isReadOnly() {
46:                 return readOnly;
47:         }
48:
49:         /**
50:          * The {@link EAttribute} to bind to the column.
51:          *
52:          * @return the {@link EAttribute} to bind
53:          */
54:         public EAttribute getColumnAttribute() {
55:                 return columnAttribute;
56:         }
57:
58:         @Override
59:         public int hashCode() {
60:                 final int prime = 31;
61:                 int result = 1;
62:•                result = prime * result + (columnAttribute == null ? 0 : columnAttribute.hashCode());
63:•                result = prime * result + (readOnly ? 1231 : 1237);
64:                 return result;
65:         }
66:
67:         @Override
68:         public boolean equals(Object obj) {
69:•                if (this == obj) {
70:                         return true;
71:                 }
72:•                if (obj == null) {
73:                         return false;
74:                 }
75:•                if (getClass() != obj.getClass()) {
76:                         return false;
77:                 }
78:                 final TableColumnConfiguration other = (TableColumnConfiguration) obj;
79:•                if (columnAttribute == null) {
80:•                        if (other.columnAttribute != null) {
81:                                 return false;
82:                         }
83:•                } else if (!columnAttribute.equals(other.columnAttribute)) {
84:                         return false;
85:                 }
86:•                if (readOnly != other.readOnly) {
87:                         return false;
88:                 }
89:                 return true;
90:         }
91:
92: }