Révision 1584
| tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 1584) | ||
|---|---|---|
| 195 | 195 |
specificitesTable.setSortColumn(unitColumn); |
| 196 | 196 |
specificitesTable.setSortDirection(SWT.UP); |
| 197 | 197 |
|
| 198 |
if (!getResult().isParentVisible()) {
|
|
| 198 |
if (!this.getResult().isParentVisible()) {
|
|
| 199 | 199 |
ThresholdsGroup thresholdsGroup = new ThresholdsGroup(this.getExtendedParametersGroup(), SWT.NONE, this, true, false); |
| 200 | 200 |
this.fMinSpinner = thresholdsGroup.getFMinSpinner(); |
| 201 | 201 |
this.vMaxSpinner = thresholdsGroup.getVMaxSpinner(); |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1584) | ||
|---|---|---|
| 852 | 852 |
// Stores the last parameters before the computing to later auto-update the Widgets only if some parameters have changed |
| 853 | 853 |
//setLastComputingParameters(TXMEditor.this.getResult().getLastParametersFromHistory()); |
| 854 | 854 |
} |
| 855 |
else {
|
|
| 856 |
// popup alert to inform user that children results will be recomputed |
|
| 857 |
if(!TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER) |
|
| 858 |
&& TXMEditor.this.getResult().hasVisibleChild() && !MessageDialog.openQuestion(getShell(), TXMCoreMessages.common_warning, TXMUIMessages.warning_popup_allDescendantResultsWillBeUpdated)) {
|
|
| 859 |
setCanceled(true); |
|
| 860 |
} |
|
| 861 |
|
|
| 862 |
} |
|
| 855 |
// FIXME: SJ: there is a bug when deleting LT lines for example, the popup alert to inform user that children results will be recomputed is not triggered |
|
| 856 |
// problem here is the DeleteLines commands, etc. call TXMEditor.compute(false) at this moment, they should call TXMEditor.compute(true) but the LT Editor is not ready to manage that |
|
| 857 |
// else if(TXMEditor.this.getResult().hasBeenComputedOnce()) {
|
|
| 858 |
// // popup alert to inform user that children results will be recomputed |
|
| 859 |
// if(!TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER) |
|
| 860 |
// && TXMEditor.this.getResult().hasVisibleChild() && !MessageDialog.openQuestion(getShell(), TXMCoreMessages.common_warning, TXMUIMessages.warning_popup_allDescendantResultsWillBeUpdated)) {
|
|
| 861 |
// setCanceled(true); |
|
| 862 |
// } |
|
| 863 |
// |
|
| 864 |
// } |
|
| 863 | 865 |
} |
| 864 | 866 |
}); |
| 865 | 867 |
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TableLinesViewerComparator.java (revision 1584) | ||
|---|---|---|
| 25 | 25 |
* @author sjacquot |
| 26 | 26 |
* |
| 27 | 27 |
*/ |
| 28 |
// FIXME: SJ: this class should manage a result of type TableResult extends TXMResult |
|
| 29 |
// This class then should be responsible of the sort of the UI but also of the call of a TableResult.sort() method |
|
| 30 |
// The class TableResult or MatrixResult should define a method sort(int columnIndex), abstract or not |
|
| 28 | 31 |
public class TableLinesViewerComparator extends ViewerComparator {
|
| 29 | 32 |
|
| 30 | 33 |
|
| ... | ... | |
| 76 | 79 |
|
| 77 | 80 |
int result = 0; |
| 78 | 81 |
|
| 82 |
Object cell1 = e1; |
|
| 83 |
Object cell2 = e2; |
|
| 84 |
|
|
| 85 |
|
|
| 79 | 86 |
if(e1 instanceof List) {
|
| 80 |
Object cell1 = ((List)e1).get(this.lastColumnIndex); |
|
| 81 |
Object cell2 = ((List)e2).get(this.lastColumnIndex); |
|
| 82 |
|
|
| 83 |
if (Integer.class.isInstance(cell1)) {
|
|
| 84 |
result = ((Integer)cell1).compareTo(((Integer)cell2)); |
|
| 85 |
} |
|
| 86 |
else if (Double.class.isInstance(cell1)) {
|
|
| 87 |
result = ((Double)cell1).compareTo(((Double)cell2)); |
|
| 88 |
} |
|
| 89 |
else if (Float.class.isInstance(cell1)) {
|
|
| 90 |
result = ((Float)cell1).compareTo(((Float)cell2)); |
|
| 91 |
} |
|
| 92 |
else if (Long.class.isInstance(cell1)) {
|
|
| 93 |
result = ((Long)cell1).compareTo(((Long)cell2)); |
|
| 94 |
} |
|
| 95 |
else if (String.class.isInstance(cell1)) {
|
|
| 96 |
result = this.collator.compare((String)cell1, (String)cell2); |
|
| 97 |
} |
|
| 98 |
else if (Boolean.class.isInstance(cell1)) {
|
|
| 99 |
result = ((Boolean)cell1).compareTo(((Boolean)cell2)); |
|
| 100 |
} |
|
| 101 |
else if (Date.class.isInstance(cell1)) {
|
|
| 102 |
result = ((Date)cell1).compareTo(((Date)cell2)); |
|
| 103 |
} |
|
| 87 |
cell1 = ((List)e1).get(this.lastColumnIndex); |
|
| 88 |
cell2 = ((List)e2).get(this.lastColumnIndex); |
|
| 104 | 89 |
} |
| 105 | 90 |
|
| 91 |
if (Integer.class.isInstance(cell1)) {
|
|
| 92 |
result = ((Integer)cell1).compareTo(((Integer)cell2)); |
|
| 93 |
} |
|
| 94 |
else if (Double.class.isInstance(cell1)) {
|
|
| 95 |
result = ((Double)cell1).compareTo(((Double)cell2)); |
|
| 96 |
} |
|
| 97 |
else if (Float.class.isInstance(cell1)) {
|
|
| 98 |
result = ((Float)cell1).compareTo(((Float)cell2)); |
|
| 99 |
} |
|
| 100 |
else if (Long.class.isInstance(cell1)) {
|
|
| 101 |
result = ((Long)cell1).compareTo(((Long)cell2)); |
|
| 102 |
} |
|
| 103 |
else if (String.class.isInstance(cell1)) {
|
|
| 104 |
result = this.collator.compare((String)cell1, (String)cell2); |
|
| 105 |
} |
|
| 106 |
else if (Boolean.class.isInstance(cell1)) {
|
|
| 107 |
result = ((Boolean)cell1).compareTo(((Boolean)cell2)); |
|
| 108 |
} |
|
| 109 |
else if (Date.class.isInstance(cell1)) {
|
|
| 110 |
result = ((Date)cell1).compareTo(((Date)cell2)); |
|
| 111 |
} |
|
| 112 |
|
|
| 113 |
|
|
| 106 | 114 |
// reverse if needed |
| 107 | 115 |
if (this.direction == DESCENDING) {
|
| 108 | 116 |
result = -result; |
| ... | ... | |
| 187 | 195 |
Table table = viewer.getTable(); |
| 188 | 196 |
for (int i = 0; i < table.getColumnCount(); i++) {
|
| 189 | 197 |
TableColumn column = table.getColumn(i); |
| 190 |
String test = column.getText(); |
|
| 191 | 198 |
if(!column.getText().isEmpty()) {
|
| 192 | 199 |
this.addSelectionAdapter(viewer, column, i); |
| 193 | 200 |
} |
Formats disponibles : Unified diff