Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 180280
Collapse All | Expand All

(-)src/org/eclipse/hyades/test/ui/datapool/internal/control/DatapoolMenuManager.java (-88 / +83 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials 
3
 * All rights reserved. This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 20-25 Link Here
20
import org.eclipse.hyades.test.ui.datapool.internal.action.DeleteColumnAction;
20
import org.eclipse.hyades.test.ui.datapool.internal.action.DeleteColumnAction;
21
import org.eclipse.hyades.test.ui.datapool.internal.action.DeleteRowAction;
21
import org.eclipse.hyades.test.ui.datapool.internal.action.DeleteRowAction;
22
import org.eclipse.hyades.test.ui.datapool.internal.action.EditColumnAction;
22
import org.eclipse.hyades.test.ui.datapool.internal.action.EditColumnAction;
23
import org.eclipse.hyades.test.ui.datapool.internal.action.EditRowAction;
23
import org.eclipse.hyades.test.ui.datapool.internal.action.FindReplaceAction;
24
import org.eclipse.hyades.test.ui.datapool.internal.action.FindReplaceAction;
24
import org.eclipse.hyades.test.ui.datapool.internal.action.InsertColumnAction;
25
import org.eclipse.hyades.test.ui.datapool.internal.action.InsertColumnAction;
25
import org.eclipse.hyades.test.ui.datapool.internal.action.InsertRowAction;
26
import org.eclipse.hyades.test.ui.datapool.internal.action.InsertRowAction;
Lines 32-43 Link Here
32
import org.eclipse.jface.viewers.ISelectionProvider;
33
import org.eclipse.jface.viewers.ISelectionProvider;
33
34
34
/**
35
/**
35
 * @author psun
36
 * DatapoolMenuManager.java
36
 *
37
 * <p/>
38
 * 
39
 * 
40
 * @author  Peter Sun
41
 * @author  Paul E. Slauenwhite
42
 * @version April 13, 2008
43
 * @since   January 27, 2005
37
 */
44
 */
38
public class DatapoolMenuManager {
45
public class DatapoolMenuManager {
39
    private InsertRowAction insertRowAction = null;
46
    
47
	private InsertRowAction insertRowAction = null;
40
    private DeleteRowAction deleteRowAction = null;
48
    private DeleteRowAction deleteRowAction = null;
49
    private EditRowAction editRowAction = null;
41
    private InsertColumnAction insertColumnAction = null;
50
    private InsertColumnAction insertColumnAction = null;
42
    private DeleteColumnAction deleteColumnAction = null;
51
    private DeleteColumnAction deleteColumnAction = null;
43
    private EditColumnAction editColumnAction = null;
52
    private EditColumnAction editColumnAction = null;
Lines 51-56 Link Here
51
    private boolean showColumnActions = true;
60
    private boolean showColumnActions = true;
52
    private boolean showRowActions = true;
61
    private boolean showRowActions = true;
53
    private boolean showEditActions = true;
62
    private boolean showEditActions = true;
63
    
64
	/**
65
	 * Display mode Display mode constant for enabling the {@link InsertRowAction} (value is 1&lt;&lt;1).
66
	 */
67
	public static final int INSERT_ROW_ACTION_ENABLED = 1 << 1;
68
69
	/**
70
	 * Display mode constant for enabling the {@link DeleteRowAction} (value is 1&lt;&lt;2).
71
	 */
72
	public static final int DELETE_ROW_ACTION_ENABLED = 1 << 2;
73
74
	/**
75
	 * Display mode constant for enabling the {@link EditRowAction} (value is 1&lt;&lt;3).
76
	 */
77
	public static final int EDIT_ROW_ACTION_ENABLED = 1 << 3;
78
79
	/**
80
	 * Display mode constant for enabling the {@link InsertColumnAction} (value is 1&lt;&lt;4).
81
	 */
82
	public static final int INSERT_COLUMN_ACTION_ENABLED = 1 << 4;
83
84
	/**
85
	 * Display mode constant for enabling the {@link DeleteColumnAction} (value is 1&lt;&lt;5).
86
	 */
87
	public static final int DELETE_COLUMN_ACTION_ENABLED = 1 << 5;
88
89
	/**
90
	 * Display mode constant for enabling the {@link EditColumnAction} (value is 1&lt;&lt6).
91
	 */
92
	public static final int EDIT_COLUMN_ACTION_ENABLED = 1 << 6;
93
94
	/**
95
	 * Display mode constant for enabling the cut {@link EditAction} (value is 1&lt;&lt;7).
96
	 */
97
	public static final int CUT_ACTION_ENABLED = 1 << 7;
98
99
	/**
100
	 * Display mode constant for enabling the copy {@link EditAction} (value is 1&lt;&lt;8).
101
	 */
102
	public static final int COPY_ACTION_ENABLED = 1 << 8;
103
104
	/**
105
	 * Display mode constant for enabling the paste {@link EditAction} (value is 1&lt;&lt9).
106
	 */
107
	public static final int PASTE_ACTION_ENABLED = 1 << 9;
54
108
55
    public DatapoolMenuManager(DatapoolTable table, String vendorID, boolean showEquivalenceClassActions, boolean showVariableActions, boolean showRecordActions) {
109
    public DatapoolMenuManager(DatapoolTable table, String vendorID, boolean showEquivalenceClassActions, boolean showVariableActions, boolean showRecordActions) {
56
        if (table == null) return;
110
        if (table == null) return;
Lines 70-76 Link Here
70
124
71
        insertRowAction = new InsertRowAction(provider, table);
125
        insertRowAction = new InsertRowAction(provider, table);
72
        deleteRowAction = new DeleteRowAction(provider, table);
126
        deleteRowAction = new DeleteRowAction(provider, table);
73
        //editRowAction = new EditRowAction(provider, table);
127
        editRowAction = new EditRowAction(provider, table);
74
        insertColumnAction = new InsertColumnAction(provider, table);
128
        insertColumnAction = new InsertColumnAction(provider, table);
75
        deleteColumnAction = new DeleteColumnAction(provider, table);
129
        deleteColumnAction = new DeleteColumnAction(provider, table);
76
        editColumnAction = new EditColumnAction(provider, table);
130
        editColumnAction = new EditColumnAction(provider, table);
Lines 102-108 Link Here
102
        if (showRowActions) {
156
        if (showRowActions) {
103
            menuMgr.add(insertRowAction);
157
            menuMgr.add(insertRowAction);
104
            menuMgr.add(deleteRowAction);
158
            menuMgr.add(deleteRowAction);
105
            //menuMgr.add(editRowAction);
159
            menuMgr.add(editRowAction);
106
            menuMgr.add(new Separator());
160
            menuMgr.add(new Separator());
107
        }
161
        }
108
        if (showColumnActions) {
162
        if (showColumnActions) {
Lines 125-211 Link Here
125
        }
179
        }
126
    }
180
    }
127
181
128
    public void setDisplayMode(int mode, boolean isCutCopyPasteable) {
182
    public void setDisplayMode(int displayMode) {
129
        //- Enable find/replace action
183
        
130
        FindReplaceAction frAction = DatapoolActionHandlerListener.INSTANCE.getFindReplaceAction();
184
    	//Enable find/replace action:
131
        if (frAction != null) {
185
    	FindReplaceAction findReplaceAction = DatapoolActionHandlerListener.INSTANCE.getFindReplaceAction();
132
            frAction.setEnabled(true);
186
    	
133
        }
187
    	if (findReplaceAction != null) {
134
        boolean showPaste = !DatapoolClipboard.getInstance().isEmpty();
188
    		findReplaceAction.setEnabled(true);
135
        // Based on the mode, enable certain menu items.
189
    	}
136
        switch (mode) {
190
    	
137
            case 0:
191
    	//Set the display modes for the row actions:
138
                insertRowAction.aboutToShow(true);
192
    	insertRowAction.aboutToShow((displayMode & INSERT_ROW_ACTION_ENABLED) != 0);
139
                deleteRowAction.aboutToShow(true);
193
        deleteRowAction.aboutToShow((displayMode & DELETE_ROW_ACTION_ENABLED) != 0);
140
                insertColumnAction.aboutToShow(true);
194
		editRowAction.aboutToShow((displayMode & EDIT_ROW_ACTION_ENABLED) != 0);
141
                deleteColumnAction.aboutToShow(false);
195
        
142
                editColumnAction.aboutToShow(false);
196
    	//Set the display modes for the columns actions:
143
                cutAction.setEnabled(isCutCopyPasteable);
197
		insertColumnAction.aboutToShow((displayMode & INSERT_COLUMN_ACTION_ENABLED) != 0);
144
                copyAction.setEnabled(isCutCopyPasteable);
198
        deleteColumnAction.aboutToShow((displayMode & DELETE_COLUMN_ACTION_ENABLED) != 0);
145
                pasteAction.setEnabled(showPaste && isCutCopyPasteable);
199
        editColumnAction.aboutToShow((displayMode & EDIT_COLUMN_ACTION_ENABLED) != 0);
146
                break;
200
        
147
            case 1:
201
    	//Set the display modes for the edit actions:
148
                insertRowAction.aboutToShow(true);
202
        cutAction.setEnabled((displayMode & CUT_ACTION_ENABLED) != 0);
149
                deleteRowAction.aboutToShow(true);
203
        copyAction.setEnabled((displayMode & COPY_ACTION_ENABLED) != 0);
150
                insertColumnAction.aboutToShow(true);
204
        pasteAction.setEnabled((displayMode & PASTE_ACTION_ENABLED) != 0);
151
                deleteColumnAction.aboutToShow(true);
152
                editColumnAction.aboutToShow(true);
153
                cutAction.setEnabled(true && isCutCopyPasteable);
154
                copyAction.setEnabled(true && isCutCopyPasteable);
155
                pasteAction.setEnabled(showPaste && isCutCopyPasteable);
156
                break;
157
            case 2:
158
            case 4:
159
                insertRowAction.aboutToShow(true);
160
                deleteRowAction.aboutToShow(false);
161
                insertColumnAction.aboutToShow(true);
162
                deleteColumnAction.aboutToShow(false);
163
                editColumnAction.aboutToShow(false);
164
                cutAction.setEnabled(false && isCutCopyPasteable);
165
                copyAction.setEnabled(false && isCutCopyPasteable);
166
                pasteAction.setEnabled(false && isCutCopyPasteable);
167
                break;
168
            case 3:
169
                insertRowAction.aboutToShow(true);
170
                deleteRowAction.aboutToShow(false);
171
                insertColumnAction.aboutToShow(true);
172
                deleteColumnAction.aboutToShow(true);
173
                editColumnAction.aboutToShow(false);
174
                cutAction.setEnabled(false && isCutCopyPasteable);
175
                copyAction.setEnabled(false && isCutCopyPasteable);
176
                pasteAction.setEnabled(false && isCutCopyPasteable);
177
                break;
178
            case 5:
179
                insertRowAction.aboutToShow(false);
180
                deleteRowAction.aboutToShow(false);
181
                insertColumnAction.aboutToShow(false);
182
                deleteColumnAction.aboutToShow(false);
183
                editColumnAction.aboutToShow(false);
184
                cutAction.setEnabled(false && isCutCopyPasteable);
185
                copyAction.setEnabled(true && isCutCopyPasteable);
186
                pasteAction.setEnabled(false && isCutCopyPasteable);
187
                break;
188
            case 6:
189
                //- Case of only one variable left in the equivalence class
190
                insertRowAction.aboutToShow(true);
191
                deleteRowAction.aboutToShow(true);
192
                insertColumnAction.aboutToShow(true);
193
                deleteColumnAction.aboutToShow(false);
194
                editColumnAction.aboutToShow(true);
195
                cutAction.setEnabled(true && isCutCopyPasteable);
196
                copyAction.setEnabled(true && isCutCopyPasteable);
197
                pasteAction.setEnabled(showPaste && isCutCopyPasteable);
198
                break;
199
            default:
200
                insertRowAction.aboutToShow(true);
201
                deleteRowAction.aboutToShow(true);
202
                insertColumnAction.aboutToShow(true);
203
                deleteColumnAction.aboutToShow(true);
204
                editColumnAction.aboutToShow(true);
205
                cutAction.setEnabled(true && isCutCopyPasteable);
206
                copyAction.setEnabled(true && isCutCopyPasteable);
207
                pasteAction.setEnabled(false && isCutCopyPasteable);
208
                break;
209
        }
210
    }
205
    }
211
}
206
}
(-)src/org/eclipse/hyades/test/ui/datapool/internal/control/DatapoolTable.java (-97 / +119 lines)
Lines 72-77 Link Here
72
import org.eclipse.swt.events.KeyListener;
72
import org.eclipse.swt.events.KeyListener;
73
import org.eclipse.swt.events.MenuEvent;
73
import org.eclipse.swt.events.MenuEvent;
74
import org.eclipse.swt.events.MenuListener;
74
import org.eclipse.swt.events.MenuListener;
75
import org.eclipse.swt.events.MouseAdapter;
75
import org.eclipse.swt.events.MouseEvent;
76
import org.eclipse.swt.events.MouseEvent;
76
import org.eclipse.swt.events.MouseListener;
77
import org.eclipse.swt.events.MouseListener;
77
import org.eclipse.swt.events.PaintEvent;
78
import org.eclipse.swt.events.PaintEvent;
Lines 111-117 Link Here
111
 * 
112
 * 
112
 * @author  Peter Sun
113
 * @author  Peter Sun
113
 * @author  Paul E. Slauenwhite
114
 * @author  Paul E. Slauenwhite
114
 * @version April 8, 2008
115
 * @version April 13, 2008
115
 * @since   January 27, 2005
116
 * @since   January 27, 2005
116
 */
117
 */
117
public class DatapoolTable implements IMenuListener, MenuListener, SelectionListener, IDatapoolListener {
118
public class DatapoolTable implements IMenuListener, MenuListener, SelectionListener, IDatapoolListener {
Lines 862-868 Link Here
862
				// No editing of equivalence class/record name;
863
				// No editing of equivalence class/record name;
863
				if(newColumnSelectionIndex == 0)
864
				if(newColumnSelectionIndex == 0)
864
				{
865
				{
865
					//editRowAux(row);
866
					return;					
866
					return;					
867
				}
867
				}
868
868
Lines 914-920 Link Here
914
		}		
914
		}		
915
	}
