Revision 274 trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/gui/numberFormat/DecimalFormatPanel.java

View differences:

DecimalFormatPanel.java
1 1
package org.gvsig.app.project.documents.layout.fframes.gui.numberFormat;
2 2

  
3
import java.awt.BorderLayout;
4 3
import java.awt.event.ActionEvent;
5 4
import java.awt.event.ActionListener;
6 5
import java.text.DecimalFormat;
7 6
import java.text.DecimalFormatSymbols;
8 7

  
9 8
import javax.swing.JComboBox;
10
import javax.swing.JFrame;
11 9
import javax.swing.JLabel;
12 10

  
13 11
import org.gvsig.gui.beans.swing.GridBagLayoutPanel;
......
154 152
		else {
155 153
			b_decimalSep = false;
156 154
		}
157
		if (thousandsSeparator!=null && thousandsSeparator.length()>0) {
155
		if (thousandsSeparator!=null &&
156
				thousandsSeparator!=getCbThousandsSep().getNoneItem() &&
157
				thousandsSeparator.length()>0) {
158 158
			sym.setGroupingSeparator(thousandsSeparator.charAt(0));
159 159
			b_thousandsSep = true;
160 160
		}
......
230 230
	
231 231
	public void setFormat(DecimalFormat format) {
232 232
		this.format = format;
233
		boolean groupingUsed = format.isGroupingUsed();
233 234
		getTfDecimalDigits().setInteger(format.getMinimumFractionDigits());
234 235
		
235 236
		String decSep = String.valueOf(format.getDecimalFormatSymbols().getDecimalSeparator());
236 237
		selectItem(getCbDecimalSep(), decSep);
237 238
		
238
		String thousandsSep = String.valueOf(format.getDecimalFormatSymbols().getGroupingSeparator());
239
		selectItem(getCbThousandsSep(), thousandsSep);
239
		if (groupingUsed) {
240
			String thousandsSep = String.valueOf(format.getDecimalFormatSymbols().getGroupingSeparator());
241
			selectItem(getCbThousandsSep(), thousandsSep);
242
		}
243
		else {
244
			selectItem(getCbThousandsSep(), getCbThousandsSep().getNoneItem());
245
		}
240 246
	}
241 247
	
242 248
	/**

Also available in: Unified diff