diff options
author | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-22 10:17:33 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-22 10:17:33 +0100 |
commit | bd813a3bc656dd2d26951bf703abe78c94a002d4 (patch) | |
tree | 401bb7061e40803e48e813ec9ee94ce81415f9ea /wizards/com | |
parent | 307556af7f3802f71b9c28643021513d6256f084 (diff) | |
parent | 87784da170cc31da2f4cf3fbf474295361afef76 (diff) |
Automated merge with ssh://hg@hg.services.openoffice.org/cws/dba34c
Diffstat (limited to 'wizards/com')
124 files changed, 1544 insertions, 1400 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java index 2d7174bdb69f..09d2fb9831b5 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java +++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java @@ -235,7 +235,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { try { - itemsTables[i].write(""); + itemsTables[i].write(PropertyNames.EMPTY_STRING); } catch (Exception ex) { @@ -665,16 +665,16 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data private void writeTitle(TextElement te, XTextRange tr, String text) { - te.text = (text == null ? "" : text); + te.text = (text == null ? PropertyNames.EMPTY_STRING : text); te.write(tr); } private static long DAY_IN_MILLIS = (24 * 60 * 60 * 1000); private String getDateString(String d) { - if (d == null || d.equals("")) + if (d == null || d.equals(PropertyNames.EMPTY_STRING)) { - return ""; + return PropertyNames.EMPTY_STRING; } int date = new Integer(d).intValue(); calendar.clear(); @@ -694,9 +694,9 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data private String getTimeString(String s) { - if (s == null || s.equals("")) + if (s == null || s.equals(PropertyNames.EMPTY_STRING)) { - return ""; + return PropertyNames.EMPTY_STRING; } int time = new Integer(s).intValue(); @@ -733,7 +733,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data boolean visible = ((Boolean) Helper.getUnoPropertyValue(section, "IsVisible")).booleanValue(); if (!visible) { - ((XTextContent) UnoRuntime.queryInterface(XTextContent.class, section)).getAnchor().setString(""); + ((XTextContent) UnoRuntime.queryInterface(XTextContent.class, section)).getAnchor().setString(PropertyNames.EMPTY_STRING); } } } @@ -760,7 +760,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { Object minutesAllSection = getSection(SECTION_MINUTES_ALL); XTextSection xTextSection = (XTextSection) UnoRuntime.queryInterface(XTextSection.class, minutesAllSection); - xTextSection.getAnchor().setString(""); + xTextSection.getAnchor().setString(PropertyNames.EMPTY_STRING); } catch (Exception ex) { @@ -831,15 +831,15 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data if (itemText.equals(FILLIN_MINUTE_NUM)) { - fillMinutesItem(item, topic[0].Value, ""); + fillMinutesItem(item, topic[0].Value, PropertyNames.EMPTY_STRING); } else if (itemText.equals(FILLIN_MINUTE_TOPIC)) { - fillMinutesItem(item, topic[1].Value, ""); + fillMinutesItem(item, topic[1].Value, PropertyNames.EMPTY_STRING); } else if (itemText.equals(FILLIN_MINUTE_RESPONSIBLE)) { - fillMinutesItem(item, topic[2].Value, ""); + fillMinutesItem(item, topic[2].Value, PropertyNames.EMPTY_STRING); } else if (itemText.equals(FILLIN_MINUTE_TIME)) { @@ -863,7 +863,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data topicStartTime += topicTime * 1000; time += getTimeString(String.valueOf(topicStartTime)); } - fillMinutesItem(item, time, ""); + fillMinutesItem(item, time, PropertyNames.EMPTY_STRING); } } @@ -889,16 +889,16 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data * If the given text is empty, uses a placeholder with the giveb placeholder text. * @param range text range to fill * @param text the text to fill to the text range object. - * @param placeholder the placeholder text to use, if the text argument is empty (null or "") + * @param placeholder the placeholder text to use, if the text argument is empty (null or PropertyNames.EMPTY_STRING) */ private void fillMinutesItem(XTextRange range, Object text, String placeholder) { String paraStyle = (String) Helper.getUnoPropertyValue(range, "ParaStyleName"); range.setString((String) text); Helper.setUnoPropertyValue(range, "ParaStyleName", paraStyle); - if (text == null || text.equals("")) + if (text == null || text.equals(PropertyNames.EMPTY_STRING)) { - if (placeholder != null && !placeholder.equals("")) + if (placeholder != null && !placeholder.equals(PropertyNames.EMPTY_STRING)) { XTextContent placeHolder = createPlaceHolder(docMSF, placeholder, resources.resPlaceHolderHint); try @@ -1024,7 +1024,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data // write items // =========== - String cellName = ""; + String cellName = PropertyNames.EMPTY_STRING; /* now go through all items that belong to this * table. Check each one agains the model. If it should @@ -1072,7 +1072,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data while ((!cellName.equals(cursor.getRangeName()) && (!cursor.getRangeName().startsWith("A")))) { cell = xTextTable.getCellByName(cursor.getRangeName()); - ((XTextRange) UnoRuntime.queryInterface(XTextRange.class, cell)).setString(""); + ((XTextRange) UnoRuntime.queryInterface(XTextRange.class, cell)).setString(PropertyNames.EMPTY_STRING); cellName = cursor.getRangeName(); cursor.goRight((short) 1, false); } @@ -1316,7 +1316,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { writtenTopics.add(null); } - writtenTopics.set(topic, ""); + writtenTopics.set(topic, PropertyNames.EMPTY_STRING); // make sure threr are enough rows for me... int rows = getRowCount(table); @@ -1764,7 +1764,7 @@ class TextElement extends ParaStyled public void write(Object textRange) { ((XTextRange) UnoRuntime.queryInterface(XTextRange.class, textRange)).setString(text); - if (!text.equals("")) + if (!text.equals(PropertyNames.EMPTY_STRING)) { super.write(textRange); } @@ -1772,7 +1772,7 @@ class TextElement extends ParaStyled } /** - * A Text element which, if the text to write is empty (null or "") + * A Text element which, if the text to write is empty (null or PropertyNames.EMPTY_STRING) * inserts a placeholder instead. * @author rp143992 * @@ -1805,7 +1805,7 @@ class PlaceholderTextElement extends TextElement public void write(Object textRange) { super.write(textRange); - if (text == null || text.equals("")) + if (text == null || text.equals(PropertyNames.EMPTY_STRING)) { XTextRange xTextRange = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, textRange); try diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java index ab600176080d..397985c2a937 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java @@ -105,7 +105,7 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda XButton btnUp; XButton btnDown; - final private String IMGHELP1_HID = ""; + final private String IMGHELP1_HID = PropertyNames.EMPTY_STRING; //Font Descriptors as Class members. @@ -117,7 +117,7 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda AgendaWizardDialogResources resources; private String[] PROPS_LIST = new String[] {"Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; - private String[] PROPS_LABEL_B = new String[] {"FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; + private String[] PROPS_LABEL_B = new String[] {PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; private String[] PROPS_CHECK = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; private String[] PROPS_BUTTON = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; private String[] PROPS_X = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java index 50ee492f8c78..96f8d53eafff 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java @@ -50,6 +50,7 @@ import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.NoValidPathException; import com.sun.star.wizards.common.SystemDialog; import com.sun.star.wizards.common.HelpIds; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.document.OfficeDocument; import com.sun.star.wizards.text.ViewHandler; import com.sun.star.wizards.ui.PathSelection; @@ -172,7 +173,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog // synchronize GUI and CGAgenda object. makeDA(); - if(myPathSelection.xSaveTextBox.getText().equalsIgnoreCase("")) {myPathSelection.initializePath();} + if(myPathSelection.xSaveTextBox.getText().equalsIgnoreCase(PropertyNames.EMPTY_STRING)) {myPathSelection.initializePath();} executeDialog(agendaTemplate.xFrame); removeTerminateListener(); @@ -212,7 +213,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog private void initializePaths() { try { sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard"); - sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", ""); + sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", PropertyNames.EMPTY_STRING); sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap"); } catch (NoValidPathException e) { e.printStackTrace(); @@ -221,14 +222,14 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog private void checkSavePath() { if (agenda.cp_TemplatePath == null || - agenda.cp_TemplatePath.equals("") || + agenda.cp_TemplatePath.equals(PropertyNames.EMPTY_STRING) || !getFileAccess().exists(FileAccess.getParentDir(agenda.cp_TemplatePath),false) || !getFileAccess().isDirectory(FileAccess.getParentDir(agenda.cp_TemplatePath ))) { try { agenda.cp_TemplatePath = FileAccess.connectURLs( - FileAccess.getOfficePath(xMSF, "Work", "", "") , + FileAccess.getOfficePath(xMSF, "Work", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING) , resources.resDefaultFilename ); } @@ -243,7 +244,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog */ private void makeDA() { - setControlProperty("listPageDesign", "StringItemList", agendaTemplates[0]); + setControlProperty("listPageDesign", PropertyNames.STRING_ITEM_LIST, agendaTemplates[0]); checkSavePath(); //setFilename(agenda.cp_TemplatePath); @@ -420,7 +421,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog */ private void setFilename(String url) { try { - String path = getFileAccess().getPath(url,""); + String path = getFileAccess().getPath(url,PropertyNames.EMPTY_STRING); Helper.setUnoPropertyValue( getModel(myPathSelection.xSaveTextBox), "Text", path); } catch (Exception ex) { @@ -463,7 +464,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog try { FileAccess fileAccess = new FileAccess(xMSF); sPath = myPathSelection.getSelectedPath(); - if (sPath.equals("")) { + if (sPath.equals(PropertyNames.EMPTY_STRING)) { myPathSelection.triggerPathPicker(); sPath = myPathSelection.getSelectedPath(); } diff --git a/wizards/com/sun/star/wizards/agenda/CGAgenda.java b/wizards/com/sun/star/wizards/agenda/CGAgenda.java index b7dc1cc37c00..d64ec8372bd3 100644 --- a/wizards/com/sun/star/wizards/agenda/CGAgenda.java +++ b/wizards/com/sun/star/wizards/agenda/CGAgenda.java @@ -28,6 +28,7 @@ package com.sun.star.wizards.agenda; import com.sun.star.wizards.common.ConfigGroup; import com.sun.star.wizards.common.ConfigSet; +import com.sun.star.wizards.common.PropertyNames; /** * CGAgenda means Configuration Group Agenda. @@ -43,13 +44,13 @@ public class CGAgenda extends ConfigGroup /** step 1 - include minutes*/ public boolean cp_IncludeMinutes; /** step 2 - title */ - public String cp_Title = ""; + public String cp_Title = PropertyNames.EMPTY_STRING; /** step 2 - date */ public String cp_Date; /** step 2 - time */ public String cp_Time; /** step 2 - location */ - public String cp_Location = ""; + public String cp_Location = PropertyNames.EMPTY_STRING; /** step 3 - show meeting type */ public boolean cp_ShowMeetingType; /** step 3 - show read */ diff --git a/wizards/com/sun/star/wizards/agenda/CGTopic.java b/wizards/com/sun/star/wizards/agenda/CGTopic.java index 74b818205b9f..6ef5ac21e3ea 100644 --- a/wizards/com/sun/star/wizards/agenda/CGTopic.java +++ b/wizards/com/sun/star/wizards/agenda/CGTopic.java @@ -30,6 +30,7 @@ package com.sun.star.wizards.agenda; import com.sun.star.beans.PropertyValue; import com.sun.star.wizards.common.ConfigGroup; import com.sun.star.wizards.common.Indexable; +import com.sun.star.wizards.common.PropertyNames; /** * CGTopic means: Configuration Group Topic. @@ -74,7 +75,7 @@ public class CGTopic extends ConfigGroup implements Indexable { */ public void setDataToRow(Object row) { PropertyValue[] pv = (PropertyValue[])row; - pv[0].Value = "" + cp_Index + "."; + pv[0].Value = PropertyNames.EMPTY_STRING + cp_Index + "."; pv[1].Value = cp_Topic; pv[2].Value = cp_Responsible; pv[3].Value = cp_Time; diff --git a/wizards/com/sun/star/wizards/agenda/CallWizard.java b/wizards/com/sun/star/wizards/agenda/CallWizard.java index 3dc8dcd8ef91..ae19b4ef311d 100644 --- a/wizards/com/sun/star/wizards/agenda/CallWizard.java +++ b/wizards/com/sun/star/wizards/agenda/CallWizard.java @@ -37,6 +37,7 @@ import com.sun.star.registry.XRegistryKey; import com.sun.star.task.XJob; import com.sun.star.task.XJobExecutor; import com.sun.star.uno.Type; +import com.sun.star.wizards.common.PropertyNames; /** * This class capsulates the class, that implements the minimal component, a factory for @@ -100,7 +101,7 @@ public class CallWizard { public void trigger(String str) { try { - if (str.equalsIgnoreCase("start")) { + if (str.equalsIgnoreCase(PropertyNames.START)) { AgendaWizardDialogImpl aw = new AgendaWizardDialogImpl(xmultiservicefactory); if (!AgendaWizardDialogImpl.running) { aw.startWizard(); @@ -184,7 +185,7 @@ public class CallWizard { }; try { - byteReturn = ("" + this.hashCode()).getBytes(); + byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { System.err.println(exception); } diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.java b/wizards/com/sun/star/wizards/agenda/TopicsControl.java index 25f0cf9103a0..2361176f861f 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.java +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.java @@ -304,7 +304,7 @@ public class TopicsControl extends ControlScroller implements XFocusListener } /** - * in order to use the "move up", "down" "insert" and "remove" buttons, + * in order to use the "move up", "downPropertyNames.SPACEinsert" and "remove" buttons, * we track the last control the gained focus, in order to know which * row should be handled. * @param fe @@ -463,9 +463,9 @@ public class TopicsControl extends ControlScroller implements XFocusListener // after rotating all the properties from this row on, // we clear the row, so it is practically a new one... PropertyValue[] pv1 = (PropertyValue[]) scrollfields.get(lastFocusRow); - pv1[1].Value = ""; - pv1[2].Value = ""; - pv1[3].Value = ""; + pv1[1].Value = PropertyNames.EMPTY_STRING; + pv1[2].Value = PropertyNames.EMPTY_STRING; + pv1[3].Value = PropertyNames.EMPTY_STRING; // update the preview document. updateDocumentRow(lastFocusRow); @@ -487,10 +487,10 @@ public class TopicsControl extends ControlScroller implements XFocusListener private PropertyValue[] newRow(int i) { PropertyValue[] pv = new PropertyValue[4]; - pv[0] = Properties.createProperty(LABEL + i, "" + (i + 1) + "."); - pv[1] = Properties.createProperty(TOPIC + i, ""); - pv[2] = Properties.createProperty(RESP + i, ""); - pv[3] = Properties.createProperty(TIME + i, ""); + pv[0] = Properties.createProperty(LABEL + i, PropertyNames.EMPTY_STRING + (i + 1) + "."); + pv[1] = Properties.createProperty(TOPIC + i, PropertyNames.EMPTY_STRING); + pv[2] = Properties.createProperty(RESP + i, PropertyNames.EMPTY_STRING); + pv[3] = Properties.createProperty(TIME + i, PropertyNames.EMPTY_STRING); return pv; } @@ -536,9 +536,9 @@ public class TopicsControl extends ControlScroller implements XFocusListener PropertyValue[] data = getTopicData(row); // now - is this row empty? - return data[1].Value.equals("") && - data[2].Value.equals("") && - data[3].Value.equals(""); + return data[1].Value.equals(PropertyNames.EMPTY_STRING) && + data[2].Value.equals(PropertyNames.EMPTY_STRING) && + data[3].Value.equals(PropertyNames.EMPTY_STRING); } /** @@ -1173,7 +1173,7 @@ public class TopicsControl extends ControlScroller implements XFocusListener LABEL_PROPS, new Object[] { - I_8, "" + (i + 1) + ".", new Integer(x + 4), new Integer(y + 2), IStep, new Short((short) tabindex), 10 + I_8, PropertyNames.EMPTY_STRING + (i + 1) + ".", new Integer(x + 4), new Integer(y + 2), IStep, new Short((short) tabindex), 10 }); textbox = dialog.insertTextField(TOPIC + i, "topicTextChanged", this, diff --git a/wizards/com/sun/star/wizards/common/ConfigSet.java b/wizards/com/sun/star/wizards/common/ConfigSet.java index 216f91b5e430..7684de5e10ce 100644 --- a/wizards/com/sun/star/wizards/common/ConfigSet.java +++ b/wizards/com/sun/star/wizards/common/ConfigSet.java @@ -90,11 +90,11 @@ public class ConfigSet implements ConfigNode, XMLProvider, ListModel public void add(int i, Object o) { int name = i; - while (getElement("" + name) != null) + while (getElement(PropertyNames.EMPTY_STRING + name) != null) { name++; } - childrenMap.put("" + name, o); + childrenMap.put(PropertyNames.EMPTY_STRING + name, o); childrenList.add(i, o); fireListDataListenerIntervalAdded(i, i); diff --git a/wizards/com/sun/star/wizards/common/Configuration.java b/wizards/com/sun/star/wizards/common/Configuration.java index 04dd385ddf60..a95e773649b1 100644 --- a/wizards/com/sun/star/wizards/common/Configuration.java +++ b/wizards/com/sun/star/wizards/common/Configuration.java @@ -97,7 +97,7 @@ public abstract class Configuration Object o = getNode(name, parent); if (AnyConverter.isVoid(o)) { - return ""; + return PropertyNames.EMPTY_STRING; } return (String) o; } @@ -213,7 +213,7 @@ public abstract class Configuration public static String getOfficeLocaleString(XMultiServiceFactory xMSF) { - String sLocale = ""; + String sLocale = PropertyNames.EMPTY_STRING; try { Locale aLocLocale = new Locale(); diff --git a/wizards/com/sun/star/wizards/common/Desktop.java b/wizards/com/sun/star/wizards/common/Desktop.java index 8902696c37b4..0f9bfbf0939d 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.java +++ b/wizards/com/sun/star/wizards/common/Desktop.java @@ -161,7 +161,7 @@ public class Desktop public static void dispatchURL(XMultiServiceFactory xMSF, String sURL, XFrame xFrame) { - dispatchURL(xMSF, sURL, xFrame, ""); + dispatchURL(xMSF, sURL, xFrame, PropertyNames.EMPTY_STRING); } public static void dispatchURL(XDispatch _xDispatch, com.sun.star.util.URL oURL) @@ -190,7 +190,7 @@ public class Desktop { boolean bElementexists = true; int i = 1; - String sIncSuffix = ""; + String sIncSuffix = PropertyNames.EMPTY_STRING; String BaseName = ElementName; while (bElementexists == true) { @@ -212,7 +212,7 @@ public class Desktop { boolean bElementexists = true; int i = 1; - String sIncSuffix = ""; + String sIncSuffix = PropertyNames.EMPTY_STRING; String BaseName = ElementName; while (bElementexists == true) { @@ -238,7 +238,7 @@ public class Desktop int nContFlags = nStartFlags; Object ocharservice = _xMSF.createInstance("com.sun.star.i18n.CharacterClassification"); XCharacterClassification xCharacterClassification = (XCharacterClassification) UnoRuntime.queryInterface(XCharacterClassification.class, ocharservice); - ParseResult aResult = xCharacterClassification.parsePredefinedToken(KParseType.IDENTNAME, _sString, 0, _aLocale, nStartFlags, "", nContFlags, " "); + ParseResult aResult = xCharacterClassification.parsePredefinedToken(KParseType.IDENTNAME, _sString, 0, _aLocale, nStartFlags, PropertyNames.EMPTY_STRING, nContFlags, PropertyNames.SPACE); return aResult.EndPos; } catch (Exception e) @@ -258,7 +258,7 @@ public class Desktop if (i < snewname.length()) { String sspecialchar = snewname.substring(i, i + 1); - snewname = JavaTools.replaceSubString(snewname, "", sspecialchar); + snewname = JavaTools.replaceSubString(snewname, PropertyNames.EMPTY_STRING, sspecialchar); } } return snewname; @@ -322,7 +322,7 @@ public class Desktop } scompname = _sElementName + _sSuffixSeparator + a++; } - return ""; + return PropertyNames.EMPTY_STRING; } /** @@ -377,9 +377,9 @@ public class Desktop try { TemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard"); - UserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", ""); + UserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", PropertyNames.EMPTY_STRING); BitmapPath = FileAccess.combinePaths(xMSF, TemplatePath, "/../wizard/bitmap"); - WorkPath = FileAccess.getOfficePath(xMSF, "Work", "", ""); + WorkPath = FileAccess.getOfficePath(xMSF, "Work", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); } catch (NoValidPathException nopathexception) { @@ -397,20 +397,20 @@ public class Desktop catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static String getUserTemplatePath(XMultiServiceFactory _xMSF) { try { - String sUserTemplatePath = FileAccess.getOfficePath(_xMSF, "Template", "user", ""); + String sUserTemplatePath = FileAccess.getOfficePath(_xMSF, "Template", "user", PropertyNames.EMPTY_STRING); return sUserTemplatePath; } catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static String getBitmapPath(XMultiServiceFactory _xMSF) @@ -423,20 +423,20 @@ public class Desktop catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static String getWorkPath(XMultiServiceFactory _xMSF) { try { - String sWorkPath = FileAccess.getOfficePath(_xMSF, "Work", "", ""); + String sWorkPath = FileAccess.getOfficePath(_xMSF, "Work", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); return sWorkPath; } catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static XStringSubstitution createStringSubstitution(XMultiServiceFactory xMSF) diff --git a/wizards/com/sun/star/wizards/common/FileAccess.java b/wizards/com/sun/star/wizards/common/FileAccess.java index 6278d7e71a97..1b5e91c6c58b 100644 --- a/wizards/com/sun/star/wizards/common/FileAccess.java +++ b/wizards/com/sun/star/wizards/common/FileAccess.java @@ -74,22 +74,22 @@ public class FileAccess String ResultPath = getOfficePath(xMSF, sPath, xSimpleFileAccess); // As there are several conventions about the look of Url (e.g. with " " or with "%20") you cannot make a // simple String comparison to find out, if a path is already in "ResultPath" - String[] PathList = JavaTools.ArrayoutofString(ResultPath, ";"); + String[] PathList = JavaTools.ArrayoutofString(ResultPath, PropertyNames.SEMI_COLON); int MaxIndex = PathList.length - 1; String CompCurPath; // sAddPath.replace(null, (char) 47); - String CompAddPath = JavaTools.replaceSubString(sAddPath, "", "/"); + String CompAddPath = JavaTools.replaceSubString(sAddPath, PropertyNames.EMPTY_STRING, "/"); String CurPath; for (int i = 0; i <= MaxIndex; i++) { CurPath = JavaTools.convertfromURLNotation(PathList[i]); - CompCurPath = JavaTools.replaceSubString(CurPath, "", "/"); + CompCurPath = JavaTools.replaceSubString(CurPath, PropertyNames.EMPTY_STRING, "/"); if (CompCurPath.equals(CompAddPath)) { return; } } - ResultPath += ";" + sAddPath; + ResultPath += PropertyNames.SEMI_COLON + sAddPath; return; } @@ -117,7 +117,7 @@ public class FileAccess { try { - String ResultPath = ""; + String ResultPath = PropertyNames.EMPTY_STRING; XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.util.PathSettings"); ResultPath = com.sun.star.uno.AnyConverter.toString(Helper.getUnoPropertyValue(xInterface, sPath)); ResultPath = deleteLastSlashfromUrl(ResultPath); @@ -126,7 +126,7 @@ public class FileAccess catch (Exception exception) { exception.printStackTrace(System.out); - return ""; + return PropertyNames.EMPTY_STRING; } } @@ -135,7 +135,7 @@ public class FileAccess * chapter 6.2.7 * @param xMSF * @param sPath - * @param sType use "share" or "user". Set to "" if not needed eg for the WorkPath; + * @param sType use "share" or "user". Set to PropertyNames.EMPTY_STRING if not needed eg for the WorkPath; * In the return Officepath a possible slash at the end is cut off * @param sSearchDir * @return @@ -145,9 +145,9 @@ public class FileAccess { //This method currently only works with sPath="Template" - String ResultPath = ""; + String ResultPath = PropertyNames.EMPTY_STRING; - String Template_writable = ""; + String Template_writable = PropertyNames.EMPTY_STRING; String[] Template_internal; String[] Template_user; @@ -156,7 +156,7 @@ public class FileAccess { XInterface xPathInterface = (XInterface) xMSF.createInstance("com.sun.star.util.PathSettings"); XPropertySet xPropertySet = (XPropertySet) com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, xPathInterface); - String WritePath = ""; + String WritePath = PropertyNames.EMPTY_STRING; String[] ReadPaths = null; XInterface xUcbInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); @@ -204,11 +204,11 @@ public class FileAccess catch (Exception exception) { exception.printStackTrace(System.out); - ResultPath = ""; + ResultPath = PropertyNames.EMPTY_STRING; } if (bexists == false) { - throw new NoValidPathException(xMSF, ""); + throw new NoValidPathException(xMSF, PropertyNames.EMPTY_STRING); } return ResultPath; } @@ -217,9 +217,9 @@ public class FileAccess { //This method currently only works with sPath="Template" - // String ResultPath = ""; + // String ResultPath = PropertyNames.EMPTY_STRING; ArrayList<String> aPathList = new ArrayList<String>(); - String Template_writable = ""; + String Template_writable = PropertyNames.EMPTY_STRING; String[] Template_internal; String[] Template_user; @@ -230,7 +230,7 @@ public class FileAccess { XInterface xPathInterface = (XInterface) xMSF.createInstance("com.sun.star.util.PathSettings"); XPropertySet xPropertySet = (XPropertySet) com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, xPathInterface); - // String WritePath = ""; + // String WritePath = PropertyNames.EMPTY_STRING; // XInterface xUcbInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); // XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); @@ -288,11 +288,11 @@ public class FileAccess catch (Exception exception) { exception.printStackTrace(System.out); - // ResultPath = ""; + // ResultPath = PropertyNames.EMPTY_STRING; } // if (bexists == false) // { -// throw new NoValidPathException(xMSF, ""); +// throw new NoValidPathException(xMSF, PropertyNames.EMPTY_STRING); // } // return ResultPath; return aPathList; @@ -374,7 +374,7 @@ public class FileAccess /* public static String getOfficePath(XMultiServiceFactory xMSF, String sPath, String sType) throws NoValidPathException { - String ResultPath = ""; + String ResultPath = PropertyNames.EMPTY_STRING; Object oPathSettings; int iPathCount; String[] PathList; @@ -383,10 +383,10 @@ public class FileAccess XInterface xUcbInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); ResultPath = getOfficePath(xMSF, sPath, xSimpleFileAccess); - PathList = JavaTools.ArrayoutofString(ResultPath, ";"); - if (!sType.equals("")) { - ResultPath = ""; - String CurPath = ""; + PathList = JavaTools.ArrayoutofString(ResultPath, PropertyNames.SEMI_COLON); + if (!sType.equals(PropertyNames.EMPTY_STRING)) { + ResultPath = PropertyNames.EMPTY_STRING; + String CurPath = PropertyNames.EMPTY_STRING; String EndString = "/" + sType; int EndLength = EndString.length(); sType = "/" + sType + "/"; @@ -403,11 +403,11 @@ public class FileAccess } } else ResultPath = PathList[0]; - if (ResultPath.equals("") == false) + if (ResultPath.equals(PropertyNames.EMPTY_STRING) == false) bexists = xSimpleFileAccess.exists(ResultPath); } catch (Exception exception) { exception.printStackTrace(System.out); - ResultPath = ""; + ResultPath = PropertyNames.EMPTY_STRING; } if (bexists == false) throw new NoValidPathException(xMSF); @@ -452,7 +452,7 @@ public class FileAccess public static String combinePaths(XMultiServiceFactory xMSF, String _sFirstPath, String _sSecondPath) throws NoValidPathException { boolean bexists = false; - String ReturnPath = ""; + String ReturnPath = PropertyNames.EMPTY_STRING; try { XInterface xUcbInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); @@ -463,18 +463,18 @@ public class FileAccess catch (Exception exception) { exception.printStackTrace(System.out); - return ""; + return PropertyNames.EMPTY_STRING; } if (bexists == false) { - throw new NoValidPathException(xMSF, ""); + throw new NoValidPathException(xMSF, PropertyNames.EMPTY_STRING); } return ReturnPath; } public static boolean createSubDirectory(XMultiServiceFactory xMSF, XSimpleFileAccess xSimpleFileAccess, String Path) { - String sNoDirCreation = ""; + String sNoDirCreation = PropertyNames.EMPTY_STRING; try { Resource oResource = new Resource(xMSF, "ImportWizard", "imp"); @@ -516,7 +516,7 @@ public class FileAccess try { String SubDir; - String SubDirPath = ""; + String SubDirPath = PropertyNames.EMPTY_STRING; int SubLen; int NewLen; int RestLen; @@ -604,7 +604,7 @@ public class FileAccess */ public static String[][] getFolderTitles(com.sun.star.lang.XMultiServiceFactory xMSF, String FilterName, String FolderName) { - String[][] LocLayoutFiles = new String[2][]; //{"",""}{""}; + String[][] LocLayoutFiles = new String[2][]; //{PropertyNames.EMPTY_STRING,PropertyNames.EMPTY_STRING}{PropertyNames.EMPTY_STRING}; try { java.util.Vector<String> TitleVector = null; @@ -621,9 +621,9 @@ public class FileAccess TitleVector = new java.util.Vector<String>(/*nameList.length*/); NameVector = new java.util.Vector<String>(nameList.length); - FilterName = FilterName == null || FilterName.equals("") ? null : FilterName + "-"; + FilterName = FilterName == null || FilterName.equals(PropertyNames.EMPTY_STRING) ? null : FilterName + "-"; - String fileName = ""; + String fileName = PropertyNames.EMPTY_STRING; PropertyValue[] noArgs = { }; for (int i = 0; i < nameList.length; i++) { @@ -676,7 +676,7 @@ public class FileAccess public static String getPathFromList(XMultiServiceFactory xMSF, ArrayList _aList, String _sFile) { - String sFoundFile = ""; + String sFoundFile = PropertyNames.EMPTY_STRING; try { XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); @@ -709,12 +709,12 @@ public class FileAccess public static String[][] getFolderTitles(com.sun.star.lang.XMultiServiceFactory xMSF, String _sStartFilterName, ArrayList FolderNames) throws NoValidPathException { - return getFolderTitles(xMSF, _sStartFilterName, FolderNames, ""); + return getFolderTitles(xMSF, _sStartFilterName, FolderNames, PropertyNames.EMPTY_STRING); } private static String getTitle(XMultiServiceFactory xMSF, String _sFile) { - String sTitle = ""; + String sTitle = PropertyNames.EMPTY_STRING; try { XInterface xDocInterface = (XInterface) xMSF.createInstance("com.sun.star.document.DocumentProperties"); @@ -732,7 +732,7 @@ public class FileAccess public static String[][] getFolderTitles(com.sun.star.lang.XMultiServiceFactory xMSF, String _sStartFilterName, ArrayList FolderName, String _sEndFilterName) throws NoValidPathException { - String[][] LocLayoutFiles = new String[2][]; //{"",""}{""}; + String[][] LocLayoutFiles = new String[2][]; //{PropertyNames.EMPTY_STRING,PropertyNames.EMPTY_STRING}{PropertyNames.EMPTY_STRING}; if (FolderName.size() == 0) { throw new NoValidPathException(null, "Path not given."); @@ -759,9 +759,9 @@ public class FileAccess try { String[] nameList = xSimpleFileAccess.getFolderContents(sFolderName, false); - _sStartFilterName = _sStartFilterName == null || _sStartFilterName.equals("") ? null : _sStartFilterName + "-"; + _sStartFilterName = _sStartFilterName == null || _sStartFilterName.equals(PropertyNames.EMPTY_STRING) ? null : _sStartFilterName + "-"; - String fileName = ""; + String fileName = PropertyNames.EMPTY_STRING; for (int i = 0; i < nameList.length; i++) { fileName = getFilename(nameList[i]); @@ -769,13 +769,13 @@ public class FileAccess if (_sStartFilterName == null || fileName.startsWith(_sStartFilterName)) { - if (_sEndFilterName.equals("")) + if (_sEndFilterName.equals(PropertyNames.EMPTY_STRING)) { sTitle = getTitle(xMSF, nameList[i]); } else if (fileName.endsWith(_sEndFilterName)) { - fileName = fileName.replaceAll(_sEndFilterName + "$", ""); + fileName = fileName.replaceAll(_sEndFilterName + "$", PropertyNames.EMPTY_STRING); sTitle = fileName; } else @@ -842,7 +842,7 @@ public class FileAccess public String getPath(String parentURL, String childURL) { - return filenameConverter.getSystemPathFromFileURL(parentURL + (((childURL == null || childURL.equals("")) ? "" : "/" + childURL))); + return filenameConverter.getSystemPathFromFileURL(parentURL + (((childURL == null || childURL.equals(PropertyNames.EMPTY_STRING)) ? PropertyNames.EMPTY_STRING : "/" + childURL))); } /** @@ -855,7 +855,7 @@ public class FileAccess int p = filename.indexOf("."); if (p == -1) { - return ""; + return PropertyNames.EMPTY_STRING; } else { @@ -1083,7 +1083,7 @@ public class FileAccess public String createNewDir(String parentDir, String name) { - String s = getNewFile(parentDir, name, ""); + String s = getNewFile(parentDir, name, PropertyNames.EMPTY_STRING); if (mkdir(s)) { return s; @@ -1112,7 +1112,7 @@ public class FileAccess private static String filename(String name, String ext, int i) { - return name + (i == 0 ? "" : String.valueOf(i)) + (ext.equals("") ? "" : "." + ext); + return name + (i == 0 ? PropertyNames.EMPTY_STRING : String.valueOf(i)) + (ext.equals(PropertyNames.EMPTY_STRING) ? PropertyNames.EMPTY_STRING : "." + ext); } public int getSize(String url) @@ -1129,7 +1129,7 @@ public class FileAccess public static String connectURLs(String urlFolder, String urlFilename) { - return urlFolder + (urlFolder.endsWith("/") ? "" : "/") + + return urlFolder + (urlFolder.endsWith("/") ? PropertyNames.EMPTY_STRING : "/") + (urlFilename.startsWith("/") ? urlFilename.substring(1) : urlFilename); } diff --git a/wizards/com/sun/star/wizards/common/HelpIds.java b/wizards/com/sun/star/wizards/common/HelpIds.java index ad8faa2b2d42..a3b577d1e52b 100644 --- a/wizards/com/sun/star/wizards/common/HelpIds.java +++ b/wizards/com/sun/star/wizards/common/HelpIds.java @@ -38,7 +38,7 @@ public class HelpIds "HID:WIZARDS_HID0_CANCEL", // HID:34205 "HID:WIZARDS_HID0_STATUS_DIALOG", // HID:34206 "HID:WIZARDS_HID1_LST_SESSIONS", // HID:34207 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID1_BTN_DEL_SES", // HID:34209 "HID:WIZARDS_HID2_LST_DOCS", // HID:34210 "HID:WIZARDS_HID2_BTN_ADD_DOC", // HID:34211 @@ -81,13 +81,13 @@ public class HelpIds "HID:WIZARDS_HID5_BTN_BACKGND", // HID:34248 "HID:WIZARDS_HID5_BTN_ICONS", // HID:34249 "HID:WIZARDS_HID6_TXT_SITE_TITLE", // HID:34250 - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID6_TXT_SITE_DESC", // HID:34253 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID6_DATE_SITE_CREATED", // HID:34255 "HID:WIZARDS_HID6_DATE_SITE_UPDATED", // HID:34256 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID6_TXT_SITE_EMAIL", // HID:34258 "HID:WIZARDS_HID6_TXT_SITE_COPYRIGHT", // HID:34259 "HID:WIZARDS_HID7_BTN_PREVIEW", // HID:34260 @@ -102,24 +102,24 @@ public class HelpIds "HID:WIZARDS_HID7_BTN_FTP", // HID:34269 "HID:WIZARDS_HID7_CHK_SAVE", // HID:34270 "HID:WIZARDS_HID7_TXT_SAVE", // HID:34271 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_BG", // HID:34290 "HID:WIZARDS_HID_BG_BTN_OTHER", // HID:34291 "HID:WIZARDS_HID_BG_BTN_NONE", // HID:34292 @@ -143,23 +143,23 @@ public class HelpIds "HID:WIZARDS_HID_BG_BTN_IMG14", // HID:34300 "HID:WIZARDS_HID_BG_BTN_IMG15", // HID:34311 "HID:WIZARDS_HID_BG_BTN_IMG16", // HID:34312 - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGREPORT_DIALOG", // HID:34320 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGREPORT_0_CMDPREV", // HID:34322 "HID:WIZARDS_HID_DLGREPORT_0_CMDNEXT", // HID:34323 "HID:WIZARDS_HID_DLGREPORT_0_CMDFINISH", // HID:34324 "HID:WIZARDS_HID_DLGREPORT_0_CMDCANCEL", // HID:34325 - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGREPORT_1_LBTABLES", // HID:34330 "HID:WIZARDS_HID_DLGREPORT_1_FIELDSAVAILABLE", // HID:34331 "HID:WIZARDS_HID_DLGREPORT_1_CMDMOVESELECTED", // HID:34332 @@ -169,7 +169,7 @@ public class HelpIds "HID:WIZARDS_HID_DLGREPORT_1_FIELDSSELECTED", // HID:34336 "HID:WIZARDS_HID_DLGREPORT_1_CMDMOVEUP", // HID:34337 "HID:WIZARDS_HID_DLGREPORT_1_CMDMOVEDOWN", // HID:34338 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGREPORT_2_GROUPING", // HID:34340 "HID:WIZARDS_HID_DLGREPORT_2_CMDGROUP", // HID:34341 "HID:WIZARDS_HID_DLGREPORT_2_CMDUNGROUP", // HID:34342 @@ -188,18 +188,18 @@ public class HelpIds "HID:WIZARDS_HID_DLGREPORT_3_SORT4", // HID:34355 "HID:WIZARDS_HID_DLGREPORT_3_OPTASCEND4", // HID:34356 "HID:WIZARDS_HID_DLGREPORT_3_OPTDESCEND4", // HID:34357 - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGREPORT_4_TITLE", // HID:34362 "HID:WIZARDS_HID_DLGREPORT_4_DATALAYOUT", // HID:34363 "HID:WIZARDS_HID_DLGREPORT_4_PAGELAYOUT", // HID:34364 "HID:WIZARDS_HID_DLGREPORT_4_LANDSCAPE", // HID:34365 "HID:WIZARDS_HID_DLGREPORT_4_PORTRAIT", // HID:34366 - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGREPORT_5_OPTDYNTEMPLATE", // HID:34370 "HID:WIZARDS_HID_DLGREPORT_5_OPTSTATDOCUMENT", // HID:34371 "HID:WIZARDS_HID_DLGREPORT_5_TXTTEMPLATEPATH", // HID:34372 @@ -209,8 +209,8 @@ public class HelpIds "HID:WIZARDS_HID_DLGREPORT_5_TXTDOCUMENTPATH", // HID:34376 "HID:WIZARDS_HID_DLGREPORT_5_CMDDOCUMENTPATH", // HID:34377 "HID:WIZARDS_HID_DLGREPORT_5_CHKLINKTODB", // HID:34378 - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_1", // HID:34381 "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_2", // HID:34382 "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_3", // HID:34383 @@ -218,29 +218,29 @@ public class HelpIds "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_5", // HID:34385 "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_6", // HID:34386 "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_7", // HID:34387 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_DIALOG", // HID:34400 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_CMDPREV", // HID:34402 "HID:WIZARDS_HID_DLGFORM_CMDNEXT", // HID:34403 "HID:WIZARDS_HID_DLGFORM_CMDFINISH", // HID:34404 "HID:WIZARDS_HID_DLGFORM_CMDCANCEL", // HID:34405 - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_MASTER_LBTABLES", // HID:34411 "HID:WIZARDS_HID_DLGFORM_MASTER_FIELDSAVAILABLE", // HID:34412 "HID:WIZARDS_HID_DLGFORM_MASTER_CMDMOVESELECTED", // HID:34413 @@ -250,17 +250,17 @@ public class HelpIds "HID:WIZARDS_HID_DLGFORM_MASTER_FIELDSSELECTED", // HID:34417 "HID:WIZARDS_HID_DLGFORM_MASTER_CMDMOVEUP", // HID:34418 "HID:WIZARDS_HID_DLGFORM_MASTER_CMDMOVEDOWN", // HID:34419 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_CHKCREATESUBFORM", // HID:34421 "HID:WIZARDS_HID_DLGFORM_OPTONEXISTINGRELATION", // HID:34422 "HID:WIZARDS_HID_DLGFORM_OPTSELECTMANUALLY", // HID:34423 "HID:WIZARDS_HID_DLGFORM_lstRELATIONS", // HID:34424 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_SUB_LBTABLES", // HID:34431 "HID:WIZARDS_HID_DLGFORM_SUB_FIELDSAVAILABLE", // HID:34432 "HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVESELECTED", // HID:34433 @@ -270,7 +270,7 @@ public class HelpIds "HID:WIZARDS_HID_DLGFORM_SUB_FIELDSSELECTED", // HID:34437 "HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEUP", // HID:34438 "HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEDOWN", // HID:34439 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK1", // HID:34441 "HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK1", // HID:34442 "HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK2", // HID:34443 @@ -279,8 +279,8 @@ public class HelpIds "HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK3", // HID:34446 "HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK4", // HID:34447 "HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK4", // HID:34448 - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_CMDALIGNLEFT", // HID:34451 "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", // HID:34452 "HID:WIZARDS_HID_DLGFORM_CMDLEFTLABELED", // HID:34453 @@ -296,40 +296,40 @@ public class HelpIds "HID:WIZARDS_HID_DLGFORM_CHKNOMODIFICATION", // HID:34463 "HID:WIZARDS_HID_DLGFORM_CHKNODELETION", // HID:34464 "HID:WIZARDS_HID_DLGFORM_CHKNOADDITION", // HID:34465 - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_LSTSTYLES", // HID:34471 "HID:WIZARDS_HID_DLGFORM_CMDNOBORDER", // HID:34472 "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", // HID:34473 "HID:WIZARDS_HID_DLGFORM_CMDSIMPLEBORDER", // HID:34474 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGFORM_TXTPATH", // HID:34481 "HID:WIZARDS_HID_DLGFORM_OPTWORKWITHFORM", // HID:34482 "HID:WIZARDS_HID_DLGFORM_OPTMODIFYFORM", // HID:34483 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGNEWSLTR_DIALOG", // HID:34500 "HID:WIZARDS_HID_DLGNEWSLTR_OPTSTANDARDLAYOUT", // HID:34501 "HID:WIZARDS_HID_DLGNEWSLTR_OPTPARTYLAYOUT", // HID:34502 @@ -337,19 +337,19 @@ public class HelpIds "HID:WIZARDS_HID_DLGNEWSLTR_OPTSINGLESIDED", // HID:34504 "HID:WIZARDS_HID_DLGNEWSLTR_OPTDOUBLESIDED", // HID:34505 "HID:WIZARDS_HID_DLGNEWSLTR_CMDGOON", // HID:34506 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGDEPOT_DIALOG_SELLBUY", // HID:34520 "HID:WIZARDS_HID_DLGDEPOT_0_TXTSTOCKID_SELLBUY", // HID:34521 "HID:WIZARDS_HID_DLGDEPOT_0_TXTQUANTITY", // HID:34522 @@ -381,25 +381,25 @@ public class HelpIds "HID:WIZARDS_HID_DLGDEPOT_LSTMARKETS", // HID:34548 "HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_HISTORY", // HID:34549 "HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_HISTORY", // HID:34550 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGIMPORT_DIALOG", // HID:34570 "HID:WIZARDS_HID_DLGIMPORT_0_CMDHELP", // HID:34571 "HID:WIZARDS_HID_DLGIMPORT_0_CMDCANCEL", // HID:34572 @@ -424,7 +424,7 @@ public class HelpIds "HID:WIZARDS_HID_DLGIMPORT_2_LBEXPORTDOCUMENTPATH", // HID:34591 "HID:WIZARDS_HID_DLGIMPORT_2_EDEXPORTDOCUMENTPATH", // HID:34592 "HID:WIZARDS_HID_DLGIMPORT_2_CMDEXPORTPATHSELECT", // HID:34593 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGIMPORT_3_TBSUMMARY", // HID:34595 "HID:WIZARDS_HID_DLGIMPORT_0_CHKWRITER", // HID:34596 "HID:WIZARDS_HID_DLGIMPORT_0_CHKCALC", // HID:34597 @@ -432,34 +432,34 @@ public class HelpIds "HID:WIZARDS_HID_DLGIMPORT_0_CHKMATHGLOBAL", // HID:34599 "HID:WIZARDS_HID_DLGIMPORT_2_CMDTEMPLATEPATHSELECT2", // HID:34600 "HID:WIZARDS_HID_DLGIMPORT_2_CMDDOCUMENTPATHSELECT2", // HID:34601 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGCORRESPONDENCE_DIALOG", // HID:34630 "HID:WIZARDS_HID_DLGCORRESPONDENCE_CANCEL", // HID:34631 "HID:WIZARDS_HID_DLGCORRESPONDENCE_OPTIONAGENDA1", // HID:34632 @@ -468,28 +468,28 @@ public class HelpIds "HID:WIZARDS_HID_DLGCORRESPONDENCE_OPTIONLETTER1", // HID:34635 "HID:WIZARDS_HID_DLGCORRESPONDENCE_OPTIONLETTER2", // HID:34636 "HID:WIZARDS_HID_DLGCORRESPONDENCE_LETTEROKAY", // HID:34637 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGSTYLES_DIALOG", // HID:34650 "HID:WIZARDS_HID_DLGSTYLES_LISTBOX", // HID:34651 "HID:WIZARDS_HID_DLGSTYLES_CANCEL", // HID:34652 "HID:WIZARDS_HID_DLGSTYLES_OKAY", // HID:34653 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGCONVERT_DIALOG", // HID:34660 "HID:WIZARDS_HID_DLGCONVERT_CHECKBOX1", // HID:34661 "HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON1", // HID:34662 @@ -511,25 +511,25 @@ public class HelpIds "HID:WIZARDS_HID_DLGCONVERT_CBTARGETOPEN", // HID:34678 "HID:WIZARDS_HID_DLGCONVERT_CHKPROTECT", // HID:34679 "HID:WIZARDS_HID_DLGCONVERT_CHKTEXTDOCUMENTS", // HID:34680 - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGPASSWORD_CMDGOON", // HID:34690 "HID:WIZARDS_HID_DLGPASSWORD_CMDCANCEL", // HID:34691 "HID:WIZARDS_HID_DLGPASSWORD_CMDHELP", // HID:34692 "HID:WIZARDS_HID_DLGPASSWORD_TXTPASSWORD", // HID:34693 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGHOLIDAYCAL_DIALOG", // HID:34700 "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_PREVIEW", // HID:34701 "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_OPYEAR", // HID:34702 @@ -604,39 +604,39 @@ public class HelpIds "HID:WIZARDS_HID_LTRWIZ_OPTMAKECHANGES", // HID:40814 "HID:WIZARDS_HID_LTRWIZ_TXTPATH", // HID:40815 "HID:WIZARDS_HID_LTRWIZ_CMDPATH", // HID:40816 - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_LTRWIZARD", // HID:40820 "HID:WIZARDS_HID_LTRWIZARD_HELP", // HID:40821 "HID:WIZARDS_HID_LTRWIZARD_BACK", // HID:40822 "HID:WIZARDS_HID_LTRWIZARD_NEXT", // HID:40823 "HID:WIZARDS_HID_LTRWIZARD_CREATE", // HID:40824 "HID:WIZARDS_HID_LTRWIZARD_CANCEL", // HID:40825 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_LSTTABLES", // HID:40850 "HID:WIZARDS_HID_QUERYWIZARD_LSTFIELDS", // HID:40851 "HID:WIZARDS_HID_QUERYWIZARD_CMDMOVESELECTED", // HID:40852 @@ -646,12 +646,12 @@ public class HelpIds "HID:WIZARDS_HID_QUERYWIZARD_LSTSELFIELDS", // HID:40856 "HID:WIZARDS_HID_QUERYWIZARD_CMDMOVEUP", // HID:40857 "HID:WIZARDS_HID_QUERYWIZARD_CMDMOVEDOWN", // HID:40858 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_SORT1", // HID:40865 "HID:WIZARDS_HID_QUERYWIZARD_OPTASCEND1", // HID:40866 "HID:WIZARDS_HID_QUERYWIZARD_OPTDESCEND1", // HID:40867 @@ -664,7 +664,7 @@ public class HelpIds "HID:WIZARDS_HID_QUERYWIZARD_SORT4", // HID:40874 "HID:WIZARDS_HID_QUERYWIZARD_OPTASCEND4", // HID:40875 "HID:WIZARDS_HID_QUERYWIZARD_OPTDESCEND4", // HID:40876 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_OPTMATCHALL", // HID:40878 "HID:WIZARDS_HID_QUERYWIZARD_OPTMATCHANY", // HID:40879 "HID:WIZARDS_HID_QUERYWIZARD_LSTFIELDNAME_1", // HID:40880 @@ -676,12 +676,12 @@ public class HelpIds "HID:WIZARDS_HID_QUERYWIZARD_LSTFIELDNAME_3", // HID:40886 "HID:WIZARDS_HID_QUERYWIZARD_LSTOPERATOR_3", // HID:40887 "HID:WIZARDS_HID_QUERYWIZARD_TXTVALUE_3", // HID:40888 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_OPTAGGREGATEDETAILQUERY", // HID:40895 "HID:WIZARDS_HID_QUERYWIZARD_OPTAGGREGATESUMMARYQUERY", // HID:40896 "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFUNCTION_1", // HID:40897 @@ -696,20 +696,20 @@ public class HelpIds "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFIELDS_5", // HID:40906 "HID:WIZARDS_HID_QUERYWIZARD_BTNAGGREGATEPLUS", // HID:40907 "HID:WIZARDS_HID_QUERYWIZARD_BTNAGGREGATEMINUS", // HID:40908 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERFIELDS", // HID:40915 "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERMOVESELECTED", // HID:40916 "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERREMOVESELECTED", // HID:40917 "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERSELFIELDS", // HID:40918 "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERMOVEUP", // HID:40919 "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERMOVEDOWN", // HID:40920 - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_OPTGROUPMATCHALL", // HID:40923 "HID:WIZARDS_HID_QUERYWIZARD_OPTGROUPMATCHANY", // HID:40924 "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERFIELDNAME_1", // HID:40925 @@ -721,12 +721,12 @@ public class HelpIds "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERFIELDNAME_3", // HID:40931 "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTEROPERATOR_3", // HID:40932 "HID:WIZARDS_HID_QUERYWIZARD_TXTFILTERVALUE_3", // HID:40933 - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_1", // HID:40940 "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_2", // HID:40941 "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_3", // HID:40942 @@ -734,61 +734,61 @@ public class HelpIds "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_5", // HID:40944 "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_6", // HID:40945 "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_7", // HID:40946 - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_TXTQUERYTITLE", // HID:40955 "HID:WIZARDS_HID_QUERYWIZARD_OPTDISPLAYQUERY", // HID:40956 "HID:WIZARDS_HID_QUERYWIZARD_OPTMODIFYQUERY", // HID:40957 "HID:WIZARDS_HID_QUERYWIZARD_TXTSUMMARY", // HID:40958 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD", // HID:40970 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_QUERYWIZARD_BACK", // HID:40972 "HID:WIZARDS_HID_QUERYWIZARD_NEXT", // HID:40973 "HID:WIZARDS_HID_QUERYWIZARD_CREATE", // HID:40974 "HID:WIZARDS_HID_QUERYWIZARD_CANCEL", // HID:40975 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_IS", // HID:41000 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_IS_BTN_NONE", // HID:41002 "HID:WIZARDS_HID_IS_BTN_OK", // HID:41003 "HID:WIZARDS_HID_IS_BTN_CANCEL", // HID:41004 @@ -824,9 +824,9 @@ public class HelpIds "HID:WIZARDS_HID_IS_BTN_IMG30", // HID:41034 "HID:WIZARDS_HID_IS_BTN_IMG31", // HID:41035 "HID:WIZARDS_HID_IS_BTN_IMG32", // HID:41036 - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_FTP", // HID:41040 "HID:WIZARDS_HID_FTP_SERVER", // HID:41041 "HID:WIZARDS_HID_FTP_USERNAME", // HID:41042 @@ -836,8 +836,8 @@ public class HelpIds "HID:WIZARDS_HID_FTP_BTN_PATH", // HID:41046 "HID:WIZARDS_HID_FTP_OK", // HID:41047 "HID:WIZARDS_HID_FTP_CANCEL", // HID:41048 - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_AGWIZ", // HID:41051 "HID:WIZARDS_HID_AGWIZ_HELP", // HID:41052 "HID:WIZARDS_HID_AGWIZ_NEXT", // HID:41053 @@ -886,27 +886,27 @@ public class HelpIds "HID:WIZARDS_HID_AGWIZ_5_TXT_TOPIC_5", // HID:41096 "HID:WIZARDS_HID_AGWIZ_5_TXT_RESPONSIBLE_5", // HID:41097 "HID:WIZARDS_HID_AGWIZ_5_TXT_MINUTES_5", // HID:41098 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_FAXWIZ_OPTBUSINESSFAX", // HID:41120 "HID:WIZARDS_HID_FAXWIZ_LSTBUSINESSSTYLE", // HID:41121 "HID:WIZARDS_HID_FAXWIZ_OPTPRIVATEFAX", // HID:41122 @@ -942,53 +942,53 @@ public class HelpIds "HID:WIZARDS_HID_IMAGECONTROL2", // HID:41152 "HID:WIZARDS_HID_FAXWIZ_TXTPATH", // HID:41153 "HID:WIZARDS_HID_FAXWIZ_CMDPATH", // HID:41154 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_FAXWIZARD", // HID:41180 "HID:WIZARDS_HID_FAXWIZARD_HELP", // HID:41181 "HID:WIZARDS_HID_FAXWIZARD_BACK", // HID:41182 "HID:WIZARDS_HID_FAXWIZARD_NEXT", // HID:41183 "HID:WIZARDS_HID_FAXWIZARD_CREATE", // HID:41184 "HID:WIZARDS_HID_FAXWIZARD_CANCEL", // HID:41185 - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGTABLE_DIALOG", // HID:41200 - "", + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGTABLE_CMDPREV", // HID:41202 "HID:WIZARDS_HID_DLGTABLE_CMDNEXT", // HID:41203 "HID:WIZARDS_HID_DLGTABLE_CMDFINISH", // HID:41204 @@ -1004,9 +1004,9 @@ public class HelpIds "HID:WIZARDS_HID_DLGTABLE_FIELDSSELECTED", // HID:41214 "HID:WIZARDS_HID_DLGTABLE_CMDMOVEUP", // HID:41215 "HID:WIZARDS_HID_DLGTABLE_CMDMOVEDOWN", // HID:41216 - "", - "", - "", + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, + PropertyNames.EMPTY_STRING, "HID:WIZARDS_HID_DLGTABLE_LB_SELFIELDNAMES", // HID:41220 "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDUP", // HID:41221 "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDDOWN", // HID:41222 diff --git a/wizards/com/sun/star/wizards/common/JavaTools.java b/wizards/com/sun/star/wizards/common/JavaTools.java index 836b2a7ea242..a05c3a6460f7 100644 --- a/wizards/com/sun/star/wizards/common/JavaTools.java +++ b/wizards/com/sun/star/wizards/common/JavaTools.java @@ -52,7 +52,7 @@ public class JavaTools /* public static void main(String args[]) { - String sPath = ""; + String sPath = PropertyNames.EMPTY_STRING; DateTime oDateTime = null; long n; String ConnectStr = "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.NamingService"; //localhost ;Lo-1.Germany.sun.com; 10.16.65.155 @@ -200,7 +200,7 @@ public class JavaTools public static String getlongestArrayItem(String[] StringArray) { - String sLongestItem = ""; + String sLongestItem = PropertyNames.EMPTY_STRING; int FieldCount = StringArray.length; int iOldLength = 0; int iCurLength = 0; @@ -218,17 +218,17 @@ public class JavaTools public static String ArraytoString(String[] LocArray) { - String ResultString = ""; + StringBuilder ResultString = new StringBuilder(PropertyNames.EMPTY_STRING); int iLen = LocArray.length; for (int i = 0; i < iLen; i++) { - ResultString += LocArray[i]; + ResultString.append(LocArray[i]); if (i < iLen - 1) { - ResultString += ";"; + ResultString.append(PropertyNames.SEMI_COLON); } } - return ResultString; + return ResultString.toString(); } /** @@ -377,7 +377,7 @@ public class JavaTools public static String[] ArrayoutofString(String MainString, String Token) { String[] StringArray; - if (MainString.equals("") == false) + if (MainString.equals(PropertyNames.EMPTY_STRING) == false) { Vector StringVector = new Vector(); String LocString = null; @@ -443,17 +443,17 @@ public class JavaTools { String sFilename = getFilenameOutOfPath(sPath); String[] FilenameList = ArrayoutofString(sFilename, "."); - String FileDescription = ""; + StringBuilder FileDescription = new StringBuilder(PropertyNames.EMPTY_STRING); for (int i = 0; i < FilenameList.length - 1; i++) { - FileDescription += FilenameList[i]; + FileDescription.append(FilenameList[i]); } - return FileDescription; + return FileDescription.toString(); } public static String convertfromURLNotation(String _sURLPath) { - String sPath = ""; + String sPath = PropertyNames.EMPTY_STRING; try { URL oJavaURL = new URL(_sURLPath); @@ -762,7 +762,7 @@ public class JavaTools { if (sSecondString != null) { - bissame = sSecondString.equals(""); + bissame = sSecondString.equals(PropertyNames.EMPTY_STRING); } else { @@ -771,7 +771,7 @@ public class JavaTools } else { - if (sFirstString.equals("")) + if (sFirstString.equals(PropertyNames.EMPTY_STRING)) { bissame = (sSecondString == null); } diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java index 109affffd5ef..ff3795473fee 100644 --- a/wizards/com/sun/star/wizards/common/NumericalHelper.java +++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java @@ -411,7 +411,7 @@ public class NumericalHelper // return toInt(_aValue); // } // catch(com.sun.star.lang.IllegalArgumentException e) { -// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, ""); +// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING); // return 0; // }} // @@ -421,8 +421,8 @@ public class NumericalHelper // return toString(_aValue); // } // catch(com.sun.star.lang.IllegalArgumentException e) { -// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, ""); -// return ""; +// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING); +// return PropertyNames.EMPTY_STRING; // }} // // @@ -431,7 +431,7 @@ public class NumericalHelper // return toInt(_aValue, _ndefaultValue); // } // catch(com.sun.star.uno.Exception e) { -// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, ""); +// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING); // return 0; // }} // @@ -445,7 +445,7 @@ public class NumericalHelper // return toBoolean(_oObject); // } // catch (java.lang.Exception e){ -// DebugHelper.exception(BasicErrorCode.SbERR_BAD_ARGUMENT, ""); +// DebugHelper.exception(BasicErrorCode.SbERR_BAD_ARGUMENT, PropertyNames.EMPTY_STRING); // return false; // } // } @@ -461,11 +461,11 @@ public class NumericalHelper // return false; // } // else{ -// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, ""); +// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING); // return false; // } // }catch (java.lang.Exception e){ -// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, ""); +// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING); // return false; // }} // @@ -489,12 +489,12 @@ public class NumericalHelper // return false; // } // else{ -// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, ""); +// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING); // return false; // } // } // }catch (java.lang.Exception e){ -// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, ""); +// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING); // return false; // }} /** @@ -983,13 +983,13 @@ public class NumericalHelper } else { - DebugHelper.exception(1/* BasicErrorCode.SbERR_CONVERSION*/, ""); + DebugHelper.exception(1/* BasicErrorCode.SbERR_CONVERSION*/, PropertyNames.EMPTY_STRING); } } } catch (com.sun.star.uno.Exception e) { - DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, ""); + DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, PropertyNames.EMPTY_STRING); } return nreturn; } @@ -1511,7 +1511,7 @@ public class NumericalHelper // } // } // catch (com.sun.star.uno.Exception e){ -// DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, ""); +// DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, PropertyNames.EMPTY_STRING); // return false; // }} /** @@ -1554,7 +1554,7 @@ public class NumericalHelper { if (n > MAX_NUMBER || n < MIN_NUMBER) { - DebugHelper.exception(1 /*BasicErrorCode.SbERR_OUT_OF_RANGE*/, ""); + DebugHelper.exception(1 /*BasicErrorCode.SbERR_OUT_OF_RANGE*/, PropertyNames.EMPTY_STRING); } String number = NumericalHelper.toString(new Integer(n)); /* converison idea: every digit is written with a maximum of two diff --git a/wizards/com/sun/star/wizards/common/PropertyNames.java b/wizards/com/sun/star/wizards/common/PropertyNames.java index 4361b2757773..bef4d4700864 100644 --- a/wizards/com/sun/star/wizards/common/PropertyNames.java +++ b/wizards/com/sun/star/wizards/common/PropertyNames.java @@ -51,4 +51,18 @@ public class PropertyNames public static String PROPERTY_MOVEABLE = "Moveable"; public static String PROPERTY_CLOSEABLE = "Closeable"; public static String PROPERTY_ALIGN = "Align"; + public static String COMMAND = "Command"; + public static String COMMAND_TYPE = "CommandType"; + public static String SELECTED_ITEMS = "SelectedItems"; + public static String URL = "URL"; + public static String ACTIVE_CONNECTION = "ActiveConnection"; + public static String ASC = "ASC"; + public static String SEMI_COLON = ";"; + public static String EMPTY_STRING = ""; + public static String START = "start"; + public static String ORIENTATION = "Orientation"; + public static String READ_ONLY = "ReadOnly"; + public static String SPACE = " "; + public static String STRING_ITEM_LIST = "StringItemList"; + public static String FONT_DESCRIPTOR = "FontDescriptor"; } diff --git a/wizards/com/sun/star/wizards/common/PropertySetHelper.java b/wizards/com/sun/star/wizards/common/PropertySetHelper.java index aec166a5c1c5..bdca296db552 100644 --- a/wizards/com/sun/star/wizards/common/PropertySetHelper.java +++ b/wizards/com/sun/star/wizards/common/PropertySetHelper.java @@ -371,7 +371,7 @@ public class PropertySetHelper */ public void showProperties() { - String sName = ""; + String sName = PropertyNames.EMPTY_STRING; if (m_xPropertySet != null) { diff --git a/wizards/com/sun/star/wizards/common/UCB.java b/wizards/com/sun/star/wizards/common/UCB.java index d49f006a0ca8..aa612ad5fef1 100644 --- a/wizards/com/sun/star/wizards/common/UCB.java +++ b/wizards/com/sun/star/wizards/common/UCB.java @@ -121,11 +121,11 @@ public class UCB */ public void copy(String sourceDir, String filename, String targetDir) throws Exception { - copy(sourceDir,filename, targetDir, ""); + copy(sourceDir,filename, targetDir, PropertyNames.EMPTY_STRING); } /** - * target name can be "", in which case the name stays lige the source name + * target name can be PropertyNames.EMPTY_STRING, in which case the name stays lige the source name * @param sourceDir * @param sourceFilename * @param targetDir diff --git a/wizards/com/sun/star/wizards/common/XMLHelper.java b/wizards/com/sun/star/wizards/common/XMLHelper.java index 326ba03fbeea..03af04a959f7 100644 --- a/wizards/com/sun/star/wizards/common/XMLHelper.java +++ b/wizards/com/sun/star/wizards/common/XMLHelper.java @@ -52,7 +52,7 @@ public class XMLHelper Element e = doc.createElement(name); for (int i = 0; i < attNames.length; i++) { - if (attValues[i] != null && (!attValues[i].equals(""))) + if (attValues[i] != null && (!attValues[i].equals(PropertyNames.EMPTY_STRING))) { e.setAttribute(attNames[i], attValues[i]); } diff --git a/wizards/com/sun/star/wizards/db/BlindtextCreator.java b/wizards/com/sun/star/wizards/db/BlindtextCreator.java index b52381def054..308eca03e121 100644 --- a/wizards/com/sun/star/wizards/db/BlindtextCreator.java +++ b/wizards/com/sun/star/wizards/db/BlindtextCreator.java @@ -27,6 +27,7 @@ package com.sun.star.wizards.db; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; /** * @@ -40,7 +41,7 @@ public class BlindtextCreator public static String adjustBlindTextlength(String FieldTitle, int FieldWidth, boolean bIsCurLandscape, boolean bIsGroupTable, String[] _RecordFieldNames) { - String BlindTextString = ""; + String BlindTextString = PropertyNames.EMPTY_STRING; if (bIsGroupTable) { return getBlindTextString(FieldTitle, FieldWidth, FieldWidth); @@ -66,7 +67,7 @@ public class BlindtextCreator public static String getBlindTextString(String FieldTitle, int FieldWidth, int MaxWidth) { - String[] BlindTextArray = JavaTools.ArrayoutofString(BlindText, " "); + String[] BlindTextArray = JavaTools.ArrayoutofString(BlindText, PropertyNames.SPACE); String PartBlindText = BlindTextArray[0]; String NewPartBlindText; int MaxHeaderWidth; @@ -88,7 +89,7 @@ public class BlindtextCreator int i = 1; do { - NewPartBlindText = PartBlindText + " " + BlindTextArray[i]; + NewPartBlindText = PartBlindText + PropertyNames.SPACE + BlindTextArray[i]; if (NewPartBlindText.length() < MaxWidth) { PartBlindText = NewPartBlindText; diff --git a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java index db5ceb257118..18e85fea868e 100644 --- a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java +++ b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java @@ -40,7 +40,7 @@ public class ColumnPropertySet TypeInspector oTypeInspector; public XPropertySet xPropertySet; private int nType; - private String sTypeName = ""; + private String sTypeName = PropertyNames.EMPTY_STRING; public ColumnPropertySet(TypeInspector _oTypeInspector, XPropertySet _xPropertySet) { @@ -149,7 +149,7 @@ public class ColumnPropertySet private void setType(int _nType, String _sTypeName, Integer precision) { - if (_sTypeName.equals("")) + if (_sTypeName.equals(PropertyNames.EMPTY_STRING)) { sTypeName = oTypeInspector.getDefaultTypeName(nType, precision); } @@ -174,7 +174,7 @@ public class ColumnPropertySet else if (_spropname.equals(PropertyNames.PROPERTY_NAME)) { String sName = (String) _oValue; - if (!sName.equals("")) + if (!sName.equals(PropertyNames.EMPTY_STRING)) { xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); } diff --git a/wizards/com/sun/star/wizards/db/CommandMetaData.java b/wizards/com/sun/star/wizards/db/CommandMetaData.java index 1819d3485994..af4972c52e86 100644 --- a/wizards/com/sun/star/wizards/db/CommandMetaData.java +++ b/wizards/com/sun/star/wizards/db/CommandMetaData.java @@ -41,6 +41,7 @@ import com.sun.star.container.XNameAccess; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.JavaTools; import com.sun.star.wizards.common.NumberFormatter; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.Resource; import java.util.ArrayList; import java.util.HashMap; @@ -75,8 +76,8 @@ public class CommandMetaData extends DBMetaData private int CommandType; private String Command; boolean bCatalogAtStart = true; - String sCatalogSep = ""; - String sIdentifierQuote = ""; + String sCatalogSep = PropertyNames.EMPTY_STRING; + String sIdentifierQuote = PropertyNames.EMPTY_STRING; boolean bCommandComposerAttributesalreadyRetrieved = false; private XIndexAccess xIndexKeys; @@ -178,7 +179,7 @@ public class CommandMetaData extends DBMetaData } else { - sSortFieldName[1] = "ASC"; + sSortFieldName[1] = PropertyNames.ASC; } aSortFields.add(sSortFieldName); } diff --git a/wizards/com/sun/star/wizards/db/CommandName.java b/wizards/com/sun/star/wizards/db/CommandName.java index 3c6686868ff3..64e3f5cbeae5 100644 --- a/wizards/com/sun/star/wizards/db/CommandName.java +++ b/wizards/com/sun/star/wizards/db/CommandName.java @@ -29,17 +29,18 @@ package com.sun.star.wizards.db; import com.sun.star.sdbc.SQLException; import com.sun.star.uno.Exception; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; public class CommandName { protected CommandMetaData oCommandMetaData; - protected String CatalogName = ""; - protected String SchemaName = ""; - protected String TableName = ""; - protected String DisplayName = ""; - protected String ComposedName = ""; - protected String AliasName = ""; + protected String CatalogName = PropertyNames.EMPTY_STRING; + protected String SchemaName = PropertyNames.EMPTY_STRING; + protected String TableName = PropertyNames.EMPTY_STRING; + protected String DisplayName = PropertyNames.EMPTY_STRING; + protected String ComposedName = PropertyNames.EMPTY_STRING; + protected String AliasName = PropertyNames.EMPTY_STRING; protected boolean bCatalogAtStart; protected String sCatalogSep; protected String sIdentifierQuote; @@ -59,21 +60,21 @@ public class CommandName oCommandMetaData = _CommandMetaData; if ((_CatalogName != null) && (oCommandMetaData.xDBMetaData.supportsCatalogsInTableDefinitions())) { - if (!_CatalogName.equals("")) + if (!_CatalogName.equals(PropertyNames.EMPTY_STRING)) { CatalogName = _CatalogName; } } if ((_SchemaName != null) && (oCommandMetaData.xDBMetaData.supportsSchemasInTableDefinitions())) { - if (!_SchemaName.equals("")) + if (!_SchemaName.equals(PropertyNames.EMPTY_STRING)) { SchemaName = _SchemaName; } } if (_TableName != null) { - if (!_TableName.equals("")) + if (!_TableName.equals(PropertyNames.EMPTY_STRING)) { TableName = _TableName; } @@ -117,7 +118,7 @@ public class CommandName NameList = new String[0]; NameList = JavaTools.ArrayoutofString(_DisplayName, "."); SchemaName = NameList[0]; - TableName = NameList[1]; // TODO Was ist mit diesem Fall: CatalogSep = "." und CatalogName = "" + TableName = NameList[1]; // TODO Was ist mit diesem Fall: CatalogSep = "." und CatalogName = PropertyNames.EMPTY_STRING } else { @@ -138,7 +139,7 @@ public class CommandName { if (CatalogName != null) { - if (!CatalogName.equals("")) + if (!CatalogName.equals(PropertyNames.EMPTY_STRING)) { if (bCatalogAtStart == true) { @@ -148,12 +149,12 @@ public class CommandName } if (SchemaName != null) { - if (!SchemaName.equals("")) + if (!SchemaName.equals(PropertyNames.EMPTY_STRING)) { ComposedName += quoteName(SchemaName) + "."; } } - if (ComposedName.equals("")) + if (ComposedName.equals(PropertyNames.EMPTY_STRING)) { ComposedName = quoteName(TableName); } @@ -163,7 +164,7 @@ public class CommandName } if ((bCatalogAtStart == false) && (CatalogName != null)) { - if (!CatalogName.equals("")) + if (!CatalogName.equals(PropertyNames.EMPTY_STRING)) { ComposedName += sCatalogSep + quoteName(CatalogName); } @@ -203,7 +204,7 @@ public class CommandName { if (sName == null) { - sName = ""; + sName = PropertyNames.EMPTY_STRING; } return new StringBuilder(_sIdentifierQuote).append(sName).append(_sIdentifierQuote).toString(); } diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 5a151937d73f..54a68cad17b4 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -187,7 +187,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } return oNumberFormatter; @@ -215,9 +215,9 @@ public class DBMetaData xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, xDatabaseContext ); DataSourceNames = xNameAccess.getElementNames(); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -326,9 +326,9 @@ public class DBMetaData // TODO: Performance leak getColumns() take very long. xColumns = UnoRuntime.queryInterface( XNameAccess.class, xCommandCols.getColumns() ); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } public XNameAccess getColumns() @@ -357,7 +357,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return bHasEscapeProcessing; } @@ -453,7 +453,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return - 1; } } @@ -507,7 +507,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -530,7 +530,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return isSQL92CheckEnabled; } @@ -579,9 +579,9 @@ public class DBMetaData xModel = xDocu.getDatabaseDocument(); } } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -596,9 +596,9 @@ public class DBMetaData try { XConnection xConnection = null; - if (Properties.hasPropertyValue(curproperties, "ActiveConnection")) + if (Properties.hasPropertyValue(curproperties, PropertyNames.ACTIVE_CONNECTION)) { - xConnection = UnoRuntime.queryInterface( XConnection.class, Properties.getPropertyValue( curproperties, "ActiveConnection" ) ); + xConnection = UnoRuntime.queryInterface( XConnection.class, Properties.getPropertyValue( curproperties, PropertyNames.ACTIVE_CONNECTION ) ); if (xConnection != null) { com.sun.star.container.XChild child = UnoRuntime.queryInterface( com.sun.star.container.XChild.class, xConnection ); @@ -653,15 +653,15 @@ public class DBMetaData } catch (IllegalArgumentException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } catch (UnknownPropertyException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } catch (WrappedTargetException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return false; @@ -684,7 +684,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } @@ -703,7 +703,7 @@ public class DBMetaData getDataSourceInterfaces(); if (bPasswordIsRequired == false) { - DBConnection = _dataSource.getConnection("", ""); + DBConnection = _dataSource.getConnection(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); bgetConnection = true; } else @@ -746,11 +746,11 @@ public class DBMetaData } return bgetConnection; } - catch (Exception exception) + catch (Exception e) { String sMsgConnectionImpossible = oResource.getResText(RID_DB_COMMON + 35); showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sMsgConnectionImpossible); - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } @@ -767,7 +767,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return 0; } } @@ -784,7 +784,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return 0; } } @@ -816,7 +816,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } @@ -852,7 +852,7 @@ public class DBMetaData XPropertySet xPSet = UnoRuntime.queryInterface( XPropertySet.class, oQuery ); String s = _oSQLQueryComposer.m_xQueryAnalyzer.getQuery(); - xPSet.setPropertyValue("Command", s); + xPSet.setPropertyValue(PropertyNames.COMMAND, s); XNameContainer xNameCont = UnoRuntime.queryInterface( XNameContainer.class, xQueryDefs ); m_connectionTools.getObjectNames().checkNameForCreate(com.sun.star.sdb.CommandType.QUERY, _QueryName); @@ -877,13 +877,13 @@ public class DBMetaData } exception.printStackTrace(System.out); } - catch (SQLException exception) + catch (SQLException e) { - callSQLErrorMessageDialog(exception, null); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return false; } @@ -949,7 +949,7 @@ public class DBMetaData NamedValueCollection creationArgs = new NamedValueCollection(); creationArgs.put( PropertyNames.PROPERTY_NAME, basename ); - creationArgs.put( "URL", documentURL ); + creationArgs.put( PropertyNames.URL, documentURL ); creationArgs.put( "AsTemplate", i_createTemplate ); XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, _xDocNameAccess ); Object oDBDocument = xDocMSF.createInstanceWithArguments( "com.sun.star.sdb.DocumentDefinition", creationArgs.getPropertyValues() ); @@ -962,7 +962,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -992,7 +992,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return sColValues; } @@ -1006,7 +1006,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return null; } } @@ -1020,7 +1020,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return null; } } @@ -1041,7 +1041,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } diff --git a/wizards/com/sun/star/wizards/db/QueryMetaData.java b/wizards/com/sun/star/wizards/db/QueryMetaData.java index 5fe6cd55c3a9..f6fe9176086c 100644 --- a/wizards/com/sun/star/wizards/db/QueryMetaData.java +++ b/wizards/com/sun/star/wizards/db/QueryMetaData.java @@ -196,7 +196,7 @@ public class QueryMetaData extends CommandMetaData ArrayList<String> CommandNames = new ArrayList<String>(1); for (int i = 0; i < _FieldNames.length; i++) { - String CurCommandName = ""; + String CurCommandName = PropertyNames.EMPTY_STRING; String[] MetaList = JavaTools.ArrayoutofString(_FieldNames[i], "."); if (MetaList.length > 1) { diff --git a/wizards/com/sun/star/wizards/db/RecordParser.java b/wizards/com/sun/star/wizards/db/RecordParser.java index 6c8ddb5b2c36..f9621fe8420d 100644 --- a/wizards/com/sun/star/wizards/db/RecordParser.java +++ b/wizards/com/sun/star/wizards/db/RecordParser.java @@ -44,6 +44,7 @@ import com.sun.star.wizards.common.JavaTools; import com.sun.star.wizards.common.NumberFormatter; import com.sun.star.sdbc.XResultSet; import com.sun.star.task.XInteractionHandler; +import com.sun.star.wizards.common.PropertyNames; public class RecordParser extends QueryMetaData { @@ -217,9 +218,9 @@ public class RecordParser extends QueryMetaData try { Helper.setUnoPropertyValue(xRowSet, "DataSourceName", DataSourceName); - Helper.setUnoPropertyValue(xRowSet, "ActiveConnection", DBConnection); - Helper.setUnoPropertyValue(xRowSet, "Command", Command); - Helper.setUnoPropertyValue(xRowSet, "CommandType", new Integer(_nCommandType)); // CommandType + Helper.setUnoPropertyValue(xRowSet, PropertyNames.ACTIVE_CONNECTION, DBConnection); + Helper.setUnoPropertyValue(xRowSet, PropertyNames.COMMAND, Command); + Helper.setUnoPropertyValue(xRowSet, PropertyNames.COMMAND_TYPE, new Integer(_nCommandType)); // CommandType xExecute.executeWithCompletion(xInteraction); com.sun.star.sdb.XResultSetAccess xResultAccess = (com.sun.star.sdb.XResultSetAccess) UnoRuntime.queryInterface(com.sun.star.sdb.XResultSetAccess.class, xRowSet); ResultSet = xResultAccess.createResultSet(); diff --git a/wizards/com/sun/star/wizards/db/RelationController.java b/wizards/com/sun/star/wizards/db/RelationController.java index acf47581d3e2..6c8b212f3cfd 100644 --- a/wizards/com/sun/star/wizards/db/RelationController.java +++ b/wizards/com/sun/star/wizards/db/RelationController.java @@ -33,6 +33,7 @@ import com.sun.star.sdbc.XResultSet; import com.sun.star.sdbc.XRow; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; /** * @author bc93774 @@ -94,7 +95,7 @@ public class RelationController extends CommandName private Object getCatalogName(CommandName _oCommandName) { String sLocCatalog = _oCommandName.getCatalogName(); - if (sLocCatalog.equals("")) + if (sLocCatalog.equals(PropertyNames.EMPTY_STRING)) { return null; } diff --git a/wizards/com/sun/star/wizards/db/TableDescriptor.java b/wizards/com/sun/star/wizards/db/TableDescriptor.java index 0330e518b774..80fbfd9ed906 100644 --- a/wizards/com/sun/star/wizards/db/TableDescriptor.java +++ b/wizards/com/sun/star/wizards/db/TableDescriptor.java @@ -81,8 +81,8 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen private XColumnsSupplier xKeyColumnSupplier; private XPropertySet xKey; private boolean bIDFieldisInserted = false; - private String IDFieldName = ""; - private String sColumnAlreadyExistsMessage = ""; + private String IDFieldName = PropertyNames.EMPTY_STRING; + private String sColumnAlreadyExistsMessage = PropertyNames.EMPTY_STRING; // private WizardDialog oUnoDialog; private XWindow xWindow; @@ -319,7 +319,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - xPropTableDataDescriptor.setPropertyValue(PropertyNames.PROPERTY_NAME, ""); + xPropTableDataDescriptor.setPropertyValue(PropertyNames.PROPERTY_NAME, PropertyNames.EMPTY_STRING); if ((xKeyDrop != null) && (xIndexAccessKeys != null)) { int icount = xIndexAccessKeys.getCount(); @@ -374,7 +374,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { if (_svalue != null) { - if (!_svalue.equals("")) + if (!_svalue.equals(PropertyNames.EMPTY_STRING)) { try { @@ -664,7 +664,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { if (!hasByName(_columnname)) { - if (_columnname.equals("")) + if (_columnname.equals(PropertyNames.EMPTY_STRING)) { return false; } @@ -694,7 +694,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen try { XPropertySet xColPropertySet = xColumnDataDescriptorFactory.createDataDescriptor(); - IDFieldName = Desktop.getUniqueName(getColumnNames(), _columnname, ""); + IDFieldName = Desktop.getUniqueName(getColumnNames(), _columnname, PropertyNames.EMPTY_STRING); xColPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, IDFieldName); int nDataType = oTypeInspector.convertDataType(com.sun.star.sdbc.DataType.INTEGER); diff --git a/wizards/com/sun/star/wizards/db/TypeInspector.java b/wizards/com/sun/star/wizards/db/TypeInspector.java index 1f22801fd8c5..6e6bc358aaea 100644 --- a/wizards/com/sun/star/wizards/db/TypeInspector.java +++ b/wizards/com/sun/star/wizards/db/TypeInspector.java @@ -38,6 +38,7 @@ import com.sun.star.sdbc.XRow; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; public class TypeInspector { @@ -284,7 +285,7 @@ public class TypeInspector */ public String getDefaultTypeName(int _curDataType, Integer precision) { - String ret = ""; + String ret = PropertyNames.EMPTY_STRING; for (int i = 0; i < nDataTypeInfos.length; i++) { if (nDataTypeInfos[i] == _curDataType) diff --git a/wizards/com/sun/star/wizards/document/Control.java b/wizards/com/sun/star/wizards/document/Control.java index b5ec0ec4ff63..8a7b10f2cefd 100644 --- a/wizards/com/sun/star/wizards/document/Control.java +++ b/wizards/com/sun/star/wizards/document/Control.java @@ -145,7 +145,7 @@ public class Control extends Shape public String getControlName(String _fieldname) { - String controlname = ""; + String controlname = PropertyNames.EMPTY_STRING; switch (getControlType()) { case FormHandler.SOLABEL: @@ -338,7 +338,7 @@ public class Control extends Shape } xPropertySet.setPropertyValue("Text", stext); aPreferredSize = getPeer().getPreferredSize(); - xPropertySet.setPropertyValue("Text", ""); + xPropertySet.setPropertyValue("Text", PropertyNames.EMPTY_STRING); } return aPreferredSize; } diff --git a/wizards/com/sun/star/wizards/document/DatabaseControl.java b/wizards/com/sun/star/wizards/document/DatabaseControl.java index e26449bc4632..22b0af405b17 100644 --- a/wizards/com/sun/star/wizards/document/DatabaseControl.java +++ b/wizards/com/sun/star/wizards/document/DatabaseControl.java @@ -152,7 +152,7 @@ public class DatabaseControl extends Control return FormHandler.oControlData[i].GridColumnName; } } - return ""; + return PropertyNames.EMPTY_STRING; } public int getControlHeight() diff --git a/wizards/com/sun/star/wizards/document/FormHandler.java b/wizards/com/sun/star/wizards/document/FormHandler.java index 17dece81a03e..e1fab5a3301b 100644 --- a/wizards/com/sun/star/wizards/document/FormHandler.java +++ b/wizards/com/sun/star/wizards/document/FormHandler.java @@ -59,9 +59,17 @@ import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XServiceInfo; import com.sun.star.container.XNamed; +import java.util.logging.Level; +import java.util.logging.Logger; public class FormHandler { + private static final String CHECKBOX = "CheckBox"; + private static final String DATEFIELD = "DateField"; + private static final String FORMATTEDFIELD = "FormattedField"; + private static final String IMAGECONTROL = "ImageControl"; + private static final String TEXTFIELD = "TextField"; + private static final String TIMEFIELD = "TimeField"; public XFormsSupplier xFormsSupplier; public XMultiServiceFactory xMSFDoc; @@ -124,30 +132,30 @@ public class FormHandler sModelServices[SOIMAGECONTROL] = "com.sun.star.form.component.DatabaseImageControl"; oControlData = new ControlData[22]; - oControlData[0] = createControlData(DataType.BIT, SOCHECKBOX, "CheckBox", "CheckBox", false); - oControlData[1] = createControlData(DataType.BOOLEAN, SOCHECKBOX, "CheckBox", "CheckBox", false); - oControlData[2] = createControlData(DataType.TINYINT, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[3] = createControlData(DataType.SMALLINT, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[4] = createControlData(DataType.INTEGER, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[5] = createControlData(DataType.BIGINT, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[6] = createControlData(DataType.FLOAT, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[7] = createControlData(DataType.REAL, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[8] = createControlData(DataType.DOUBLE, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[9] = createControlData(DataType.NUMERIC, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[10] = createControlData(DataType.DECIMAL, SONUMERICCONTROL, "FormattedField", "FormattedField", false); - oControlData[11] = createControlData(DataType.CHAR, SOTEXTBOX, "TextField", "TextField", false); - oControlData[12] = createControlData(DataType.VARCHAR, SOTEXTBOX, "TextField", "TextField", true); - oControlData[13] = createControlData(DataType.LONGVARCHAR, SOTEXTBOX, "TextField", "TextField", true); - oControlData[14] = createControlData(DataType.DATE, SODATECONTROL, "DateField", "DateField", false); - oControlData[15] = createControlData(DataType.TIME, SOTIMECONTROL, "TimeField", "TimeField", false); - oControlData[16] = createControlData(DataType.TIMESTAMP, SODATECONTROL, "DateField", "TextField", false); + oControlData[0] = createControlData(DataType.BIT, SOCHECKBOX, CHECKBOX, CHECKBOX, false); + oControlData[1] = createControlData(DataType.BOOLEAN, SOCHECKBOX, CHECKBOX, CHECKBOX, false); + oControlData[2] = createControlData(DataType.TINYINT, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[3] = createControlData(DataType.SMALLINT, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[4] = createControlData(DataType.INTEGER, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[5] = createControlData(DataType.BIGINT, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[6] = createControlData(DataType.FLOAT, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[7] = createControlData(DataType.REAL, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[8] = createControlData(DataType.DOUBLE, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[9] = createControlData(DataType.NUMERIC, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[10] = createControlData(DataType.DECIMAL, SONUMERICCONTROL, FORMATTEDFIELD, FORMATTEDFIELD, false); + oControlData[11] = createControlData(DataType.CHAR, SOTEXTBOX, TEXTFIELD, TEXTFIELD, false); + oControlData[12] = createControlData(DataType.VARCHAR, SOTEXTBOX, TEXTFIELD, TEXTFIELD, true); + oControlData[13] = createControlData(DataType.LONGVARCHAR, SOTEXTBOX, TEXTFIELD, TEXTFIELD, true); + oControlData[14] = createControlData(DataType.DATE, SODATECONTROL, DATEFIELD, DATEFIELD, false); + oControlData[15] = createControlData(DataType.TIME, SOTIMECONTROL, TIMEFIELD, TIMEFIELD, false); + oControlData[16] = createControlData(DataType.TIMESTAMP, SODATECONTROL, DATEFIELD, TEXTFIELD, false); // oImageControlData = new ControlData[4]; - oControlData[17] = createControlData(DataType.BINARY, SOIMAGECONTROL, "ImageControl", "TextField", false); - oControlData[18] = createControlData(DataType.VARBINARY, SOIMAGECONTROL, "ImageControl", "TextField", false); - oControlData[19] = createControlData(DataType.LONGVARBINARY, SOIMAGECONTROL, "ImageControl", "TextField", false); - oControlData[20] = createControlData(DataType.BLOB, SOIMAGECONTROL, "ImageControl", "TextField", false); + oControlData[17] = createControlData(DataType.BINARY, SOIMAGECONTROL, IMAGECONTROL, TEXTFIELD, false); + oControlData[18] = createControlData(DataType.VARBINARY, SOIMAGECONTROL, IMAGECONTROL, TEXTFIELD, false); + oControlData[19] = createControlData(DataType.LONGVARBINARY, SOIMAGECONTROL, IMAGECONTROL, TEXTFIELD, false); + oControlData[20] = createControlData(DataType.BLOB, SOIMAGECONTROL, IMAGECONTROL, TEXTFIELD, false); - oControlData[21] = createControlData(DataType.OTHER, SOIMAGECONTROL, "ImageControl", "TextField", false); + oControlData[21] = createControlData(DataType.OTHER, SOIMAGECONTROL, IMAGECONTROL, TEXTFIELD, false); } public int getControlType(int _fieldtype) @@ -209,8 +217,7 @@ public class FormHandler public XNameContainer getDocumentForms() { - XNameContainer xNamedForms = xFormsSupplier.getForms(); - return xNamedForms; + return xFormsSupplier.getForms(); } public String getValueofHiddenControl(XNameAccess xNamedForm, String ControlName, String sMsg) throws com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException @@ -238,7 +245,7 @@ public class FormHandler try { XInterface xHiddenControl; - if (xNameAccess.hasByName(ControlName) == true) + if (xNameAccess.hasByName(ControlName)) { xHiddenControl = (XInterface) AnyConverter.toObject(new Type(XInterface.class), xNameAccess.getByName(ControlName)); } @@ -249,9 +256,9 @@ public class FormHandler } Helper.setUnoPropertyValue(xHiddenControl, "HiddenValue", ControlValue); } - catch (Exception exception) + catch (Exception ex) { - exception.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, ex); } } @@ -285,9 +292,9 @@ public class FormHandler xNamedFormContainer.removeByName(_FormName); } } - catch (com.sun.star.uno.Exception exception) + catch (com.sun.star.uno.Exception ex) { - exception.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, ex); } } @@ -306,7 +313,7 @@ public class FormHandler } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } } @@ -318,11 +325,11 @@ public class FormHandler } catch ( WrappedTargetException e ) { - e.printStackTrace( System.err ); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } catch( final NoSuchElementException e ) { - e.printStackTrace( System.err ); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } } @@ -363,9 +370,9 @@ public class FormHandler return getFormByName(_FormName); } } - catch (com.sun.star.uno.Exception exception) + catch (com.sun.star.uno.Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); return null; } } @@ -393,7 +400,7 @@ public class FormHandler } catch (IllegalArgumentException e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } return xNamedForm; } @@ -490,7 +497,7 @@ public class FormHandler } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } } @@ -538,7 +545,7 @@ public class FormHandler } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); return null; } } @@ -586,9 +593,9 @@ public class FormHandler XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, this.xMSFDoc.createInstance("com.sun.star.text.DocumentSettings")); xPropertySet.setPropertyValue("DoNotCaptureDrawObjsOnPage", new Boolean(!_bCaptureObjects)); } - catch (Exception ex) + catch (Exception e) { - ex.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } } } diff --git a/wizards/com/sun/star/wizards/document/GridControl.java b/wizards/com/sun/star/wizards/document/GridControl.java index ef13d5c12a66..284dc5ef4309 100644 --- a/wizards/com/sun/star/wizards/document/GridControl.java +++ b/wizards/com/sun/star/wizards/document/GridControl.java @@ -76,7 +76,7 @@ public class GridControl extends Shape FieldColumn curfieldcolumn = fieldcolumns[i]; if (curfieldcolumn.getFieldType() == DataType.TIMESTAMP) { - TimeStampControl oControl = new TimeStampControl(new Resource(_xMSF, "", "dbw"), this, curfieldcolumn); + TimeStampControl oControl = new TimeStampControl(new Resource(_xMSF, PropertyNames.EMPTY_STRING, "dbw"), this, curfieldcolumn); } else { diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.java b/wizards/com/sun/star/wizards/document/OfficeDocument.java index ea132453bb30..5e745dee7963 100644 --- a/wizards/com/sun/star/wizards/document/OfficeDocument.java +++ b/wizards/com/sun/star/wizards/document/OfficeDocument.java @@ -87,7 +87,7 @@ public class OfficeDocument oEventProperties[0].Name = "EventType"; oEventProperties[0].Value = EventType; // "Service", "StarBasic" oEventProperties[1] = new PropertyValue(); - oEventProperties[1].Name = "Script"; //"URL"; + oEventProperties[1].Name = "Script"; //PropertyNames.URL; oEventProperties[1].Value = EventURL; xEventsSuppl.getEvents().replaceByName(EventName, oEventProperties); } @@ -131,7 +131,7 @@ public class OfficeDocument PropertyValue[] loadValues = new PropertyValue[2]; loadValues[0] = new PropertyValue(); - loadValues[0].Name = "ReadOnly"; + loadValues[0].Name = PropertyNames.READ_ONLY; loadValues[0].Value = readonly ? Boolean.TRUE : Boolean.FALSE; loadValues[1] = new PropertyValue(); loadValues[1].Name = "Preview"; @@ -145,7 +145,7 @@ public class OfficeDocument try { xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, frame); - /*if (frame.getName() == null || frame.getName().equals("")); + /*if (frame.getName() == null || frame.getName().equals(PropertyNames.EMPTY_STRING)); frame.setName("T" + System.currentTimeMillis());*/ XComponent xComponent = xComponentLoader.loadComponentFromURL(sURL, "_self", 0, loadValues); @@ -389,13 +389,13 @@ public class OfficeDocument PropertyValue[][] mediaDescr = new PropertyValue[1][1]; mediaDescr[0][0] = new PropertyValue(); - mediaDescr[0][0].Name = "URL"; + mediaDescr[0][0].Name = PropertyNames.URL; mediaDescr[0][0].Value = url; String type = ((XTypeDetection) UnoRuntime.queryInterface(XTypeDetection.class, typeDetect)).queryTypeByDescriptor(mediaDescr, true); XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, typeDetect); - if (type.equals("")) + if (type.equals(PropertyNames.EMPTY_STRING)) { return null; } diff --git a/wizards/com/sun/star/wizards/document/TimeStampControl.java b/wizards/com/sun/star/wizards/document/TimeStampControl.java index 88733ee883c1..0ca625062e67 100644 --- a/wizards/com/sun/star/wizards/document/TimeStampControl.java +++ b/wizards/com/sun/star/wizards/document/TimeStampControl.java @@ -105,8 +105,8 @@ public class TimeStampControl extends DatabaseControl oResource = _oResource; sDateAppendix = oResource.getResText(UIConsts.RID_FORM + 88); sTimeAppendix = oResource.getResText(UIConsts.RID_FORM + 89); - oDateControl = new DatabaseControl(_oGridControl, _curfieldcolumn, DataType.DATE, _curfieldcolumn.getFieldTitle() + " " + sDateAppendix); - oTimeControl = new DatabaseControl(_oGridControl, _curfieldcolumn, DataType.TIME, _curfieldcolumn.getFieldTitle() + " " + sTimeAppendix); + oDateControl = new DatabaseControl(_oGridControl, _curfieldcolumn, DataType.DATE, _curfieldcolumn.getFieldTitle() + PropertyNames.SPACE + sDateAppendix); + oTimeControl = new DatabaseControl(_oGridControl, _curfieldcolumn, DataType.TIME, _curfieldcolumn.getFieldTitle() + PropertyNames.SPACE + sTimeAppendix); } public void setPropertyValue(String _sPropertyName, Object _aPropertyValue) throws Exception diff --git a/wizards/com/sun/star/wizards/fax/CallWizard.java b/wizards/com/sun/star/wizards/fax/CallWizard.java index 69e061f95918..fd0ad8307a4e 100644 --- a/wizards/com/sun/star/wizards/fax/CallWizard.java +++ b/wizards/com/sun/star/wizards/fax/CallWizard.java @@ -38,6 +38,7 @@ import com.sun.star.registry.XRegistryKey; import com.sun.star.task.XJob; import com.sun.star.task.XJobExecutor; import com.sun.star.uno.Type; +import com.sun.star.wizards.common.PropertyNames; /** * This class capsulates the class, that implements the minimal component, a factory for @@ -105,7 +106,7 @@ public class CallWizard */ public void trigger(String str) { - if (str.equalsIgnoreCase("start")) + if (str.equalsIgnoreCase(PropertyNames.START)) { FaxWizardDialogImpl lw = new FaxWizardDialogImpl(xmultiservicefactory); if (!FaxWizardDialogImpl.running) @@ -189,7 +190,7 @@ public class CallWizard try { - byteReturn = ("" + this.hashCode()).getBytes(); + byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.java b/wizards/com/sun/star/wizards/fax/FaxDocument.java index 7cb8178d3264..d429ee42d2b8 100644 --- a/wizards/com/sun/star/wizards/fax/FaxDocument.java +++ b/wizards/com/sun/star/wizards/fax/FaxDocument.java @@ -153,7 +153,7 @@ public class FaxDocument extends TextDocument } else { - myFieldHandler.changeUserFieldContent(sFieldName, ""); + myFieldHandler.changeUserFieldContent(sFieldName, PropertyNames.EMPTY_STRING); } } @@ -179,7 +179,7 @@ public class FaxDocument extends TextDocument public void killEmptyUserFields() { TextFieldHandler myFieldHandler = new TextFieldHandler(xMSF, xTextDocument); - myFieldHandler.removeUserFieldByContent(""); + myFieldHandler.removeUserFieldByContent(PropertyNames.EMPTY_STRING); } public void killEmptyFrames() diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java index b249bdd76035..02ccab6b177e 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java @@ -179,7 +179,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD lblTitle1 = insertLabel("lblTitle1", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -305,7 +305,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD lblTitle3 = insertLabel("lblTitle3", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -453,7 +453,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD lblTitle4 = insertLabel("lblTitle4", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -511,7 +511,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD lblFooter = insertLabel("lblFooter", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -520,7 +520,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD lblTitle5 = insertLabel("lblTitle5", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -617,7 +617,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD lblTitle6 = insertLabel("lblTitle6", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java index 8ee9f0472c57..36d1d4af9add 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java @@ -162,7 +162,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog //update the dialog UI according to the loaded Configuration updateUI(); - if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase("")) + if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase(PropertyNames.EMPTY_STRING)) { myPathSelection.initializePath(); } @@ -217,7 +217,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog //myFaxDoc.xTextDocument.lockControllers(); FileAccess fileAccess = new FileAccess(xMSF); sPath = myPathSelection.getSelectedPath(); - if (sPath.equals("")) + if (sPath.equals(PropertyNames.EMPTY_STRING)) { myPathSelection.triggerPathPicker(); sPath = myPathSelection.getSelectedPath(); @@ -356,7 +356,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog PropertyValue GraphicValues[] = new PropertyValue[1]; GraphicValues[0] = new PropertyValue(); - GraphicValues[0].Name = "URL"; + GraphicValues[0].Name = PropertyNames.URL; GraphicValues[0].Value = "private:resource/svx/imagelist/18000/18022"; XGraphic xGraphic = xGraphicProvider.queryGraphic(GraphicValues); @@ -380,7 +380,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog try { sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard"); - sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", ""); + sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", PropertyNames.EMPTY_STRING); sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap"); } catch (NoValidPathException e) @@ -395,19 +395,19 @@ public class FaxWizardDialogImpl extends FaxWizardDialog { String sFaxSubPath = "/wizard/fax"; sFaxPath = FileAccess.combinePaths(xMSF, sTemplatePath, sFaxSubPath); - sWorkPath = FileAccess.getOfficePath(xMSF, "Work", "", ""); + sWorkPath = FileAccess.getOfficePath(xMSF, "Work", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus", sFaxPath); PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri", sFaxPath); - setControlProperty("lstBusinessStyle", "StringItemList", BusinessFiles[0]); - setControlProperty("lstPrivateStyle", "StringItemList", PrivateFiles[0]); + setControlProperty("lstBusinessStyle", PropertyNames.STRING_ITEM_LIST, BusinessFiles[0]); + setControlProperty("lstPrivateStyle", PropertyNames.STRING_ITEM_LIST, PrivateFiles[0]); - setControlProperty("lstBusinessStyle", "SelectedItems", new short[] + setControlProperty("lstBusinessStyle", PropertyNames.SELECTED_ITEMS, new short[] { 0 }); - setControlProperty("lstPrivateStyle", "SelectedItems", new short[] + setControlProperty("lstPrivateStyle", PropertyNames.SELECTED_ITEMS, new short[] { 0 }); @@ -432,34 +432,34 @@ public class FaxWizardDialogImpl extends FaxWizardDialog public void initializeSalutation() { - setControlProperty("lstSalutation", "StringItemList", resources.SalutationLabels); + setControlProperty("lstSalutation", PropertyNames.STRING_ITEM_LIST, resources.SalutationLabels); } public void initializeGreeting() { - setControlProperty("lstGreeting", "StringItemList", resources.GreetingLabels); + setControlProperty("lstGreeting", PropertyNames.STRING_ITEM_LIST, resources.GreetingLabels); } public void initializeCommunication() { - setControlProperty("lstCommunicationType", "StringItemList", resources.CommunicationLabels); + setControlProperty("lstCommunicationType", PropertyNames.STRING_ITEM_LIST, resources.CommunicationLabels); } private void setDefaultForGreetingAndSalutationAndCommunication() { XTextComponent xTextComponent; xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); - if (xTextComponent.getText().equals("")) + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.SalutationLabels[0]); } xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); - if (xTextComponent.getText().equals("")) + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.GreetingLabels[0]); } xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType); - if (xTextComponent.getText().equals("")) + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.CommunicationLabels[0]); } diff --git a/wizards/com/sun/star/wizards/form/CallFormWizard.java b/wizards/com/sun/star/wizards/form/CallFormWizard.java index 0538eb5fa1b3..f53fef4dd90e 100644 --- a/wizards/com/sun/star/wizards/form/CallFormWizard.java +++ b/wizards/com/sun/star/wizards/form/CallFormWizard.java @@ -29,6 +29,7 @@ package com.sun.star.wizards.form; import com.sun.star.beans.PropertyValue; import com.sun.star.uno.Type; import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.common.PropertyNames; /** This class capsulates the class, that implements the minimal component, a * factory for creating the service (<CODE>__getServiceFactory</CODE>). @@ -81,7 +82,7 @@ public class CallFormWizard { try { - if (sEvent.compareTo("start") == 0) + if (sEvent.compareTo(PropertyNames.START) == 0) { FormWizard CurFormWizard = new FormWizard( m_serviceFactory, m_wizardContext ); CurFormWizard.startFormWizard(); @@ -159,7 +160,7 @@ public class CallFormWizard try { - byteReturn = new String("" + this.hashCode()).getBytes(); + byteReturn = new String(PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { diff --git a/wizards/com/sun/star/wizards/form/FieldLinker.java b/wizards/com/sun/star/wizards/form/FieldLinker.java index 056d06934f55..e9671aaf91c0 100644 --- a/wizards/com/sun/star/wizards/form/FieldLinker.java +++ b/wizards/com/sun/star/wizards/form/FieldLinker.java @@ -81,8 +81,8 @@ public class FieldLinker extends DBLimitedFieldSelection SOTHIRDLINKLST = 2; SOFOURTHLINKLST = 3; IListBoxPosX = new Integer(iCompPosX + 6); - sSlaveListHeader = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_FORM + 20, 4); //new String[rowcount];""; //CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 40); - sMasterListHeader = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_FORM + 24, 4);// new String[rowcount];""; //CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 40); + sSlaveListHeader = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_FORM + 20, 4); //new String[rowcount];PropertyNames.EMPTY_STRING; //CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 40); + sMasterListHeader = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_FORM + 24, 4);// new String[rowcount];PropertyNames.EMPTY_STRING; //CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 40); SOLINKLST = new int[] { SOFIRSTLINKLST, SOSECLINKLST, SOTHIRDLINKLST, SOFOURTHLINKLST @@ -212,8 +212,8 @@ public class FieldLinker extends DBLimitedFieldSelection Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); if (bDoEnable == false) { - Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[i]), "SelectedItems", new short[] { 0 }); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[i]), "SelectedItems", new short[] { 0 }); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[i]), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[i]), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); } } } @@ -225,11 +225,11 @@ public class FieldLinker extends DBLimitedFieldSelection if ((iNextMasterItemPos != 0) && (iNextSlaveItemPos != 0)) { - Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[curindex]), "SelectedItems", new short[] {iNextMasterItemPos }); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[curindex]), "SelectedItems", new short[] {iNextSlaveItemPos}); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[curindex]), PropertyNames.SELECTED_ITEMS, new short[] {iNextMasterItemPos }); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[curindex]), PropertyNames.SELECTED_ITEMS, new short[] {iNextSlaveItemPos}); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[curindex + 1]), "SelectedItems", new short[] { 0 }); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[curindex + 1]), "SelectedItems", new short[] { 0 }); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[curindex + 1]), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[curindex + 1]), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); toggleControlRow(curindex, true); } } diff --git a/wizards/com/sun/star/wizards/form/Finalizer.java b/wizards/com/sun/star/wizards/form/Finalizer.java index 997b9a885676..199e55d2ebb6 100644 --- a/wizards/com/sun/star/wizards/form/Finalizer.java +++ b/wizards/com/sun/star/wizards/form/Finalizer.java @@ -73,7 +73,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGFORM_TXTPATH", 97, 35, UIConsts.INTEGERS[8], new Short((short) 82), "", 185 + UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGFORM_TXTPATH", 97, 35, UIConsts.INTEGERS[8], new Short((short) 82), PropertyNames.EMPTY_STRING, 185 }); CurUnoDialog.insertLabel("lblProceed", new String[] diff --git a/wizards/com/sun/star/wizards/form/FormConfiguration.java b/wizards/com/sun/star/wizards/form/FormConfiguration.java index f8cc43a1833b..b6f6c476b84c 100644 --- a/wizards/com/sun/star/wizards/form/FormConfiguration.java +++ b/wizards/com/sun/star/wizards/form/FormConfiguration.java @@ -161,7 +161,7 @@ public class FormConfiguration oRelationController = _oRelationController; sreferencedTables = oRelationController.getExportedKeys(); bsupportsRelations = (sreferencedTables.length > 0); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstRelations), "StringItemList", sreferencedTables); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstRelations), PropertyNames.STRING_ITEM_LIST, sreferencedTables); this.CurSubFormFieldSelection = _CurSubFormFieldSelection; toggleRelationsListbox(); Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), PropertyNames.PROPERTY_ENABLED, new Boolean(bsupportsRelations && (chkcreateSubForm.getState() == 1))); @@ -195,7 +195,7 @@ public class FormConfiguration { if (areexistingRelationsdefined()) { - short[] iselected = (short[]) Helper.getUnoArrayPropertyValue(UnoDialog.getModel(lstRelations), "SelectedItems"); + short[] iselected = (short[]) Helper.getUnoArrayPropertyValue(UnoDialog.getModel(lstRelations), PropertyNames.SELECTED_ITEMS); if (iselected != null) { if (iselected.length > 0) @@ -204,7 +204,7 @@ public class FormConfiguration } } } - return ""; + return PropertyNames.EMPTY_STRING; } public void onexistingRelationSelection() diff --git a/wizards/com/sun/star/wizards/form/FormControlArranger.java b/wizards/com/sun/star/wizards/form/FormControlArranger.java index 8d76f65f6435..916c92621efa 100644 --- a/wizards/com/sun/star/wizards/form/FormControlArranger.java +++ b/wizards/com/sun/star/wizards/form/FormControlArranger.java @@ -363,7 +363,7 @@ public class FormControlArranger m_currentMaxRowHeight = 0; nSecMaxRowY = 0; m_maxPostionX = 0; - xProgressBar.start("", FieldColumns.length); + xProgressBar.start(PropertyNames.EMPTY_STRING, FieldColumns.length); for (int i = 0; i < FieldColumns.length; i++) { try @@ -596,7 +596,7 @@ public class FormControlArranger { curLabelControl.setSize(new Size(m_LabelWidth, m_LabelHeight)); } -// if (CurHelpText != ""){ +// if (CurHelpText != PropertyNames.EMPTY_STRING){ // oModel.HelpText = CurHelptext; // } } @@ -630,7 +630,7 @@ public class FormControlArranger if (DBControlList[i].getControlType() == FormHandler.SOCHECKBOX) { // Checkboxes have no Label near by - DBControlList[i].setPropertyValue(PropertyNames.PROPERTY_LABEL, ""); + DBControlList[i].setPropertyValue(PropertyNames.PROPERTY_LABEL, PropertyNames.EMPTY_STRING); } } } diff --git a/wizards/com/sun/star/wizards/form/FormDocument.java b/wizards/com/sun/star/wizards/form/FormDocument.java index 8749f2ce39e8..63bd67a9f0ce 100644 --- a/wizards/com/sun/star/wizards/form/FormDocument.java +++ b/wizards/com/sun/star/wizards/form/FormDocument.java @@ -316,7 +316,7 @@ public class FormDocument extends TextDocument ControlForm oSubControlForm = getControlFormByName(SOSUBFORM); oSubControlForm.setFormProperties(aFormProperties, oSubFormDBMetaData); String sRefTableName = _curFormConfiguration.getreferencedTableName(); - if (sRefTableName.equals("")) + if (sRefTableName.equals(PropertyNames.EMPTY_STRING)) { LinkFieldNames = _curFieldLinker.getLinkFieldNames(); } @@ -512,8 +512,8 @@ public class FormDocument extends TextDocument try { xPropertySet.setPropertyValue("DataSourceName", getDataSourceName()); - xPropertySet.setPropertyValue("Command", _oDBMetaData.getCommandName()); - xPropertySet.setPropertyValue("CommandType", new Integer(_oDBMetaData.getCommandType())); + xPropertySet.setPropertyValue(PropertyNames.COMMAND, _oDBMetaData.getCommandName()); + xPropertySet.setPropertyValue(PropertyNames.COMMAND_TYPE, new Integer(_oDBMetaData.getCommandType())); for (int i = 0; i < _aPropertySetList.length; i++) { xPropertySet.setPropertyValue(_aPropertySetList[i].Name, _aPropertySetList[i].Value); diff --git a/wizards/com/sun/star/wizards/form/FormWizard.java b/wizards/com/sun/star/wizards/form/FormWizard.java index bc49311be433..101c054a2c2b 100644 --- a/wizards/com/sun/star/wizards/form/FormWizard.java +++ b/wizards/com/sun/star/wizards/form/FormWizard.java @@ -56,8 +56,8 @@ public class FormWizard extends DatabaseObjectWizard private Finalizer curFinalizer; private static String slblFields; private static String slblSelFields; - private String sShowBinaryFields = ""; - private String serrFormNameexists = ""; + private String sShowBinaryFields = PropertyNames.EMPTY_STRING; + private String serrFormNameexists = PropertyNames.EMPTY_STRING; public static final int SOMAIN_PAGE = 1; public static final int SOSUBFORM_PAGE = 2; public static final int SOSUBFORMFIELDS_PAGE = 3; @@ -343,7 +343,7 @@ public class FormWizard extends DatabaseObjectWizard { curFormDocument.oSubFormDBMetaData.getConnection(new PropertyValue[] { - Properties.createProperty("ActiveConnection", curFormDocument.oMainFormDBMetaData.DBConnection) + Properties.createProperty(PropertyNames.ACTIVE_CONNECTION, curFormDocument.oMainFormDBMetaData.DBConnection) }); curFormDocument.xProgressBar.setValue(20); buildSteps(); @@ -398,7 +398,7 @@ public class FormWizard extends DatabaseObjectWizard ID = 1; if (sIncSuffix != null) { - if ((!sIncSuffix.equals("")) && (!sIncSuffix.equals("_"))) + if ((!sIncSuffix.equals(PropertyNames.EMPTY_STRING)) && (!sIncSuffix.equals("_"))) { String sID = JavaTools.ArrayoutofString(sIncSuffix, "_")[1]; ID = Integer.parseInt(sID); diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java index 3ce766717c07..657ca504fcfb 100644 --- a/wizards/com/sun/star/wizards/form/StyleApplier.java +++ b/wizards/com/sun/star/wizards/form/StyleApplier.java @@ -122,7 +122,7 @@ public class StyleApplier lstStyles = CurUnoDialog.insertListBox("lstStyles", null, SCHANGELAYOUT, this, new String[] { - PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "SelectedItems", PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.SELECTED_ITEMS, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -177,7 +177,7 @@ public class StyleApplier /* public void initialize(short _iStyleindex){ if (_iStyleindex < lstStyles.getItemCount()){ - Helper.setUnoPropertyValue(UnoDialog.getModel(lstStyles), "SelectedItems", new short[]{_iStyleindex}); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstStyles), PropertyNames.SELECTED_ITEMS, new short[]{_iStyleindex}); applyStyle(true, false); } } @@ -208,7 +208,7 @@ public class StyleApplier { try { - short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(lstStyles), "SelectedItems")); + short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(lstStyles), PropertyNames.SELECTED_ITEMS)); if (SelFields != null) { return SelFields[0]; @@ -331,7 +331,7 @@ public class StyleApplier int index = JavaTools.FieldInList(_sDataList, _sHeader); if (index > -1) { - String sPropName = ""; + String sPropName = PropertyNames.EMPTY_STRING; int iStyleColor; while (((sPropName.indexOf("}") < 0) && (index < _sDataList.length - 1))) { @@ -345,8 +345,8 @@ public class StyleApplier sPropValue = sPropValue.trim(); if (sPropValue.indexOf("#") > 0) { - sPropValue = JavaTools.replaceSubString(sPropValue, "", ";"); - sPropValue = JavaTools.replaceSubString(sPropValue, "", " "); + sPropValue = JavaTools.replaceSubString(sPropValue, PropertyNames.EMPTY_STRING, PropertyNames.SEMI_COLON); + sPropValue = JavaTools.replaceSubString(sPropValue, PropertyNames.EMPTY_STRING, PropertyNames.SPACE); return Integer.decode(sPropValue).intValue(); } } @@ -367,7 +367,7 @@ public class StyleApplier try { // TODO: check different languages in header layouts - aStylePaths = FileAccess.getOfficePaths(getMSF(), "Config", "", ""); + aStylePaths = FileAccess.getOfficePaths(getMSF(), "Config", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); FileAccess.combinePaths(getMSF(), aStylePaths, "/wizard/form/styles"); String[][] LayoutFiles = FileAccess.getFolderTitles(getMSF(), null, aStylePaths, ".css"); @@ -384,10 +384,10 @@ public class StyleApplier private String getStylePath() { // TODO: umstellen auf mehrere Pfade - String StylesPath = ""; + String StylesPath = PropertyNames.EMPTY_STRING; try { - StylesPath = FileAccess.getOfficePath(xMSF, "Config", "", ""); + StylesPath = FileAccess.getOfficePath(xMSF, "Config", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); StylesPath = FileAccess.combinePaths(xMSF, StylesPath, "/wizard/form/styles"); } catch (NoValidPathException e) diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java index cbab5c8c8ae6..678ed88962b0 100644 --- a/wizards/com/sun/star/wizards/form/UIControlArranger.java +++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java @@ -191,7 +191,7 @@ public class UIControlArranger { if (listItem == null) { - return ""; + return PropertyNames.EMPTY_STRING; } return HelpTexts[((Integer) listItem).intValue()]; diff --git a/wizards/com/sun/star/wizards/letter/CallWizard.java b/wizards/com/sun/star/wizards/letter/CallWizard.java index ff993c61e506..250d59aea19f 100644 --- a/wizards/com/sun/star/wizards/letter/CallWizard.java +++ b/wizards/com/sun/star/wizards/letter/CallWizard.java @@ -38,6 +38,7 @@ import com.sun.star.registry.XRegistryKey; import com.sun.star.task.XJob; import com.sun.star.task.XJobExecutor; import com.sun.star.uno.Type; +import com.sun.star.wizards.common.PropertyNames; /** * This class capsulates the class, that implements the minimal component, a factory for @@ -105,7 +106,7 @@ public class CallWizard */ public void trigger(String str) { - if (str.equalsIgnoreCase("start")) + if (str.equalsIgnoreCase(PropertyNames.START)) { LetterWizardDialogImpl lw = new LetterWizardDialogImpl(xmultiservicefactory); if (!LetterWizardDialogImpl.running) @@ -189,7 +190,7 @@ public class CallWizard try { - byteReturn = ("" + this.hashCode()).getBytes(); + byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { diff --git a/wizards/com/sun/star/wizards/letter/LetterDocument.java b/wizards/com/sun/star/wizards/letter/LetterDocument.java index 3160ff1ed011..361e7d3da43d 100644 --- a/wizards/com/sun/star/wizards/letter/LetterDocument.java +++ b/wizards/com/sun/star/wizards/letter/LetterDocument.java @@ -158,7 +158,7 @@ public class LetterDocument extends TextDocument } else { - myFieldHandler.changeUserFieldContent(sFieldName, ""); + myFieldHandler.changeUserFieldContent(sFieldName, PropertyNames.EMPTY_STRING); } } @@ -183,7 +183,7 @@ public class LetterDocument extends TextDocument public void killEmptyUserFields() { TextFieldHandler myFieldHandler = new TextFieldHandler(xMSF, xTextDocument); - myFieldHandler.removeUserFieldByContent(""); + myFieldHandler.removeUserFieldByContent(PropertyNames.EMPTY_STRING); } public void killEmptyFrames() diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java index c8de529d2d41..2f3f87f244ff 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java @@ -246,7 +246,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW lblTitle1 = insertLabel("lblTitle1", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -499,7 +499,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW lblTitle2 = insertLabel("lblTitle2", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -620,7 +620,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW lblTitle3 = insertLabel("lblTitle3", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -768,7 +768,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW lblTitle4 = insertLabel("lblTitle4", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -808,7 +808,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW lblFooter = insertLabel("lblFooter", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -817,7 +817,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW lblTitle5 = insertLabel("lblTitle5", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -902,7 +902,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW lblTitle6 = insertLabel("lblTitle6", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java index 295d900bdec6..6f4503d3936a 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java @@ -177,27 +177,27 @@ public class LetterWizardDialogImpl extends LetterWizardDialog myConfig.cp_PrivateLetter.cp_Norm = oL; initializeTemplates(xMSF); - if (myConfig.cp_BusinessLetter.cp_Greeting.equals("")) + if (myConfig.cp_BusinessLetter.cp_Greeting.equals(PropertyNames.EMPTY_STRING)) { myConfig.cp_BusinessLetter.cp_Greeting = resources.GreetingLabels[0]; } - if (myConfig.cp_BusinessLetter.cp_Salutation.equals("")) + if (myConfig.cp_BusinessLetter.cp_Salutation.equals(PropertyNames.EMPTY_STRING)) { myConfig.cp_BusinessLetter.cp_Salutation = resources.SalutationLabels[0]; } - if (myConfig.cp_PrivateOfficialLetter.cp_Greeting.equals("")) + if (myConfig.cp_PrivateOfficialLetter.cp_Greeting.equals(PropertyNames.EMPTY_STRING)) { myConfig.cp_PrivateOfficialLetter.cp_Greeting = resources.GreetingLabels[1]; } - if (myConfig.cp_PrivateOfficialLetter.cp_Salutation.equals("")) + if (myConfig.cp_PrivateOfficialLetter.cp_Salutation.equals(PropertyNames.EMPTY_STRING)) { myConfig.cp_PrivateOfficialLetter.cp_Salutation = resources.SalutationLabels[1]; } - if (myConfig.cp_PrivateLetter.cp_Greeting.equals("")) + if (myConfig.cp_PrivateLetter.cp_Greeting.equals(PropertyNames.EMPTY_STRING)) { myConfig.cp_PrivateLetter.cp_Greeting = resources.GreetingLabels[2]; } - if (myConfig.cp_PrivateLetter.cp_Salutation.equals("")) + if (myConfig.cp_PrivateLetter.cp_Salutation.equals(PropertyNames.EMPTY_STRING)) { myConfig.cp_PrivateLetter.cp_Salutation = resources.SalutationLabels[2]; } @@ -205,7 +205,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog //update the dialog UI according to the loaded Configuration updateUI(); - if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase("")) + if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase(PropertyNames.EMPTY_STRING)) { myPathSelection.initializePath(); } @@ -258,7 +258,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog //myLetterDoc.xTextDocument.lockControllers(); FileAccess fileAccess = new FileAccess(xMSF); sPath = myPathSelection.getSelectedPath(); - if (sPath.equals("")) + if (sPath.equals(PropertyNames.EMPTY_STRING)) { myPathSelection.triggerPathPicker(); sPath = myPathSelection.getSelectedPath(); @@ -383,7 +383,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog lstBusinessStyleItemChanged(); enableSenderReceiver(); setPossibleFooter(true); - if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase("")) + if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase(PropertyNames.EMPTY_STRING)) { myPathSelection.initializePath(); } @@ -403,7 +403,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog disableBusinessPaper(); enableSenderReceiver(); setPossibleFooter(true); - if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase("")) + if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase(PropertyNames.EMPTY_STRING)) { myPathSelection.initializePath(); } @@ -423,7 +423,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog disableBusinessPaper(); disableSenderReceiver(); setPossibleFooter(false); - if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase("")) + if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase(PropertyNames.EMPTY_STRING)) { myPathSelection.initializePath(); } @@ -687,7 +687,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog //Height of the Company Address in the Receiver Field int iReceiverHeight = (int) (0.5 * 1000); - BusCompanyAddressReceiver = myLetterDoc.new BusinessPaperObject(" ", iFrameWidth, iReceiverHeight, iFrameX, (iFrameY - iReceiverHeight)); + BusCompanyAddressReceiver = myLetterDoc.new BusinessPaperObject(PropertyNames.SPACE, iFrameWidth, iReceiverHeight, iFrameX, (iFrameY - iReceiverHeight)); setPossibleAddressReceiver(false); } @@ -941,12 +941,12 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { XTextComponent xTextComponent; xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); - if (xTextComponent.getText().equals("")) + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.SalutationLabels[0]); } xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); - if (xTextComponent.getText().equals("")) + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.GreetingLabels[0]); } @@ -1099,12 +1099,12 @@ public class LetterWizardDialogImpl extends LetterWizardDialog public void initializeSalutation() { - setControlProperty("lstSalutation", "StringItemList", resources.SalutationLabels); + setControlProperty("lstSalutation", PropertyNames.STRING_ITEM_LIST, resources.SalutationLabels); } public void initializeGreeting() { - setControlProperty("lstGreeting", "StringItemList", resources.GreetingLabels); + setControlProperty("lstGreeting", PropertyNames.STRING_ITEM_LIST, resources.GreetingLabels); } public void initializeNorms() @@ -1114,19 +1114,19 @@ public class LetterWizardDialogImpl extends LetterWizardDialog String[] allLocales = lc.getIDs(); Object[] nameList = { - "", "" + PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING }; String[] nameList1 = { - "", "" + PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING }; String[] nameList1b = { - "", "" + PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING }; String[] nameList2 = { - "", "" + PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING }; Vector allPaths = new Vector(); String sLetterSubPath = "/wizard/letter/"; @@ -1135,7 +1135,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { sTemplatePath = FileAccess.deleteLastSlashfromUrl(sTemplatePath); String[] PathParts = sTemplatePath.split("/"); - String nuString = ""; + String nuString = PropertyNames.EMPTY_STRING; String sMainPath; for (int i = 0; i < (PathParts.length - 1); i++) { @@ -1212,8 +1212,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog String[] LanguageLabels; boolean found = false; - String cIsoCode = ""; - String MSID = ""; + String cIsoCode = PropertyNames.EMPTY_STRING; + String MSID = PropertyNames.EMPTY_STRING; int z = 0; for (int i = 0; i < nameList.length; i++) { @@ -1221,7 +1221,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog cIsoCode = FileAccess.getFilename((String) nameList[i]); for (int t = 0; t < allLocales.length; t++) { - String[] aLang = allLocales[t].split(";"); + String[] aLang = allLocales[t].split(PropertyNames.SEMI_COLON); if (cIsoCode.equalsIgnoreCase(aLang[1])) { MSID = aLang[2]; @@ -1233,7 +1233,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { for (int t = 0; t < allLocales.length; t++) { - String[] aLang = allLocales[t].split(";"); + String[] aLang = allLocales[t].split(PropertyNames.SEMI_COLON); if (cIsoCode.equalsIgnoreCase(aLang[1].substring(0, 2))) { MSID = aLang[2]; @@ -1271,7 +1271,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog //NormPaths = new String[nameList.length]; //LanguageLabels = new String[Norms.length]; - setControlProperty("lstLetterNorm", "StringItemList", LanguageLabels); + setControlProperty("lstLetterNorm", PropertyNames.STRING_ITEM_LIST, LanguageLabels); } private CGLetter getCurrentLetter() @@ -1294,7 +1294,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog try { sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard"); - sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", ""); + sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", PropertyNames.EMPTY_STRING); sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/../wizard/bitmap"); } catch (NoValidPathException e) @@ -1315,19 +1315,19 @@ public class LetterWizardDialogImpl extends LetterWizardDialog OfficialFiles = FileAccess.getFolderTitles(xMSF, "off", sLetterPath); PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri", sLetterPath); - setControlProperty("lstBusinessStyle", "StringItemList", BusinessFiles[0]); - setControlProperty("lstPrivOfficialStyle", "StringItemList", OfficialFiles[0]); - setControlProperty("lstPrivateStyle", "StringItemList", PrivateFiles[0]); + setControlProperty("lstBusinessStyle", PropertyNames.STRING_ITEM_LIST, BusinessFiles[0]); + setControlProperty("lstPrivOfficialStyle", PropertyNames.STRING_ITEM_LIST, OfficialFiles[0]); + setControlProperty("lstPrivateStyle", PropertyNames.STRING_ITEM_LIST, PrivateFiles[0]); - setControlProperty("lstBusinessStyle", "SelectedItems", new short[] + setControlProperty("lstBusinessStyle", PropertyNames.SELECTED_ITEMS, new short[] { 0 }); - setControlProperty("lstPrivOfficialStyle", "SelectedItems", new short[] + setControlProperty("lstPrivOfficialStyle", PropertyNames.SELECTED_ITEMS, new short[] { 0 }); - setControlProperty("lstPrivateStyle", "SelectedItems", new short[] + setControlProperty("lstPrivateStyle", PropertyNames.SELECTED_ITEMS, new short[] { 0 }); diff --git a/wizards/com/sun/star/wizards/query/CallQueryWizard.java b/wizards/com/sun/star/wizards/query/CallQueryWizard.java index 76da8d5dee55..84870f99646e 100644 --- a/wizards/com/sun/star/wizards/query/CallQueryWizard.java +++ b/wizards/com/sun/star/wizards/query/CallQueryWizard.java @@ -31,6 +31,7 @@ import com.sun.star.beans.PropertyValue; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.Type; import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.common.PropertyNames; /** This class capsulates the class, that implements the minimal component, a * factory for creating the service (<CODE>__getServiceFactory</CODE>). @@ -81,15 +82,15 @@ public class CallQueryWizard { super(); m_serviceFactory = i_serviceFactory; - registerProperty( "Command", (short)( PropertyAttribute.READONLY | PropertyAttribute.MAYBEVOID ) ); - registerProperty( "CommandType", PropertyAttribute.READONLY ); + registerProperty( PropertyNames.COMMAND, (short)( PropertyAttribute.READONLY | PropertyAttribute.MAYBEVOID ) ); + registerProperty( PropertyNames.COMMAND_TYPE, PropertyAttribute.READONLY ); } public void trigger(String sEvent) { try { - if (sEvent.compareTo("start") == 0) + if (sEvent.compareTo(PropertyNames.START) == 0) { QueryWizard CurQueryWizard = new QueryWizard( m_serviceFactory, m_wizardContext ); Command = CurQueryWizard.startQueryWizard(); @@ -168,7 +169,7 @@ public class CallQueryWizard try { - byteReturn = ("" + this.hashCode()).getBytes(); + byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { diff --git a/wizards/com/sun/star/wizards/query/Finalizer.java b/wizards/com/sun/star/wizards/query/Finalizer.java index bfdb93c3bb02..ad11db4041d2 100644 --- a/wizards/com/sun/star/wizards/query/Finalizer.java +++ b/wizards/com/sun/star/wizards/query/Finalizer.java @@ -118,7 +118,7 @@ public class Finalizer }); m_queryWizard.insertTextField("txtSummary", 0, null, new String[] { - PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ReadOnly", PropertyNames.PROPERTY_STEP, "VScroll", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.READ_ONLY, PropertyNames.PROPERTY_STEP, "VScroll", PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -142,7 +142,7 @@ public class Finalizer String sCurQueryName = AnyConverter.toString(Helper.getUnoPropertyValue(UnoDialog.getModel(m_aTxtTitle), "Text")); if (sCurQueryName != null) { - if (sCurQueryName.equals("")) + if (sCurQueryName.equals(PropertyNames.EMPTY_STRING)) { String[] sCommandNames = CurDBMetaData.getIncludedCommandNames(); sCurQueryName = resQuery + "_" + sCommandNames[0]; @@ -158,7 +158,7 @@ public class Finalizer catch (com.sun.star.uno.Exception exception) { exception.printStackTrace(System.out); - return ""; + return PropertyNames.EMPTY_STRING; } } @@ -176,7 +176,7 @@ public class Finalizer ) return queryName; - return ""; + return PropertyNames.EMPTY_STRING; } public final boolean displayQueryDesign() diff --git a/wizards/com/sun/star/wizards/query/QuerySummary.java b/wizards/com/sun/star/wizards/query/QuerySummary.java index deb56499c3a4..76e670a848be 100644 --- a/wizards/com/sun/star/wizards/query/QuerySummary.java +++ b/wizards/com/sun/star/wizards/query/QuerySummary.java @@ -29,6 +29,7 @@ package com.sun.star.wizards.query; import com.sun.star.beans.PropertyValue; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.Resource; import com.sun.star.wizards.db.FieldColumn; import com.sun.star.wizards.db.QueryMetaData; @@ -62,12 +63,12 @@ public class QuerySummary extends QueryMetaData { try { - String sFieldNamesFraction = ""; - String sSortingFraction = ""; - String sFilterFraction = ""; - String sAggregateFraction = ""; - String sGroupByFraction = ""; - String sHavingFraction = ""; + String sFieldNamesFraction = PropertyNames.EMPTY_STRING; + String sSortingFraction = PropertyNames.EMPTY_STRING; + String sFilterFraction = PropertyNames.EMPTY_STRING; + String sAggregateFraction = PropertyNames.EMPTY_STRING; + String sGroupByFraction = PropertyNames.EMPTY_STRING; + String sHavingFraction = PropertyNames.EMPTY_STRING; sFieldNamesFraction = combineFieldNameFraction() + sReturnChar; sSortingFraction = combinePartString(RID_QUERY + 51, getSortFieldNames(), RID_QUERY + 52, RID_QUERY + 93, new String[] { @@ -83,7 +84,7 @@ public class QuerySummary extends QueryMetaData } // TODO: remove the last return from the string sSummary = sFieldNamesFraction + sSortingFraction + sFilterFraction + sAggregateFraction + sGroupByFraction + sHavingFraction; - sSummary = JavaTools.replaceSubString(sSummary, "", "~"); + sSummary = JavaTools.replaceSubString(sSummary, PropertyNames.EMPTY_STRING, "~"); } catch (com.sun.star.uno.Exception exception) { @@ -100,7 +101,7 @@ public class QuerySummary extends QueryMetaData { if (_filterconditions != null && _filterconditions.length > 0) { - String sconditions = ""; + String sconditions = PropertyNames.EMPTY_STRING; String sStart = oResource.getResText(_InitResID); String BaseString = oResource.getResText(RID_QUERY + 96); if (_filterconditions.length == 1) @@ -109,7 +110,7 @@ public class QuerySummary extends QueryMetaData for (int i = 0; i < curfilterconditions.length; i++) { sconditions += FilterComponent.getDisplayCondition(BaseString, _filterconditions[0][i], this); - sconditions = appendClauseSeparator(sconditions, " " + sAnd + " ", i, curfilterconditions.length); + sconditions = appendClauseSeparator(sconditions, PropertyNames.SPACE + sAnd + PropertyNames.SPACE, i, curfilterconditions.length); } } else @@ -118,7 +119,7 @@ public class QuerySummary extends QueryMetaData for (int i = 0; i < _filterconditions.length; i++) { sconditions += FilterComponent.getDisplayCondition(BaseString, _filterconditions[i][0], this); - sconditions = appendClauseSeparator(sconditions, " " + sOr + " ", i, _filterconditions.length); + sconditions = appendClauseSeparator(sconditions, PropertyNames.SPACE + sOr + PropertyNames.SPACE, i, _filterconditions.length); } } String sreturn = sStart + sconditions; @@ -129,7 +130,7 @@ public class QuerySummary extends QueryMetaData private String combineFieldNameFraction() { - String CurString = ""; + String CurString = PropertyNames.EMPTY_STRING; String sReturn = oResource.getResText(RID_QUERY + 50); String BaseString = oResource.getResText(RID_QUERY + 92); for (int i = 0; i < FieldColumns.length; i++) @@ -197,7 +198,7 @@ public class QuerySummary extends QueryMetaData public String ArrayFieldsToString(int _InitResID, String[][] _FieldNames, int _BaseStringID, String[] _ReplaceTags) { - String CurString = ""; + String CurString = PropertyNames.EMPTY_STRING; String sReturn = oResource.getResText(_InitResID); int FieldCount = _FieldNames.length; if (FieldCount > 0) diff --git a/wizards/com/sun/star/wizards/query/QueryWizard.java b/wizards/com/sun/star/wizards/query/QueryWizard.java index a0696a435e77..9d1a454f9497 100644 --- a/wizards/com/sun/star/wizards/query/QueryWizard.java +++ b/wizards/com/sun/star/wizards/query/QueryWizard.java @@ -501,7 +501,7 @@ public class QueryWizard extends DatabaseObjectWizard ID = 1; if (sIncSuffix != null) { - if ((!sIncSuffix.equals("")) && (!sIncSuffix.equals("_"))) + if ((!sIncSuffix.equals(PropertyNames.EMPTY_STRING)) && (!sIncSuffix.equals("_"))) { String sID = JavaTools.ArrayoutofString(sIncSuffix, "_")[1]; ID = Integer.parseInt(sID); diff --git a/wizards/com/sun/star/wizards/report/CallReportWizard.java b/wizards/com/sun/star/wizards/report/CallReportWizard.java index c66596e11c02..31d4555757ee 100644 --- a/wizards/com/sun/star/wizards/report/CallReportWizard.java +++ b/wizards/com/sun/star/wizards/report/CallReportWizard.java @@ -28,11 +28,13 @@ package com.sun.star.wizards.report; import com.sun.star.beans.PropertyValue; import com.sun.star.uno.Type; -import com.sun.star.uno.UnoRuntime; import com.sun.star.text.XTextDocument; import com.sun.star.wizards.common.Properties; import com.sun.star.sdb.application.XDatabaseDocumentUI; import com.sun.star.wizards.common.NamedValueCollection; +import com.sun.star.wizards.common.PropertyNames; +import java.util.logging.Level; +import java.util.logging.Logger; /** This class capsulates the class, that implements the minimal component, a * factory for creating the service (<CODE>__getServiceFactory</CODE>). @@ -114,7 +116,7 @@ public class CallReportWizard { try { - if (sEvent.compareTo("start") == 0) + if (sEvent.compareTo(PropertyNames.START) == 0) { if (bWizardstartedalready != true) { @@ -138,9 +140,9 @@ public class CallReportWizard } } } - catch (Exception exception) + catch (Exception e) { - System.err.println(exception); + Logger.getLogger(CallReportWizard.class.getName()).log(Level.SEVERE, null, e); } System.gc(); } @@ -212,11 +214,11 @@ public class CallReportWizard try { - byteReturn = new String("" + this.hashCode()).getBytes(); + byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } - catch (Exception exception) + catch (Exception e) { - System.err.println(exception); + Logger.getLogger(CallReportWizard.class.getName()).log(Level.SEVERE, null, e); } return (byteReturn); @@ -251,9 +253,9 @@ public class CallReportWizard new Type(com.sun.star.lang.XInitialization.class) }; } - catch (Exception exception) + catch (Exception e) { - System.err.println(exception); + Logger.getLogger(CallReportWizard.class.getName()).log(Level.SEVERE, null, e); } return (typeReturn); diff --git a/wizards/com/sun/star/wizards/report/DBColumn.java b/wizards/com/sun/star/wizards/report/DBColumn.java index ee60f3744000..556c1c1cdaee 100644 --- a/wizards/com/sun/star/wizards/report/DBColumn.java +++ b/wizards/com/sun/star/wizards/report/DBColumn.java @@ -257,7 +257,7 @@ public class DBColumn XTextCursor xTextCursor = TextDocument.createTextCursor(xNameCell); xTextCursor.gotoStart(false); xTextCursor.gotoEnd(true); - xTextCursor.setString(""); + xTextCursor.setString(PropertyNames.EMPTY_STRING); oTextFieldHandler.insertUserField(xTextCursor, CurDBField.getFieldName(), CurDBField.getFieldTitle()); } @@ -266,7 +266,7 @@ public class DBColumn XTextCursor xTextCursor = TextDocument.createTextCursor(xCell); xTextCursor.gotoStart(false); xTextCursor.gotoEnd(true); - xTextCursor.setString(""); + xTextCursor.setString(PropertyNames.EMPTY_STRING); oTextFieldHandler.insertUserField(xTextCursor, CurDBField.getFieldName(), CurDBField.getFieldTitle()); } diff --git a/wizards/com/sun/star/wizards/report/Dataimport.java b/wizards/com/sun/star/wizards/report/Dataimport.java index 00b58fb5e008..a467b3dbbeab 100644 --- a/wizards/com/sun/star/wizards/report/Dataimport.java +++ b/wizards/com/sun/star/wizards/report/Dataimport.java @@ -34,6 +34,8 @@ import com.sun.star.text.XTextDocument; import com.sun.star.wizards.ui.*; import com.sun.star.wizards.common.*; import com.sun.star.uno.Exception; +import java.util.logging.Level; +import java.util.logging.Logger; public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionListener { // extends ReportWizard @@ -95,8 +97,8 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi // curproperties[0] = Properties.createProperty("DatabaseLocation", "file:///C:/Documents and Settings/bc93774.EHAM02-DEV/My Documents/MyHSQL.odb"); //// curproperties[0] = Properties.createProperty("DatabaseLocation", "file:///C:/Documents and Settings/bc93774.EHAM02-DEV/My Documents/MyDocAssign.odb"); //baseLocation ); "DataSourceName", "db1"); //// curproperties[0] = Properties.createProperty("DataSourceName", "Bibliography"); -// curproperties[1] = Properties.createProperty("CommandType", new Integer(CommandType.TABLE)); -// curproperties[2] = Properties.createProperty("Command", "Table2"); +// curproperties[1] = Properties.createProperty(PropertyNames.COMMAND_TYPE, new Integer(CommandType.TABLE)); +// curproperties[2] = Properties.createProperty(PropertyNames.COMMAND, "Table2"); // // Dataimport CurDataimport = new Dataimport(xMSF); // TextDocument oTextDocument = new TextDocument(xMSF, true, null); @@ -132,7 +134,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblProgressDBConnection", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -154,7 +156,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblProgressDataImport", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -168,7 +170,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi }, new Object[] { - 10, "", 12, 42, 0, 120 + 10, PropertyNames.EMPTY_STRING, 12, 42, 0, 120 }); insertButton("cmdCancel", 10000, this, @@ -186,14 +188,14 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi super.xReschedule.reschedule(); return; } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(Dataimport.class.getName()).log(Level.SEVERE, null, e); // return; } - catch (java.lang.Exception jexception) + catch (java.lang.Exception e) { - jexception.printStackTrace(System.out); + Logger.getLogger(Dataimport.class.getName()).log(Level.SEVERE, null, e); // return; } } diff --git a/wizards/com/sun/star/wizards/report/IReportBuilderLayouter.java b/wizards/com/sun/star/wizards/report/IReportBuilderLayouter.java index 6422befd65f0..0de49032b901 100755 --- a/wizards/com/sun/star/wizards/report/IReportBuilderLayouter.java +++ b/wizards/com/sun/star/wizards/report/IReportBuilderLayouter.java @@ -103,6 +103,14 @@ public interface IReportBuilderLayouter public void insertGroupNames(String[] _aGroupFieldNames); /** + * Insert the names of the groups which should be used as sorting, the group names are names out of the field names. + * + * If a group name is given here, it will not shown in the fields/titles, but must be in the field string list. + * @param _aSortFieldNames + */ + public void insertSortingNames(String[][] _aSortFieldNames); + + /** * This method redraws the whole layout with all it's content */ public void layout(); diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java index 1de9f32bff23..6fd22abd5093 100644 --- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java +++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java @@ -176,15 +176,15 @@ public class ReportFinalizer */ public void toggleSubTemplateControls() { - // String sStorePath = ""; + // String sStorePath = PropertyNames.EMPTY_STRING; Short iState = (Short) CurUnoDialog.getControlProperty("optCreateReportTemplate", PropertyNames.PROPERTY_STATE); boolean bDoTemplateEnable = iState.shortValue() == 1; - CurUnoDialog.setControlProperty("optEditTemplate", PropertyNames.PROPERTY_ENABLED, new Boolean(bDoTemplateEnable)); - CurUnoDialog.setControlProperty("optUseTemplate", PropertyNames.PROPERTY_ENABLED, new Boolean(bDoTemplateEnable)); - CurUnoDialog.setControlProperty("lblHowProceed", PropertyNames.PROPERTY_ENABLED, new Boolean(bDoTemplateEnable)); + CurUnoDialog.setControlProperty("optEditTemplate", PropertyNames.PROPERTY_ENABLED, bDoTemplateEnable); + CurUnoDialog.setControlProperty("optUseTemplate", PropertyNames.PROPERTY_ENABLED, bDoTemplateEnable); + CurUnoDialog.setControlProperty("lblHowProceed", PropertyNames.PROPERTY_ENABLED, bDoTemplateEnable); String sTitle = xTitleTextBox.getText(); - boolean bDoEnable = sTitle.equals(""); + boolean bDoEnable = sTitle.equals(PropertyNames.EMPTY_STRING); CurUnoDialog.enableFinishButton(!bDoEnable); } // private boolean fileexists(XMultiServiceFactory _xMSF, String _spath){ @@ -212,7 +212,7 @@ public class ReportFinalizer if (CurUnoDialog != null) { String LocStoreName = xTitleTextBox.getText(); - if (!LocStoreName.equals("")) + if (!LocStoreName.equals(PropertyNames.EMPTY_STRING)) { StoreName = LocStoreName; } @@ -234,7 +234,7 @@ public class ReportFinalizer catch (Exception e) { e.printStackTrace(System.out); - return ""; + return PropertyNames.EMPTY_STRING; } } @@ -242,7 +242,7 @@ public class ReportFinalizer { final String TitleName = xTitleTextBox.getText(); CurReportDocument.liveupdate_updateReportTitle(TitleName); - CurUnoDialog.enableFinishButton(!"".equals(TitleName)); + CurUnoDialog.enableFinishButton(!PropertyNames.EMPTY_STRING.equals(TitleName)); } public int getReportOpenMode() diff --git a/wizards/com/sun/star/wizards/report/ReportLayouter.java b/wizards/com/sun/star/wizards/report/ReportLayouter.java index 4286b8819c69..dac1b5f98101 100644 --- a/wizards/com/sun/star/wizards/report/ReportLayouter.java +++ b/wizards/com/sun/star/wizards/report/ReportLayouter.java @@ -111,7 +111,7 @@ public class ReportLayouter xContentListBox = CurUnoDialog.insertListBox("lstContent", SOCONTENTLST, new ActionListenerImpl(), new ItemListenerImpl(), new String[] { - PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "SelectedItems", PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.SELECTED_ITEMS, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -146,7 +146,7 @@ public class ReportLayouter xLayoutListBox = CurUnoDialog.insertListBox("lstLayout", SOLAYOUTLST, new ActionListenerImpl(), new ItemListenerImpl(), new String[] { - PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "SelectedItems", PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.SELECTED_ITEMS, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -227,7 +227,7 @@ public class ReportLayouter { // CurReportDocument.getDoc().xTextDocument.lockControllers(); CurReportDocument.layout_setupRecordSection(_defaultTemplatePath); - if (CurUnoDialog.getControlProperty("txtTitle", "Text").equals("")) + if (CurUnoDialog.getControlProperty("txtTitle", "Text").equals(PropertyNames.EMPTY_STRING)) { String[] sCommandNames = CurReportDocument.getRecordParser().getIncludedCommandNames(); CurUnoDialog.setControlProperty("txtTitle", "Text", sCommandNames[0]); diff --git a/wizards/com/sun/star/wizards/report/ReportTextDocument.java b/wizards/com/sun/star/wizards/report/ReportTextDocument.java index 3ab9e704b9b9..c0babfab9769 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextDocument.java +++ b/wizards/com/sun/star/wizards/report/ReportTextDocument.java @@ -53,9 +53,16 @@ import com.sun.star.wizards.text.TextStyleHandler; import com.sun.star.wizards.text.TextFieldHandler; import com.sun.star.wizards.text.ViewHandler; import com.sun.star.wizards.document.FormHandler; +import java.util.logging.Level; +import java.util.logging.Logger; class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implements Comparator { + + private static final String ISLANDSCAPE = "IsLandscape"; + private static final String ISVISIBLE = "IsVisible"; + private static final String QUERYNAME = "QueryName"; + private static final String SIZE = "Size"; // private XMultiServiceFactory xMSF; // private XMultiServiceFactory xMSFDoc; private Object ReportPageStyle; @@ -102,7 +109,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen lateInit(oResource, _aRP); } - void lateInit(Resource oResource, RecordParser _aRecordParser) + private void lateInit(Resource oResource, RecordParser _aRecordParser) { oTextTableHandler = new TextTableHandler(xMSFDoc, xTextDocument); oTextSectionHandler = new TextSectionHandler(xMSFDoc, xTextDocument); @@ -146,12 +153,12 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { oTextSection = xTextSections.getByName(RECORDSECTION); } - boolean bLayoutMode = AnyConverter.toBoolean(Helper.getUnoPropertyValue(oTextSection, "IsVisible")); + boolean bLayoutMode = AnyConverter.toBoolean(Helper.getUnoPropertyValue(oTextSection, ISVISIBLE)); return bLayoutMode; } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(ReportTextDocument.class.getName()).log(Level.SEVERE, null, e); // In doubt we rather suggest this is LayoutMode... return true; } @@ -172,7 +179,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen } // xProgressBar.setValue(100); oViewHandler.selectFirstPage(oTextTableHandler); - // xProgressBar.end(); + // xProgressBar.end(); } public void swapLayoutTemplate(String LayoutTemplatePath/*, String BitmapPath*/) @@ -181,17 +188,17 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { // xProgressBar.start("", 10); this.LayoutTemplatePath = LayoutTemplatePath; - boolean bOldIsCurLandscape = AnyConverter.toBoolean(Helper.getUnoPropertyValue(ReportPageStyle, "IsLandscape")); + boolean bOldIsCurLandscape = AnyConverter.toBoolean(Helper.getUnoPropertyValue(ReportPageStyle, ISLANDSCAPE)); oTextStyleHandler.loadStyleTemplates(LayoutTemplatePath, "LoadPageStyles"); // xProgressBar.setValue(60); changePageOrientation(bOldIsCurLandscape); // xProgressBar.setValue(100); oViewHandler.selectFirstPage(oTextTableHandler); - // xProgressBar.end(); + // xProgressBar.end(); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(ReportTextDocument.class.getName()).log(Level.SEVERE, null, e); } } @@ -199,21 +206,41 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { com.sun.star.container.XNameContainer xNamedForm = oFormHandler.insertFormbyName(SOREPORTFORMNAME); XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xNamedForm); - oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "CommandType", new String(Integer.toString(CurDBMetaData.getCommandType()))); + oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, PropertyNames.COMMAND_TYPE, Integer.toString(CurDBMetaData.getCommandType())); if (CurDBMetaData.getCommandType() == CommandType.QUERY) { - oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "QueryName", CurDBMetaData.getCommandName()); - // oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "Command", ""); - DBMetaData.CommandObject oCommand = CurDBMetaData.getQueryByName(CurDBMetaData.getCommandName()); - oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "Command", CurDBMetaData.Command); + oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, QUERYNAME, CurDBMetaData.getCommandName()); + oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, PropertyNames.COMMAND, ""); + //DBMetaData.CommandObject oCommand = CurDBMetaData.getQueryByName(CurDBMetaData.getCommandName()); + //oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, COMMAND, CurDBMetaData.Command); } else { - oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "QueryName", ""); - oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "Command", CurDBMetaData.Command); + oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, QUERYNAME, ""); + oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, PropertyNames.COMMAND, CurDBMetaData.Command); } oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "GroupFieldNames", JavaTools.ArraytoString(CurDBMetaData.GroupFieldNames)); oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "FieldNames", JavaTools.ArraytoString(CurDBMetaData.getFieldNames())); + String[][] sortFieldNames = CurDBMetaData.getSortFieldNames(); + if (sortFieldNames != null && sortFieldNames.length > 0) + { + final String space = ","; + final String colon = ";"; + StringBuilder orderBy = new StringBuilder(); + for (String[] sortPair : sortFieldNames) + { + orderBy.append(sortPair[0]).append(space).append(sortPair[1]).append(colon); + } + if (orderBy.length() != 0) + { + orderBy.delete(orderBy.lastIndexOf(colon), orderBy.length()); + } + oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "Sorting", orderBy.toString()); + } + else + { + oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "Sorting", ""); + } oFormHandler.insertHiddenControl(xNameAccess, xNamedForm, "RecordFieldNames", JavaTools.ArraytoString(CurDBMetaData.getRecordFieldNames())); } @@ -230,9 +257,9 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen ReportPageStyle = Helper.getUnoObjectbyName(oPageStyleFamily, "Standard"); FirstPageStyle = Helper.getUnoObjectbyName(oPageStyleFamily, "First Page"); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(ReportTextDocument.class.getName()).log(Level.SEVERE, null, e); } } @@ -242,15 +269,15 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { com.sun.star.awt.Size oNewSize; getReportPageStyles(); - com.sun.star.awt.Size oLocSize = (com.sun.star.awt.Size) Helper.getUnoStructValue(ReportPageStyle, "Size"); - bIsCurLandscape = AnyConverter.toBoolean(Helper.getUnoPropertyValue(ReportPageStyle, "IsLandscape")); + com.sun.star.awt.Size oLocSize = (com.sun.star.awt.Size) Helper.getUnoStructValue(ReportPageStyle, SIZE); + bIsCurLandscape = AnyConverter.toBoolean(Helper.getUnoPropertyValue(ReportPageStyle, ISLANDSCAPE)); if (bIsCurLandscape != bNewLandscape) { oNewSize = new com.sun.star.awt.Size(oLocSize.Height, oLocSize.Width); - Helper.setUnoPropertyValue(ReportPageStyle, "IsLandscape", new Boolean(bNewLandscape)); - Helper.setUnoPropertyValue(ReportPageStyle, "Size", oNewSize); - Helper.setUnoPropertyValue(FirstPageStyle, "IsLandscape", new Boolean(bNewLandscape)); - Helper.setUnoPropertyValue(FirstPageStyle, "Size", oNewSize); + Helper.setUnoPropertyValue(ReportPageStyle, ISLANDSCAPE, bNewLandscape); + Helper.setUnoPropertyValue(ReportPageStyle, SIZE, oNewSize); + Helper.setUnoPropertyValue(FirstPageStyle, ISLANDSCAPE, bNewLandscape); + Helper.setUnoPropertyValue(FirstPageStyle, SIZE, oNewSize); int iLeftMargin = AnyConverter.toInt(Helper.getUnoPropertyValue(ReportPageStyle, "LeftMargin")); int iRightMargin = AnyConverter.toInt(Helper.getUnoPropertyValue(ReportPageStyle, "RightMargin")); PageWidth = oNewSize.Width - iLeftMargin - iRightMargin; @@ -260,9 +287,9 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen } } } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(ReportTextDocument.class.getName()).log(Level.SEVERE, null, e); } } @@ -303,9 +330,9 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen } return true; } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(ReportTextDocument.class.getName()).log(Level.SEVERE, null, e); return false; } } @@ -352,6 +379,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen // { // return (JavaTools.FieldInList(CurDBMetaData.GroupFieldNames, _FieldName) != -1); // } + public void replaceFieldValueInRecordSection(int RecordCount) { int GroupCount = CurDBMetaData.GroupFieldNames.length; @@ -367,7 +395,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen String TableName; DBColumn OldDBColumn; DBColumn CurDBColumn; - XNameAccess xTableNames = oTextTableHandler.xTextTablesSupplier.getTextTables(); + // XNameAccess xTableNames = oTextTableHandler.xTextTablesSupplier.getTextTables(); int GroupFieldCount = SelGroupNames.length; for (int i = 0; i < GroupFieldCount; i++) { @@ -639,7 +667,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { try { - Vector aFieldColumns = new Vector(); + ArrayList<FieldColumn> aFieldColumns = new ArrayList<FieldColumn>(); for (int i = 0; i < _FieldColumns.length; i++) { FieldColumn CurFieldColumn = _FieldColumns[i]; @@ -654,7 +682,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen } catch (RuntimeException e) { - e.printStackTrace(System.out); + Logger.getLogger(ReportTextDocument.class.getName()).log(Level.SEVERE, null, e); return null; } } @@ -728,7 +756,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { // xRelativeTextContentRemove.removeTextContentBefore(xTextContent); xRelativeTextContentRemove.removeTextContentAfter(xTextContent); - // IllegalArgumentException may be thrown when no paragraphbreak is there + // IllegalArgumentException may be thrown when no paragraphbreak is there } catch (IllegalArgumentException iexception) { @@ -751,17 +779,17 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen for (int i = 0; i < GroupFieldCount; i++) { oTextSection = xTextSections.getByName(GROUPSECTION + String.valueOf(i + 1)); - Helper.setUnoPropertyValue(oTextSection, "IsVisible", new Boolean(_IsVisible)); + Helper.setUnoPropertyValue(oTextSection, ISVISIBLE, _IsVisible); } if (xTextSections.hasByName(RECORDSECTION)) { oTextSection = xTextSections.getByName(RECORDSECTION); - Helper.setUnoPropertyValue(oTextSection, "IsVisible", new Boolean(_IsVisible)); + Helper.setUnoPropertyValue(oTextSection, ISVISIBLE, _IsVisible); } } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(ReportTextDocument.class.getName()).log(Level.SEVERE, null, e); } } diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java index ceecaf28ba4f..039ae870359a 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java +++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java @@ -30,16 +30,12 @@ package com.sun.star.wizards.report; import com.sun.star.awt.VclWindowPeerAttribute; import com.sun.star.awt.XWindowPeer; import com.sun.star.beans.PropertyValue; -import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; import com.sun.star.container.XNamed; -import com.sun.star.frame.XController; import com.sun.star.frame.XFrame; -import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.XComponent; import com.sun.star.sdb.CommandType; -import com.sun.star.sdbc.SQLException; import com.sun.star.table.XCellRange; import com.sun.star.text.XTextContent; import com.sun.star.text.XTextCursor; @@ -57,9 +53,9 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sdb.application.DatabaseObject; import com.sun.star.sdb.application.XDatabaseDocumentUI; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.SystemDialog; import com.sun.star.wizards.db.DBMetaData; -import com.sun.star.wizards.db.SQLQueryComposer; import com.sun.star.wizards.document.OfficeDocument; import com.sun.star.wizards.ui.UIConsts; import java.util.ArrayList; @@ -202,9 +198,9 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme } } } - catch (Exception exception) + catch (Exception ex) { - exception.printStackTrace(System.out); + Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); } return xNamedTextSection; } @@ -228,40 +224,54 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme XNameContainer xNamedForms = getDoc().oFormHandler.getDocumentForms(); Object oDBForm = Helper.getUnoObjectbyName(xNamedForms, ReportWizard.SOREPORTFORMNAME); boolean bgetConnection; - String sQueryName = ""; + String sQueryName = PropertyNames.EMPTY_STRING; if (oDBForm != null) { String sMsg = sMsgHiddenControlMissing + (char) 13 + sMsgEndAutopilot; XNameAccess xNamedForm = UnoRuntime.queryInterface( XNameAccess.class, oDBForm ); - getRecordParser().Command = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "Command", sMsg); - String sCommandType = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "CommandType", sMsg); + getRecordParser().Command = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND, sMsg); + String sCommandType = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND_TYPE, sMsg); String sGroupFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "GroupFieldNames", sMsg); String sFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "FieldNames", sMsg); + final String sorting = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "Sorting", sMsg); String sRecordFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "RecordFieldNames", sMsg); if (xNamedForm.hasByName("QueryName")) { sQueryName = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "QueryName", sMsg); } - String[] sFieldNameList = JavaTools.ArrayoutofString(sFieldNames, ";"); - String[] sNewList = JavaTools.ArrayoutofString(sRecordFieldNames, ";"); + String[] sFieldNameList = JavaTools.ArrayoutofString(sFieldNames, PropertyNames.SEMI_COLON); + String[] sNewList = JavaTools.ArrayoutofString(sRecordFieldNames, PropertyNames.SEMI_COLON); + if ( !PropertyNames.EMPTY_STRING.equals(sorting)) + { + String[] sortList = JavaTools.ArrayoutofString(sorting, PropertyNames.SEMI_COLON); + ArrayList<String[]> aSortFields = new ArrayList<String[]>(); + for (String sortEntry : sortList) + { + aSortFields.add(JavaTools.ArrayoutofString(sortEntry, ",")); + } + String[][] sortFieldNames = new String[aSortFields.size()][2]; + aSortFields.toArray(sortFieldNames); + getRecordParser().setSortFieldNames(sortFieldNames); + } getRecordParser().setRecordFieldNames(sNewList); - getRecordParser().GroupFieldNames = JavaTools.ArrayoutofString(sGroupFieldNames, ";"); + getRecordParser().GroupFieldNames = JavaTools.ArrayoutofString(sGroupFieldNames, PropertyNames.SEMI_COLON); getRecordParser().setCommandType(Integer.valueOf(sCommandType).intValue()); + sMsgQueryCreationImpossible = JavaTools.replaceSubString(sMsgQueryCreationImpossible, getRecordParser().Command, "<STATEMENT>"); bgetConnection = getRecordParser().getConnection(_properties); int nCommandType = com.sun.star.sdb.CommandType.COMMAND; boolean bexecute = false; if (bgetConnection) { - - if ((getRecordParser().getCommandType() == CommandType.QUERY) && (getRecordParser().Command.equals(""))) + if ((getRecordParser().getCommandType() == CommandType.QUERY) && (getRecordParser().Command.equals(PropertyNames.EMPTY_STRING))) { DBMetaData.CommandObject oCommand = getRecordParser().getQueryByName(sQueryName); if (getRecordParser().hasEscapeProcessing(oCommand.getPropertySet())) { - getRecordParser().Command = (String) oCommand.getPropertySet().getPropertyValue("Command"); + getRecordParser().Command = (String) oCommand.getPropertySet().getPropertyValue(PropertyNames.COMMAND); getRecordParser().getSQLQueryComposer().m_xQueryAnalyzer.setQuery(getRecordParser().Command); getRecordParser().getSQLQueryComposer().prependSortingCriteria(); + getRecordParser().Command = getRecordParser().getSQLQueryComposer().getQuery(); } else { @@ -293,13 +303,14 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme { return false; } - catch (java.lang.Exception javaexception) + catch (java.lang.Exception ex) { - javaexception.printStackTrace(System.out); + Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); return false; } - catch (com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException exception) + catch (com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException ex) { + Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); return false; } } @@ -322,8 +333,6 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme Object CurGroupValue; String CurGroupTableName; // RecordParser CurDBMetaData = getRecordParser(); - com.sun.star.style.BreakType CorrBreakValue = null; - String CorrPageDescName = ""; getDoc().oTextFieldHandler.fixDateFields(true); getDoc().removeAllVisibleTextSections(); getDoc().removeNonLayoutTextTables(); @@ -389,7 +398,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme for (ColIndex = 0; ColIndex < GroupFieldCount; ColIndex++) { CurDBColumn = (DBColumn) getDoc().DBColumnsVector.elementAt(ColIndex); - Object oValue = ""; + Object oValue = PropertyNames.EMPTY_STRING; addLinkedTextSection(xTextCursor, ReportTextDocument.COPYOFGROUPSECTION + Integer.toString(ColIndex + 1), CurDBColumn, oValue); } addLinkedTextSection(xTextCursor, ReportTextDocument.COPYOFRECORDSECTION, null, null); @@ -403,8 +412,9 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme } getDoc().oTextSectionHandler.breakLinkofTextSections(); } - catch (Exception exception) + catch (Exception ex) { + Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); } // catch (java.lang.Exception javaexception) // { @@ -462,7 +472,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme xNameCellCursor = ReportTextDocument.createTextCursor(CurDBColumn.xNameCell); xNameCellCursor.gotoStart(false); FieldContent = getDoc().oTextFieldHandler.getUserFieldContent(xNameCellCursor); - if (!FieldContent.equals("")) + if (!FieldContent.equals(PropertyNames.EMPTY_STRING)) { xNameCellCursor.goRight((short) 1, true); xNameCellCursor.setString(FieldContent); @@ -629,6 +639,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme } catch (Exception e) { + Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, e ); } } return m_aReportPath; @@ -646,7 +657,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme return sPath; } } - return ""; + return PropertyNames.EMPTY_STRING; } public String getLayoutPath() @@ -661,7 +672,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme return sPath; } } - return ""; + return PropertyNames.EMPTY_STRING; } public int getDefaultPageOrientation() diff --git a/wizards/com/sun/star/wizards/report/ReportWizard.java b/wizards/com/sun/star/wizards/report/ReportWizard.java index 224cd7abeff3..597893986282 100644 --- a/wizards/com/sun/star/wizards/report/ReportWizard.java +++ b/wizards/com/sun/star/wizards/report/ReportWizard.java @@ -79,7 +79,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, private ReportLayouter CurReportLayouter; private ReportFinalizer CurReportFinalizer; private int nReportMode = ReportFinalizer.SOCREATEDOCUMENT; - private String m_sReportName = ""; + private String m_sReportName = PropertyNames.EMPTY_STRING; protected static final String SOREPORTFORMNAME = "ReportSource"; private static final int SOMAINPAGE = 1; private static final int SOTITLEPAGE = 2; @@ -272,10 +272,17 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, final SQLQueryComposer sqlQueryComposer = recordParser.getSQLQueryComposer(); if (this.CurDBCommandFieldSelection.getSelectedCommandType() == CommandType.TABLE) { - bQueryCreated = sqlQueryComposer.setQueryCommand(this.xWindow, false, false); - m_reportDocument.setCommandType(CommandType.COMMAND); - String sQuery = sqlQueryComposer.getQuery(); - m_reportDocument.setCommand(sQuery); + if (m_reportDocument instanceof ReportTextImplementation) + { + bQueryCreated = sqlQueryComposer.setQueryCommand(this.xWindow, false, false); + m_reportDocument.setCommandType(CommandType.COMMAND); + String sQuery = sqlQueryComposer.getQuery(); + m_reportDocument.setCommand(sQuery); + } + else + { + bQueryCreated = true; + } } else { @@ -284,24 +291,25 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, String sQueryName = CurDBCommandFieldSelection.getSelectedCommandName(); DBMetaData.CommandObject oCommand = recordParser.getQueryByName(sQueryName); bHasEscapeProcessing = recordParser.hasEscapeProcessing(oCommand.getPropertySet()); - String sCommand = (String) oCommand.getPropertySet().getPropertyValue("Command"); + String sCommand = (String) oCommand.getPropertySet().getPropertyValue(PropertyNames.COMMAND); if (bHasEscapeProcessing) { - // String sCommand = (String) oCommand.xPropertySet.getPropertyValue("Command"); - bQueryCreated = (!sCommand.equals("")); - sqlQueryComposer.m_xQueryAnalyzer.setQuery(sCommand); - sqlQueryComposer.prependSortingCriteria(); -// TODO: check with query - m_reportDocument.setCommandType(CommandType.COMMAND); - m_reportDocument.setCommand(sqlQueryComposer.getQuery()); - bQueryCreated = true; + // String sCommand = (String) oCommand.xPropertySet.getPropertyValue(PropertyNames.COMMAND); + bQueryCreated = (!sCommand.equals(PropertyNames.EMPTY_STRING)); + if (m_reportDocument instanceof ReportTextImplementation) + { + sqlQueryComposer.m_xQueryAnalyzer.setQuery(sCommand); + sqlQueryComposer.prependSortingCriteria(); + m_reportDocument.setCommandType(CommandType.COMMAND); + m_reportDocument.setCommand(sqlQueryComposer.getQuery()); + } } else { m_reportDocument.setCommandType(CommandType.COMMAND); m_reportDocument.setCommand(sCommand); - bQueryCreated = true; } + bQueryCreated = true; } catch (Exception e) { @@ -589,7 +597,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, public static String getBlindTextNote(Object _aDocument, Resource _oResource) { - String sBlindTextNote = ""; + String sBlindTextNote = PropertyNames.EMPTY_STRING; if (_aDocument instanceof ReportTextImplementation) { sBlindTextNote = _oResource.getResText(UIConsts.RID_REPORT + 75); @@ -698,7 +706,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, m_nID = 1; if (sIncSuffix != null) { - if ((!sIncSuffix.equals("")) && (!sIncSuffix.equals("_"))) + if ((!sIncSuffix.equals(PropertyNames.EMPTY_STRING)) && (!sIncSuffix.equals("_"))) { String sID = JavaTools.ArrayoutofString(sIncSuffix, "_")[1]; m_nID = Integer.parseInt(sID); @@ -717,7 +725,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, else { boolean bEnabled = (CurGroupFieldSelection.getSelectedFieldNames().length > 0); - Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled)); + Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), PropertyNames.PROPERTY_ENABLED, bEnabled); } } @@ -732,7 +740,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, else { boolean bEnabled = (CurGroupFieldSelection.getSelectedFieldNames().length > 0); - Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled)); + Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), PropertyNames.PROPERTY_ENABLED, bEnabled); } } diff --git a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java index 6a90214696a5..0e9945912425 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java +++ b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java @@ -33,7 +33,6 @@ import com.sun.star.awt.XWindowPeer; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XHierarchicalNameContainer; -import com.sun.star.container.XNameContainer; import com.sun.star.frame.XController; import com.sun.star.frame.XDispatch; import com.sun.star.frame.XDispatchProvider; @@ -60,6 +59,7 @@ import java.util.Set; import java.util.Vector; import com.sun.star.wizards.common.FileAccess; import com.sun.star.wizards.common.NamedValueCollection; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.report.IReportBuilderLayouter; import com.sun.star.wizards.report.IReportDefinitionReadAccess; import com.sun.star.wizards.report.IReportDocument; @@ -78,23 +78,24 @@ import java.util.logging.Logger; public class ReportBuilderImplementation extends ReportImplementationHelper implements IReportDocument, IReportDefinitionReadAccess { - private Resource m_resource; - private XDatabaseDocumentUI m_documentUI; + private Resource m_resource; + private XDatabaseDocumentUI m_documentUI; private static final int MAXIMUM_GROUPCOUNT = 4; + private String[] groupNames = null; - private ReportBuilderImplementation( XMultiServiceFactory _serviceFactory ) + private ReportBuilderImplementation(XMultiServiceFactory _serviceFactory) { // creates an access to the ReportBuilder Extension super(_serviceFactory, ReportLayouter.SOOPTLANDSCAPE); } - public static IReportDocument create( XMultiServiceFactory i_serviceFactory ) + public static IReportDocument create(XMultiServiceFactory i_serviceFactory) { - return new ReportBuilderImplementation( i_serviceFactory ); + return new ReportBuilderImplementation(i_serviceFactory); } - public void initialize( final XDatabaseDocumentUI i_documentUI, final Resource i_resource ) + public void initialize(final XDatabaseDocumentUI i_documentUI, final Resource i_resource) { m_documentUI = i_documentUI; m_resource = i_resource; @@ -106,12 +107,12 @@ public class ReportBuilderImplementation extends ReportImplementationHelper public XWindowPeer getWizardParent() { - final XWindowPeer aWindowPeer = UnoRuntime.queryInterface( XWindowPeer.class, getFrame().getComponentWindow() ); + final XWindowPeer aWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, getFrame().getComponentWindow()); return aWindowPeer; } private XFrame m_xFrame = null; // private ReportBuilderLayouter m_aReportBuilderLayouter = null; - private String m_sReportBuilderLayoutName = ""; + private String m_sReportBuilderLayoutName = PropertyNames.EMPTY_STRING; /** * Get access to the current ReportLayouter, which depends on the name. @@ -139,15 +140,18 @@ public class ReportBuilderImplementation extends ReportImplementationHelper try { NamedValueCollection creationArgs = new NamedValueCollection(); - creationArgs.put( "DocumentServiceName", "com.sun.star.report.ReportDefinition" ); - creationArgs.put( "Mode", "remote" ); + creationArgs.put("DocumentServiceName", "com.sun.star.report.ReportDefinition"); + creationArgs.put("Mode", "remote"); - XComponent[] docDefinition = new XComponent[] { null }; + XComponent[] docDefinition = new XComponent[] + { + null + }; XComponent reportDefinitionComp = m_documentUI.createComponentWithArguments( - DatabaseObject.REPORT, creationArgs.getPropertyValues(), docDefinition ); + DatabaseObject.REPORT, creationArgs.getPropertyValues(), docDefinition); - m_documentDefinition = UnoRuntime.queryInterface( XPropertySet.class, docDefinition[0] ); - m_reportDocument = UnoRuntime.queryInterface( XReportDefinition.class, reportDefinitionComp ); + m_documentDefinition = UnoRuntime.queryInterface(XPropertySet.class, docDefinition[0]); + m_reportDocument = UnoRuntime.queryInterface(XReportDefinition.class, reportDefinitionComp); } catch (com.sun.star.uno.Exception e) { @@ -164,7 +168,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper private XModeSelector getModeSelector() { final XController xController = getReportDefinition().getCurrentController(); - final XModeSelector xModeSelector = UnoRuntime.queryInterface( XModeSelector.class, xController ); + final XModeSelector xModeSelector = UnoRuntime.queryInterface(XModeSelector.class, xController); return xModeSelector; } @@ -209,11 +213,11 @@ public class ReportBuilderImplementation extends ReportImplementationHelper try { final XController xController = getReportDefinition().getCurrentController(); - final XDispatchProvider xDP = UnoRuntime.queryInterface( XDispatchProvider.class, xController ); + final XDispatchProvider xDP = UnoRuntime.queryInterface(XDispatchProvider.class, xController); // Create special service for parsing of given URL. final Object aURLTransformer = getMSF().createInstance("com.sun.star.util.URLTransformer"); - final XURLTransformer xURLTransformer = UnoRuntime.queryInterface( com.sun.star.util.XURLTransformer.class, aURLTransformer ); + final XURLTransformer xURLTransformer = UnoRuntime.queryInterface(com.sun.star.util.XURLTransformer.class, aURLTransformer); com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1]; aURL[0] = new com.sun.star.util.URL(); @@ -273,14 +277,14 @@ public class ReportBuilderImplementation extends ReportImplementationHelper return; } - final XCommandProcessor xProcessor = UnoRuntime.queryInterface( XCommandProcessor.class, m_documentDefinition ); + final XCommandProcessor xProcessor = UnoRuntime.queryInterface(XCommandProcessor.class, m_documentDefinition); final com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command(); aCommand.Name = "store"; xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null); final XHierarchicalNameContainer aNameContainer = UnoRuntime.queryInterface(XHierarchicalNameContainer.class, m_aReportDocument); - aNameContainer.insertByHierarchicalName( Name, m_documentDefinition ); + aNameContainer.insertByHierarchicalName(Name, m_documentDefinition); } public boolean liveupdate_addGroupNametoDocument(String[] GroupNames, String CurGroupTitle, Vector GroupFieldVector, ArrayList ReportPath, int iSelCount) @@ -366,19 +370,19 @@ public class ReportBuilderImplementation extends ReportImplementationHelper { try { - if ( m_documentDefinition != null ) + if (m_documentDefinition != null) { // set the document to "not modified", to ensure that it won't ask the user before closing - XModifiable documentModify = UnoRuntime.queryInterface( XModifiable.class, m_reportDocument ); - documentModify.setModified( false ); + XModifiable documentModify = UnoRuntime.queryInterface(XModifiable.class, m_reportDocument); + documentModify.setModified(false); // actually close - XSubDocument subComponent = UnoRuntime.queryInterface( XSubDocument.class, m_documentDefinition ); + XSubDocument subComponent = UnoRuntime.queryInterface(XSubDocument.class, m_documentDefinition); subComponent.close(); } } - catch ( Exception ex ) + catch (Exception ex) { - Logger.getLogger( ReportBuilderImplementation.class.getName() ).log( Level.SEVERE, null, ex ); + Logger.getLogger(ReportBuilderImplementation.class.getName()).log(Level.SEVERE, null, ex); } m_documentDefinition = null; m_reportDocument = null; @@ -407,15 +411,15 @@ public class ReportBuilderImplementation extends ReportImplementationHelper { } - private XComponent loadReport( final String i_reportName ) + private XComponent loadReport(final String i_reportName) { try { - return m_documentUI.loadComponent( DatabaseObject.REPORT, i_reportName, false ); + return m_documentUI.loadComponent(DatabaseObject.REPORT, i_reportName, false); } - catch ( Exception ex ) + catch (Exception ex) { - Logger.getLogger( ReportBuilderImplementation.class.getName() ).log( Level.SEVERE, null, ex ); + Logger.getLogger(ReportBuilderImplementation.class.getName()).log(Level.SEVERE, null, ex); } return null; } @@ -428,19 +432,19 @@ public class ReportBuilderImplementation extends ReportImplementationHelper aCommand.Name = "open"; try { - final Object result = commandProcessor.execute( aCommand, commandProcessor.createCommandIdentifier(), null ); - return UnoRuntime.queryInterface( XComponent.class, result ); + final Object result = commandProcessor.execute(aCommand, commandProcessor.createCommandIdentifier(), null); + return UnoRuntime.queryInterface(XComponent.class, result); } - catch ( Exception ex ) + catch (Exception ex) { - Logger.getLogger( ReportBuilderImplementation.class.getName() ).log( Level.SEVERE, null, ex ); + Logger.getLogger(ReportBuilderImplementation.class.getName()).log(Level.SEVERE, null, ex); } return null; } - public void createAndOpenReportDocument( String i_name, boolean i_asTemplate, boolean i_openForEditing ) + public void createAndOpenReportDocument(String i_name, boolean i_asTemplate, boolean i_openForEditing) { - if ( i_openForEditing ) + if (i_openForEditing) { // we won't destroy the report builder window, also don't create a document // Do we need to reopen the report builder with the known name? @@ -449,13 +453,13 @@ public class ReportBuilderImplementation extends ReportImplementationHelper return; } - if ( i_asTemplate ) + if (i_asTemplate) { // don't need the report definition anymore - the document it represents has already been stored closeReportDefinition(); // open the report, again, this time not in design, but containing data - loadReport( i_name ); + loadReport(i_name); } else { @@ -466,8 +470,10 @@ public class ReportBuilderImplementation extends ReportImplementationHelper closeReportDefinition(); // store the generated report - if ( getRecordParser().storeDatabaseDocumentToTempPath( document, i_name ) ) - getRecordParser().addReportDocument( document, false ); + if (getRecordParser().storeDatabaseDocumentToTempPath(document, i_name)) + { + getRecordParser().addReportDocument(document, false); + } } dispose(); @@ -509,10 +515,17 @@ public class ReportBuilderImplementation extends ReportImplementationHelper public void setSorting(String[][] _aSortFieldNames) { getRecordParser().setSortFieldNames(_aSortFieldNames); + if (groupNames != null) + { + getRecordParser().prependSortFieldNames(groupNames); + } + getReportBuilderLayouter().insertSortingNames(_aSortFieldNames); + getReportBuilderLayouter().layout(); } public void setGrouping(String[] _aGroupFieldNames) { + groupNames = _aGroupFieldNames; getRecordParser().prependSortFieldNames(_aGroupFieldNames); getReportBuilderLayouter().insertGroupNames(_aGroupFieldNames); @@ -532,12 +545,12 @@ public class ReportBuilderImplementation extends ReportImplementationHelper try { // Check general availability of office paths - m_aReportPath = FileAccess.getOfficePaths( getMSF(), "Template", "share", "/wizard" ); - FileAccess.combinePaths( getMSF(), m_aReportPath, "/wizard/report" ); + m_aReportPath = FileAccess.getOfficePaths(getMSF(), "Template", "share", "/wizard"); + FileAccess.combinePaths(getMSF(), m_aReportPath, "/wizard/report"); } - catch ( NoValidPathException ex ) + catch (NoValidPathException ex) { - Logger.getLogger( ReportBuilderImplementation.class.getName() ).log( Level.SEVERE, null, ex ); + Logger.getLogger(ReportBuilderImplementation.class.getName()).log(Level.SEVERE, null, ex); } } return m_aReportPath; @@ -545,7 +558,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper public String getContentPath() { - return ""; + return PropertyNames.EMPTY_STRING; } public int getDefaultPageOrientation() @@ -727,7 +740,6 @@ public class ReportBuilderImplementation extends ReportImplementationHelper getReportDefinition().setCommandType(_nCommand); } - public void checkInvariants() throws java.lang.Exception { final String sDefaultHeaderLayoutPath = getDefaultHeaderLayout(); @@ -737,12 +749,9 @@ public class ReportBuilderImplementation extends ReportImplementationHelper } FileAccess aAccess = new FileAccess(getGlobalMSF()); - if (! aAccess.exists(sDefaultHeaderLayoutPath, true)) + if (!aAccess.exists(sDefaultHeaderLayoutPath, true)) { throw new java.io.IOException("default.otr"); } } - } - - diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java index ccb74ebf6f07..9094807570ad 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarSingleColumn.java @@ -28,6 +28,7 @@ package com.sun.star.wizards.reportbuilder.layout; import com.sun.star.awt.Rectangle; +import com.sun.star.report.XGroup; import com.sun.star.report.XSection; import com.sun.star.wizards.common.Resource; import com.sun.star.wizards.report.IReportDefinitionReadAccess; @@ -98,7 +99,7 @@ public class ColumnarSingleColumn extends ReportBuilderLayouter doNotBreakInTable(xSection); } - protected void insertDetailFieldTitles() + protected void insertDetailFieldTitles(int lastGroupPostion) { // we won't extra field titles } diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java index d79713524021..023d447a939f 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java @@ -28,6 +28,7 @@ package com.sun.star.wizards.reportbuilder.layout; import com.sun.star.awt.Rectangle; +import com.sun.star.report.XGroup; import com.sun.star.report.XSection; import com.sun.star.wizards.common.Resource; import com.sun.star.wizards.report.IReportDefinitionReadAccess; @@ -130,7 +131,7 @@ public class ColumnarTwoColumns extends ReportBuilderLayouter doNotBreakInTable(xSection); } - protected void insertDetailFieldTitles() + protected void insertDetailFieldTitles(int lastGroupPostion) { // we won't extra field titles } diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java b/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java index 55fdafe6c79a..f2bdbcd6e428 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java @@ -41,6 +41,7 @@ import com.sun.star.report.XReportDefinition; import com.sun.star.report.XSection; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.common.PropertyNames; /** * @@ -319,8 +320,8 @@ public class DesignTemplate m_xReportDefinition = (XReportDefinition) UnoRuntime.queryInterface(XReportDefinition.class, aObj); PropertyValue[] aLoadProps = new PropertyValue[2]; - aLoadProps[0] = Properties.createProperty("URL", _sPath); - aLoadProps[1] = Properties.createProperty("ReadOnly", Boolean.TRUE); + aLoadProps[0] = Properties.createProperty(PropertyNames.URL, _sPath); + aLoadProps[1] = Properties.createProperty(PropertyNames.READ_ONLY, Boolean.TRUE); m_xReportDefinition.load(aLoadProps); analyseReportDefinition(); diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java index 9fd891a446f2..f1c02112414a 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsAbove.java @@ -29,6 +29,7 @@ package com.sun.star.wizards.reportbuilder.layout; import com.sun.star.awt.Rectangle; +import com.sun.star.report.XGroup; import com.sun.star.report.XSection; import com.sun.star.wizards.common.Resource; import com.sun.star.wizards.report.IReportDefinitionReadAccess; @@ -159,7 +160,7 @@ public class InBlocksLabelsAbove extends ColumnarTwoColumns doNotBreakInTable(xSection); } - protected void insertDetailFieldTitles() + protected void insertDetailFieldTitles(int lastGroupPostion) { // we won't extra field titles } diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java index c03cf7cec909..b8ac18db61a4 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/InBlocksLabelsLeft.java @@ -29,6 +29,7 @@ package com.sun.star.wizards.reportbuilder.layout; import com.sun.star.awt.Rectangle; +import com.sun.star.report.XGroup; import com.sun.star.report.XSection; import com.sun.star.wizards.common.Resource; import com.sun.star.wizards.report.IReportDefinitionReadAccess; @@ -126,7 +127,7 @@ public class InBlocksLabelsLeft extends ColumnarTwoColumns doNotBreakInTable(xSection); } - protected void insertDetailFieldTitles() + protected void insertDetailFieldTitles(int lastGroupPostion) { // we won't extra field titles } diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java index 0c2e5af3bd36..e236405448f2 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java @@ -72,6 +72,8 @@ import com.sun.star.wizards.report.IReportDefinitionReadAccess; import com.sun.star.wizards.ui.UIConsts; import java.util.HashMap; import java.util.Locale; +import java.util.logging.Level; +import java.util.logging.Logger; /** * This class is abstract and more like a helper for create different layouts for Report Builder Wizard. @@ -83,6 +85,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter private IReportDefinitionReadAccess m_xReportDefinitionReadAccess; private Resource m_aResource; + private String[][] m_aSortNames; /** * dispose the ReportBuilderLayouter @@ -91,7 +94,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter { closeDesignTemplate(); m_xReportDefinitionReadAccess = null; - // m_xReportBuilderLayouter = null; + // m_xReportBuilderLayouter = null; } /** @@ -148,11 +151,11 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter insertPageFooter(); clearGroups(); - insertGroups(); + int lastGroupPostion = insertGroups(); clearDetails(); // clearFieldTitles(); - insertDetailFieldTitles(); + insertDetailFieldTitles(lastGroupPostion); insertDetailFields(); } catch (java.lang.ArrayIndexOutOfBoundsException e) @@ -163,13 +166,13 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter { throw e; } - catch (Exception e) + catch (Exception ex) { - // Exception not set. Not from interest here. - int dummy = 0; + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } // ------------------------------------------------------------------------- + /** * Remove all Groups */ @@ -183,13 +186,14 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter { xGroups.removeByIndex(0); } - catch (com.sun.star.uno.Exception e) + catch (com.sun.star.uno.Exception ex) { - // Exception not set. Not from interest here. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } } // ------------------------------------------------------------------------- + /** * Remove all fields * @param _xSectionToClear @@ -209,10 +213,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter final XShape aShape = (XShape) UnoRuntime.queryInterface(XShape.class, aObj); _xSectionToClear.remove(aShape); } - catch (com.sun.star.uno.Exception e) + catch (com.sun.star.uno.Exception ex) { - // Exception not set. - int dummy = 0; + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } @@ -226,6 +229,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter // public void clearFieldTitles() // { // } + /** * * @param _nGroupCount @@ -307,10 +311,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } } } - catch (com.sun.star.uno.Exception e) + catch (com.sun.star.uno.Exception ex) { - // TODO: Exception not set. - e.printStackTrace(); + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } return aUsedStyle; } @@ -352,6 +355,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return m_nPageWidth; } // ------------------------------------------------------------------------- + /** * Stores the Group names. To insert/create a report with such group names, call layout() * @param _aGroupNames @@ -361,6 +365,11 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter m_aGroupNames = _aGroupNames; } + public void insertSortingNames(String[][] _aSortFieldNames) + { + m_aSortNames = _aSortFieldNames; + } + protected void copyGroupProperties(int _nGroup) { if (getDesignTemplate() != null) @@ -368,103 +377,111 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter try { final XGroups xForeignGroups = getDesignTemplate().getGroups(); - int nGroups = xForeignGroups.getCount(); - Object aForeignGroup = xForeignGroups.getByIndex(_nGroup); - XGroup xForeignGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aForeignGroup); - XSection xForeignGroupSection = xForeignGroup.getHeader(); - - if (xForeignGroupSection != null) + if (_nGroup < xForeignGroups.getCount()) { - final XGroups xGroups = getReportDefinition().getGroups(); - Object aGroup = xGroups.getByIndex(_nGroup); - XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup); - XSection xGroupSection = xGroup.getHeader(); + XGroup xForeignGroup = UnoRuntime.queryInterface(XGroup.class, xForeignGroups.getByIndex(_nGroup)); + XSection xForeignGroupSection = xForeignGroup.getHeader(); - // copy Properties - copyProperties(xForeignGroupSection, xGroupSection); + if (xForeignGroupSection != null) + { + final XGroups xGroups = getReportDefinition().getGroups(); + Object aGroup = xGroups.getByIndex(_nGroup); + XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup); + XSection xGroupSection = xGroup.getHeader(); + + // copy Properties + copyProperties(xForeignGroupSection, xGroupSection); + } } } - catch (Exception e) + catch (Exception ex) { - int dummy = 0; + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } } // ------------------------------------------------------------------------- - protected void insertGroups() - { - if (m_aGroupNames == null) - { - return; - } + protected int insertGroups() + { final XGroups xGroups = getReportDefinition().getGroups(); - final int nLeftPageIndent = getLeftPageIndent(); - final int nLabelWidth = getMaxLabelWidth(); // 3000; - final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups()); - final int nFieldWidth = nUsablePageWidth - nLabelWidth; - - // after done with all groups, we need access to the last group, for set property 'KeepTogether' so we remember it. - XGroup aLastGroup = null; + int lastGroupPosition = -1; - for (int i = 0; i < m_aGroupNames.length; i++) + if (m_aGroupNames != null) { - final XGroup xGroup = xGroups.createGroup(); - aLastGroup = xGroup; + final int nLeftPageIndent = getLeftPageIndent(); + final int nLabelWidth = getMaxLabelWidth(); // 3000; + final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups()); + final int nFieldWidth = nUsablePageWidth - nLabelWidth; - // TODO: debug what the m_aGroupNames are, "field:[...]" or the "fieldname" - xGroup.setExpression(m_aGroupNames[i]); - xGroup.setHeaderOn(true); - // we don't want any group footer (default off) - // xGroup.setFooterOn(true); + XGroup aLastGroup = null; + // after done with all groups, we need access to the last group, for set property 'KeepTogether' so we remember it. - try + for (int i = 0; i < m_aGroupNames.length; i++) { - // we need to append by hand - // TODO: documentation is unclear here, that we have to insert by hand - int nCount = xGroups.getCount(); - xGroups.insertByIndex(nCount, xGroup); + lastGroupPosition = i; + final XGroup xGroup = xGroups.createGroup(); + aLastGroup = xGroup; - final XSection xGroupSection = xGroup.getHeader(); - copyGroupProperties(nCount); + xGroup.setExpression(m_aGroupNames[i]); + xGroup.setHeaderOn(true); - Rectangle aRect = new Rectangle(); - aRect.X = nLeftPageIndent + getLeftGroupIndent(i); - SectionObject aSO = getDesignTemplate().getGroupLabel(i); - int nLabelHeight = 0; -// if (aSO != null) -// { - nLabelHeight = aSO.getHeight(LayoutConstants.LabelHeight); - aRect = insertLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth, aSO); -// } -// else -// { -// nLabelHeight = 500; -// aRect = insertBoldLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth); -// } - final String sGroupName = convertToFieldName(m_aGroupNames[i]); - aSO = getDesignTemplate().getGroupTextField(i); - insertFormattedField(xGroupSection, sGroupName, aRect, nFieldWidth, aSO); - - // draw a line under the label/formattedfield - aRect.X = nLeftPageIndent + getLeftGroupIndent(i); - aRect.Y = nLabelHeight; - final int nLineWidth = getPageWidth() - getRightPageIndent() - aRect.X; - final int nLineHeight = LayoutConstants.LineHeight; - insertHorizontalLine(xGroupSection, aRect, nLineWidth, nLineHeight); - xGroupSection.setHeight(nLabelHeight + nLineHeight); + try + { + int nCount = xGroups.getCount(); + xGroups.insertByIndex(nCount, xGroup); + final XSection xGroupSection = xGroup.getHeader(); + copyGroupProperties(nCount); + + Rectangle aRect = new Rectangle(); + aRect.X = nLeftPageIndent + getLeftGroupIndent(i); + SectionObject aSO = getDesignTemplate().getGroupLabel(i); + aRect = insertLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth, aSO); + final String sGroupName = convertToFieldName(m_aGroupNames[i]); + aSO = getDesignTemplate().getGroupTextField(i); + aRect = insertFormattedField(xGroupSection, sGroupName, aRect, nFieldWidth, aSO); + int height = aRect.Height; + + // draw a line under the label/formattedfield + aRect.X = nLeftPageIndent + getLeftGroupIndent(i); + aRect.Y = aRect.Height; + final int nLineWidth = getPageWidth() - getRightPageIndent() - aRect.X; + final int nLineHeight = LayoutConstants.LineHeight; + insertHorizontalLine(xGroupSection, aRect, nLineWidth, nLineHeight); + xGroupSection.setHeight(height + nLineHeight); + } + catch (com.sun.star.uno.Exception ex) + { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); + } } - catch (com.sun.star.uno.Exception e) + + // hold the inner group together + if (aLastGroup != null) { - // TODO: Exception not set. + doNotBreakInTable(aLastGroup); } } - - // hold the inner group together - if (aLastGroup != null) + if (m_aSortNames != null) { - doNotBreakInTable(aLastGroup); + for (String[] sortFieldName : m_aSortNames) + { + try + { + final XGroup xGroup = xGroups.createGroup(); + xGroup.setExpression(sortFieldName[0]); + xGroup.setSortAscending(PropertyNames.ASC.equals(sortFieldName[1])); + xGroup.setHeaderOn(false); + int nCount = xGroups.getCount(); + xGroups.insertByIndex(nCount, xGroup); + } + catch (java.lang.Exception ex) + { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); + } + } } + return lastGroupPosition; } // ------------------------------------------------------------------------- @@ -487,10 +504,10 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return m_aFieldTitleNames[i]; } } - return ""; + return PropertyNames.EMPTY_STRING; } - protected int getTypeFromFieldName(String _sField) + protected int getTypeFromFieldName(String _sField) { for (int i = 0; i < m_aFieldNames.length; i++) { @@ -514,6 +531,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return false; } // ------------------------------------------------------------------------- + /** * Helper to get all field names without the names which are already in the group names * @param _aList @@ -578,8 +596,10 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return getNamesWithoutGroupNames(m_aFieldNames, m_aFieldTitleNames); } // ------------------------------------------------------------------------- - abstract protected void insertDetailFieldTitles(); + + abstract protected void insertDetailFieldTitles(int lastGroupPostion); // ------------------------------------------------------------------------- + /** * Give a list off all field names to insert the field names, call layout() * @param _aFieldNames @@ -627,12 +647,14 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter copyProperties(xForeignSection, xSection); } } - catch (Exception e) + catch (Exception ex) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } } // ------------------------------------------------------------------------- + protected Rectangle insertLabel(XSection _xSection, String _sLabel, Rectangle _aRect, int _nWidth, SectionObject _aSO) { if (_xSection != null) @@ -678,15 +700,15 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter xFixedText.setHeight(nHeight); _xSection.add(xFixedText); } - catch (com.sun.star.uno.Exception e) + catch (com.sun.star.uno.Exception ex) { - // TODO: Exception not set. - int dummy = 0; + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } return _aRect; } // ------------------------------------------------------------------------- + protected String convertToFieldName(String _sElementName) { final StringBuffer aDataField = new StringBuffer(32); @@ -694,6 +716,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return aDataField.toString(); } + protected String convertFromFieldName(String _sName) { if (_sName.startsWith("field:[")) @@ -705,6 +728,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return _sName; } // ------------------------------------------------------------------------- + /** * Insert a already formatted field name into a given section * @@ -732,9 +756,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter int nHeight = LayoutConstants.FormattedFieldHeight; int nType = getTypeFromFieldName(convertFromFieldName(_sFormattedfield)); - if (nType == DataType.BINARY || - nType == DataType.VARBINARY || - nType == DataType.LONGVARBINARY) + if (nType == DataType.BINARY + || nType == DataType.VARBINARY + || nType == DataType.LONGVARBINARY) { aField = getMSFofReportDefinition().createInstance("com.sun.star.report.ImageControl"); nHeight = LayoutConstants.BinaryHeight; @@ -744,6 +768,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter aField = getMSFofReportDefinition().createInstance("com.sun.star.report.FormattedField"); nHeight = LayoutConstants.FormattedFieldHeight; if (nType == DataType.LONGVARCHAR) /* memo */ + { nHeight = LayoutConstants.MemoFieldHeight; // special case for memo } @@ -757,7 +782,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter xReportControlModel.setDataField(_sFormattedfield); if (_aSO != null) { - // TODO: there seems to be some problems with copy all properties from the design template to the current design + // TODO: there seems to be some problems with copy all properties from the design template to the current design final FontDescriptor aFD = _aSO.getFontDescriptor(); if (aFD != null) { @@ -772,9 +797,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter _aRect.X += _nWidth; xReportControlModel.setHeight(nHeight); - if (nType == DataType.BINARY || - nType == DataType.VARBINARY || - nType == DataType.LONGVARBINARY) + if (nType == DataType.BINARY + || nType == DataType.VARBINARY + || nType == DataType.LONGVARBINARY) { // aField = getMSFofReportDefinition().createInstance("com.sun.star.report.ImageControl"); final XImageControl xImageControl = (XImageControl) UnoRuntime.queryInterface(XImageControl.class, xReportControlModel); @@ -795,9 +820,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter // xReportControlModel.??? // } } - catch (com.sun.star.beans.UnknownPropertyException e) + catch (com.sun.star.beans.UnknownPropertyException ex) { - // seems we not able to set ParaAdjust + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } // spezial case rpt:now() (default date format) @@ -819,10 +844,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter _xSection.add(xReportControlModel); } } - catch (com.sun.star.uno.Exception e) + catch (com.sun.star.uno.Exception ex) { - // TODO: Exception not set. - int dummy = 0; + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } return _aRect; @@ -851,6 +875,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return m_xMSF; } // ------------------------------------------------------------------------- + protected Rectangle insertVerticalLine(XSection _xSection, Rectangle _aRect, int _nWidth, int _nHeight) { return insertLine(_xSection, _aRect, _nWidth, _nHeight, 1); @@ -882,15 +907,15 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter xFixedLine.setHeight(_nHeight); _xSection.add(xFixedLine); } - catch (com.sun.star.uno.Exception e) + catch (com.sun.star.uno.Exception ex) { - // TODO: Exception not set. - int dummy = 0; + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } return _aRect; } // ------------------------------------------------------------------------- + protected void clearReportHeader() { XSection xSection; @@ -902,9 +927,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter emptySection(xSection); } } - catch (com.sun.star.container.NoSuchElementException e) + catch (com.sun.star.container.NoSuchElementException ex) { - // Exception not set. Not really from interest. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex); } } @@ -930,6 +955,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } else @@ -953,7 +979,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (com.sun.star.container.NoSuchElementException e) { - // Exception not set. Not really from interest. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } @@ -979,6 +1005,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } else @@ -989,6 +1016,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } } // ------------------------------------------------------------------------- + protected void clearPageHeader() { XSection xSection; @@ -1002,7 +1030,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (com.sun.star.container.NoSuchElementException e) { - // Exception not set. Not really from interest. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } @@ -1017,7 +1045,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter // // DebugHelper.writeInfo("Date: " + aBuf.toString()); // return aBuf.toString(); // } - // protected String getCurrentDate() // { // Calendar aCalendar = Calendar.getInstance(); @@ -1060,7 +1087,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (com.sun.star.container.NoSuchElementException e) { - // Exception not set. Should not from interest here. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } @@ -1112,7 +1139,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter final PropertySetHelper aPropertySetHelper = new PropertySetHelper(xFixedTextModel); // aPropertySetHelper.showProperties(); - aPropertySetHelper.setPropertyValueDontThrow("FontDescriptor", _aFont); + aPropertySetHelper.setPropertyValueDontThrow(PropertyNames.FONT_DESCRIPTOR, _aFont); final Object aUnoCtrlFixedText = getGlobalMSF().createInstance("com.sun.star.awt.UnoControlFixedText"); // XServiceInfo xServiceInfo2 = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, aUnoCtrlFixedText); @@ -1150,7 +1177,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { - // TODO: Exception not set. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } return aSizeMM_100TH; } @@ -1161,24 +1188,24 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter { return m_sTableName; } - return ""; + return PropertyNames.EMPTY_STRING; } protected String getUserNameFromConfiguration() { - String sFirstName = ""; - String sLastName = ""; + String sFirstName = PropertyNames.EMPTY_STRING; + String sLastName = PropertyNames.EMPTY_STRING; try { Object oProdNameAccess = Configuration.getConfigurationRoot(getGlobalMSF(), "org.openoffice.UserProfile/Data", false); sFirstName = (String) Helper.getUnoObjectbyName(oProdNameAccess, "givenname"); sLastName = (String) Helper.getUnoObjectbyName(oProdNameAccess, "sn"); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } - return sFirstName + " " + sLastName; + return sFirstName + PropertyNames.SPACE + sLastName; } /** @@ -1210,6 +1237,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } } @@ -1238,14 +1266,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter Object aClone = aComponent.createClone(); if (aClone != null) { - String sName = aComponent.getName(); - com.sun.star.awt.Point aPosition = aComponent.getPosition(); - Size aSize = aComponent.getSize(); - XShape aShape = (XShape) UnoRuntime.queryInterface(XShape.class, aClone); - String sShapeType = aShape.getShapeType(); - com.sun.star.awt.Point aShapePoint = aShape.getPosition(); - Size aShapeSize = aShape.getSize(); // normally 'createClone' will create a real clone of the component, // but there seems some problems, we have to controll. @@ -1260,9 +1281,10 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } - // String sName = xForeignSection.getName(); - // int dummy = 0; + // String sName = xForeignSection.getName(); + // int dummy = 0; } protected void insertPageHeader() @@ -1287,6 +1309,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } return; } @@ -1364,7 +1387,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (com.sun.star.uno.Exception e) { - // TODO: Exception not set. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } } @@ -1390,6 +1413,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } else @@ -1423,8 +1447,8 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter final String sSurroundDoubleQuotes = "\"" + sPageOf + "\""; final String sPageNumber = sSurroundDoubleQuotes.replaceAll("#page#", "\" & PageNumber() & \""); final String sPageCount = sPageNumber.replaceAll("#count#", "\" & PageCount() & \""); - final String sNoLastUnusedQuotes = sPageCount.replaceAll(" & \\\"\\\"", ""); - final String sNoFirstUnusedQuotes = sNoLastUnusedQuotes.replaceAll("\\\"\\\" & ", ""); + final String sNoLastUnusedQuotes = sPageCount.replaceAll(" & \\\"\\\"", PropertyNames.EMPTY_STRING); + final String sNoFirstUnusedQuotes = sNoLastUnusedQuotes.replaceAll("\\\"\\\" & ", PropertyNames.EMPTY_STRING); final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent(); @@ -1455,7 +1479,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { - // TODO: Exception not set. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } } @@ -1595,7 +1619,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (com.sun.star.uno.Exception e) { - // TODO: Exception not set. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } return nWidth; @@ -1623,7 +1647,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter String sDefaultHeaderLayout = m_xReportDefinitionReadAccess.getDefaultHeaderLayout(); loadAndSetBackgroundTemplate(sDefaultHeaderLayout); - // copy all functions from the design template to the current report definition + // copy all functions from the design template to the current report definition // XFunctions xOtherFunctions = m_xDesignTemplate.getReportDefinition().getFunctions(); // final int nFunctionCount = xOtherFunctions.getCount(); // for (int i=0;i<nFunctionCount;i++) @@ -1678,8 +1702,8 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter closeDesignTemplate(); String sName = FileAccess.getFilename(LayoutTemplatePath); - if (sName.toLowerCase().equals("default.otr_") || - LayoutTemplatePath.equals("DefaultLayoutOfHeaders")) + if (sName.toLowerCase().equals("default.otr_") + || LayoutTemplatePath.equals("DefaultLayoutOfHeaders")) { // this is the default layout, we don't want to have a layout for this. } @@ -1690,4 +1714,3 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } } } - diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java index 797ac097f915..106b2a341d17 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java @@ -65,14 +65,12 @@ abstract public class SectionObject public int getHeight(int _nDefault) { - final int nHeight = getPropertySetHelper().getPropertyValueAsInteger(PropertyNames.PROPERTY_HEIGHT, _nDefault); - return nHeight; + return getPropertySetHelper().getPropertyValueAsInteger(PropertyNames.PROPERTY_HEIGHT, _nDefault); } public float getCharWeight(float _nDefault) { - final float fCharWeight = (float) getPropertySetHelper().getPropertyValueAsDouble("CharWeight", _nDefault); - return fCharWeight; + return(float) getPropertySetHelper().getPropertyValueAsDouble("CharWeight", _nDefault); } public void setFontToBold() diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java b/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java index 0fe168b28263..51edc3e3ac13 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java @@ -92,60 +92,59 @@ public class Tabular extends ReportBuilderLayouter xSection.setHeight(nHeight); } - protected void insertDetailFieldTitles() + protected void insertDetailFieldTitles(int lastGroupPostion) { final String[] aFieldTitleNames = getFieldTitleNames(); - if (aFieldTitleNames == null) + if (aFieldTitleNames == null || aFieldTitleNames.length == 0) { return; } - if (aFieldTitleNames.length == 0) - { - return; - } - final int nGroups = getReportDefinition().getGroups().getCount(); try { - XSection xSection = null; SectionObject aSO = null; - if (nGroups == 0) + final XGroups xGroups = getReportDefinition().getGroups(); + final XGroup xGroup; + if (lastGroupPostion == -1) { // Spezial case, there is no Group. - final XGroups xGroups = getReportDefinition().getGroups(); - final XGroup xGroup = xGroups.createGroup(); + xGroup = xGroups.createGroup(); xGroup.setHeaderOn(true); xGroups.insertByIndex(xGroups.getCount(), xGroup); - xSection = xGroup.getHeader(); copyGroupProperties(0); aSO = getDesignTemplate().getDetailLabel(); aSO.setFontToBold(); } else { - final XGroups xGroups = getReportDefinition().getGroups(); // we insert the titles in the last group - final Object aGroup = xGroups.getByIndex(nGroups - 1); - final XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup); - xSection = xGroup.getHeader(); + xGroup = UnoRuntime.queryInterface(XGroup.class, xGroups.getByIndex(lastGroupPostion)); // We don't need to copy the GroupProperties, because this is done in the insertGroup() member function // copyGroupProperties(0); - aSO = getDesignTemplate().getGroupLabel(nGroups - 1); + aSO = getDesignTemplate().getGroupLabel(lastGroupPostion); } + XSection xSection = xGroup.getHeader(); Rectangle aRect = new Rectangle(); -// TODO: getCountOfGroups() == nGroups??? aRect.X = getLeftPageIndent() + getLeftGroupIndent(getCountOfGroups()); - // TODO: group line is fix - aRect.Y = aSO.getHeight(LayoutConstants.LabelHeight) + LayoutConstants.LineHeight; // group height + a little empty line + if (lastGroupPostion == -1) + { + xSection.setHeight(0); // group height + a little empty line) + aRect.Y = 0; + } + else + { + aRect.Y = xSection.getHeight() + LayoutConstants.LineHeight; + } + final int nWidth = calculateFieldWidth(getLeftGroupIndent(getCountOfGroups()), aFieldTitleNames.length); for (int i = 0; i < aFieldTitleNames.length; i++) { aRect = insertLabel(xSection, aFieldTitleNames[i], aRect, nWidth, aSO); } - xSection.setHeight(aSO.getHeight(LayoutConstants.LabelHeight) + LayoutConstants.LineHeight + aSO.getHeight(LayoutConstants.LabelHeight)); + xSection.setHeight(xSection.getHeight() + aSO.getHeight(LayoutConstants.LabelHeight)); } catch (com.sun.star.uno.Exception e) { diff --git a/wizards/com/sun/star/wizards/table/CallTableWizard.java b/wizards/com/sun/star/wizards/table/CallTableWizard.java index af685eadf343..21174d59ff74 100644 --- a/wizards/com/sun/star/wizards/table/CallTableWizard.java +++ b/wizards/com/sun/star/wizards/table/CallTableWizard.java @@ -30,6 +30,7 @@ import com.sun.star.beans.PropertyAttribute; import com.sun.star.beans.PropertyValue; import com.sun.star.uno.Type; import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.common.PropertyNames; /** This class capsulates the class, that implements the minimal component, a * factory for creating the service (<CODE>__getServiceFactory</CODE>). @@ -80,15 +81,15 @@ public class CallTableWizard { super(); m_serviceFactory = i_serviceFactory; - registerProperty( "Command", (short)( PropertyAttribute.READONLY | PropertyAttribute.MAYBEVOID ) ); - registerProperty( "CommandType", PropertyAttribute.READONLY ); + registerProperty( PropertyNames.COMMAND, (short)( PropertyAttribute.READONLY | PropertyAttribute.MAYBEVOID ) ); + registerProperty( PropertyNames.COMMAND_TYPE, PropertyAttribute.READONLY ); } public void trigger( String sEvent ) { try { - if ( sEvent.compareTo("start") == 0 ) + if ( sEvent.compareTo(PropertyNames.START) == 0 ) { TableWizard CurTableWizard = new TableWizard( m_serviceFactory, m_wizardContext ); Command = CurTableWizard.startTableWizard(); @@ -166,7 +167,7 @@ public class CallTableWizard try { - byteReturn = new String("" + this.hashCode()).getBytes(); + byteReturn = new String(PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { diff --git a/wizards/com/sun/star/wizards/table/FieldDescription.java b/wizards/com/sun/star/wizards/table/FieldDescription.java index cf00c86f90d4..70fa37f18a2f 100644 --- a/wizards/com/sun/star/wizards/table/FieldDescription.java +++ b/wizards/com/sun/star/wizards/table/FieldDescription.java @@ -40,7 +40,7 @@ import com.sun.star.wizards.common.PropertyNames; public class FieldDescription { - private String tablename = ""; + private String tablename = PropertyNames.EMPTY_STRING; // String fieldname; private String keyname; private XNameAccess xNameAccessTableNode; diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java index 5c5111e273b1..dbf2aeb730b7 100644 --- a/wizards/com/sun/star/wizards/table/FieldFormatter.java +++ b/wizards/com/sun/star/wizards/table/FieldFormatter.java @@ -110,7 +110,7 @@ public class FieldFormatter implements XItemListener btnShiftUp = CurUnoDialog.insertButton("btnShiftUp", "shiftFieldNameUp", this, new String[] { - PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_ENABLED, PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -120,7 +120,7 @@ public class FieldFormatter implements XItemListener btnShiftDown = CurUnoDialog.insertButton("btnShiftDown", "shiftFieldNameDown", this, new String[] { - PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_ENABLED, PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -132,7 +132,7 @@ public class FieldFormatter implements XItemListener btnminus = CurUnoDialog.insertButton("btnminus", "removeFieldName", this, new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -142,7 +142,7 @@ public class FieldFormatter implements XItemListener btnplus = CurUnoDialog.insertButton("btnplus", "addFieldName", this, new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -152,7 +152,7 @@ public class FieldFormatter implements XItemListener CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "ColDescriptorHeader", new String[] { - PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.ORIENTATION, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -177,7 +177,7 @@ public class FieldFormatter implements XItemListener }, new Object[] { - UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_COLNAME", 274, 37, IFieldFormatStep, new Short(curtabindex++), "", 50 + UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_COLNAME", 274, 37, IFieldFormatStep, new Short(curtabindex++), PropertyNames.EMPTY_STRING, 50 }); txtfieldname.addTextListener(CurUnoDialog); CurUnoDialog.getPeerConfiguration().setAccessibleName(btnplus, sbtnplushelptext); @@ -198,7 +198,7 @@ public class FieldFormatter implements XItemListener 85, 158, 49, IFieldFormatStep, new Short(curtabindex++), 166, 50 }); //, "HID:WIZARDS_HID_DLGTABLE_COLMODIFIER" curTableDescriptor = _curTableDescriptor; - Helper.setUnoPropertyValue(oColumnDescriptorModel, "ActiveConnection", _curTableDescriptor.DBConnection); + Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.ACTIVE_CONNECTION, _curTableDescriptor.DBConnection); txtfieldname.setMaxTextLen((short) this.curTableDescriptor.getMaxColumnNameLength()); } else @@ -210,8 +210,8 @@ public class FieldFormatter implements XItemListener CurUnoDialog.repaintDialogStep(); } } - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList", _fieldnames); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, _fieldnames); + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); @@ -224,7 +224,7 @@ public class FieldFormatter implements XItemListener { boolean benableShiftUpButton = false; boolean benableShiftDownButton = false; - boolean bfieldnameisselected = Helper.getUnoArrayPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems") != null; + boolean bfieldnameisselected = Helper.getUnoArrayPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS) != null; int ilistcount = /* xlstFieldNames.getItemCount();*/ UnoDialog.getListBoxItemCount(xlstFieldNames); boolean blistispopulated = (ilistcount > 0); if (bfieldnameisselected) @@ -241,12 +241,12 @@ public class FieldFormatter implements XItemListener public void addFieldName() { - String snewfieldname = Desktop.getUniqueName(xlstFieldNames.getItems(), suntitled, ""); + String snewfieldname = Desktop.getUniqueName(xlstFieldNames.getItems(), suntitled, PropertyNames.EMPTY_STRING); short icount = xlstFieldNames.getItemCount(); if (CurUnoDialog.verifyfieldcount(icount)) { xlstFieldNames.addItem(snewfieldname, icount); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { icount }); @@ -262,7 +262,7 @@ public class FieldFormatter implements XItemListener public void removeFieldName() { - String[] fieldnames = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList"); + String[] fieldnames = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST); short ipos = UnoDialog.getSelectedItemPos(xlstFieldNames); String fieldname = fieldnames[ipos]; xlstFieldNames.removeItems(ipos, (short) 1); @@ -270,7 +270,7 @@ public class FieldFormatter implements XItemListener int ilistcount = /* xlstFieldNames.getItemCount();*/ UnoDialog.getListBoxItemCount(xlstFieldNames); if ((ipos) < ilistcount) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { ipos }); @@ -280,14 +280,14 @@ public class FieldFormatter implements XItemListener if (ilistcount > -1) { ipos = (short) ((short) ilistcount - (short) 1); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { ipos }); } } curTableDescriptor.dropColumnbyName(fieldname); - fieldnames = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList"); + fieldnames = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST); boolean benable = ((ipos > -1) && (ipos < fieldnames.length)); if (benable) { @@ -297,7 +297,7 @@ public class FieldFormatter implements XItemListener } else { - Helper.setUnoPropertyValue(UnoDialog.getModel(txtfieldname), "Text", ""); + Helper.setUnoPropertyValue(UnoDialog.getModel(txtfieldname), "Text", PropertyNames.EMPTY_STRING); Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, new Boolean(benable)); CurUnoDialog.setcompleted(TableWizard.SOFIELDSFORMATPAGE, benable); } @@ -323,8 +323,8 @@ public class FieldFormatter implements XItemListener String[] fieldnames = xlstFieldNames.getItems(); short ipos = xlstFieldNames.getSelectedItemPos(); fieldnames[ipos] = newfieldname; - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList", fieldnames); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, fieldnames); + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { ipos }); @@ -336,10 +336,10 @@ public class FieldFormatter implements XItemListener { short ipos = xlstFieldNames.getSelectedItemPos(); String[] snewlist = shiftArrayItem(xlstFieldNames.getItems(), ipos, -1); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList", snewlist); + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, snewlist); if ((ipos - 1) > -1) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { (short) (ipos - 1) }); @@ -352,10 +352,10 @@ public class FieldFormatter implements XItemListener { short ipos = xlstFieldNames.getSelectedItemPos(); String[] snewlist = shiftArrayItem(xlstFieldNames.getItems(), ipos, 1); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList", snewlist); + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, snewlist); if ((ipos + 1) < xlstFieldNames.getItemCount()) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { (short) (ipos + 1) }); @@ -415,13 +415,13 @@ public class FieldFormatter implements XItemListener public boolean iscompleted() { - String[] sfieldnames = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList"); + String[] sfieldnames = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST); return sfieldnames.length > 0; } public String[] getFieldNames() { - return (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), "StringItemList"); + return (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST); } /* (non-Javadoc) diff --git a/wizards/com/sun/star/wizards/table/Finalizer.java b/wizards/com/sun/star/wizards/table/Finalizer.java index 83c92aeb731f..dd6933385927 100644 --- a/wizards/com/sun/star/wizards/table/Finalizer.java +++ b/wizards/com/sun/star/wizards/table/Finalizer.java @@ -92,7 +92,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_TXT_NAME", 97, 35, IFINALSTEP, new Short(curtabindex++), "", 223 + UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_TXT_NAME", 97, 35, IFINALSTEP, new Short(curtabindex++), PropertyNames.EMPTY_STRING, 223 }); txtTableName.addTextListener(CurUnoDialog); txtTableName.setMaxTextLen((short) this.curtabledescriptor.getMaxTableNameLength()); @@ -103,7 +103,7 @@ public class Finalizer if (sCatalogNames.length > 0) { bsupportsCatalogs = true; - String sCatalog = ""; + String sCatalog = PropertyNames.EMPTY_STRING; try { sCatalog = curtabledescriptor.DBConnection.getCatalog(); @@ -127,7 +127,7 @@ public class Finalizer xCatalogListBox = CurUnoDialog.insertListBox("lstCatalog", null, null, new String[] { - "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -138,7 +138,7 @@ public class Finalizer { isel = 0; } - CurUnoDialog.setControlProperty("lstCatalog", "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstCatalog", PropertyNames.SELECTED_ITEMS, new short[] { (short) isel }); @@ -158,7 +158,7 @@ public class Finalizer if (sSchemaNames.length > 0) { bsupportsSchemata = true; - String sSchema = ""; + String sSchema = PropertyNames.EMPTY_STRING; try { sSchema = (String) curtabledescriptor.getDataSourcePropertySet().getPropertyValue("User"); @@ -182,7 +182,7 @@ public class Finalizer xSchemaListBox = CurUnoDialog.insertListBox("lstSchema", null, null, new String[] { - "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -193,7 +193,7 @@ public class Finalizer { isel = 0; } - CurUnoDialog.setControlProperty("lstSchema", "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSchema", PropertyNames.SELECTED_ITEMS, new short[] { (short) isel }); @@ -302,7 +302,7 @@ public class Finalizer public void setTableName(String _tablename) { - if (txtTableName.getText().equals("")) + if (txtTableName.getText().equals(PropertyNames.EMPTY_STRING)) { String ssuffix = Desktop.getIncrementSuffix(curtabledescriptor.getTableNamesAsNameAccess(), getComposedTableName(_tablename)); txtTableName.setText(_tablename + ssuffix); @@ -317,7 +317,7 @@ public class Finalizer public String getTableName(String _firsttablename) { - if (txtTableName.getText().equals("")) + if (txtTableName.getText().equals(PropertyNames.EMPTY_STRING)) { setTableName(_firsttablename); } @@ -332,7 +332,7 @@ public class Finalizer } else { - return ""; + return PropertyNames.EMPTY_STRING; } } @@ -344,7 +344,7 @@ public class Finalizer } else { - return ""; + return PropertyNames.EMPTY_STRING; } } diff --git a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java index aec63204f64a..34c880c3bab5 100644 --- a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java +++ b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java @@ -210,7 +210,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener } } String selfield = lstSinglePrimeKey.getSelectedItem(); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), "StringItemList", fieldnames); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), PropertyNames.STRING_ITEM_LIST, fieldnames); if (selfield != null) { if (JavaTools.FieldInList(fieldnames, selfield) > -1) diff --git a/wizards/com/sun/star/wizards/table/ScenarioSelector.java b/wizards/com/sun/star/wizards/table/ScenarioSelector.java index e7b94596a90a..8c2b52cf5244 100644 --- a/wizards/com/sun/star/wizards/table/ScenarioSelector.java +++ b/wizards/com/sun/star/wizards/table/ScenarioSelector.java @@ -196,7 +196,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X public void initializeTable(int _iTable) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, new short[] { (short) _iTable }); @@ -266,7 +266,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X { for (int i = 0; i < CurTableWizardUnoDialog.fielditems.size(); i++) { - String stablename = ""; + String stablename = PropertyNames.EMPTY_STRING; try { FieldDescription ofielddescription = (FieldDescription) CurTableWizardUnoDialog.fielditems.get(fieldnames[i]); @@ -276,7 +276,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X { e.printStackTrace(System.out); } - if (!stablename.equals("")) + if (!stablename.equals(PropertyNames.EMPTY_STRING)) { return stablename; } @@ -347,7 +347,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X if (iduplicate != -1) { XNameAccess xNameAccessFieldNode; - String sdisplayname = Desktop.getUniqueName(NewItems, NewItems[iduplicate], ""); + String sdisplayname = Desktop.getUniqueName(NewItems, NewItems[iduplicate], PropertyNames.EMPTY_STRING); FieldDescription curfielddescription = new FieldDescription(xMSF, aLocale, this, sdisplayname, NewItems[iduplicate], imaxcolumnchars); CurTableWizardUnoDialog.fielditems.put(sdisplayname, curfielddescription); NewItems[iduplicate] = sdisplayname; diff --git a/wizards/com/sun/star/wizards/table/TableWizard.java b/wizards/com/sun/star/wizards/table/TableWizard.java index 79ddb8ae1039..deb38a044f76 100644 --- a/wizards/com/sun/star/wizards/table/TableWizard.java +++ b/wizards/com/sun/star/wizards/table/TableWizard.java @@ -53,7 +53,7 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener, ScenarioSelector curScenarioSelector; FieldFormatter curFieldFormatter; PrimaryKeyHandler curPrimaryKeyHandler; - String sMsgWizardName = ""; + String sMsgWizardName = PropertyNames.EMPTY_STRING; public Hashtable fielditems; int wizardmode; String tablename; @@ -66,7 +66,7 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener, public static final int SOFIELDSFORMATPAGE = 2; public static final int SOPRIMARYKEYPAGE = 3; public static final int SOFINALPAGE = 4; - private String sMsgColumnAlreadyExists = ""; + private String sMsgColumnAlreadyExists = PropertyNames.EMPTY_STRING; String WizardHeaderText[] = new String[8]; private String m_tableName; @@ -325,15 +325,15 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener, Object oFormWizard = this.xMSF.createInstance("com.sun.star.wizards.form.CallFormWizard"); NamedValueCollection wizardContext = new NamedValueCollection(); - wizardContext.put( "ActiveConnection", curTableDescriptor.DBConnection ); + wizardContext.put( PropertyNames.ACTIVE_CONNECTION, curTableDescriptor.DBConnection ); wizardContext.put( "DataSource", curTableDescriptor.getDataSource() ); - wizardContext.put( "CommandType", CommandType.TABLE ); - wizardContext.put( "Command", scomposedtablename ); + wizardContext.put( PropertyNames.COMMAND_TYPE, CommandType.TABLE ); + wizardContext.put( PropertyNames.COMMAND, scomposedtablename ); wizardContext.put( "DocumentUI", m_docUI ); XInitialization xInitialization = UnoRuntime.queryInterface( XInitialization.class, oFormWizard ); xInitialization.initialize( wizardContext.getPropertyValues() ); XJobExecutor xJobExecutor = UnoRuntime.queryInterface( XJobExecutor.class, oFormWizard ); - xJobExecutor.trigger("start"); + xJobExecutor.trigger(PropertyNames.START); } catch (Exception e) { @@ -387,7 +387,7 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener, { jexception.printStackTrace(System.out); } - return ""; + return PropertyNames.EMPTY_STRING; } public boolean getTableResources() diff --git a/wizards/com/sun/star/wizards/text/TextDocument.java b/wizards/com/sun/star/wizards/text/TextDocument.java index 4fe2e9f0d710..732dcf777acd 100644 --- a/wizards/com/sun/star/wizards/text/TextDocument.java +++ b/wizards/com/sun/star/wizards/text/TextDocument.java @@ -74,6 +74,7 @@ import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.JavaTools; import com.sun.star.wizards.common.Helper.DateUtils; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.document.OfficeDocument; public class TextDocument @@ -210,7 +211,7 @@ public class TextDocument { XStatusIndicatorFactory xStatusIndicatorFactory = (XStatusIndicatorFactory) UnoRuntime.queryInterface(XStatusIndicatorFactory.class, xFrame); xProgressBar = xStatusIndicatorFactory.createStatusIndicator(); - xProgressBar.start("", 100); + xProgressBar.start(PropertyNames.EMPTY_STRING, 100); xProgressBar.setValue(5); } xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); @@ -239,7 +240,7 @@ public class TextDocument { XStatusIndicatorFactory xStatusIndicatorFactory = (XStatusIndicatorFactory) UnoRuntime.queryInterface(XStatusIndicatorFactory.class, xFrame); xProgressBar = xStatusIndicatorFactory.createStatusIndicator(); - xProgressBar.start("", 100); + xProgressBar.start(PropertyNames.EMPTY_STRING, 100); xProgressBar.setValue(5); } @@ -248,7 +249,7 @@ public class TextDocument PropertyValue loadValues[] = new PropertyValue[3]; // open document in the Preview mode loadValues[0] = new PropertyValue(); - loadValues[0].Name = "ReadOnly"; + loadValues[0].Name = PropertyNames.READ_ONLY; loadValues[0].Value = Boolean.TRUE; loadValues[1] = new PropertyValue(); loadValues[1].Name = "AsTemplate"; @@ -365,7 +366,7 @@ public class TextDocument iScale = (iLastPos - iFirstPos) / iScaleLen; xTextCursor.gotoStart(false); xTextCursor.gotoEnd(true); - xTextCursor.setString(""); + xTextCursor.setString(PropertyNames.EMPTY_STRING); unlockallControllers(); return iScale; } @@ -399,7 +400,7 @@ public class TextDocument XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, uD); Object gn = xNA.getByName("givenname"); Object sn = xNA.getByName("sn"); - String fullname = (String) gn + " " + (String) sn; + String fullname = (String) gn + PropertyNames.SPACE + (String) sn; Calendar cal = new GregorianCalendar(); int year = cal.get(Calendar.YEAR); @@ -418,7 +419,7 @@ public class TextDocument xDocProps2.setAuthor(fullname); xDocProps2.setModifiedBy(fullname); String description = xDocProps2.getDescription(); - description = description + " " + TemplateDescription; + description = description + PropertyNames.SPACE + TemplateDescription; description = JavaTools.replaceSubString(description, WizardName, "<wizard_name>"); description = JavaTools.replaceSubString(description, myDate, "<current_date>"); xDocProps2.setDescription(description); diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.java b/wizards/com/sun/star/wizards/text/TextFieldHandler.java index e25227516058..8236ddb86d3a 100644 --- a/wizards/com/sun/star/wizards/text/TextFieldHandler.java +++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.java @@ -82,7 +82,7 @@ public class TextFieldHandler Object oTextField = Helper.getUnoPropertyValue(xTextRange, "TextField"); if (com.sun.star.uno.AnyConverter.isVoid(oTextField)) { - return ""; + return PropertyNames.EMPTY_STRING; } else { @@ -96,7 +96,7 @@ public class TextFieldHandler { exception.printStackTrace(System.out); } - return ""; + return PropertyNames.EMPTY_STRING; } public void insertUserField(XTextCursor xTextCursor, String FieldName, String FieldTitle) diff --git a/wizards/com/sun/star/wizards/text/TextSectionHandler.java b/wizards/com/sun/star/wizards/text/TextSectionHandler.java index 42fd75879c3c..b948b2a60d4b 100644 --- a/wizards/com/sun/star/wizards/text/TextSectionHandler.java +++ b/wizards/com/sun/star/wizards/text/TextSectionHandler.java @@ -43,6 +43,7 @@ import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.PropertyNames; public class TextSectionHandler { @@ -161,7 +162,7 @@ public class TextSectionHandler XIndexAccess xAllTextSections = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); int iSectionCount = xAllTextSections.getCount(); SectionFileLink oSectionLink = new SectionFileLink(); - oSectionLink.FileURL = ""; + oSectionLink.FileURL = PropertyNames.EMPTY_STRING; for (int i = 0; i < iSectionCount; i++) { oTextSection = xAllTextSections.getByIndex(i); @@ -170,7 +171,7 @@ public class TextSectionHandler "FileLink", "LinkRegion" }, new Object[] { - oSectionLink, "" + oSectionLink, PropertyNames.EMPTY_STRING }); } } @@ -183,13 +184,13 @@ public class TextSectionHandler public void breakLinkOfTextSection(Object oTextSection) { SectionFileLink oSectionLink = new SectionFileLink(); - oSectionLink.FileURL = ""; + oSectionLink.FileURL = PropertyNames.EMPTY_STRING; Helper.setUnoPropertyValues(oTextSection, new String[] { "FileLink", "LinkRegion" }, new Object[] { - oSectionLink, "" + oSectionLink, PropertyNames.EMPTY_STRING }); } diff --git a/wizards/com/sun/star/wizards/text/TextStyleHandler.java b/wizards/com/sun/star/wizards/text/TextStyleHandler.java index e6c952e65785..82da36f16019 100644 --- a/wizards/com/sun/star/wizards/text/TextStyleHandler.java +++ b/wizards/com/sun/star/wizards/text/TextStyleHandler.java @@ -36,6 +36,7 @@ import com.sun.star.text.XTextDocument; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; +import com.sun.star.wizards.common.PropertyNames; public class TextStyleHandler { @@ -58,7 +59,7 @@ public class TextStyleHandler { XStyleLoader xStyleLoader = (XStyleLoader) UnoRuntime.queryInterface(XStyleLoader.class, xStyleFamiliesSupplier.getStyleFamilies()); com.sun.star.beans.PropertyValue[] StyleOptions = xStyleLoader.getStyleLoaderOptions(); - String CurOptionName = ""; + String CurOptionName = PropertyNames.EMPTY_STRING; int PropCount = StyleOptions.length; for (int i = 0; i < PropCount; i++) { diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java index 3f37d68123a6..2940e89a6ae4 100644 --- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java +++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java @@ -127,7 +127,7 @@ public class AggregateComponent extends ControlScroller CurUnoDialog.insertButton("btnplus", SOADDROW, new ActionListenerImpl(), new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -136,7 +136,7 @@ public class AggregateComponent extends ControlScroller CurUnoDialog.insertButton("btnminus", SOREMOVEROW, new ActionListenerImpl(), new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -528,7 +528,7 @@ public class AggregateComponent extends ControlScroller xFunctionListBox = CurUnoDialog.insertListBox(getFunctionControlName(index), 1, null, new ItemListenerImpl(), new String[] { - "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -570,13 +570,13 @@ public class AggregateComponent extends ControlScroller private void insertFieldNames() { - Helper.setUnoPropertyValue(UnoDialog.getModel(xFieldListBox), "StringItemList", CurDBMetaData.NumericFieldNames); + Helper.setUnoPropertyValue(UnoDialog.getModel(xFieldListBox), PropertyNames.STRING_ITEM_LIST, CurDBMetaData.NumericFieldNames); } private boolean isComplete() { - boolean bfieldnameisselected = (Helper.getUnoArrayPropertyValue(UnoDialog.getModel(xFieldListBox), "SelectedItems") != null); - boolean bfunctionisselected = (Helper.getUnoArrayPropertyValue(UnoDialog.getModel(xFunctionListBox), "SelectedItems") != null); + boolean bfieldnameisselected = (Helper.getUnoArrayPropertyValue(UnoDialog.getModel(xFieldListBox), PropertyNames.SELECTED_ITEMS) != null); + boolean bfunctionisselected = (Helper.getUnoArrayPropertyValue(UnoDialog.getModel(xFunctionListBox), PropertyNames.SELECTED_ITEMS) != null); return (bfieldnameisselected && bfunctionisselected); } diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java index 2239b940798e..4436c5dbfe95 100644 --- a/wizards/com/sun/star/wizards/ui/ButtonList.java +++ b/wizards/com/sun/star/wizards/ui/ButtonList.java @@ -135,7 +135,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener new Object[] { Integer.valueOf(imageTextHeight), - "", + PropertyNames.EMPTY_STRING, "(1)", Integer.valueOf(nXPos), Integer.valueOf(nYPos), @@ -190,7 +190,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener lblCounter = dialog.insertLabel(m_aControlName + "_lblCounter", pNames1, new Object[] { Integer.valueOf(LINE_HEIGHT), - "", + PropertyNames.EMPTY_STRING, Integer.valueOf(pos.Width + btnSize.intValue() + 1), Integer.valueOf(pos.Height + (m_aButtonSize.Height + gap.Height) * rows + gap.Height + imageTextHeight + ((btnSize.intValue() - LINE_HEIGHT) / 2)), step, @@ -675,7 +675,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private void refreshImageText() { Object item = m_nCurrentSelection >= 0 ? getListModel().getElementAt(m_nCurrentSelection) : null; - final String sText = " " + renderer.render(item); + final String sText = PropertyNames.SPACE + renderer.render(item); Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, sText); } @@ -770,7 +770,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener // @Override public String render(Object counter) { - return "" + ((Counter) counter).start + ".." + ((Counter) counter).end + "/" + ((Counter) counter).max; + return PropertyNames.EMPTY_STRING + ((Counter) counter).start + ".." + ((Counter) counter).end + "/" + ((Counter) counter).max; } } @@ -891,7 +891,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener } // check which Button is pressed. - String sControlName = aHelper.getPropertyValueAsString(PropertyNames.PROPERTY_NAME, ""); + String sControlName = aHelper.getPropertyValueAsString(PropertyNames.PROPERTY_NAME, PropertyNames.EMPTY_STRING); final String sButton = sControlName.substring(7 + m_aControlName.length()); int nButton = new Integer(sButton).intValue(); diff --git a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java index 1352f70f9e83..b97fb6f5e84f 100644 --- a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java @@ -63,7 +63,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject) { - short[] SelItems = (short[]) CurUnoDialog.getControlProperty(sTableListBoxName, "SelectedItems"); + short[] SelItems = (short[]) CurUnoDialog.getControlProperty(sTableListBoxName, PropertyNames.SELECTED_ITEMS); if (SelItems.length > 0) { iOldSelPos = m_iSelPos; @@ -187,7 +187,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator } else { - return ""; + return PropertyNames.EMPTY_STRING; } } @@ -205,7 +205,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator private short getselectedItemPos() { - short[] iSelPoses = ((short[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems")); + short[] iSelPoses = ((short[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS)); if (iSelPoses.length > 0) { return iSelPoses[0]; @@ -214,7 +214,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator { if (this.bpreselectCommand) { - String[] sItemList = ((String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), "StringItemList")); + String[] sItemList = ((String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.STRING_ITEM_LIST)); if (sItemList.length > 0) { return (short) 0; @@ -229,10 +229,10 @@ public class CommandFieldSelection extends FieldSelection implements Comparator try { boolean binitialize = false; - String curCommandName = ""; + String curCommandName = PropertyNames.EMPTY_STRING; //As the peer of the control might not yet exist we have to query the model for the SelectedItems short iSelPos = getselectedItemPos(); - // String[] sLocList = (String[]) CurUnoDialog.getControlProperty(sTableListBoxName, "StringItemList"); + // String[] sLocList = (String[]) CurUnoDialog.getControlProperty(sTableListBoxName, PropertyNames.STRING_ITEM_LIST); final String sSelectedTableName = xTableListBox.getItem(iSelPos); if (!bgetQueries) { @@ -245,14 +245,14 @@ public class CommandFieldSelection extends FieldSelection implements Comparator if (sSelectedTableName.startsWith(sTablePrefix)) { CurDBMetaData.setCommandType(CommandType.TABLE); - curCommandName = JavaTools.replaceSubString(sSelectedTableName, "", sTablePrefix); + curCommandName = JavaTools.replaceSubString(sSelectedTableName, PropertyNames.EMPTY_STRING, sTablePrefix); CurDBMetaData.setTableByName(curCommandName); binitialize = CurDBMetaData.getFieldNamesOfCommand(curCommandName, CommandType.TABLE, AppendMode); } else { CurDBMetaData.setCommandType(CommandType.QUERY); - curCommandName = JavaTools.replaceSubString(sSelectedTableName, "", sQueryPrefix); + curCommandName = JavaTools.replaceSubString(sSelectedTableName, PropertyNames.EMPTY_STRING, sQueryPrefix); CurDBMetaData.setQueryByName(curCommandName); binitialize = CurDBMetaData.getFieldNamesOfCommand(curCommandName, CommandType.QUERY, AppendMode); } @@ -304,7 +304,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator ContentList = setPrefixinArray(ContentList, sTablePrefix, 0, CurDBMetaData.getTableNames().length); } java.util.Arrays.sort(ContentList, this); - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "StringItemList", ContentList); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.STRING_ITEM_LIST, ContentList); short iSelPos = getselectedItemPos(); if (bpreselectCommand) { @@ -322,7 +322,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator emptyFieldsListBoxes(); iSelArray = new short[] { (short) iSelPos }; } - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems", iSelArray); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, iSelArray); toggleCommandListBox(true); if (bgetFields) { @@ -404,10 +404,10 @@ public class CommandFieldSelection extends FieldSelection implements Comparator { try { - if (Properties.hasPropertyValue(_aPropertyValue, "CommandType")) + if (Properties.hasPropertyValue(_aPropertyValue, PropertyNames.COMMAND_TYPE)) { - int nCommandType = AnyConverter.toInt(Properties.getPropertyValue(_aPropertyValue, "CommandType")); - String sCommand = AnyConverter.toString(Properties.getPropertyValue(_aPropertyValue, "Command")); + int nCommandType = AnyConverter.toInt(Properties.getPropertyValue(_aPropertyValue, PropertyNames.COMMAND_TYPE)); + String sCommand = AnyConverter.toString(Properties.getPropertyValue(_aPropertyValue, PropertyNames.COMMAND)); if (sCommand != null) { preselectCommand(sCommand, nCommandType, _bReadOnly); @@ -424,12 +424,12 @@ public class CommandFieldSelection extends FieldSelection implements Comparator { if (_selitem.length() > 0) { - String[] sitems = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), "StringItemList"); + String[] sitems = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.STRING_ITEM_LIST); String sPrefix = getCommandPrefix(_nCommandType); short iselpos = (short) JavaTools.FieldInList(sitems, sPrefix + _selitem); if (iselpos > -1) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, new short[] { iselpos }); @@ -438,13 +438,13 @@ public class CommandFieldSelection extends FieldSelection implements Comparator } else { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, new short[] { }); } if (_bReadOnly) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "ReadOnly", new Boolean(_selitem.length() > 0)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.READ_ONLY, new Boolean(_selitem.length() > 0)); } } @@ -452,22 +452,22 @@ public class CommandFieldSelection extends FieldSelection implements Comparator { if (_selitem.length() > 0) { - String[] sitems = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), "StringItemList"); + String[] sitems = (String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.STRING_ITEM_LIST); short iselpos = (short) JavaTools.FieldInList(sitems, getTablePrefix() + _selitem); if (iselpos > -1) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems", new short[] { iselpos }); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, new short[] { iselpos }); } this.fillUpFieldsListbox(); } else { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems", new short[] {} ); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, new short[] {} ); this.fillUpFieldsListbox(); } if (_bReadOnly) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "ReadOnly", new Boolean(_selitem.length() > 0)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.READ_ONLY, new Boolean(_selitem.length() > 0)); } toggleListboxButtons((short)-1,(short)-1); } diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.java b/wizards/com/sun/star/wizards/ui/ControlScroller.java index b8f2036f9867..f25616098a26 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.java +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.java @@ -26,8 +26,6 @@ ************************************************************************/ package com.sun.star.wizards.ui; -import com.sun.star.awt.XScrollBar; -import com.sun.star.awt.AdjustmentEvent; import com.sun.star.beans.*; import com.sun.star.awt.*; import com.sun.star.lang.XMultiServiceFactory; @@ -130,7 +128,7 @@ public abstract class ControlScroller new AdjustmentListenerImpl(), new String[] { - PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.ORIENTATION, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -158,7 +156,7 @@ public abstract class ControlScroller protected void setScrollBarOrientationHorizontal() { - Helper.setUnoPropertyValue(xScrollBar, "Orientation", new Integer(ScrollBarOrientation.HORIZONTAL)); + Helper.setUnoPropertyValue(xScrollBar, PropertyNames.ORIENTATION, new Integer(ScrollBarOrientation.HORIZONTAL)); } /** @@ -453,7 +451,7 @@ public abstract class ControlScroller { Object oControlModel = UnoDialog.getModel(CurUnoDialog.xDlgContainer.getControl(controlname)); String propertyname = UnoDialog.getDisplayProperty(oControlModel); - if (propertyname != "") + if (propertyname != PropertyNames.EMPTY_STRING) { CurUnoDialog.setControlProperty(controlname, propertyname, newvalue); } @@ -463,7 +461,7 @@ public abstract class ControlScroller { Object oControlModel = UnoDialog.getModel(CurUnoDialog.xDlgContainer.getControl(controlname)); String propertyname = UnoDialog.getDisplayProperty(oControlModel); - if (propertyname != "") + if (propertyname != PropertyNames.EMPTY_STRING) { return CurUnoDialog.getControlProperty(controlname, propertyname); } diff --git a/wizards/com/sun/star/wizards/ui/DBLimitedFieldSelection.java b/wizards/com/sun/star/wizards/ui/DBLimitedFieldSelection.java index 341ab73828c5..dfe5ff93f6a2 100644 --- a/wizards/com/sun/star/wizards/ui/DBLimitedFieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/DBLimitedFieldSelection.java @@ -30,6 +30,7 @@ import com.sun.star.awt.XListBox; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; /** * @author Administrator @@ -122,7 +123,7 @@ public abstract class DBLimitedFieldSelection protected void initializeListBox(XListBox xListBox, String[] _AllFieldNames, String[] _SelFieldNames, int curindex) { short[] SelList = null; - Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), "StringItemList", _AllFieldNames); + Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), PropertyNames.STRING_ITEM_LIST, _AllFieldNames); if (_SelFieldNames != null) { if (curindex < _SelFieldNames.length) @@ -136,22 +137,22 @@ public abstract class DBLimitedFieldSelection { SelList = new short[] { (short) (0) }; } - Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), "SelectedItems", SelList); + Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), PropertyNames.SELECTED_ITEMS, SelList); return; } } SelList = new short[] { (short) (0) }; - Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), "SelectedItems", SelList); + Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), PropertyNames.SELECTED_ITEMS, SelList); } protected void initializeListBox(XListBox xListBox, String[] _AllFieldNames, String _SelFieldName) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), "StringItemList", _AllFieldNames); + Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), PropertyNames.STRING_ITEM_LIST, _AllFieldNames); short[] SelList = null; int index = JavaTools.FieldInList(_AllFieldNames, _SelFieldName); SelList = new short[] { (short) (index) }; - Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), "SelectedItems", SelList); + Helper.setUnoPropertyValue(UnoDialog.getModel(xListBox), PropertyNames.SELECTED_ITEMS, SelList); } } diff --git a/wizards/com/sun/star/wizards/ui/DocumentPreview.java b/wizards/com/sun/star/wizards/ui/DocumentPreview.java index 173fae87f01b..3489ca0235b3 100644 --- a/wizards/com/sun/star/wizards/ui/DocumentPreview.java +++ b/wizards/com/sun/star/wizards/ui/DocumentPreview.java @@ -37,6 +37,7 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.util.CloseVetoException; import com.sun.star.util.XCloseable; import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.common.PropertyNames; /** * @author rpiterman @@ -126,7 +127,7 @@ public class DocumentPreview case PREVIEW_MODE: return setDocument(url, new String[] { - "Preview", "ReadOnly" + "Preview", PropertyNames.READ_ONLY }, new Object[] { Boolean.TRUE, Boolean.TRUE diff --git a/wizards/com/sun/star/wizards/ui/FieldSelection.java b/wizards/com/sun/star/wizards/ui/FieldSelection.java index 8159de0dd1dd..1a4ef1bf75e7 100644 --- a/wizards/com/sun/star/wizards/ui/FieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/FieldSelection.java @@ -317,7 +317,7 @@ public class FieldSelection Object btnmoveup = CurUnoDialog.insertButton("cmdMoveUp" + sIncSuffix, SOCMDMOVEUP, new ActionListenerImpl(), new String[] { - PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_ENABLED, PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -327,7 +327,7 @@ public class FieldSelection Object btnmovedown = CurUnoDialog.insertButton("cmdMoveDown" + sIncSuffix, SOCMDMOVEDOWN, new ActionListenerImpl(), new String[] { - PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_ENABLED, PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -336,8 +336,8 @@ public class FieldSelection CurUnoDialog.getPeerConfiguration().setAccessibleName(btnmoveselected, AccessTextMoveSelected); CurUnoDialog.getPeerConfiguration().setAccessibleName(btnremoveselected, AccessTextRemoveSelected); - CurUnoDialog.getPeerConfiguration().setAccessibleName(xFieldsListBox, JavaTools.replaceSubString(slblFields, "", "~")); - CurUnoDialog.getPeerConfiguration().setAccessibleName(xSelectedFieldsListBox, JavaTools.replaceSubString(slblSelFields, "", "~")); + CurUnoDialog.getPeerConfiguration().setAccessibleName(xFieldsListBox, JavaTools.replaceSubString(slblFields, PropertyNames.EMPTY_STRING, "~")); + CurUnoDialog.getPeerConfiguration().setAccessibleName(xSelectedFieldsListBox, JavaTools.replaceSubString(slblSelFields, PropertyNames.EMPTY_STRING, "~")); if (btnmoveall != null) { CurUnoDialog.getPeerConfiguration().setAccessibleName(btnmoveall, AccessTextMoveAll); @@ -402,7 +402,7 @@ public class FieldSelection String NeighborItem = NewItemList[iSelIndex + iNeighbor]; NewItemList[iSelIndex + iNeighbor] = CurItem; NewItemList[iSelIndex] = NeighborItem; - CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, "StringItemList", NewItemList); + CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, PropertyNames.STRING_ITEM_LIST, NewItemList); xSelectedFieldsListBox.selectItem(CurItem, true); if (xFieldSelection != null) { @@ -497,10 +497,10 @@ public class FieldSelection try { toggleListboxControls(Boolean.FALSE); - CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, "StringItemList", new String[] + CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, PropertyNames.STRING_ITEM_LIST, new String[] { }); - CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, "StringItemList", new String[] + CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, PropertyNames.STRING_ITEM_LIST, new String[] { }); } @@ -670,14 +670,14 @@ public class FieldSelection public String[] getSelectedFieldNames() { - return (String[]) CurUnoDialog.getControlProperty("lstSelFields" + sIncSuffix, "StringItemList"); + return (String[]) CurUnoDialog.getControlProperty("lstSelFields" + sIncSuffix, PropertyNames.STRING_ITEM_LIST); } public void setSelectedFieldNames(String[] _sfieldnames) { - CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, "StringItemList", _sfieldnames); + CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, PropertyNames.STRING_ITEM_LIST, _sfieldnames); String[] sleftboxfieldnames = JavaTools.removefromList(xFieldsListBox.getItems(), _sfieldnames); - CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, "StringItemList", sleftboxfieldnames); + CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, PropertyNames.STRING_ITEM_LIST, sleftboxfieldnames); } public void setModified(boolean _bModified) @@ -692,6 +692,6 @@ public class FieldSelection public void changeSelectedFieldNames(String[] _sfieldnames) { - CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, "StringItemList", _sfieldnames); + CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, PropertyNames.STRING_ITEM_LIST, _sfieldnames); } } diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java index 09937a6af6d4..1bc24f71ac41 100644 --- a/wizards/com/sun/star/wizards/ui/FilterComponent.java +++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java @@ -128,7 +128,7 @@ public class FilterComponent public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject) { int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); - String sControlName = ""; + String sControlName = PropertyNames.EMPTY_STRING; switch (iKey) { case SO_FIRSTFIELDNAME: @@ -232,7 +232,7 @@ public class FilterComponent { e.printStackTrace(System.out); } - return ""; + return PropertyNames.EMPTY_STRING; } public PropertyValue[][] getFilterConditions() @@ -249,7 +249,7 @@ public class FilterComponent final XPropertyContainer column = (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, oQueryMetaData.xMSF.createInstance(serviceName)); column.addProperty("Type", PropertyAttribute.BOUND, DataType.VARCHAR); - column.addProperty(PropertyNames.PROPERTY_NAME, PropertyAttribute.BOUND, ""); + column.addProperty(PropertyNames.PROPERTY_NAME, PropertyAttribute.BOUND, PropertyNames.EMPTY_STRING); column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), null); final XPropertySet columnSet = UnoRuntime.queryInterface(XPropertySet.class, column); @@ -341,7 +341,7 @@ public class FilterComponent String sreturn = JavaTools.replaceSubString(_BaseString, FieldName, "<FIELDNAME>"); String soperator = sLogicOperators[_filtercondition.Handle - 1]; sreturn = JavaTools.replaceSubString(sreturn, soperator, "<LOGICOPERATOR>"); - String sDisplayValue = ""; + String sDisplayValue = PropertyNames.EMPTY_STRING; if ((_filtercondition.Handle != SQLFilterOperator.SQLNULL) && (_filtercondition.Handle != SQLFilterOperator.NOT_SQLNULL) && !AnyConverter.isVoid(_filtercondition.Value)) @@ -355,7 +355,7 @@ public class FilterComponent { e.printStackTrace(System.out); } - return ""; + return PropertyNames.EMPTY_STRING; } private int getfilterstate() @@ -678,7 +678,7 @@ public class FilterComponent PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, - "StringItemList", + PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, @@ -734,11 +734,11 @@ public class FilterComponent { try { - short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTFIELDNAME]), "SelectedItems")); + short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTFIELDNAME]), PropertyNames.SELECTED_ITEMS)); if (SelFields.length > 0) { int nSelOperator = getSelectedOperator(); - // short[] SelOperator = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems")); + // short[] SelOperator = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), PropertyNames.SELECTED_ITEMS)); if (nSelOperator == com.sun.star.sdb.SQLFilterOperator.SQLNULL || /* is null */ nSelOperator == com.sun.star.sdb.SQLFilterOperator.NOT_SQLNULL) /* is not null */ @@ -761,7 +761,7 @@ public class FilterComponent if (!AnyConverter.isVoid(oValue)) { String sValue = (String.valueOf(oValue)); - return (!sValue.equals("")); + return (!sValue.equals(PropertyNames.EMPTY_STRING)); } } } @@ -788,8 +788,8 @@ public class FilterComponent String sValue = AnyConverter.toString(_filtercondition.Value); if (sValue.indexOf("{D '") > -1) { - sValue = JavaTools.replaceSubString(sValue, "", "{D '"); - sValue = JavaTools.replaceSubString(sValue, "", "' }"); + sValue = JavaTools.replaceSubString(sValue, PropertyNames.EMPTY_STRING, "{D '"); + sValue = JavaTools.replaceSubString(sValue, PropertyNames.EMPTY_STRING, "' }"); try { oQueryMetaData.getNumberFormatter().convertStringToNumber(iDateFormat, sValue); @@ -801,8 +801,8 @@ public class FilterComponent } else if (sValue.indexOf("{T '") > -1) { - sValue = JavaTools.replaceSubString(sValue, "", "{T '"); - sValue = JavaTools.replaceSubString(sValue, "", "' }"); + sValue = JavaTools.replaceSubString(sValue, PropertyNames.EMPTY_STRING, "{T '"); + sValue = JavaTools.replaceSubString(sValue, PropertyNames.EMPTY_STRING, "' }"); try { oQueryMetaData.getNumberFormatter().convertStringToNumber(iTimeFormat, sValue); @@ -836,7 +836,7 @@ public class FilterComponent protected void setFieldNames(String[] _FieldNames) { - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTFIELDNAME]), "StringItemList", _FieldNames); + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTFIELDNAME]), PropertyNames.STRING_ITEM_LIST, _FieldNames); FieldNames = _FieldNames; } @@ -867,7 +867,7 @@ public class FilterComponent }; try { - iselected = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems")); + iselected = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), PropertyNames.SELECTED_ITEMS)); } catch (Exception e) { @@ -875,7 +875,7 @@ public class FilterComponent } if ((iselected.length) == 0) { - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems", new short[] + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); @@ -891,7 +891,7 @@ public class FilterComponent { try { - short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTFIELDNAME]), "SelectedItems")); + short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTFIELDNAME]), PropertyNames.SELECTED_ITEMS)); return FieldNames[SelFields[0]]; } catch (Exception exception) @@ -907,7 +907,7 @@ public class FilterComponent { try { - short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems")); + short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), PropertyNames.SELECTED_ITEMS)); switch (SelFields[0]) { case 0: diff --git a/wizards/com/sun/star/wizards/ui/ImageList.java b/wizards/com/sun/star/wizards/ui/ImageList.java index 3f57e93edaa1..5ee289ecf8a4 100644 --- a/wizards/com/sun/star/wizards/ui/ImageList.java +++ b/wizards/com/sun/star/wizards/ui/ImageList.java @@ -240,7 +240,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener lblImageText = dialog.insertLabel(name + "_imageText", pNames1, new Object[] { new Integer(imageTextHeight), - "", + PropertyNames.EMPTY_STRING, new Integer(pos.Width + 1), new Integer(pos.Height + (imageSize.Height + gap.Height) * rows + gap.Height), step, @@ -281,7 +281,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener lblCounter = dialog.insertLabel(name + "_lblCounter", pNames1, new Object[] { new Integer(LINE_HEIGHT), - "", + PropertyNames.EMPTY_STRING, new Integer(pos.Width + btnSize.intValue() + 1), new Integer(pos.Height + (imageSize.Height + gap.Height) * rows + gap.Height + imageTextHeight + ((btnSize.intValue() - LINE_HEIGHT) / 2)), step, @@ -818,7 +818,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private void refreshImageText() { Object item = selected >= 0 ? getListModel().getElementAt(selected) : null; - Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, " " + renderer.render(item)); + Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, PropertyNames.SPACE + renderer.render(item)); } /** @@ -945,7 +945,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener public String render(Object counter) { - return "" + ((Counter) counter).start + ".." + ((Counter) counter).end + "/" + ((Counter) counter).max; + return PropertyNames.EMPTY_STRING + ((Counter) counter).start + ".." + ((Counter) counter).end + "/" + ((Counter) counter).max; } } diff --git a/wizards/com/sun/star/wizards/ui/PathSelection.java b/wizards/com/sun/star/wizards/ui/PathSelection.java index a19ca220490b..249a47a6b803 100755 --- a/wizards/com/sun/star/wizards/ui/PathSelection.java +++ b/wizards/com/sun/star/wizards/ui/PathSelection.java @@ -41,9 +41,9 @@ public class PathSelection XMultiServiceFactory xMSF; int iDialogType; int iTransferMode; - public String sDefaultDirectory = ""; - public String sDefaultName = ""; - public String sDefaultFilter = ""; + public String sDefaultDirectory = PropertyNames.EMPTY_STRING; + public String sDefaultName = PropertyNames.EMPTY_STRING; + public String sDefaultFilter = PropertyNames.EMPTY_STRING; public boolean usedPathPicker = false; public XPathSelectionListener xAction; public XTextComponent xSaveTextBox; @@ -91,7 +91,7 @@ public class PathSelection { new Boolean(Enabled), 12, TxtHelpURL, new Integer(XPos), new Integer(YPos + 10), new Integer(DialogStep), new Short((short) (CurTabIndex + 1)), new Integer(Width - 26) }); - //CurUnoDialog.setControlProperty("txtSavePath", "ReadOnly", Boolean.TRUE); + //CurUnoDialog.setControlProperty("txtSavePath", PropertyNames.READ_ONLY, Boolean.TRUE); CurUnoDialog.setControlProperty("txtSavePath", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); CurUnoDialog.insertButton("cmdSelectPath", "triggerPathPicker", this, new String[] { diff --git a/wizards/com/sun/star/wizards/ui/PeerConfig.java b/wizards/com/sun/star/wizards/ui/PeerConfig.java index 19617b593bd6..a13a02f0153c 100644 --- a/wizards/com/sun/star/wizards/ui/PeerConfig.java +++ b/wizards/com/sun/star/wizards/ui/PeerConfig.java @@ -129,7 +129,7 @@ public class PeerConfig implements XWindowListener for (int i = 0; i < this.aImageUrlTasks.size(); i++) { ImageUrlTask aImageUrlTask = (ImageUrlTask) aImageUrlTasks.elementAt(i); - String sImageUrl = ""; + String sImageUrl = PropertyNames.EMPTY_STRING; if (AnyConverter.isInt(aImageUrlTask.oResource)) { sImageUrl = oUnoDialog.getWizardImageUrl(((Integer) aImageUrlTask.oResource).intValue(), ((Integer) aImageUrlTask.oHCResource).intValue()); @@ -138,7 +138,7 @@ public class PeerConfig implements XWindowListener { sImageUrl = oUnoDialog.getImageUrl(((String) aImageUrlTask.oResource), ((String) aImageUrlTask.oHCResource)); } - if (!sImageUrl.equals("")) + if (!sImageUrl.equals(PropertyNames.EMPTY_STRING)) { Helper.setUnoPropertyValue(aImageUrlTask.oModel, PropertyNames.PROPERTY_IMAGEURL, sImageUrl); } diff --git a/wizards/com/sun/star/wizards/ui/SortingComponent.java b/wizards/com/sun/star/wizards/ui/SortingComponent.java index d15f5131b560..bf1576525947 100644 --- a/wizards/com/sun/star/wizards/ui/SortingComponent.java +++ b/wizards/com/sun/star/wizards/ui/SortingComponent.java @@ -99,7 +99,7 @@ public class SortingComponent bDoEnable = (i < 2); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lblSort" + new Integer(i + 1).toString(), new String[] { - PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.ORIENTATION, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { new Boolean(bDoEnable), 8, sSortHeader[i], 0, ICompPosX, new Integer(iCurPosY), IStep, new Short(curtabindex++), ICompWidth @@ -111,7 +111,7 @@ public class SortingComponent "Dropdown", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Boolean(true), new Boolean(bDoEnable), 12, HIDString, new Short(UnoDialog.getListBoxLineCount()), "lstSort" + new Integer(i + 1), IListBoxPosX, new Integer(iCurPosY + 14), IStep, new Short(curtabindex++), IListBoxWidth + true, bDoEnable, 12, HIDString, new Short(UnoDialog.getListBoxLineCount()), "lstSort" + new Integer(i + 1), IListBoxPosX, new Integer(iCurPosY + 14), IStep, new Short(curtabindex++), IListBoxWidth }); //new Short((short) (17+i*4)) HIDString = HelpIds.getHelpIdString(FirstHelpIndex + 1); @@ -120,7 +120,7 @@ public class SortingComponent PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Boolean(bDoEnable), 10, HIDString, sSortAscend[i], IOptButtonPosX, new Integer(iCurPosY + 10), new Short((short) 1), IStep, new Short(curtabindex++), new String("ASC"), IOptButtonWidth + bDoEnable, 10, HIDString, sSortAscend[i], IOptButtonPosX, new Integer(iCurPosY + 10), new Short((short) 1), IStep, new Short(curtabindex++), PropertyNames.ASC, IOptButtonWidth }); //, new Short((short) (18+i*4)) HIDString = HelpIds.getHelpIdString(FirstHelpIndex + 2); @@ -129,7 +129,7 @@ public class SortingComponent PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Boolean(bDoEnable), 10, HIDString, sSortDescend[i], IOptButtonPosX, new Integer(iCurPosY + 24), new Short((short) 0), IStep, new Short(curtabindex++), new String("DESC"), IOptButtonWidth + bDoEnable, 10, HIDString, sSortDescend[i], IOptButtonPosX, new Integer(iCurPosY + 24), new Short((short) 0), IStep, new Short(curtabindex++), "DESC", IOptButtonWidth }); //, new Short((short) (19+i*4)) iCurPosY = iCurPosY + 36; FirstHelpIndex += 3; @@ -186,8 +186,8 @@ public class SortingComponent (short) 0 }; } - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 1).toString(), "StringItemList", ViewFieldNames); - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 1).toString(), "SelectedItems", SelList); + CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 1).toString(), PropertyNames.STRING_ITEM_LIST, ViewFieldNames); + CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 1).toString(), PropertyNames.SELECTED_ITEMS, SelList); toggleSortListBox(i, (i <= _SortFieldNames.length)); } } @@ -211,7 +211,7 @@ public class SortingComponent */ public void setReadOnly(int _index, boolean _breadonly) { - CurUnoDialog.setControlProperty("lstSort" + new Integer(_index + 1).toString(), "ReadOnly", new Boolean(_breadonly)); + CurUnoDialog.setControlProperty("lstSort" + new Integer(_index + 1).toString(), PropertyNames.READ_ONLY, new Boolean(_breadonly)); } /** @@ -261,12 +261,12 @@ public class SortingComponent ArrayList<String> SortDescriptions = new ArrayList<String>(); for (int i = 0; i <= MaxSortIndex; i++) { - if (!((Boolean) CurUnoDialog.getControlProperty("lstSort" + (i + 1), "ReadOnly"))) + if (!((Boolean) CurUnoDialog.getControlProperty("lstSort" + (i + 1), PropertyNames.READ_ONLY))) { CurFieldName = xSortListBox[i].getSelectedItem(); SortDescriptions.add(CurFieldName); iCurState = ((Short) CurUnoDialog.getControlProperty("optAscend" + new Integer(i + 1).toString(), PropertyNames.PROPERTY_STATE)).shortValue(); - SortFieldNames.add(new String[]{CurFieldName,iCurState == 1 ? "ASC" :"DESC" }); + SortFieldNames.add(new String[]{CurFieldName,iCurState == 1 ? PropertyNames.ASC :"DESC" }); } } // When searching for a duplicate entry we can neglect wether the entries are to be sorted ascending or descending @@ -303,7 +303,7 @@ public class SortingComponent toggleSortListBox(i, (false)); if (i < MaxSortIndex) { - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); @@ -326,15 +326,15 @@ public class SortingComponent iNextItemPos = xSortListBox[i + 1].getSelectedItemPos(); if (iNextItemPos != 0) { - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 1).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 1).toString(), PropertyNames.SELECTED_ITEMS, new short[] { iNextItemPos }); - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), PropertyNames.SELECTED_ITEMS, new short[] { }); toggleSortListBox(i, true); - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); @@ -363,7 +363,7 @@ public class SortingComponent CurUnoDialog.setControlProperty("optDescend" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); if (bDoEnable == false) { - CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.java b/wizards/com/sun/star/wizards/ui/UnoDialog.java index e4f92d537841..1798986a563a 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.java @@ -277,19 +277,19 @@ public class UnoDialog implements EventNames // This function may look ugly, but this is the only way to check the count // of values in the model,which is always right. // the control is only a view and could be right or not. - final String[] fieldnames = (String[]) Helper.getUnoPropertyValue(getModel(_xListBox), "StringItemList"); + final String[] fieldnames = (String[]) Helper.getUnoPropertyValue(getModel(_xListBox), PropertyNames.STRING_ITEM_LIST); return fieldnames.length; } public static short getSelectedItemPos(XListBox _xListBox) { - short ipos[] = (short[]) Helper.getUnoPropertyValue(getModel(_xListBox), "SelectedItems"); + short ipos[] = (short[]) Helper.getUnoPropertyValue(getModel(_xListBox), PropertyNames.SELECTED_ITEMS); return ipos[0]; } public static boolean isListBoxSelected(XListBox _xListBox) { - short ipos[] = (short[]) Helper.getUnoPropertyValue(getModel(_xListBox), "SelectedItems"); + short ipos[] = (short[]) Helper.getUnoPropertyValue(getModel(_xListBox), PropertyNames.SELECTED_ITEMS); return ipos.length > 0; } @@ -697,11 +697,11 @@ public class UnoDialog implements EventNames public static void deselectListBox(XInterface _xBasisListBox) { Object oListBoxModel = getModel(_xBasisListBox); - Object sList = Helper.getUnoPropertyValue(oListBoxModel, "StringItemList"); - Helper.setUnoPropertyValue(oListBoxModel, "StringItemList", new String[] + Object sList = Helper.getUnoPropertyValue(oListBoxModel, PropertyNames.STRING_ITEM_LIST); + Helper.setUnoPropertyValue(oListBoxModel, PropertyNames.STRING_ITEM_LIST, new String[] { }); - Helper.setUnoPropertyValue(oListBoxModel, "StringItemList", sList); + Helper.setUnoPropertyValue(oListBoxModel, PropertyNames.STRING_ITEM_LIST, sList); } public void calculateDialogPosition(Rectangle FramePosSize) @@ -811,7 +811,7 @@ public class UnoDialog implements EventNames { FontDescriptor oFontDesc = new FontDescriptor(); oFontDesc.Weight = FontWeight; - setControlProperty(ControlName, "FontDescriptor", oFontDesc); + setControlProperty(ControlName, PropertyNames.FONT_DESCRIPTOR, oFontDesc); } /** @@ -863,7 +863,7 @@ public class UnoDialog implements EventNames xListBox.removeItems((short) 0, (short) 1); if (SelPos > 0) { - setControlProperty(ListBoxName, "SelectedItems", new short[SelPos]); + setControlProperty(ListBoxName, PropertyNames.SELECTED_ITEMS, new short[SelPos]); xListBox.selectItemPos((short) (SelPos - 1), true); } } @@ -1000,7 +1000,7 @@ public class UnoDialog implements EventNames */ public static String getDisplayProperty(int itype) { - // String propertyname = ""; + // String propertyname = PropertyNames.EMPTY_STRING; switch (itype) { case UIConsts.CONTROLTYPE.FIXEDTEXT: @@ -1036,9 +1036,9 @@ public class UnoDialog implements EventNames case UIConsts.CONTROLTYPE.PATTERNFIELD: return "Text"; case UIConsts.CONTROLTYPE.LISTBOX: - return "SelectedItems"; + return PropertyNames.SELECTED_ITEMS; default: - return ""; + return PropertyNames.EMPTY_STRING; } } diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.java b/wizards/com/sun/star/wizards/ui/UnoDialog2.java index a872accecdcc..c42fd453f957 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog2.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.java @@ -369,7 +369,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames public String translateURL(String relativeURL) { - return ""; + return PropertyNames.EMPTY_STRING; } public static Object getControlModel(Object unoControl) diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java index 859904e7fc6f..9af5fc560a82 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.java +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java @@ -467,7 +467,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lnNaviSep", new String[] { - PropertyNames.PROPERTY_HEIGHT, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.ORIENTATION, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -477,7 +477,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lnRoadSep", new String[] { - PropertyNames.PROPERTY_HEIGHT, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.ORIENTATION, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -496,30 +496,30 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL }, new Object[] { - new Boolean(true), IButtonHeight, oWizardResource.getResText(UIConsts.RID_COMMON + 15), new Integer(iHelpPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.HELP_value), ICurStep, new Short(curtabindex++), IButtonWidth + true, IButtonHeight, oWizardResource.getResText(UIConsts.RID_COMMON + 15), new Integer(iHelpPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.HELP_value), ICurStep, new Short(curtabindex++), IButtonWidth }); insertButton("btnWizardBack", BACK_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(false), IButtonHeight, HelpIds.getHelpIdString(hid + 2), oWizardResource.getResText(UIConsts.RID_COMMON + 13), new Integer(iBackPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth + false, IButtonHeight, HelpIds.getHelpIdString(hid + 2), oWizardResource.getResText(UIConsts.RID_COMMON + 13), new Integer(iBackPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth }); insertButton("btnWizardNext", NEXT_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(true), IButtonHeight, HelpIds.getHelpIdString(hid + 3), oWizardResource.getResText(UIConsts.RID_COMMON + 14), new Integer(iNextPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth + true, IButtonHeight, HelpIds.getHelpIdString(hid + 3), oWizardResource.getResText(UIConsts.RID_COMMON + 14), new Integer(iNextPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth }); insertButton("btnWizardFinish", FINISH_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(true), IButtonHeight, HelpIds.getHelpIdString(hid + 4), oWizardResource.getResText(UIConsts.RID_COMMON + 12), new Integer(iFinishPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth + true, IButtonHeight, HelpIds.getHelpIdString(hid + 4), oWizardResource.getResText(UIConsts.RID_COMMON + 12), new Integer(iFinishPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth }); insertButton("btnWizardCancel", CANCEL_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(true), IButtonHeight, HelpIds.getHelpIdString(hid + 5), oWizardResource.getResText(UIConsts.RID_COMMON + 11), new Integer(iCancelPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth + true, IButtonHeight, HelpIds.getHelpIdString(hid + 5), oWizardResource.getResText(UIConsts.RID_COMMON + 11), new Integer(iCancelPosX), new Integer(iBtnPosY), new Short((short) PushButtonType.STANDARD_value), ICurStep, new Short(curtabindex++), IButtonWidth }); setControlProperty("btnWizardNext", "DefaultButton", Boolean.TRUE); @@ -747,7 +747,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL insertLabel("lblQueryTitle" + String.valueOf(i), new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.java b/wizards/com/sun/star/wizards/ui/event/DataAware.java index 4c8d009f967a..63213e444dc9 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/DataAware.java @@ -320,7 +320,7 @@ public abstract class DataAware { ex2.printStackTrace(); } catch (NullPointerException npe) { if (getMethod.getReturnType().equals(String.class)) - return ""; + return PropertyNames.EMPTY_STRING; if (getMethod.getReturnType().equals(Short.class)) return new Short((short) 0); if (getMethod.getReturnType().equals(Integer.class)) diff --git a/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java b/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java index 3a5a1f6b637a..4dc917a76ad3 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java +++ b/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java @@ -312,11 +312,11 @@ public class DataAwareFields if (convertTo.equals(Boolean.class)) { - return (s != null && !s.equals("") && s.equals("true")) ? Boolean.TRUE : Boolean.FALSE; + return (s != null && !s.equals(PropertyNames.EMPTY_STRING) && s.equals("true")) ? Boolean.TRUE : Boolean.FALSE; } else if (convertTo.equals(Integer.class)) { - if (s == null || s.equals("")) + if (s == null || s.equals(PropertyNames.EMPTY_STRING)) { return Any.VOID; } @@ -327,7 +327,7 @@ public class DataAwareFields } else if (convertTo.equals(Double.class)) { - if (s == null || s.equals("")) + if (s == null || s.equals(PropertyNames.EMPTY_STRING)) { return Any.VOID; } @@ -352,7 +352,7 @@ public class DataAwareFields { try { - field.set(target, value == null || (value.equals(Any.VOID)) ? "" : value.toString()); + field.set(target, value == null || (value.equals(Any.VOID)) ? PropertyNames.EMPTY_STRING : value.toString()); } catch (IllegalAccessException ex) { @@ -380,7 +380,7 @@ public class DataAwareFields { if (field.getType().equals(String.class)) { - return ""; + return PropertyNames.EMPTY_STRING; } if (field.getType().equals(Short.class)) { diff --git a/wizards/com/sun/star/wizards/ui/event/ListModelBinder.java b/wizards/com/sun/star/wizards/ui/event/ListModelBinder.java index b2dc75f22f48..b29b960d4c06 100644 --- a/wizards/com/sun/star/wizards/ui/event/ListModelBinder.java +++ b/wizards/com/sun/star/wizards/ui/event/ListModelBinder.java @@ -34,6 +34,7 @@ import com.sun.star.awt.XComboBox; import com.sun.star.awt.XListBox; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.PropertyNames; /** * @author rpiterman @@ -52,7 +53,7 @@ public class ListModelBinder implements ListDataListener { if (item == null) { - return ""; + return PropertyNames.EMPTY_STRING; } else { @@ -119,12 +120,12 @@ public class ListModelBinder implements ListDataListener protected short[] getSelectedItems() { - return (short[]) Helper.getUnoPropertyValue(unoListModel, "SelectedItems"); + return (short[]) Helper.getUnoPropertyValue(unoListModel, PropertyNames.SELECTED_ITEMS); } protected void setSelectedItems(short[] selected) { - Helper.setUnoPropertyValue(unoListModel, "SelectedItems", selected); + Helper.setUnoPropertyValue(unoListModel, PropertyNames.SELECTED_ITEMS, selected); } /* (non-Javadoc) @@ -180,7 +181,7 @@ public class ListModelBinder implements ListDataListener public static void fillList(Object list, Object[] items, Renderer renderer) { XListBox xlist = (XListBox) UnoRuntime.queryInterface(XListBox.class, list); - Helper.setUnoPropertyValue(UnoDataAware.getModel(list), "StringItemList", new String[] + Helper.setUnoPropertyValue(UnoDataAware.getModel(list), PropertyNames.STRING_ITEM_LIST, new String[] { }); for (short i = 0; i < items.length; i++) @@ -195,7 +196,7 @@ public class ListModelBinder implements ListDataListener public static void fillComboBox(Object list, Object[] items, Renderer renderer) { XComboBox xComboBox = (XComboBox) UnoRuntime.queryInterface(XComboBox.class, list); - Helper.setUnoPropertyValue(UnoDataAware.getModel(list), "StringItemList", new String[] + Helper.setUnoPropertyValue(UnoDataAware.getModel(list), PropertyNames.STRING_ITEM_LIST, new String[] { }); for (short i = 0; i < items.length; i++) diff --git a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java index 86c50b13ce02..c45a496c7849 100644 --- a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java +++ b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java @@ -28,7 +28,6 @@ package com.sun.star.wizards.ui.event; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import com.sun.star.wizards.common.PropertyNames; /** * Encapsulate a Method invocation. diff --git a/wizards/com/sun/star/wizards/ui/event/SimpleDataAware.java b/wizards/com/sun/star/wizards/ui/event/SimpleDataAware.java index 8a9c2200d76d..e6c23226d0e7 100644 --- a/wizards/com/sun/star/wizards/ui/event/SimpleDataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/SimpleDataAware.java @@ -69,7 +69,7 @@ public class SimpleDataAware extends DataAware return (Boolean)value; else if (value.getClass().isArray()) return ((short[])value).length != 0 ? Boolean.TRUE : Boolean.FALSE; - else if (value.equals("")) return Boolean.FALSE; + else if (value.equals(PropertyNames.EMPTY_STRING)) return Boolean.FALSE; else return Boolean.TRUE; } diff --git a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java index acc0ed8787e6..5ab0a8f20743 100644 --- a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java @@ -126,7 +126,7 @@ public class UnoDataAware extends DataAware { return ((short[]) value).length != 0 ? Boolean.TRUE : Boolean.FALSE; } - else if (value.equals("")) + else if (value.equals(PropertyNames.EMPTY_STRING)) { return Boolean.FALSE; } @@ -179,7 +179,7 @@ public class UnoDataAware extends DataAware public static UnoDataAware attachEditControl(Object data, String prop, Object unoControl, Listener listener, boolean field) { - return attachTextControl(data, prop, unoControl, listener, "Text", field, ""); + return attachTextControl(data, prop, unoControl, listener, "Text", field, PropertyNames.EMPTY_STRING); } public static UnoDataAware attachDateControl(Object data, String prop, Object unoControl, Listener listener, boolean field) @@ -232,7 +232,7 @@ public class UnoDataAware extends DataAware public static UnoDataAware attachLabel(Object data, String prop, Object label, final Listener listener, boolean field) { return new UnoDataAware(data, - field ? DataAwareFields.getFieldValueFor(data, prop, "") + field ? DataAwareFields.getFieldValueFor(data, prop, PropertyNames.EMPTY_STRING) : new DataAware.PropertyValue(prop, data), label, PropertyNames.PROPERTY_LABEL); } @@ -244,7 +244,7 @@ public class UnoDataAware extends DataAware field ? DataAwareFields.getFieldValueFor(data, prop, new short[0]) : new DataAware.PropertyValue(prop, data), - listBox, "SelectedItems"); + listBox, PropertyNames.SELECTED_ITEMS); xListBox.addItemListener(itemListener(uda, listener)); return uda; } diff --git a/wizards/com/sun/star/wizards/web/BackgroundsDialog.java b/wizards/com/sun/star/wizards/web/BackgroundsDialog.java index 70c40fbc6072..f31294a190b5 100644 --- a/wizards/com/sun/star/wizards/web/BackgroundsDialog.java +++ b/wizards/com/sun/star/wizards/web/BackgroundsDialog.java @@ -33,6 +33,7 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.wizards.common.ConfigSet; import com.sun.star.wizards.common.Configuration; import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.SystemDialog; import com.sun.star.wizards.ui.ImageList; import com.sun.star.wizards.web.data.CGImage; @@ -127,7 +128,7 @@ public class BackgroundsDialog extends ImageListDialog { Object configView = Configuration.getConfigurationRoot(xMSF, FileAccess.connectURLs(WebWizardConst.CONFIG_PATH, "BackgroundImages"), true); int i = Configuration.getChildrenNames(configView).length + 1; - Object o = Configuration.addConfigNode(configView, "" + i); + Object o = Configuration.addConfigNode(configView, PropertyNames.EMPTY_STRING + i); Configuration.set(s, "Href", o); Configuration.commit(configView); } @@ -172,7 +173,7 @@ public class BackgroundsDialog extends ImageListDialog public String render(Object object) { - return object == null ? "" : FileAccess.getPathFilename(fileAccess.getPath((String) object, null)); + return object == null ? PropertyNames.EMPTY_STRING : FileAccess.getPathFilename(fileAccess.getPath((String) object, null)); } } diff --git a/wizards/com/sun/star/wizards/web/CallWizard.java b/wizards/com/sun/star/wizards/web/CallWizard.java index 4fab3ea43bf9..6cabc6f145d1 100644 --- a/wizards/com/sun/star/wizards/web/CallWizard.java +++ b/wizards/com/sun/star/wizards/web/CallWizard.java @@ -38,6 +38,7 @@ import com.sun.star.task.XJob; import com.sun.star.task.XJobExecutor; import com.sun.star.uno.Type; import com.sun.star.wizards.common.Desktop; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.Resource; /** @@ -107,7 +108,7 @@ public class CallWizard */ public void trigger(String str) { - if (str.equalsIgnoreCase("start")) + if (str.equalsIgnoreCase(PropertyNames.START)) { if (webWizard == null) { @@ -226,7 +227,7 @@ public class CallWizard try { - byteReturn = ("" + this.hashCode()).getBytes(); + byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { @@ -284,7 +285,7 @@ public class CallWizard { XMultiServiceFactory xmsf = Desktop.connect(ConnectStr); CallWizard.WizardImplementation ww = new CallWizard.WizardImplementation(xmsf); - ww.trigger("start"); + ww.trigger(PropertyNames.START); } catch (Exception exception) diff --git a/wizards/com/sun/star/wizards/web/FTPDialog.java b/wizards/com/sun/star/wizards/web/FTPDialog.java index c95a060f167f..c4101f30c92c 100644 --- a/wizards/com/sun/star/wizards/web/FTPDialog.java +++ b/wizards/com/sun/star/wizards/web/FTPDialog.java @@ -153,16 +153,16 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID //Resources Object private FTPDialogResources resources; private List dataAware = new Vector(); - public String username = ""; - public String password = ""; + public String username = PropertyNames.EMPTY_STRING; + public String password = PropertyNames.EMPTY_STRING; /** * The ftp host name */ - public String host = ""; + public String host = PropertyNames.EMPTY_STRING; /** * The ftp directory. */ - private String dir = ""; + private String dir = PropertyNames.EMPTY_STRING; /** * the ftp publish object which contains the * data for this dialog. @@ -353,7 +353,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID PROPNAMES_BUTTON2, new Object[] { - INTEGER_14, "", resources.resbtnHelp_value, "btnHelp", 57, 142, new Short((short) PushButtonType.HELP_value), new Short((short) 15), INTEGER_50 + INTEGER_14, PropertyNames.EMPTY_STRING, resources.resbtnHelp_value, "btnHelp", 57, 142, new Short((short) PushButtonType.HELP_value), new Short((short) 15), INTEGER_50 }); } @@ -379,8 +379,8 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID public short execute(UnoDialog parent) throws Exception { host = extractHost(publish.cp_URL); - username = publish.cp_Username == null ? "" : publish.cp_Username; - password = publish.password == null ? "" : publish.password; + username = publish.cp_Username == null ? PropertyNames.EMPTY_STRING : publish.cp_Username; + password = publish.password == null ? PropertyNames.EMPTY_STRING : publish.password; dir = extractDir(publish.cp_URL); setLabel(STATUS_UNKONWN); @@ -419,7 +419,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID { if (ftpUrl == null || ftpUrl.length() < 6) { - return ""; + return PropertyNames.EMPTY_STRING; } String url = ftpUrl.substring(6); int i = url.indexOf("/"); @@ -469,11 +469,11 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID /** * @param s - * @return true if the string is null or "". + * @return true if the string is null or PropertyNames.EMPTY_STRING. */ private final boolean isEmpty(String s) { - return (s == null) || (s.equals("")); + return (s == null) || (s.equals(PropertyNames.EMPTY_STRING)); } /** @@ -724,7 +724,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID public void chooseDirectory() { SystemDialog sd = SystemDialog.createOfficeFolderDialog(xMSF); - String newUrl = sd.callFolderDialog(resources.resFTPDirectory, "", getFullUrl()); + String newUrl = sd.callFolderDialog(resources.resFTPDirectory, PropertyNames.EMPTY_STRING, getFullUrl()); if (newUrl != null) { /* if the user chose a local directory, diff --git a/wizards/com/sun/star/wizards/web/IconsDialog.java b/wizards/com/sun/star/wizards/web/IconsDialog.java index 6228180a75f4..83be292e79b8 100644 --- a/wizards/com/sun/star/wizards/web/IconsDialog.java +++ b/wizards/com/sun/star/wizards/web/IconsDialog.java @@ -32,6 +32,7 @@ import com.sun.star.awt.Size; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.wizards.common.ConfigSet; import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.ui.ImageList; import com.sun.star.wizards.web.data.CGIconSet; @@ -79,7 +80,7 @@ public class IconsDialog extends ImageListDialog implements ImageList.IImageRend resources.resCounter }); - htmlexpDirectory = FileAccess.getOfficePath(xmsf, "Gallery", "share", ""); + htmlexpDirectory = FileAccess.getOfficePath(xmsf, "Gallery", "share", PropertyNames.EMPTY_STRING); set = set_; objects = new Integer[set.getSize() * icons.length]; for (int i = 0; i < objects.length; i++) @@ -174,7 +175,7 @@ public class IconsDialog extends ImageListDialog implements ImageList.IImageRend { if (object == null) { - return ""; + return PropertyNames.EMPTY_STRING; } int i = ((Number) object).intValue(); int iset = getIconsetNum(i); diff --git a/wizards/com/sun/star/wizards/web/ImageListDialog.java b/wizards/com/sun/star/wizards/web/ImageListDialog.java index c726c0266df1..3943271408fe 100644 --- a/wizards/com/sun/star/wizards/web/ImageListDialog.java +++ b/wizards/com/sun/star/wizards/web/ImageListDialog.java @@ -165,7 +165,7 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts PROPNAMES, new Object[] { - Boolean.FALSE, INTEGER_14, "", resources[RES_HELP], "CommandButton3", iButtonsX, 71, new Short((short) com.sun.star.awt.PushButtonType.HELP_value), new Short((short) 9), INTEGER_50 + Boolean.FALSE, INTEGER_14, PropertyNames.EMPTY_STRING, resources[RES_HELP], "CommandButton3", iButtonsX, 71, new Short((short) com.sun.star.awt.PushButtonType.HELP_value), new Short((short) 9), INTEGER_50 }); if (showOtherButton) @@ -208,7 +208,7 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts lblTitle = insertLabel("lblTitle", new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -275,9 +275,9 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts public String render(Object counter) { - String s = JavaTools.replaceSubString(template, "" + ((Counter) counter).start, START); - s = JavaTools.replaceSubString(s, "" + ((Counter) counter).end, END); - s = JavaTools.replaceSubString(s, "" + ((Counter) counter).max, TOTAL); + String s = JavaTools.replaceSubString(template, PropertyNames.EMPTY_STRING + ((Counter) counter).start, START); + s = JavaTools.replaceSubString(s, PropertyNames.EMPTY_STRING + ((Counter) counter).end, END); + s = JavaTools.replaceSubString(s, PropertyNames.EMPTY_STRING + ((Counter) counter).max, TOTAL); return s; } } diff --git a/wizards/com/sun/star/wizards/web/LogTaskListener.java b/wizards/com/sun/star/wizards/web/LogTaskListener.java index f1814f9e4cb6..8666aaf9738e 100644 --- a/wizards/com/sun/star/wizards/web/LogTaskListener.java +++ b/wizards/com/sun/star/wizards/web/LogTaskListener.java @@ -33,6 +33,7 @@ */ package com.sun.star.wizards.web; +import com.sun.star.wizards.common.PropertyNames; import java.io.PrintStream; import com.sun.star.wizards.ui.event.TaskEvent; @@ -96,7 +97,7 @@ public class LogTaskListener implements TaskListener, ErrorHandler */ public boolean error(Exception ex, Object arg, int ix, int i) { - System.out.println("" + arg + "//" + ix + "//Exception: " + ex.getLocalizedMessage()); + System.out.println(PropertyNames.EMPTY_STRING + arg + "//" + ix + "//Exception: " + ex.getLocalizedMessage()); ex.printStackTrace(); return true; } diff --git a/wizards/com/sun/star/wizards/web/Process.java b/wizards/com/sun/star/wizards/web/Process.java index d1ae8e23763e..3140d3dc328c 100644 --- a/wizards/com/sun/star/wizards/web/Process.java +++ b/wizards/com/sun/star/wizards/web/Process.java @@ -43,6 +43,7 @@ import org.w3c.dom.Document; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.wizards.common.ConfigSet; import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.UCB; import com.sun.star.wizards.ui.event.Task; import com.sun.star.wizards.web.data.CGContent; @@ -240,7 +241,7 @@ public class Process implements WebWizardConst, ProcessErrors { try { - String s = FileAccess.getOfficePath(xmsf, "Temp", "", ""); + String s = FileAccess.getOfficePath(xmsf, "Temp", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); return s; } catch (Exception e) @@ -308,7 +309,7 @@ public class Process implements WebWizardConst, ProcessErrors //2. background image String background = settings.cp_DefaultSession.cp_Design.cp_BackgroundImage; - if (background != null && !background.equals("")) + if (background != null && !background.equals(PropertyNames.EMPTY_STRING)) { sourceDir = FileAccess.getParentDir(background); filename = background.substring(sourceDir.length()); @@ -354,7 +355,7 @@ public class Process implements WebWizardConst, ProcessErrors catch (Exception ex) { //error in copying media - error(ex, "", ERROR_PUBLISH_MEDIA, ErrorHandler.ERROR_PROCESS_FATAL); + error(ex, PropertyNames.EMPTY_STRING, ERROR_PUBLISH_MEDIA, ErrorHandler.ERROR_PROCESS_FATAL); return false; } @@ -435,7 +436,7 @@ public class Process implements WebWizardConst, ProcessErrors } catch (Exception ex) { - error(ex, "", ERROR_GENERATE_XSLT, ErrorHandler.ERROR_PROCESS_FATAL); + error(ex, PropertyNames.EMPTY_STRING, ERROR_GENERATE_XSLT, ErrorHandler.ERROR_PROCESS_FATAL); return false; } @@ -519,7 +520,7 @@ public class Process implements WebWizardConst, ProcessErrors for (Iterator i = templates.keySet().iterator(); i.hasNext();) { - String key = ""; + String key = PropertyNames.EMPTY_STRING; key = (String) i.next(); @@ -586,7 +587,7 @@ public class Process implements WebWizardConst, ProcessErrors * faileure here is fatal. */ contentDir = fileAccess.createNewDir(dir, content.cp_Name); - if (contentDir == null || contentDir.equals("")) + if (contentDir == null || contentDir.equals(PropertyNames.EMPTY_STRING)) { throw new IOException("Directory " + dir + " could not be created."); } @@ -697,7 +698,7 @@ public class Process implements WebWizardConst, ProcessErrors * the copyExporter does not change * the extension of the target... */ - String destExt = (exporter.cp_Extension.equals("") + String destExt = (exporter.cp_Extension.equals(PropertyNames.EMPTY_STRING) ? FileAccess.getExtension(docFilename) : exporter.cp_Extension); diff --git a/wizards/com/sun/star/wizards/web/StatusDialog.java b/wizards/com/sun/star/wizards/web/StatusDialog.java index 3e3d40f54e76..c0e6b08f6cff 100644 --- a/wizards/com/sun/star/wizards/web/StatusDialog.java +++ b/wizards/com/sun/star/wizards/web/StatusDialog.java @@ -109,7 +109,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener }, new Object[] { - 8, "", new Integer(width * 2 / 3), 6, new Short(tabstop++), new Integer(width / 3 - 4) + 8, PropertyNames.EMPTY_STRING, new Integer(width * 2 / 3), 6, new Short(tabstop++), new Integer(width / 3 - 4) }); progressBar = insertProgressBar("progress", new String[] diff --git a/wizards/com/sun/star/wizards/web/StylePreview.java b/wizards/com/sun/star/wizards/web/StylePreview.java index 93507929d84b..c6c095eb9388 100644 --- a/wizards/com/sun/star/wizards/web/StylePreview.java +++ b/wizards/com/sun/star/wizards/web/StylePreview.java @@ -28,6 +28,7 @@ package com.sun.star.wizards.web; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.web.data.CGStyle; /** @@ -98,7 +99,7 @@ public class StylePreview String css = FileAccess.connectURLs(wwRoot, "styles/" + style.cp_CssHref); - if (background == null || background.equals("")) + if (background == null || background.equals(PropertyNames.EMPTY_STRING)) { //delete the background image if (fileAccess.exists(backgroundFilename, false)) @@ -137,7 +138,7 @@ public class StylePreview */ private String createTempDir(XMultiServiceFactory xmsf) throws Exception { - String tempPath = FileAccess.getOfficePath(xmsf, "Temp", "", ""); + String tempPath = FileAccess.getOfficePath(xmsf, "Temp", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); String s = fileAccess.createNewDir(tempPath, "wwiz"); fileAccess.createNewDir(s, "images"); return s; diff --git a/wizards/com/sun/star/wizards/web/TOCPreview.java b/wizards/com/sun/star/wizards/web/TOCPreview.java index 1fb70a11d4b5..bd7f84527343 100644 --- a/wizards/com/sun/star/wizards/web/TOCPreview.java +++ b/wizards/com/sun/star/wizards/web/TOCPreview.java @@ -35,6 +35,7 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.util.URL; import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.UCB; import com.sun.star.wizards.ui.event.Task; import com.sun.star.wizards.web.data.CGLayout; @@ -101,7 +102,7 @@ public class TOCPreview { Document doc = (Document) settings.cp_DefaultSession.createDOM(); CGLayout layout = settings.cp_DefaultSession.getLayout(); - Task task = new Task("", "", 10000); + Task task = new Task(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, 10000); Process.generate(xmsf, layout, doc, fileAccess, tempDir, task); Process.copyLayoutFiles(ucb, fileAccess, settings, layout, tempDir); xDispatch.dispatch(openHyperlink, loadArgs); //Dispatch.dispatch(openHyperlink, loadArgs); @@ -110,7 +111,7 @@ public class TOCPreview private PropertyValue[] loadArgs(String url) { PropertyValue pv = new PropertyValue(); - pv.Name = "URL"; + pv.Name = PropertyNames.URL; pv.Value = url; return new PropertyValue[] { diff --git a/wizards/com/sun/star/wizards/web/WWD_Events.java b/wizards/com/sun/star/wizards/web/WWD_Events.java index 26f518c4e6c8..f4b657854592 100644 --- a/wizards/com/sun/star/wizards/web/WWD_Events.java +++ b/wizards/com/sun/star/wizards/web/WWD_Events.java @@ -67,10 +67,10 @@ public abstract class WWD_Events extends WWD_Startup private static final short[] EMPTY_SHORT_ARRAY = new short[0]; /** * Tracks the current loaded session. - * If "" - it means the current session is the default one (empty) + * If PropertyNames.EMPTY_STRING - it means the current session is the default one (empty) * If a session is loaded, this will be the name of the loaded session. */ - protected String currentSession = ""; + protected String currentSession = PropertyNames.EMPTY_STRING; /** * He - my constructor ! @@ -106,11 +106,11 @@ public abstract class WWD_Events extends WWD_Startup { if ((old == 1)) { - String sessionToLoad = ""; - short[] s = (short[]) Helper.getUnoPropertyValue(getModel(lstLoadSettings), "SelectedItems"); + String sessionToLoad = PropertyNames.EMPTY_STRING; + short[] s = (short[]) Helper.getUnoPropertyValue(getModel(lstLoadSettings), PropertyNames.SELECTED_ITEMS); if (s.length == 0 || s[0] == 0) { - sessionToLoad = ""; + sessionToLoad = PropertyNames.EMPTY_STRING; } else { @@ -135,7 +135,7 @@ public abstract class WWD_Events extends WWD_Startup */ public void sessionSelected() { - short[] s = (short[]) Helper.getUnoPropertyValue(getModel(lstLoadSettings), "SelectedItems"); + short[] s = (short[]) Helper.getUnoPropertyValue(getModel(lstLoadSettings), PropertyNames.SELECTED_ITEMS); setEnabled(btnDelSession, s.length > 0 && s[0] > 0); } @@ -148,18 +148,18 @@ public abstract class WWD_Events extends WWD_Startup { final StatusDialog sd = getStatusDialog(); - final Task task = new Task("LoadDocs", "", 10); + final Task task = new Task("LoadDocs", PropertyNames.EMPTY_STRING, 10); sd.execute(this, task, resources.resLoadingSession); task.start(); setSelectedDoc(EMPTY_SHORT_ARRAY); - Helper.setUnoPropertyValue(getModel(lstDocuments), "SelectedItems", EMPTY_SHORT_ARRAY); - Helper.setUnoPropertyValue(getModel(lstDocuments), "StringItemList", EMPTY_STRING_ARRAY); + Helper.setUnoPropertyValue(getModel(lstDocuments), PropertyNames.SELECTED_ITEMS, EMPTY_SHORT_ARRAY); + Helper.setUnoPropertyValue(getModel(lstDocuments), PropertyNames.STRING_ITEM_LIST, EMPTY_STRING_ARRAY); Object view = null; - if (sessionToLoad.equals("")) + if (sessionToLoad.equals(PropertyNames.EMPTY_STRING)) { view = Configuration.getConfigurationRoot(xMSF, CONFIG_PATH + "/DefaultSession", false); } @@ -175,7 +175,7 @@ public abstract class WWD_Events extends WWD_Startup task.setMax(session.cp_Content.cp_Documents.getSize() * 5 + 7); task.advance(true); - if (sessionToLoad.equals("")) + if (sessionToLoad.equals(PropertyNames.EMPTY_STRING)) { setSaveSessionName(session); } @@ -212,7 +212,7 @@ public abstract class WWD_Events extends WWD_Startup */ public void delSession() { - short[] selected = (short[]) Helper.getUnoPropertyValue(getModel(lstLoadSettings), "SelectedItems"); + short[] selected = (short[]) Helper.getUnoPropertyValue(getModel(lstLoadSettings), PropertyNames.SELECTED_ITEMS); if (selected.length == 0) { return; @@ -254,7 +254,7 @@ public abstract class WWD_Events extends WWD_Startup { Helper.setUnoPropertyValue(getModel(btnDelSession), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); // select... } - Helper.setUnoPropertyValue(getModel(lstLoadSettings), "SelectedItems", nextSelected); + Helper.setUnoPropertyValue(getModel(lstLoadSettings), PropertyNames.SELECTED_ITEMS, nextSelected); //ListModelBinder.fillComboBox(cbSaveSettings, settings.savedSessions.items(), null); @@ -332,7 +332,7 @@ public abstract class WWD_Events extends WWD_Startup { return; } - final Task task = new Task("", "", files.length * 5); + final Task task = new Task(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, files.length * 5); /* * If more than a certain number @@ -455,7 +455,7 @@ public abstract class WWD_Events extends WWD_Startup { if (background == null) { - background = ""; + background = PropertyNames.EMPTY_STRING; } settings.cp_DefaultSession.cp_Design.cp_BackgroundImage = (String) background; refreshStylePreview(); @@ -543,7 +543,7 @@ public abstract class WWD_Events extends WWD_Startup */ public void setPublishLocalDir() { - String dir = showFolderDialog("Local destination directory", "", settings.cp_DefaultSession.cp_OutDirectory); + String dir = showFolderDialog("Local destination directory", PropertyNames.EMPTY_STRING, settings.cp_DefaultSession.cp_OutDirectory); //if ok was pressed... setPublishUrl(LOCAL_PUBLISHER, dir, 0); @@ -898,7 +898,7 @@ public abstract class WWD_Events extends WWD_Startup } else { - return ""; + return PropertyNames.EMPTY_STRING; } } @@ -965,7 +965,7 @@ public abstract class WWD_Events extends WWD_Startup */ final CGPublish p = getPublisher(FTP_PUBLISHER); // if ftp is checked, and no proxies are set, and password is empty... - if (p.cp_Publish && (!proxies) && (p.password == null || p.password.equals(""))) + if (p.cp_Publish && (!proxies) && (p.password == null || p.password.equals(PropertyNames.EMPTY_STRING))) { if (showFTPDialog(p)) { @@ -1036,7 +1036,7 @@ public abstract class WWD_Events extends WWD_Startup } else { - settings.cp_LastSavedSession = ""; + settings.cp_LastSavedSession = PropertyNames.EMPTY_STRING; } try { diff --git a/wizards/com/sun/star/wizards/web/WWD_General.java b/wizards/com/sun/star/wizards/web/WWD_General.java index fd716e1b9c06..cb109fd01668 100644 --- a/wizards/com/sun/star/wizards/web/WWD_General.java +++ b/wizards/com/sun/star/wizards/web/WWD_General.java @@ -64,7 +64,7 @@ public abstract class WWD_General extends WebWizardDialog StatusDialog statusDialog = new StatusDialog(xMSF, StatusDialog.STANDARD_WIDTH, resources.resLoadingSession, false, new String[] { - resources.prodName, "", "", "", "", "" + resources.prodName, PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING }, HelpIds.getHelpIdString(HID0_STATUS_DIALOG)); try { @@ -302,7 +302,7 @@ public abstract class WWD_General extends WebWizardDialog public boolean checkSaveSession() { return (!isSaveSession() || - !getSessionSaveName().equals("")); + !getSessionSaveName().equals(PropertyNames.EMPTY_STRING)); } @@ -317,7 +317,7 @@ public abstract class WWD_General extends WebWizardDialog if (p.cp_Publish) { String url = (String) Helper.getUnoPropertyValue(getModel(text), property); - if ((url == null) || (url.equals(""))) + if ((url == null) || (url.equals(PropertyNames.EMPTY_STRING))) { throw new IllegalArgumentException(); } diff --git a/wizards/com/sun/star/wizards/web/WWD_Startup.java b/wizards/com/sun/star/wizards/web/WWD_Startup.java index 2a250c84c266..f75740363a93 100644 --- a/wizards/com/sun/star/wizards/web/WWD_Startup.java +++ b/wizards/com/sun/star/wizards/web/WWD_Startup.java @@ -265,7 +265,7 @@ public abstract class WWD_Startup extends WWD_General ilLayouts.setListModel(settings.cp_Layouts); ilLayouts.create(this); - checkContent(settings.cp_DefaultSession.cp_Content, new Task("", "", 99999), this.xControl); + checkContent(settings.cp_DefaultSession.cp_Content, new Task(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, 99999), this.xControl); //saved sessions, styles, combobox save session. // also set the chosen saved session... @@ -548,7 +548,7 @@ public abstract class WWD_Startup extends WWD_General protected void selectSession() { int selectedSession = 0; - if (settings.cp_LastSavedSession != null && !settings.cp_LastSavedSession.equals("")) + if (settings.cp_LastSavedSession != null && !settings.cp_LastSavedSession.equals(PropertyNames.EMPTY_STRING)) { Object ses = settings.cp_SavedSessions.getElement(settings.cp_LastSavedSession); @@ -557,7 +557,7 @@ public abstract class WWD_Startup extends WWD_General selectedSession = settings.cp_SavedSessions.getIndexOf(ses); } } - Helper.setUnoPropertyValue(getModel(lstLoadSettings), "SelectedItems", new short[] + Helper.setUnoPropertyValue(getModel(lstLoadSettings), PropertyNames.SELECTED_ITEMS, new short[] { (short) selectedSession }); @@ -682,8 +682,8 @@ public abstract class WWD_Startup extends WWD_General }); pubAware.add(uda); pubAware.add( - isLabel ? UnoDataAware.attachLabel(p, "URL", textbox, checkPublish, false) - : UnoDataAware.attachEditControl(p, "URL", textbox, checkPublish, false)); + isLabel ? UnoDataAware.attachLabel(p, PropertyNames.URL, textbox, checkPublish, false) + : UnoDataAware.attachEditControl(p, PropertyNames.URL, textbox, checkPublish, false)); } @@ -806,7 +806,7 @@ public abstract class WWD_Startup extends WWD_General catch (FileNotFoundException ex) { - int relocate = SystemDialog.showMessageBox(xMSF, xC.getPeer(), "WarningBox", VclWindowPeerAttribute.YES_NO + VclWindowPeerAttribute.DEF_NO, getFileAccess().getPath(doc.cp_URL, "") + "\n\n" + resources.resSpecifyNewFileLocation); + int relocate = SystemDialog.showMessageBox(xMSF, xC.getPeer(), "WarningBox", VclWindowPeerAttribute.YES_NO + VclWindowPeerAttribute.DEF_NO, getFileAccess().getPath(doc.cp_URL, PropertyNames.EMPTY_STRING) + "\n\n" + resources.resSpecifyNewFileLocation); if (relocate == 2) { @@ -831,7 +831,7 @@ public abstract class WWD_Startup extends WWD_General //file is a directory AbstractErrorHandler.showMessage(xMSF, xControl.getPeer(), JavaTools.replaceSubString(resources.resErrIsDirectory, - getFileAccess().getPath(doc.cp_URL, ""), + getFileAccess().getPath(doc.cp_URL, PropertyNames.EMPTY_STRING), "%FILENAME"), ErrorHandler.ERROR_PROCESS_FATAL); return false; @@ -842,7 +842,7 @@ public abstract class WWD_Startup extends WWD_General exp.printStackTrace(); AbstractErrorHandler.showMessage(xMSF, xControl.getPeer(), JavaTools.replaceSubString(resources.resErrDocValidate, - getFileAccess().getPath(doc.cp_URL, ""), + getFileAccess().getPath(doc.cp_URL, PropertyNames.EMPTY_STRING), "%FILENAME"), ErrorHandler.ERROR_PROCESS_FATAL); return false; } @@ -907,7 +907,7 @@ public abstract class WWD_Startup extends WWD_General void updateBackgroundText() { String bg = settings.cp_DefaultSession.cp_Design.cp_BackgroundImage; - if (bg == null || bg.equals("")) + if (bg == null || bg.equals(PropertyNames.EMPTY_STRING)) { bg = resources.resBackgroundNone; } @@ -922,7 +922,7 @@ public abstract class WWD_Startup extends WWD_General { String iconset = settings.cp_DefaultSession.cp_Design.cp_IconSet; String iconsetName; - if (iconset == null || iconset.equals("")) + if (iconset == null || iconset.equals(PropertyNames.EMPTY_STRING)) { iconsetName = resources.resIconsetNone; } diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialog.java b/wizards/com/sun/star/wizards/web/WebWizardDialog.java index 7c782354c0dd..7191e65bedb8 100644 --- a/wizards/com/sun/star/wizards/web/WebWizardDialog.java +++ b/wizards/com/sun/star/wizards/web/WebWizardDialog.java @@ -196,11 +196,11 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }; private static String[] PROPNAMES_TXT_2 = new String[] { - PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ReadOnly", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.READ_ONLY, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }; private static String[] PROPNAMES_TITLE = new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }; private static Integer INTEGER_91 = 91; private static Integer INTEGER_97 = 97; @@ -270,7 +270,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TXT, new Object[] { - INTEGERS[2], "", "lnLoadSettings", 91, 147, INTEGERS[1], new Short(tabIndex++), 234 + INTEGERS[2], PropertyNames.EMPTY_STRING, "lnLoadSettings", 91, 147, INTEGERS[1], new Short(tabIndex++), 234 }); lblLoadSettings = insertLabel("lblLoadSettings", new String[] @@ -341,7 +341,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC btnDocUp = insertButton("btnDocUp", BTNDOCUP_ACTION_PERFORMED, new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -350,7 +350,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC btnDocDown = insertButton("btnDocDown", BTNDOCDOWN_ACTION_PERFORMED, new String[] { - "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -620,7 +620,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - 0, Boolean.FALSE, 78, "", "imgPreview", 91, 100, Boolean.FALSE, INTEGERS[5], new Short((short) 55), 232 + 0, Boolean.FALSE, 78, PropertyNames.EMPTY_STRING, "imgPreview", 91, 100, Boolean.FALSE, INTEGERS[5], new Short((short) 55), 232 }); } @@ -853,7 +853,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TXT, new Object[] { - INTEGERS[2], "", "lnSaveSetting", 97, 151, INTEGERS[7], new Short(tabIndex++), 228 + INTEGERS[2], PropertyNames.EMPTY_STRING, "lnSaveSetting", 97, 151, INTEGERS[7], new Short(tabIndex++), 228 }); chkSaveSettings = insertCheckBox("chkSaveSettings", CHKSAVESETTINGS_ITEM_CHANGED, PROPNAMES_CHKBOX, @@ -926,7 +926,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC public String render(Object listItem) { - return listItem == null ? "" : ((CGLayout) listItem).cp_Name; + return listItem == null ? PropertyNames.EMPTY_STRING : ((CGLayout) listItem).cp_Name; } } } diff --git a/wizards/com/sun/star/wizards/web/data/CGDocument.java b/wizards/com/sun/star/wizards/web/data/CGDocument.java index 765e49d1f6ee..76affdb36d5a 100644 --- a/wizards/com/sun/star/wizards/web/data/CGDocument.java +++ b/wizards/com/sun/star/wizards/web/data/CGDocument.java @@ -72,20 +72,20 @@ public class CGDocument extends ConfigSetItem implements XMLProvider public static final int PAGE_TYPE_UNKNOWN = 0; public static final int PAGE_TYPE_PAGE = 1; public static final int PAGE_TYPE_SLIDE = 2; - public String cp_Title = ""; - public String cp_Description = ""; + public String cp_Title = PropertyNames.EMPTY_STRING; + public String cp_Description = PropertyNames.EMPTY_STRING; public String cp_URL; - public String cp_Author = ""; + public String cp_Author = PropertyNames.EMPTY_STRING; public String cp_Exporter; /** * the destination filename to which this * document will be exported to. */ - public String localFilename = ""; - public String urlFilename = ""; - public String title = ""; - public String description = ""; - public String author = ""; + public String localFilename = PropertyNames.EMPTY_STRING; + public String urlFilename = PropertyNames.EMPTY_STRING; + public String title = PropertyNames.EMPTY_STRING; + public String description = PropertyNames.EMPTY_STRING; + public String author = PropertyNames.EMPTY_STRING; public DateTime createDate; public DateTime updateDate; public int sizeBytes = -1; @@ -124,7 +124,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider cp_URL = getSettings().getFileAccess(xmsf).getURL(url); if (task == null) { - task = new Task("", "", 5); + task = new Task(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING, 5); } validate(xmsf, task); } @@ -159,7 +159,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider task.advance(true); //2 - String path = getSettings().getFileAccess(xmsf).getPath(cp_URL, ""); + String path = getSettings().getFileAccess(xmsf).getPath(cp_URL, PropertyNames.EMPTY_STRING); localFilename = FileAccess.getFilename(path, File.separator); /* if the type is a star office convertable document @@ -202,23 +202,23 @@ public class CGDocument extends ConfigSetItem implements XMLProvider valid = true; - if (cp_Title.equals("")) + if (cp_Title.equals(PropertyNames.EMPTY_STRING)) { cp_Title = title; } - if (cp_Title.equals("")) + if (cp_Title.equals(PropertyNames.EMPTY_STRING)) { cp_Title = localFilename; } - if (cp_Description.equals("")) + if (cp_Description.equals(PropertyNames.EMPTY_STRING)) { cp_Description = description; } - if (cp_Author.equals("")) + if (cp_Author.equals(PropertyNames.EMPTY_STRING)) { cp_Author = author; } - if (cp_Exporter == null || cp_Exporter.equals("")) + if (cp_Exporter == null || cp_Exporter.equals(PropertyNames.EMPTY_STRING)) { cp_Exporter = (String) getSettings().cp_Exporters.getKey( getSettings().getExporters(appType)[0]); @@ -237,7 +237,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider } String media = (mediaDesc == null) - ? "" : (String) Properties.getPropertyValue(mediaDescriptor, PropertyNames.PROPERTY_NAME); + ? PropertyNames.EMPTY_STRING : (String) Properties.getPropertyValue(mediaDescriptor, PropertyNames.PROPERTY_NAME); appType = getDocType(media); //System.out.println(appType); @@ -260,7 +260,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider */ private String getDocType(String media) { - if (media.equals("")) + if (media.equals(PropertyNames.EMPTY_STRING)) { return TypeDetection.NO_TYPE; } @@ -317,16 +317,16 @@ public class CGDocument extends ConfigSetItem implements XMLProvider }, new String[] { - d.cp_DisplayTitle ? cp_Title : "", - d.cp_DisplayDescription ? cp_Description : "", - d.cp_DisplayAuthor ? cp_Author : "", - d.cp_DisplayFileFormat ? getTargetTypeName(exp) : "", - d.cp_DisplayFilename ? localFilename : "", - d.cp_DisplayCreateDate ? createDate() : "", - d.cp_DisplayUpdateDate ? updateDate() : "", - d.cp_DisplayPages && (pages > -1) ? "" + pages() : "", //TODO when do i calculate pages? - d.cp_DisplaySize ? sizeKB() : "",//TODO when do i calculate size? - d.cp_DisplayFormatIcon ? getIcon(exp) : "", + d.cp_DisplayTitle ? cp_Title : PropertyNames.EMPTY_STRING, + d.cp_DisplayDescription ? cp_Description : PropertyNames.EMPTY_STRING, + d.cp_DisplayAuthor ? cp_Author : PropertyNames.EMPTY_STRING, + d.cp_DisplayFileFormat ? getTargetTypeName(exp) : PropertyNames.EMPTY_STRING, + d.cp_DisplayFilename ? localFilename : PropertyNames.EMPTY_STRING, + d.cp_DisplayCreateDate ? createDate() : PropertyNames.EMPTY_STRING, + d.cp_DisplayUpdateDate ? updateDate() : PropertyNames.EMPTY_STRING, + d.cp_DisplayPages && (pages > -1) ? PropertyNames.EMPTY_STRING + pages() : PropertyNames.EMPTY_STRING, //TODO when do i calculate pages? + d.cp_DisplaySize ? sizeKB() : PropertyNames.EMPTY_STRING,//TODO when do i calculate size? + d.cp_DisplayFormatIcon ? getIcon(exp) : PropertyNames.EMPTY_STRING, dirName, urlFilename }); } @@ -335,7 +335,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider { if (this.updateDate == null) { - return ""; + return PropertyNames.EMPTY_STRING; } return getSettings().formatter.formatCreated(this.updateDate); } @@ -344,7 +344,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider { if (this.createDate == null) { - return ""; + return PropertyNames.EMPTY_STRING; } return getSettings().formatter.formatCreated(this.createDate); } @@ -353,7 +353,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider { if (sizeBytes == -1) { - return ""; + return PropertyNames.EMPTY_STRING; } else { @@ -363,8 +363,8 @@ public class CGDocument extends ConfigSetItem implements XMLProvider private String pages() { - return pages == -1 ? "" - : JavaTools.replaceSubString(pagesTemplate(), "" + pages, "%NUMBER"); + return pages == -1 ? PropertyNames.EMPTY_STRING + : JavaTools.replaceSubString(pagesTemplate(), PropertyNames.EMPTY_STRING + pages, "%NUMBER"); } private String pagesTemplate() @@ -373,26 +373,26 @@ public class CGDocument extends ConfigSetItem implements XMLProvider switch (pagesType) { case PAGE_TYPE_UNKNOWN: - return ""; + return PropertyNames.EMPTY_STRING; case PAGE_TYPE_PAGE: return getSettings().resources[CGSettings.RESOURCE_PAGES_TEMPLATE]; case PAGE_TYPE_SLIDE: return getSettings().resources[CGSettings.RESOURCE_SLIDES_TEMPLATE]; default: - return ""; + return PropertyNames.EMPTY_STRING; } } private String getTargetTypeName(CGExporter exp) { - return (exp.targetTypeName.equals("")) + return (exp.targetTypeName.equals(PropertyNames.EMPTY_STRING)) ? (String) Properties.getPropertyValue(mediaDescriptor, "UIName") : exp.targetTypeName; } private String getIcon(CGExporter exporter) { - return exporter.cp_Icon.equals("") ? getIcon(this.appType) : exporter.cp_Icon; + return exporter.cp_Icon.equals(PropertyNames.EMPTY_STRING) ? getIcon(this.appType) : exporter.cp_Icon; } private String getIcon(String appType) diff --git a/wizards/com/sun/star/wizards/web/data/CGExporter.java b/wizards/com/sun/star/wizards/web/data/CGExporter.java index c23073fbed01..0ee8ec894dc0 100644 --- a/wizards/com/sun/star/wizards/web/data/CGExporter.java +++ b/wizards/com/sun/star/wizards/web/data/CGExporter.java @@ -27,6 +27,7 @@ package com.sun.star.wizards.web.data; import com.sun.star.wizards.common.ConfigSet; +import com.sun.star.wizards.common.PropertyNames; public class CGExporter extends ConfigSetItem { @@ -42,7 +43,7 @@ public class CGExporter extends ConfigSetItem public String cp_TargetType; public boolean cp_Binary; public int cp_PageType; - public String targetTypeName = ""; + public String targetTypeName = PropertyNames.EMPTY_STRING; public ConfigSet cp_Arguments = new ConfigSet(CGArgument.class); public String toString() @@ -52,6 +53,6 @@ public class CGExporter extends ConfigSetItem public boolean supports(String mime) { - return (cp_SupportedMimeTypes.equals("") || cp_SupportedMimeTypes.indexOf(mime) > -1); + return (cp_SupportedMimeTypes.equals(PropertyNames.EMPTY_STRING) || cp_SupportedMimeTypes.indexOf(mime) > -1); } } diff --git a/wizards/com/sun/star/wizards/web/data/CGPublish.java b/wizards/com/sun/star/wizards/web/data/CGPublish.java index 1a3746a3873d..51e53fca6da6 100644 --- a/wizards/com/sun/star/wizards/web/data/CGPublish.java +++ b/wizards/com/sun/star/wizards/web/data/CGPublish.java @@ -27,6 +27,7 @@ package com.sun.star.wizards.web.data; import com.sun.star.wizards.common.ConfigGroup; +import com.sun.star.wizards.common.PropertyNames; /** * @@ -82,13 +83,13 @@ public class CGPublish extends ConfigGroup catch (Exception e) { e.printStackTrace(); - return ""; + return PropertyNames.EMPTY_STRING; } } private String ftpURL() { return "ftp://" + cp_Username + - ((password != null && password.length() > 0) ? ":" + password : "") + "@" + cp_URL.substring(7); + ((password != null && password.length() > 0) ? ":" + password : PropertyNames.EMPTY_STRING) + "@" + cp_URL.substring(7); } } diff --git a/wizards/com/sun/star/wizards/web/data/CGSettings.java b/wizards/com/sun/star/wizards/web/data/CGSettings.java index ecc538b9fa83..4102c2f87dbf 100644 --- a/wizards/com/sun/star/wizards/web/data/CGSettings.java +++ b/wizards/com/sun/star/wizards/web/data/CGSettings.java @@ -83,8 +83,8 @@ public class CGSettings extends ConfigGroup xmsf = xmsf_; try { - soTemplateDir = FileAccess.getOfficePath(xmsf, "Config", "", ""); - soGalleryDir = FileAccess.getOfficePath(xmsf, "Gallery", "share", ""); + soTemplateDir = FileAccess.getOfficePath(xmsf, "Config", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); + soGalleryDir = FileAccess.getOfficePath(xmsf, "Gallery", "share", PropertyNames.EMPTY_STRING); root = this; formatter = new Formatter(xmsf, document); resources = resources_; @@ -152,7 +152,7 @@ public class CGSettings extends ConfigGroup throws NoSuchElementException, WrappedTargetException { - if (!exporter.cp_TargetType.equals("")) + if (!exporter.cp_TargetType.equals(PropertyNames.EMPTY_STRING)) { exporter.targetTypeName = (String) Properties.getPropertyValue( diff --git a/wizards/com/sun/star/wizards/web/data/CGStyle.java b/wizards/com/sun/star/wizards/web/data/CGStyle.java index e6258d8c5fe1..c268e568ae03 100644 --- a/wizards/com/sun/star/wizards/web/data/CGStyle.java +++ b/wizards/com/sun/star/wizards/web/data/CGStyle.java @@ -26,6 +26,8 @@ ************************************************************************/ package com.sun.star.wizards.web.data; +import com.sun.star.wizards.common.PropertyNames; + public class CGStyle extends ConfigSetItem { @@ -42,7 +44,7 @@ public class CGStyle extends ConfigSetItem public String getBackgroundUrl() { - if (cp_BackgroundImage == null || cp_BackgroundImage.equals("")) + if (cp_BackgroundImage == null || cp_BackgroundImage.equals(PropertyNames.EMPTY_STRING)) { return null; } |