summaryrefslogtreecommitdiffstats
path: root/wizards
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-01-28 14:31:54 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-01-28 14:31:54 +0000
commit619922aba90051d021a828cb325cf7f9ad6a5284 (patch)
tree54b8ff9e989aabb2319aa0c2ae3fcbb7e4711de9 /wizards
parentINTEGRATION: CWS onlineupdate6b (1.13.6); FILE MERGED (diff)
downloadcore-619922aba90051d021a828cb325cf7f9ad6a5284.tar.gz
core-619922aba90051d021a828cb325cf7f9ad6a5284.zip
INTEGRATION: CWS dbawizards (1.6.116); FILE MERGED
2008/01/04 14:08:14 bc 1.6.116.2: #i72887# removing ring relation-ship 2008/01/02 13:39:20 bc 1.6.116.1: #i73896# implemented Collator for sorting
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/ui/CommandFieldSelection.java28
1 files changed, 23 insertions, 5 deletions
diff --git a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java
index cd356fc1295c..aeeb4dbbba77 100644
--- a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java
+++ b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java
@@ -4,9 +4,9 @@
*
* $RCSfile: CommandFieldSelection.java,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: vg $ $Date: 2006-04-07 13:21:48 $
+ * last change: $Author: vg $ $Date: 2008-01-28 15:31:54 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -37,13 +37,15 @@ import com.sun.star.wizards.db.*;
import com.sun.star.awt.XWindow;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.sdb.CommandType;
-import com.sun.star.sdbc.SQLException;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.awt.*;
import com.sun.star.beans.PropertyValue;
+import java.text.Collator;
+import java.util.Comparator;
+import java.util.Locale;
-public class CommandFieldSelection extends FieldSelection {
+public class CommandFieldSelection extends FieldSelection implements Comparator{
CommandMetaData CurDBMetaData;
XListBox xTableListBox;
XFixedText xlblTable;
@@ -56,8 +58,8 @@ public class CommandFieldSelection extends FieldSelection {
short iOldSelPos = -1;
boolean bpreselectCommand = true;
boolean bgetQueries;
- boolean AppendMode;
WizardDialog oWizardDialog;
+ private Collator aCollator = null;
class ItemListenerImpl implements com.sun.star.awt.XItemListener {
@@ -243,6 +245,7 @@ public class CommandFieldSelection extends FieldSelection {
System.arraycopy(CurDBMetaData.TableNames, 0, ContentList, 0, CurDBMetaData.TableNames.length);
if (bgetQueries)
ContentList = setPrefixinArray(ContentList, sTablePrefix, 0, CurDBMetaData.TableNames.length);
+ java.util.Arrays.sort(ContentList, this);
Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "StringItemList", ContentList);
short iSelPos = getselectedItemPos();
if (bpreselectCommand) {
@@ -261,6 +264,21 @@ public class CommandFieldSelection extends FieldSelection {
return iSelPos;
}
+ private Collator getCollator() {
+ if (this.aCollator == null) {
+ com.sun.star.lang.Locale aOfficeLocale = Configuration.getOfficeLocale(this.CurDBMetaData.xMSF);
+ java.util.Locale aJavaLocale = new java.util.Locale(aOfficeLocale.Language, aOfficeLocale.Country, aOfficeLocale.Variant);
+ //Get the Collator for US English and set its strength to PRIMARY
+ this.aCollator = Collator.getInstance(aJavaLocale);
+ aCollator.setStrength(Collator.TERTIARY);
+ }
+ return aCollator;
+ }
+
+ public int compare(Object _oObject1, Object _oObject2){
+ return this.getCollator().compare(_oObject1, _oObject2);
+ }
+
private String[] setPrefixinArray(String[] _ContentList, String _sprefix, int _startindex, int _nlen) {
for (int i = _startindex; i < _startindex + _nlen; i++)
_ContentList[i] = _sprefix + _ContentList[i];