915
	}
916
		
916
		
917
	class CursorMouseAdapter implements MouseListener
917
	class CursorMouseAdapter extends MouseAdapter
918
	{
918
	{
919
		private TableCursor cursor = null;
919
		private TableCursor cursor = null;
920
		private IDatapoolPart datapoolPart = null;
920
		private IDatapoolPart datapoolPart = null;
Lines 924-959 Link Here
924
			this.cursor = cursor;
924
			this.cursor = cursor;
925
			this.datapoolPart = datapoolPart;
925
			this.datapoolPart = datapoolPart;
926
		}
926
		}
927
		
927
			
928
		// Double clicking in a cell creates an editor and begins editing 
928
		public void mouseDown(MouseEvent event) {	
929
		// for that cell
929
			
930
		public void mouseDoubleClick(MouseEvent event) 
930
			if(event.button == 1){				
931
		{
931
				
932
			if(equivalenceClass == null)
932
				clearCellEditor();
933
				return;
933
				
934
			datapoolPart.notifyEdit();
934
				if(equivalenceClass != null){
935
			if(datapoolPart.isReadOnly())
936
				return;				
937
			TableItem row = this.cursor.getRow();
938
			int column = this.cursor.getColumn();
939
935
940
			// No editing of equivalence class/record name;
936
					datapoolPart.notifyEdit();
941
			if(column == 0)
937
					
942
			{
938
					if(!datapoolPart.isReadOnly()){
943
				//editRowAux(row);
944
				return;					
945
			}
946
939
947
			startCellEditing(row, column);
940
						TableItem row = this.cursor.getRow();
948
			if(DatapoolTable.this.cellEditor != null)
941
						int column = this.cursor.getColumn();
949
				DatapoolTable.this.isF2Mode = true;
942
			
950
		}
943
						if(column == 0){
951
	
944
							editRowAux(row);
952
		public void mouseDown(MouseEvent event) 
945
						}
953
		{	
946
						else{
954
			if(event.button != 1)				
947
			
955
				return;
948
							startCellEditing(row, column);
956
			clearCellEditor();
949
							
950
							if(DatapoolTable.this.cellEditor != null){
951
								DatapoolTable.this.isF2Mode = true;	
952
							}
953
						}
954
					}
955
				}
956
			}
957
		}
957
		}
958
		
958
		
959
		public void mouseUp(MouseEvent event) 
959
		public void mouseUp(MouseEvent event) 
Lines 1740-1779 Link Here
1740
	 */
1740
	 */
1741
	private void setMenuMode(DatapoolMenuManager dpMenuManager) 
1741
	private void setMenuMode(DatapoolMenuManager dpMenuManager) 
1742
	{
1742
	{
1743
		if(dpMenuManager == null)
1743
		if(dpMenuManager != null){
1744
			return;
1744
						
1745
			int displayMode = 0;
1746
			int recordCount = equivalenceClass.getRecordCount();
1745
1747
1746
		int menuMode = 0;
1748
			if((!datapoolEditorPart.isReadOnly()) && (equivalenceClass != null)){
1747
		if(equivalenceClass == null)
1749
			
1748
		{
1750
		    	//Set the display modes for the row actions:
1749
			menuMode = 5;
1751
				displayMode |= DatapoolMenuManager.INSERT_ROW_ACTION_ENABLED;
1750
		}
1752
1751
		else
1753
				if(recordCount > 0){
1752
		{
1753
			IDatapool datapool = getDatapool();
1754
			if (tableCursor != null && !tableCursor.isDisposed()) {
1755
                if (tableCursor.getColumn() == 0) {
1756
                    menuMode = 0;
1757
                } else if (datapool.getVariableCount() == 1) {
1758
                    menuMode = 6;
1759
                } else {
1760
                    menuMode = 1;
1761
                }
1762
            }
1763
			if(table.getSelectionIndex() == -1)
1764
				menuMode = 2;			
1765
			//bugzillar#84838: if there's no records, should not allow to remove variables, since
1766
			//user cannot select which variable to remove
1767
			if(equivalenceClass.getRecordCount() == 0 )
1768
				menuMode = 4;
1769
			if(datapoolEditorPart.isReadOnly())
1770
				menuMode = 5;
1771
		}
1772
1754
1773
		boolean isCutCopyPasteable = false;
1755
					displayMode |= DatapoolMenuManager.DELETE_ROW_ACTION_ENABLED;
1774
		if(!table.isDisposed() && table.getSelectionCount() > 0 && tableUtil.getColumnCount() > 1)
1756
					
1775
			isCutCopyPasteable = true;
1757
					if(recordCount > 1){
1776
		dpMenuManager.setDisplayMode(menuMode, isCutCopyPasteable);
1758
						displayMode |= DatapoolMenuManager.EDIT_ROW_ACTION_ENABLED;					
1759
					}
1760
				}
1761
1762
				//Set the display modes for the columns actions:
1763
				displayMode |= DatapoolMenuManager.INSERT_COLUMN_ACTION_ENABLED;
1764
1765
				if (((tableCursor != null) && (!tableCursor.isDisposed()) && (tableCursor.getColumn() > 0)) && (table.getSelectionIndex() > -1)) {
1766
1767
					if(getDatapool().getVariableCount() > 1){
1768
						displayMode |= DatapoolMenuManager.DELETE_COLUMN_ACTION_ENABLED;
1769
					}
1770
						
1771
					displayMode |= DatapoolMenuManager.EDIT_COLUMN_ACTION_ENABLED;
1772
	            }
1773
			}
1774
1775
		    //Set the display modes for the copy edit action:
1776
			if((!table.isDisposed()) && (table.getSelectionCount() > 0) && (tableUtil.getColumnCount() > 1) && (recordCount > 0)){
1777
1778
				displayMode |= DatapoolMenuManager.CUT_ACTION_ENABLED;
1779
				displayMode |= DatapoolMenuManager.COPY_ACTION_ENABLED;
1780
				
1781
				if(!DatapoolClipboard.getInstance().isEmpty()){
1782
					displayMode |= DatapoolMenuManager.PASTE_ACTION_ENABLED;					
1783
				}
1784
			}
1785
			
1786
			dpMenuManager.setDisplayMode(displayMode);			
1787
		}
1777
	}
1788
	}
1778
1789
1779
	/**
1790
	/**
Lines 1843-1854 Link Here
1843
	 */
1854
	 */
1844
	public void editRow()
1855
	public void editRow()
1845
	{
1856
	{
1846
		TableItem tableItem = null;
1857
		if((tableCursor != null) && (!tableCursor.isDisposed())){
1847
		if(tableCursor != null && !tableCursor.isDisposed())
1858
			editRowAux(tableCursor.getRow());
1848
			tableItem = tableCursor.getRow();
1859
		}
1849
		else
1850
			return;
1851
		editRowAux(tableItem);		
1852
	}
1860
	}
1853
1861
1854
	/*
1862
	/*
Lines 1856-1889 Link Here
1856
	 */
1864
	 */
1857
	private void editRowAux(TableItem tableItem)
1865
	private void editRowAux(TableItem tableItem)
1858
	{
1866
	{
1859
		if(showRecords == false)
1860
			return;	
1861
		
1862
		// can't move record if there's none or only 1 record.
1863
		if(getEquivalenceClass().getRecordCount() < 2)
1864
			return;
1865
		
1866
		int rowIndex = table.getSelectionIndex();
1867
		TableItem previousTableItem = null;
1868
		if(rowIndex != 0)
1869
			previousTableItem = table.getItem(rowIndex - 1);
1870
1867
1871
		IDatapool datapool = getDatapool();
1868
		if((showRecords) && (getEquivalenceClass().getRecordCount() > 1)){
1872
		DatapoolRowDialog dialog = new DatapoolRowDialog(Display.getCurrent().getActiveShell(), datapool, table,  tableItem, previousTableItem, UiPluginResourceBundle.DATA_ROW_DLG_TITLE_EDIT, false);  
1869
1873
		if (dialog.open() == IDialogConstants.OK_ID)
1870
			int rowIndex = table.getSelectionIndex();
1874
		{
1871
			TableItem previousTableItem = null;
1875
			setWaitCursor();
1872
			
1876
			IDatapoolRecord record = (IDatapoolRecord)tableItem.getData(TAG_RECORD);
1873
			if(rowIndex != 0){
1877
			int recordIndex = getRecordIndex(equivalenceClass, record);
1874
				previousTableItem = table.getItem(rowIndex - 1);
1878
			int insertionRecordIndex = dialog.getInsertionRecordIndex();
1875
			}
1879
			if(recordIndex != insertionRecordIndex + 1)
1876
			
1880
			{
1877
			DatapoolRowDialog dialog = new DatapoolRowDialog(Display.getCurrent().getActiveShell(), getDatapool(), table,  tableItem, previousTableItem, UiPluginResourceBundle.DATA_ROW_DLG_TITLE_EDIT, false);  
1881
				if(insertionRecordIndex > recordIndex)
1878
	
1882
					equivalenceClass.moveRecord(recordIndex, insertionRecordIndex);
1879
			if (dialog.open() == IDialogConstants.OK_ID){
1883
				else
1880
	
1884
					equivalenceClass.moveRecord(recordIndex, insertionRecordIndex + 1);	
1881
				try{
1882
					
1883
					setWaitCursor();
1884
					
1885
					IDatapoolRecord record = ((IDatapoolRecord)(tableItem.getData(TAG_RECORD)));
1886
					int recordIndex = getRecordIndex(equivalenceClass, record);
1887
					int insertionRecordIndex = dialog.getInsertionRecordIndex();
1888
1889
					if(recordIndex != insertionRecordIndex){
1890
1891
						if (insertionRecordIndex == -1){
1892
							equivalenceClass.moveRecord(recordIndex, 0);
1893
						}
1894
						else if (insertionRecordIndex > recordIndex){
1895
							equivalenceClass.moveRecord(recordIndex, insertionRecordIndex);
1896
						}
1897
						else{
1898
							equivalenceClass.moveRecord(recordIndex, insertionRecordIndex + 1);	
1899
						}
1900
					}			
1901
				} 
1902
				catch(Exception e){
1903
					e.printStackTrace();
1904
				}
1905
				finally {
1906
					unsetWaitCursor();
1907
				}
1885
			}
1908
			}
1886
			unsetWaitCursor();	
1887
		}
1909
		}
1888
	}
1910
	}
1889
1911
Lines 2186-2199 Link Here
2186
					if(!isCancelChange)//input the correct key
2208
					if(!isCancelChange)//input the correct key
2187
					{					
2209
					{					
2188
						if (dialog.isEncrypted()) {
2210
						if (dialog.isEncrypted()) {
2189
							if (!isVariableEncrypted) {//encrypted a varible which didn't encrypted
2211
							if (!isVariableEncrypted) {//encrypted a variable which didn't encrypted
2190
								DatapoolEncryptManager.encryptedCellInVarible(variable,key,datapool);
2212
								DatapoolEncryptManager.encryptedCellInVarible(variable,key,datapool);
2191
								if(variable instanceof DPLVariable)
2213
								if(variable instanceof DPLVariable)
2192
									((DPLVariable)variable).setEncrypted(true);
2214
									((DPLVariable)variable).setEncrypted(true);
2193
							}
2215
							}
2194
2216
2195
						} else {
2217
						} else {
2196
							if (isVariableEncrypted) {//decrypted am encrypted variable
2218
							if (isVariableEncrypted) {//decrypt an encrypted variable
2197
								DatapoolEncryptManager.decryptedCellInVarible(variable,key,datapool);
2219
								DatapoolEncryptManager.decryptedCellInVarible(variable,key,datapool);
2198
								if(variable instanceof DPLVariable)
2220
								if(variable instanceof DPLVariable)
2199
									((DPLVariable)variable).setEncrypted(false);
2221
									((DPLVariable)variable).setEncrypted(false);

Return to bug 180280