diff options
Diffstat (limited to 'wizards')
151 files changed, 3917 insertions, 4039 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java index 2d7174bdb69f..32a94738da41 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java +++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java @@ -26,11 +26,7 @@ ************************************************************************/ package com.sun.star.wizards.agenda; -import java.util.Calendar; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.Vector; +import java.util.*; import com.sun.star.awt.TextEvent; @@ -201,7 +197,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { template = calcTemplateName(templateURL); document = loadAsPreview(templateURL, false); - docMSF = ((XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, document)); + docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, document); xFrame.getComponentWindow().setEnable(false); xTextDocument.lockControllers(); initialize(); @@ -235,7 +231,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { try { - itemsTables[i].write(""); + itemsTables[i].write(PropertyNames.EMPTY_STRING); } catch (Exception ex) { @@ -374,7 +370,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { itemsCache = new Hashtable(11); - XMultiServiceFactory xmsf = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, document); + XMultiServiceFactory xmsf = UnoRuntime.queryInterface(XMultiServiceFactory.class, document); // Headings itemsCache.put(FILLIN_MEETING_TYPE, @@ -442,7 +438,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data /* * Get the default locale of the document, and create the date and time formatters. */ - XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, document); + XMultiServiceFactory docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, document); try { Object defaults = docMSF.createInstance("com.sun.star.text.Defaults"); @@ -453,7 +449,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data calendar = Calendar.getInstance(jl); - XNumberFormatsSupplier nfs = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, document); + XNumberFormatsSupplier nfs = UnoRuntime.queryInterface(XNumberFormatsSupplier.class, document); Object formatSettings = nfs.getNumberFormatSettings(); com.sun.star.util.Date date = (com.sun.star.util.Date) Helper.getUnoPropertyValue(formatSettings, "NullDate"); @@ -483,8 +479,8 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data initializeItems(); initializeTitles(); initializeItemsSections(); - XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, document); - textSectionHandler = new TextSectionHandler(xMultiServiceFactory, (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, document)); + XMultiServiceFactory xMultiServiceFactory = UnoRuntime.queryInterface(XMultiServiceFactory.class, document); + textSectionHandler = new TextSectionHandler(xMultiServiceFactory, UnoRuntime.queryInterface(XTextDocument.class, document)); initializeTopics(); _allItems.clear(); _allItems = null; @@ -498,7 +494,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { XTextRange item = null; - XMultiServiceFactory xmsf = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, document); + XMultiServiceFactory xmsf = UnoRuntime.queryInterface(XMultiServiceFactory.class, document); for (int i = 0; i < _allItems.size(); i++) { @@ -550,7 +546,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data { try { - XSearchable xSearchable = (XSearchable) UnoRuntime.queryInterface(XSearchable.class, document); + XSearchable xSearchable = UnoRuntime.queryInterface(XSearchable.class, document); XSearchDescriptor sd = xSearchable.createSearchDescriptor(); sd.setSearchString("<[^>]+>"); sd.setPropertyValue("SearchRegularExpression", Boolean.TRUE); @@ -558,12 +554,12 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data XIndexAccess ia = xSearchable.findAll(sd); - List l = new Vector(ia.getCount()); + List l = new ArrayList<XTextRange>(ia.getCount()); for (int i = 0; i < ia.getCount(); i++) { try { - l.add((XTextRange) UnoRuntime.queryInterface(XTextRange.class, ia.getByIndex(i))); + l.add(UnoRuntime.queryInterface(XTextRange.class, ia.getByIndex(i))); } catch (Exception ex) { @@ -607,20 +603,20 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data private String[] getSections(Object document, String s) { - XTextSectionsSupplier xTextSectionsSupplier = (XTextSectionsSupplier) UnoRuntime.queryInterface(XTextSectionsSupplier.class, document); + XTextSectionsSupplier xTextSectionsSupplier = UnoRuntime.queryInterface(XTextSectionsSupplier.class, document); String[] allSections = xTextSectionsSupplier.getTextSections().getElementNames(); return getNamesWhichStartWith(allSections, s); } Object getSection(String name) throws NoSuchElementException, WrappedTargetException { - XTextSectionsSupplier xTextSectionsSupplier = (XTextSectionsSupplier) UnoRuntime.queryInterface(XTextSectionsSupplier.class, document); + XTextSectionsSupplier xTextSectionsSupplier = UnoRuntime.queryInterface(XTextSectionsSupplier.class, document); return ((Any) (xTextSectionsSupplier.getTextSections().getByName(name))).getObject(); } Object getTable(String name) throws NoSuchElementException, WrappedTargetException { - XTextTablesSupplier xTextTablesSupplier = (XTextTablesSupplier) UnoRuntime.queryInterface(XTextTablesSupplier.class, document); + XTextTablesSupplier xTextTablesSupplier = UnoRuntime.queryInterface(XTextTablesSupplier.class, document); return ((Any) xTextTablesSupplier.getTextTables().getByName(name)).getObject(); } @@ -665,18 +661,18 @@ 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(); + int date = Integer.parseInt(d); calendar.clear(); calendar.set(date / 10000, (date % 10000) / 100 - 1, @@ -694,11 +690,11 @@ 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(); + int time = Integer.parseInt(s); double t = ((double) (time / 1000000) / 24) + ((double) ((time % 1000000) / 1000) / (24 * 60)); return timeFormatter.convertNumberToString(timeFormat, t); @@ -722,7 +718,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data */ private void deleteHiddenSections() { - XTextSectionsSupplier xTextSectionsSupplier = (XTextSectionsSupplier) UnoRuntime.queryInterface(XTextSectionsSupplier.class, document); + XTextSectionsSupplier xTextSectionsSupplier = UnoRuntime.queryInterface(XTextSectionsSupplier.class, document); String[] allSections = xTextSectionsSupplier.getTextSections().getElementNames(); try { @@ -733,7 +729,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(""); + UnoRuntime.queryInterface(XTextContent.class, section).getAnchor().setString(PropertyNames.EMPTY_STRING); } } } @@ -759,8 +755,8 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data try { Object minutesAllSection = getSection(SECTION_MINUTES_ALL); - XTextSection xTextSection = (XTextSection) UnoRuntime.queryInterface(XTextSection.class, minutesAllSection); - xTextSection.getAnchor().setString(""); + XTextSection xTextSection = UnoRuntime.queryInterface(XTextSection.class, minutesAllSection); + xTextSection.getAnchor().setString(PropertyNames.EMPTY_STRING); } catch (Exception ex) { @@ -777,7 +773,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data int topicStartTime = 0; try { - topicStartTime = new Integer(agenda.cp_Time).intValue(); + topicStartTime = Integer.parseInt(agenda.cp_Time); } catch (Exception ex) { @@ -831,15 +827,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 +859,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 +885,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 @@ -936,7 +932,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data Helper.setUnoPropertyValue(placeHolder, "PlaceHolder", ph); Helper.setUnoPropertyValue(placeHolder, "Hint", hint); Helper.setUnoPropertyValue(placeHolder, "PlaceHolderType", new Short(PlaceholderType.TEXT)); - return (XTextContent) UnoRuntime.queryInterface(XTextContent.class, placeHolder); + return UnoRuntime.queryInterface(XTextContent.class, placeHolder); } @@ -1016,7 +1012,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data table = getTable(name); section = getSection(name); - XTextTable xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, table); + XTextTable xTextTable = UnoRuntime.queryInterface(XTextTable.class, table); XTextTableCursor cursor = xTextTable.createCursorByCellName("A1"); AgendaItem ai; // should this section be visible? @@ -1024,7 +1020,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 +1068,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(""); + UnoRuntime.queryInterface(XTextRange.class, cell).setString(PropertyNames.EMPTY_STRING); cellName = cursor.getRangeName(); cursor.goRight((short) 1, false); } @@ -1085,7 +1081,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data return; } int rowIndex = getRowIndex(cursor); - int rowsCount = getRowCount((XTextTable) UnoRuntime.queryInterface(XTextTable.class, table)); + int rowsCount = getRowCount(UnoRuntime.queryInterface(XTextTable.class, table)); /* now before deleteing i move the cursor up so it * does not disappear, because it will crash office. @@ -1201,7 +1197,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data } // and this is the XTable. - table = ((XTextTable) UnoRuntime.queryInterface(XTextTable.class, t)); + table = UnoRuntime.queryInterface(XTextTable.class, t); /* first I store all <*> ranges * which are in the topics table. @@ -1246,7 +1242,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data while (!cursor.getRangeName().equals(afterLastCell)) { cell = table.getCellByName(cursor.getRangeName()); - XTextRange xTextRange = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, cell); + XTextRange xTextRange = UnoRuntime.queryInterface(XTextRange.class, cell); // first I store the content and para style of the cell AgendaElement ae = new TextElement(xTextRange); // if the cell contains a relevant <...> @@ -1316,7 +1312,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); @@ -1413,12 +1409,14 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data break; } // move the cursor to the needed cell... - cursor.goRight((short) cursorMoves, false); - XCell xc = table.getCellByName(cursor.getRangeName()); - // and write it ! - te.write(xc); - ((TableCellFormatter) topicCellFormats.get(cursorMoves)).format(xc); - + if ( te != null) + { + cursor.goRight((short) cursorMoves, false); + XCell xc = table.getCellByName(cursor.getRangeName()); + // and write it ! + te.write(xc); + ((TableCellFormatter) topicCellFormats.get(cursorMoves)).format(xc); + } } } @@ -1585,7 +1583,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data */ public static String[] getNamesWhichStartWith(String[] allNames, String prefix) { - Vector v = new Vector(); + ArrayList<String> v = new ArrayList<String>(); for (int i = 0; i < allNames.length; i++) { if (allNames[i].startsWith(prefix)) @@ -1594,8 +1592,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data } } String[] s = new String[v.size()]; - System.arraycopy(v.toArray(), 0, s, 0, s.length); - return s; + return v.toArray(s); } /** @@ -1605,7 +1602,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data */ public static String getName(Object obj) { - return ((XNamed) UnoRuntime.queryInterface(XNamed.class, obj)).getName(); + return UnoRuntime.queryInterface(XNamed.class, obj).getName(); } /** @@ -1616,7 +1613,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data */ public static void removeTableRows(Object table, int start, int count) { - XTableRows rows = ((XTextTable) UnoRuntime.queryInterface(XTextTable.class, table)).getRows(); + XTableRows rows = UnoRuntime.queryInterface(XTextTable.class, table).getRows(); rows.removeByIndex(start, count); } @@ -1628,7 +1625,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data */ public static void insertTableRows(Object table, int start, int count) { - XTableRows rows = ((XTextTable) UnoRuntime.queryInterface(XTextTable.class, table)).getRows(); + XTableRows rows = UnoRuntime.queryInterface(XTextTable.class, table).getRows(); rows.insertByIndex(start, count); } @@ -1717,12 +1714,12 @@ class ParaStyled implements AgendaElement void format(Object textRange) { XText o; - o = ((XText) UnoRuntime.queryInterface(XText.class, textRange)); + o = UnoRuntime.queryInterface(XText.class, textRange); if (o == null) { - o = ((XTextRange) UnoRuntime.queryInterface(XTextRange.class, textRange)).getText(); + o = UnoRuntime.queryInterface(XTextRange.class, textRange).getText(); } - XTextRange xtr = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, textRange); + XTextRange xtr = UnoRuntime.queryInterface(XTextRange.class, textRange); XTextCursor cursor = o.createTextCursorByRange(xtr); Helper.setUnoPropertyValue(cursor, "ParaStyleName", paraStyle); @@ -1763,8 +1760,8 @@ class TextElement extends ParaStyled public void write(Object textRange) { - ((XTextRange) UnoRuntime.queryInterface(XTextRange.class, textRange)).setString(text); - if (!text.equals("")) + UnoRuntime.queryInterface(XTextRange.class, textRange).setString(text); + if (!text.equals(PropertyNames.EMPTY_STRING)) { super.write(textRange); } @@ -1772,7 +1769,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,9 +1802,9 @@ 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); + XTextRange xTextRange = UnoRuntime.queryInterface(XTextRange.class, textRange); try { XTextContent xTextContent = AgendaTemplate.createPlaceHolder(xmsf, placeHolderText, hint); @@ -1849,7 +1846,7 @@ class PlaceholderElement extends ParaStyled public void write(Object textRange) { - XTextRange xTextRange = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, textRange); + XTextRange xTextRange = UnoRuntime.queryInterface(XTextRange.class, textRange); try { XTextContent xTextContent = AgendaTemplate.createPlaceHolder(xmsf, placeHolderText, hint); @@ -1896,8 +1893,8 @@ class AgendaItem implements AgendaElement public void write(Object tableCursor) throws Exception { - XTextTableCursor xTextTableCursor = (XTextTableCursor) UnoRuntime.queryInterface(XTextTableCursor.class, tableCursor); - XTextTable xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, table); + XTextTableCursor xTextTableCursor = UnoRuntime.queryInterface(XTextTableCursor.class, tableCursor); + XTextTable xTextTable = UnoRuntime.queryInterface(XTextTable.class, table); String cellname = xTextTableCursor.getRangeName(); Object cell = xTextTable.getCellByName(cellname); diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java index 219125b64bd2..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,13 +117,13 @@ 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}; private String[] PROPS_TEXTAREA = new String[] {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_TEXT = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; - private String[] PROPS_IMAGE = new String[] {"Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; + private String[] PROPS_IMAGE = new String[] {PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}; private static final Short NO_BORDER = new Short((short)0); @@ -134,8 +134,8 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda //set dialog properties... Helper.setUnoPropertyValues(xDialogModel, - new String[] { "Closeable",PropertyNames.PROPERTY_HEIGHT,"Moveable",PropertyNames.PROPERTY_POSITION_X,PropertyNames.PROPERTY_POSITION_Y,PropertyNames.PROPERTY_STEP,PropertyNames.PROPERTY_TABINDEX,"Title",PropertyNames.PROPERTY_WIDTH}, - new Object[] { Boolean.TRUE,new Integer(210),Boolean.TRUE,new Integer(200),new Integer(52),INTEGERS[1],new Short((short)1),resources.resAgendaWizardDialog_title,new Integer(310)} + new String[] { PropertyNames.PROPERTY_CLOSEABLE,PropertyNames.PROPERTY_HEIGHT,PropertyNames.PROPERTY_MOVEABLE,PropertyNames.PROPERTY_POSITION_X,PropertyNames.PROPERTY_POSITION_Y,PropertyNames.PROPERTY_STEP,PropertyNames.PROPERTY_TABINDEX,PropertyNames.PROPERTY_TITLE,PropertyNames.PROPERTY_WIDTH}, + new Object[] { Boolean.TRUE,210,Boolean.TRUE,200,52,INTEGERS[1],new Short((short)1),resources.resAgendaWizardDialog_title,310} ); //Set member- FontDescriptors... @@ -149,27 +149,27 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda public void buildStep1() { lblTitle1 = insertLabel("lblTitle1", PROPS_LABEL_B, - new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle1_value,Boolean.TRUE,new Integer(91),INTEGERS[8],INTEGERS[1],new Short((short)100),new Integer(212)} + new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle1_value,Boolean.TRUE,91,INTEGERS[8],INTEGERS[1],new Short((short)100),212} ); lblPageDesign = insertLabel("lblPageDesign", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblPageDesign_value,new Integer(97),new Integer(32),INTEGERS[1],new Short((short)101),new Integer(66)} + new Object[] { INTEGERS[8],resources.reslblPageDesign_value,97,32,INTEGERS[1],new Short((short)101),66} ); listPageDesign = insertListBox("listPageDesign", null, null, PROPS_LIST, - new Object[] { Boolean.TRUE,INTEGER_12,LISTPAGEDESIGN_HID,new Integer(166),new Integer(30),INTEGERS[1],new Short((short)102),new Integer(70)} + new Object[] { Boolean.TRUE,INTEGER_12,LISTPAGEDESIGN_HID,166,30,INTEGERS[1],new Short((short)102),70} ); chkMinutes = insertCheckBox("chkMinutes", null, PROPS_CHECK, - new Object[] { INTEGERS[9],CHKMINUTES_HID,resources.reschkMinutes_value,new Integer(97),new Integer(50),new Short((short)0),INTEGERS[1],new Short((short)103),new Integer(203)} + new Object[] { INTEGERS[9],CHKMINUTES_HID,resources.reschkMinutes_value,97,50,new Short((short)0),INTEGERS[1],new Short((short)103),203} ); imgHelp1 = insertImage("imgHelp1", PROPS_IMAGE, - new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID, AgendaWizardDialogConst.INFO_IMAGE_URL, new Integer(92),new Integer(145), Boolean.FALSE, INTEGERS[1], new Short((short)104),INTEGERS[10]} + new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID, AgendaWizardDialogConst.INFO_IMAGE_URL, 92,145, Boolean.FALSE, INTEGERS[1], new Short((short)104),INTEGERS[10]} ); lblHelp1 = insertLabel("lblHelp1", PROPS_TEXTAREA, - new Object[] { new Integer(39),resources.reslblHelp1_value,Boolean.TRUE,new Integer(104),new Integer(145),INTEGERS[1],new Short((short)105),new Integer(199)} + new Object[] { 39,resources.reslblHelp1_value,Boolean.TRUE,104,145,INTEGERS[1],new Short((short)105),199} ); } @@ -177,49 +177,49 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda public void buildStep2() { lblTitle2 = insertLabel("lblTitle2", PROPS_LABEL_B, - new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle2_value,Boolean.TRUE,new Integer(91),INTEGERS[8],INTEGERS[2],new Short((short)200),new Integer(212)} + new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle2_value,Boolean.TRUE,91,INTEGERS[8],INTEGERS[2],new Short((short)200),212} ); lblDate = insertLabel("lblDate", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblDate_value,new Integer(97),new Integer(32),INTEGERS[2],new Short((short)201),new Integer(66)} + new Object[] { INTEGERS[8],resources.reslblDate_value,97,32,INTEGERS[2],new Short((short)201),66} ); txtDate = insertDateField("txtDate", null, PROPS_LIST, - new Object[] { Boolean.TRUE,INTEGER_12,TXTDATE_HID,new Integer(166),new Integer(30),INTEGERS[2],new Short((short)202),new Integer(70)} + new Object[] { Boolean.TRUE,INTEGER_12,TXTDATE_HID,166,30,INTEGERS[2],new Short((short)202),70} ); lblTime = insertLabel("lblTime", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblTime_value,new Integer(97),new Integer(50),INTEGERS[2],new Short((short)203),new Integer(66)} + new Object[] { INTEGERS[8],resources.reslblTime_value,97,50,INTEGERS[2],new Short((short)203),66} ); txtTime = insertTimeField("txtTime", null, new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StrictFormat", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, - new Object[] { INTEGER_12,TXTTIME_HID,new Integer(166),new Integer(48),INTEGERS[2],Boolean.TRUE,new Short((short)204),new Integer(70)} + new Object[] { INTEGER_12,TXTTIME_HID,166,48,INTEGERS[2],Boolean.TRUE,new Short((short)204),70} ); lblTitle = insertLabel("lblTitle", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblTitle_value,new Integer(97),new Integer(68),INTEGERS[2],new Short((short)205),new Integer(66)} + new Object[] { INTEGERS[8],resources.reslblTitle_value,97,68,INTEGERS[2],new Short((short)205),66} ); txtTitle = insertTextField("txtTitle", null, new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, - new Object[] { new Integer(26),TXTTITLE_HID,Boolean.TRUE,new Integer(166),new Integer(66),INTEGERS[2],new Short((short)206),new Integer(138)} + new Object[] { 26,TXTTITLE_HID,Boolean.TRUE,166,66,INTEGERS[2],new Short((short)206),138} ); lblLocation = insertLabel("lblLocation", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblLocation_value,new Integer(97),new Integer(100),INTEGERS[2],new Short((short)207),new Integer(66)} + new Object[] { INTEGERS[8],resources.reslblLocation_value,97,100,INTEGERS[2],new Short((short)207),66} ); cbLocation = insertTextField("cbLocation", null,null, new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, - new Object[] { new Integer(34),CBLOCATION_HID,Boolean.TRUE,new Integer(166),new Integer(98),INTEGERS[2],new Short((short)208),new Integer(138)} + new Object[] { 34,CBLOCATION_HID,Boolean.TRUE,166,98,INTEGERS[2],new Short((short)208),138} ); imgHelp2 = insertImage("imgHelp2", PROPS_IMAGE, - new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, new Integer(92),new Integer(145),Boolean.FALSE, INTEGERS[2],new Short((short)209),INTEGERS[10]} + new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, 92,145,Boolean.FALSE, INTEGERS[2],new Short((short)209),INTEGERS[10]} ); lblHelp2 = insertLabel("lblHelp2", PROPS_TEXTAREA, - new Object[] { new Integer(39),resources.reslblHelp2_value,Boolean.TRUE,new Integer(104),new Integer(145),INTEGERS[2],new Short((short)210),new Integer(199)} + new Object[] { 39,resources.reslblHelp2_value,Boolean.TRUE,104,145,INTEGERS[2],new Short((short)210),199} ); } @@ -227,93 +227,93 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda public void buildStep3() { lblTitle3 = insertLabel("lblTitle3", PROPS_LABEL_B, - new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle3_value,Boolean.TRUE,new Integer(91),INTEGERS[8],INTEGERS[3],new Short((short)300),new Integer(212)} + new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle3_value,Boolean.TRUE,91,INTEGERS[8],INTEGERS[3],new Short((short)300),212} ); chkMeetingTitle = insertCheckBox("chkMeetingTitle", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKMEETINGTITLE_HID,resources.reschkMeetingTitle_value,new Integer(97),new Integer(32),new Short((short)1),INTEGERS[3],new Short((short)301),new Integer(69)} + new Object[] { INTEGERS[8],CHKMEETINGTITLE_HID,resources.reschkMeetingTitle_value,97,32,new Short((short)1),INTEGERS[3],new Short((short)301),69} ); chkRead = insertCheckBox("chkRead", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKREAD_HID,resources.reschkRead_value,new Integer(97),new Integer(46),new Short((short)0),INTEGERS[3],new Short((short)302),new Integer(162)} + new Object[] { INTEGERS[8],CHKREAD_HID,resources.reschkRead_value,97,46,new Short((short)0),INTEGERS[3],new Short((short)302),162} ); chkBring = insertCheckBox("chkBring", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKBRING_HID,resources.reschkBring_value,new Integer(97),new Integer(60),new Short((short)0),INTEGERS[3],new Short((short)303),new Integer(162)} + new Object[] { INTEGERS[8],CHKBRING_HID,resources.reschkBring_value,97,60,new Short((short)0),INTEGERS[3],new Short((short)303),162} ); chkNotes = insertCheckBox("chkNotes", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKNOTES_HID,resources.reschkNotes_value,new Integer(97),new Integer(74),new Short((short)1),INTEGERS[3],new Short((short)304),new Integer(160)} + new Object[] { INTEGERS[8],CHKNOTES_HID,resources.reschkNotes_value,97,74,new Short((short)1),INTEGERS[3],new Short((short)304),160} ); imgHelp3 = insertImage("imgHelp3", PROPS_IMAGE, - new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, new Integer(92),new Integer(145),Boolean.FALSE, INTEGERS[3],new Short((short)305),INTEGERS[10]} + new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, 92,145,Boolean.FALSE, INTEGERS[3],new Short((short)305),INTEGERS[10]} ); lblHelp3 = insertLabel("lblHelp3", PROPS_TEXTAREA, - new Object[] { new Integer(39),resources.reslblHelp3_value,Boolean.TRUE,new Integer(104),new Integer(145),INTEGERS[3],new Short((short)306),new Integer(199)} + new Object[] { 39,resources.reslblHelp3_value,Boolean.TRUE,104,145,INTEGERS[3],new Short((short)306),199} ); } public void buildStep4() { lblTitle5 = insertLabel("lblTitle5", PROPS_LABEL_B, - new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle5_value,Boolean.TRUE,new Integer(91),INTEGERS[8],INTEGERS[4],new Short((short)400),new Integer(212)} + new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle5_value,Boolean.TRUE,91,INTEGERS[8],INTEGERS[4],new Short((short)400),212} ); chkConvenedBy = insertCheckBox("chkConvenedBy", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKCONVENEDBY_HID,resources.reschkConvenedBy_value,new Integer(97),new Integer(32),new Short((short)1),INTEGERS[4],new Short((short)401),new Integer(150)} + new Object[] { INTEGERS[8],CHKCONVENEDBY_HID,resources.reschkConvenedBy_value,97,32,new Short((short)1),INTEGERS[4],new Short((short)401),150} ); chkPresiding = insertCheckBox("chkPresiding", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKPRESIDING_HID,resources.reschkPresiding_value,new Integer(97),new Integer(46),new Short((short)0),INTEGERS[4],new Short((short)402),new Integer(150)} + new Object[] { INTEGERS[8],CHKPRESIDING_HID,resources.reschkPresiding_value,97,46,new Short((short)0),INTEGERS[4],new Short((short)402),150} ); chkNoteTaker = insertCheckBox("chkNoteTaker", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKNOTETAKER_HID,resources.reschkNoteTaker_value,new Integer(97),new Integer(60),new Short((short)0),INTEGERS[4],new Short((short)403),new Integer(150)} + new Object[] { INTEGERS[8],CHKNOTETAKER_HID,resources.reschkNoteTaker_value,97,60,new Short((short)0),INTEGERS[4],new Short((short)403),150} ); chkTimekeeper = insertCheckBox("chkTimekeeper", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKTIMEKEEPER_HID,resources.reschkTimekeeper_value,new Integer(97),new Integer(74),new Short((short)0),INTEGERS[4],new Short((short)404),new Integer(150)} + new Object[] { INTEGERS[8],CHKTIMEKEEPER_HID,resources.reschkTimekeeper_value,97,74,new Short((short)0),INTEGERS[4],new Short((short)404),150} ); chkAttendees = insertCheckBox("chkAttendees", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKATTENDEES_HID,resources.reschkAttendees_value,new Integer(97),new Integer(88),new Short((short)1),INTEGERS[4],new Short((short)405),new Integer(150)} + new Object[] { INTEGERS[8],CHKATTENDEES_HID,resources.reschkAttendees_value,97,88,new Short((short)1),INTEGERS[4],new Short((short)405),150} ); chkObservers = insertCheckBox("chkObservers", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKOBSERVERS_HID,resources.reschkObservers_value,new Integer(97),new Integer(102),new Short((short)0),INTEGERS[4],new Short((short)406),new Integer(150)} + new Object[] { INTEGERS[8],CHKOBSERVERS_HID,resources.reschkObservers_value,97,102,new Short((short)0),INTEGERS[4],new Short((short)406),150} ); chkResourcePersons = insertCheckBox("chkResourcePersons", null, PROPS_CHECK, - new Object[] { INTEGERS[8],CHKRESOURCEPERSONS_HID,resources.reschkResourcePersons_value,new Integer(97),new Integer(116),new Short((short)0),INTEGERS[4],new Short((short)407),new Integer(150)} + new Object[] { INTEGERS[8],CHKRESOURCEPERSONS_HID,resources.reschkResourcePersons_value,97,116,new Short((short)0),INTEGERS[4],new Short((short)407),150} ); imgHelp4 = insertImage("imgHelp4", PROPS_IMAGE, - new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, new Integer(92),new Integer(145),Boolean.FALSE, INTEGERS[4],new Short((short)408),INTEGERS[10]} + new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, 92,145,Boolean.FALSE, INTEGERS[4],new Short((short)408),INTEGERS[10]} ); lblHelp4 = insertLabel("lblHelp4", PROPS_TEXTAREA, - new Object[] { new Integer(39),resources.reslblHelp4_value,Boolean.TRUE,new Integer(104),new Integer(145),INTEGERS[4],new Short((short)409),new Integer(199)} + new Object[] { 39,resources.reslblHelp4_value,Boolean.TRUE,104,145,INTEGERS[4],new Short((short)409),199} ); } public void buildStep5() { lblTitle4 = insertLabel("lblTitle4", PROPS_LABEL_B, - new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle4_value,Boolean.TRUE,new Integer(91),INTEGERS[8],INTEGERS[5],new Short((short)500),new Integer(212)} + new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle4_value,Boolean.TRUE,91,INTEGERS[8],INTEGERS[5],new Short((short)500),212} ); lblTopic = insertLabel("lblTopic", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblTopic_value,new Integer(107),new Integer(28),INTEGERS[5],new Short((short)71),new Integer(501)} + new Object[] { INTEGERS[8],resources.reslblTopic_value,107,28,INTEGERS[5],new Short((short)71),501} ); lblResponsible = insertLabel("lblResponsible", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblResponsible_value,new Integer(195),new Integer(28),INTEGERS[5],new Short((short)72),new Integer(502)} + new Object[] { INTEGERS[8],resources.reslblResponsible_value,195,28,INTEGERS[5],new Short((short)72),502} ); lblDuration = insertLabel("lblDuration", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblDuration_value,new Integer(267),new Integer(28),INTEGERS[5],new Short((short)73),new Integer(503)} + new Object[] { INTEGERS[8],resources.reslblDuration_value,267,28,INTEGERS[5],new Short((short)73),503} ); @@ -322,19 +322,19 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda btnInsert = insertButton("btnInsert", BTNINSERT_ACTION_PERFORMED, PROPS_BUTTON, - new Object[] { INTEGER_14,BTNINSERT_HID,resources.resButtonInsert,new Integer(92),new Integer(136),INTEGERS[5],new Short((short)580),INTEGER_40} + new Object[] { INTEGER_14,BTNINSERT_HID,resources.resButtonInsert,92,136,INTEGERS[5],new Short((short)580),INTEGER_40} ); btnRemove = insertButton("btnRemove", BTNREMOVE_ACTION_PERFORMED, PROPS_BUTTON, - new Object[] { INTEGER_14,BTNREMOVE_HID,resources.resButtonRemove,new Integer(134),new Integer(136),INTEGERS[5],new Short((short)581),INTEGER_40} + new Object[] { INTEGER_14,BTNREMOVE_HID,resources.resButtonRemove,134,136,INTEGERS[5],new Short((short)581),INTEGER_40} ); btnUp = insertButton("btnUp", BTNUP_ACTION_PERFORMED, PROPS_BUTTON, - new Object[] { INTEGER_14,BTNUP_HID,resources.resButtonUp,new Integer(222),new Integer(136),INTEGERS[5],new Short((short)582),INTEGER_40} + new Object[] { INTEGER_14,BTNUP_HID,resources.resButtonUp,222,136,INTEGERS[5],new Short((short)582),INTEGER_40} ); btnDown = insertButton("btnDown", BTNDOWN_ACTION_PERFORMED, PROPS_BUTTON, - new Object[] { INTEGER_14,BTNDOWN_HID,resources.resButtonDown,new Integer(264),new Integer(136),INTEGERS[5],new Short((short)583),INTEGER_40} + new Object[] { INTEGER_14,BTNDOWN_HID,resources.resButtonDown,264,136,INTEGERS[5],new Short((short)583),INTEGER_40} ); @@ -344,40 +344,40 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda lblTitle6 = insertLabel("lblTitle6", PROPS_LABEL_B, - new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle6_value,Boolean.TRUE,new Integer(91),INTEGERS[8],INTEGERS[6],new Short((short)600),new Integer(212)} + new Object[] { fontDescriptor4,INTEGER_16,resources.reslblTitle6_value,Boolean.TRUE,91,INTEGERS[8],INTEGERS[6],new Short((short)600),212} ); lblHelpPg6 = insertLabel("lblHelpPg6", PROPS_TEXTAREA, - new Object[] { new Integer(24),resources.reslblHelpPg6_value,Boolean.TRUE,new Integer(97),new Integer(32),INTEGERS[6],new Short((short)601),new Integer(204)} + new Object[] { 24,resources.reslblHelpPg6_value,Boolean.TRUE,97,32,INTEGERS[6],new Short((short)601),204} ); lblTemplateName = insertLabel("lblTemplateName", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblTemplateName_value,new Integer(97),new Integer(62),INTEGERS[6],new Short((short)602),new Integer(101)} + new Object[] { INTEGERS[8],resources.reslblTemplateName_value,97,62,INTEGERS[6],new Short((short)602),101} ); txtTemplateName = insertTextField("txtTemplateName", TXTTEMPLATENAME_TEXT_CHANGED, PROPS_X, - new Object[] { INTEGER_12,TXTTEMPLATENAME_HID,new Integer(202),new Integer(60),INTEGERS[6],new Short((short)603),new Integer(100)} + new Object[] { INTEGER_12,TXTTEMPLATENAME_HID,202,60,INTEGERS[6],new Short((short)603),100} ); lblProceed = insertLabel("lblProceed", PROPS_TEXT, - new Object[] { INTEGERS[8],resources.reslblProceed_value,new Integer(97),new Integer(101),INTEGERS[6],new Short((short)607),new Integer(204)} + new Object[] { INTEGERS[8],resources.reslblProceed_value,97,101,INTEGERS[6],new Short((short)607),204} ); optCreateAgenda = insertRadioButton("optCreateAgenda", null, PROPS_CHECK, - new Object[] { INTEGERS[8],OPTCREATEAGENDA_HID,resources.resoptCreateAgenda_value,new Integer(103),new Integer(113),new Short((short)1),INTEGERS[6],new Short((short)608),new Integer(198)} + new Object[] { INTEGERS[8],OPTCREATEAGENDA_HID,resources.resoptCreateAgenda_value,103,113,new Short((short)1),INTEGERS[6],new Short((short)608),198} ); optMakeChanges = insertRadioButton("optMakeChanges", null, PROPS_BUTTON, - new Object[] { INTEGERS[8],OPTMAKECHANGES_HID,resources.resoptMakeChanges_value,new Integer(103),new Integer(125),INTEGERS[6],new Short((short)609),new Integer(198)} + new Object[] { INTEGERS[8],OPTMAKECHANGES_HID,resources.resoptMakeChanges_value,103,125,INTEGERS[6],new Short((short)609),198} ); imgHelp6 = insertImage("imgHelp6", PROPS_IMAGE, - new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, new Integer(92),new Integer(145),Boolean.FALSE, INTEGERS[6],new Short((short)610),INTEGERS[10]} + new Object[] { NO_BORDER, INTEGERS[10],IMGHELP1_HID,AgendaWizardDialogConst.INFO_IMAGE_URL, 92,145,Boolean.FALSE, INTEGERS[6],new Short((short)610),INTEGERS[10]} ); lblHelp6 = insertLabel("lblHelp6", PROPS_TEXTAREA, - new Object[] { new Integer(39),resources.reslblHelp6_value,Boolean.TRUE,new Integer(104),new Integer(145),INTEGERS[6],new Short((short)611),new Integer(199)} + new Object[] { 39,resources.reslblHelp6_value,Boolean.TRUE,104,145,INTEGERS[6],new Short((short)611),199} ); } diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java index 50ee492f8c78..20ad03c428ae 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; @@ -158,7 +159,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog // create the peer XWindow xw = agendaTemplate.xFrame.getContainerWindow(); - XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xw); + XWindowPeer xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xw); this.createWindowPeer( xWindowPeer ); // initialize roadmap @@ -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(); @@ -184,8 +185,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog removeTerminateListener(); ex.printStackTrace(); running=false; - return; - } + } } @@ -212,7 +212,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 +221,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 +243,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 +420,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 +463,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(); } @@ -482,7 +482,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog agendaTemplate.xTextDocument.lockControllers(); - xTextDocument = (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class,agendaTemplate.document); + xTextDocument = UnoRuntime.queryInterface(XTextDocument.class,agendaTemplate.document); bSaveSuccess = OfficeDocument.store(xMSF, xTextDocument, sPath , "writer8_template", false ); } catch (Exception e) { @@ -503,7 +503,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog agendaTemplate.finish( topicsControl.getTopicsData()); try { - XStorable xStoreable = (XStorable) UnoRuntime.queryInterface(XStorable.class, agendaTemplate.document); + XStorable xStoreable = UnoRuntime.queryInterface(XStorable.class, agendaTemplate.document); xStoreable.store(); } catch (Exception ex) { @@ -528,8 +528,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog loadValues[1] = new PropertyValue(); loadValues[1].Name = "InteractionHandler"; try { - XInteractionHandler xIH = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); - loadValues[1].Value = xIH; + loadValues[1].Value = UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -537,7 +536,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog //Object oDoc = OfficeDocument.load(Desktop.getDesktop(xMSF), agenda.cp_TemplatePath, "_default", new PropertyValue[0]); Object oDoc = OfficeDocument.load(Desktop.getDesktop(xMSF), sPath, "_default", new PropertyValue[0]); xTextDocument = (com.sun.star.text.XTextDocument) oDoc; - XMultiServiceFactory xDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); ViewHandler myViewHandler = new ViewHandler(xDocMSF, xTextDocument); try { myViewHandler.setViewSetting("ZoomType", new Short(com.sun.star.view.DocumentZoomType.OPTIMAL)); @@ -557,7 +556,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog private void closeDocument() { try { //xComponent.dispose(); - XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, agendaTemplate.xFrame); + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, agendaTemplate.xFrame); xCloseable.close(false); } catch (CloseVetoException e) { e.printStackTrace(); 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 0e3678139378..495ac8a94040 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.java +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.java @@ -190,7 +190,7 @@ public class TopicsControl extends ControlScroller implements XFocusListener */ static void addKeyListener(Object control, XKeyListener listener) { - XWindow xlastControl = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xlastControl = UnoRuntime.queryInterface(XWindow.class, control); xlastControl.addKeyListener(listener); } @@ -200,7 +200,7 @@ public class TopicsControl extends ControlScroller implements XFocusListener */ static void addFocusListener(Object control, XFocusListener listener) { - XWindow xlastControl = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xlastControl = UnoRuntime.queryInterface(XWindow.class, control); xlastControl.addFocusListener(listener); } @@ -304,14 +304,14 @@ 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 */ public void focusGained(FocusEvent fe) { - XControl xc = (XControl) UnoRuntime.queryInterface(XControl.class, fe.Source); + XControl xc = UnoRuntime.queryInterface(XControl.class, fe.Source); focusGained(xc); } @@ -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); } /** @@ -698,11 +698,11 @@ public class TopicsControl extends ControlScroller implements XFocusListener */ private void focus(Object textControl) { - ((XWindow) UnoRuntime.queryInterface(XWindow.class, textControl)).setFocus(); - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, textControl); + UnoRuntime.queryInterface(XWindow.class, textControl).setFocus(); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, textControl); String text = xTextComponent.getText(); xTextComponent.setSelection(new Selection(0, text.length())); - XControl xc = (XControl) UnoRuntime.queryInterface(XControl.class, textControl); + XControl xc = UnoRuntime.queryInterface(XControl.class, textControl); focusGained(xc); } @@ -876,7 +876,7 @@ public class TopicsControl extends ControlScroller implements XFocusListener */ private Selection getSelection(Object control) { - return ((XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, control)).getSelection(); + return UnoRuntime.queryInterface(XTextComponent.class, control).getSelection(); } /** @@ -897,8 +897,8 @@ public class TopicsControl extends ControlScroller implements XFocusListener { ControlRow cr = (ControlRow) ControlGroupVector.get(guiRow); Object control = getControl(cr, eventSource); - ((XWindow) UnoRuntime.queryInterface(XWindow.class, control)).setFocus(); - ((XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, control)).setSelection(s); + UnoRuntime.queryInterface(XWindow.class, control).setFocus(); + UnoRuntime.queryInterface(XTextComponent.class, control).setSelection(s); } /** @@ -1038,11 +1038,11 @@ public class TopicsControl extends ControlScroller implements XFocusListener /** * A static member used for the child-class ControlRow (GUI Constant) */ - private static Integer I_12 = new Integer(12); + private static Integer I_12 = 12; /** * A static member used for the child-class ControlRow (GUI Constant) */ - private static Integer I_8 = new Integer(8); + private static Integer I_8 = 8; /** * A static member used for the child-class ControlRow (GUI Constant) */ @@ -1173,28 +1173,28 @@ 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), new Integer(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, TEXT_PROPS, new Object[] { - I_12, HelpIds.getHelpIdString(curHelpIndex + i * 3 + 1), new Integer(x + 15), y_, IStep, new Short((short) (tabindex + 1)), new Integer(84) + I_12, HelpIds.getHelpIdString(curHelpIndex + i * 3 + 1), new Integer(x + 15), y_, IStep, new Short((short) (tabindex + 1)), 84 }); combobox = dialog.insertTextField(RESP + i, "responsibleTextChanged", this, TEXT_PROPS, new Object[] { - I_12, HelpIds.getHelpIdString(curHelpIndex + i * 3 + 2), new Integer(x + 103), y_, IStep, new Short((short) (tabindex + 2)), new Integer(68) + I_12, HelpIds.getHelpIdString(curHelpIndex + i * 3 + 2), new Integer(x + 103), y_, IStep, new Short((short) (tabindex + 2)), 68 }); timebox = dialog.insertTextField(TIME + i, "timeTextChanged", this, TEXT_PROPS, new Object[] { - I_12, HelpIds.getHelpIdString(curHelpIndex + i * 3 + 3), new Integer(x + 175), y_, IStep, new Short((short) (tabindex + 3)), new Integer(20) + I_12, HelpIds.getHelpIdString(curHelpIndex + i * 3 + 3), new Integer(x + 175), y_, IStep, new Short((short) (tabindex + 3)), 20 }); setEnabled(false); 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..08baa26b412c 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; } @@ -114,7 +114,7 @@ public abstract class Configuration public static Object getNode(String name, Object parent) throws Exception { - return ((XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, parent)).getByName(name); + return UnoRuntime.queryInterface(XNameAccess.class, parent).getByName(name); } public static void set(int value, String name, Object parent) throws Exception @@ -134,7 +134,7 @@ public abstract class Configuration public static void set(boolean value, String name, Object parent) throws Exception { - if (value == true) + if (value) { set(Boolean.TRUE, name, parent); } @@ -146,7 +146,7 @@ public abstract class Configuration public static void set(Object value, String name, Object parent) throws com.sun.star.lang.IllegalArgumentException, PropertyVetoException, UnknownPropertyException, WrappedTargetException { - ((XHierarchicalPropertySet) UnoRuntime.queryInterface(XHierarchicalPropertySet.class, parent)).setHierarchicalPropertyValue(name, value); + UnoRuntime.queryInterface(XHierarchicalPropertySet.class, parent).setHierarchicalPropertyValue(name, value); } /** Creates a new instance of RegistryEntry @@ -157,7 +157,7 @@ public abstract class Configuration */ public static Object getConfigurationNode(String name, Object parent) throws Exception { - return ((XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, parent)).getByName(name); + return UnoRuntime.queryInterface(XNameAccess.class, parent).getByName(name); } public static Object getConfigurationRoot(XMultiServiceFactory xmsf, String sPath, boolean updateable) throws com.sun.star.uno.Exception @@ -165,7 +165,7 @@ public abstract class Configuration Object oConfigProvider; oConfigProvider = xmsf.createInstance("com.sun.star.configuration.ConfigurationProvider"); - XMultiServiceFactory confMsf = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oConfigProvider); + XMultiServiceFactory confMsf = UnoRuntime.queryInterface(XMultiServiceFactory.class, oConfigProvider); final String sView = updateable ? "com.sun.star.configuration.ConfigurationUpdateAccess" : "com.sun.star.configuration.ConfigurationAccess"; @@ -192,7 +192,7 @@ public abstract class Configuration public static String[] getChildrenNames(Object configView) { - XNameAccess nameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, configView); + XNameAccess nameAccess = UnoRuntime.queryInterface(XNameAccess.class, configView); return nameAccess.getElementNames(); } @@ -201,8 +201,7 @@ public abstract class Configuration try { Object oProdNameAccess = getConfigurationRoot(xMSF, "org.openoffice.Setup/Product", false); - String ProductName = (String) Helper.getUnoObjectbyName(oProdNameAccess, "ooName"); - return ProductName; + return (String) Helper.getUnoObjectbyName(oProdNameAccess, "ooName"); } catch (Exception exception) { @@ -213,7 +212,7 @@ public abstract class Configuration public static String getOfficeLocaleString(XMultiServiceFactory xMSF) { - String sLocale = ""; + String sLocale = PropertyNames.EMPTY_STRING; try { Locale aLocLocale = new Locale(); @@ -247,8 +246,7 @@ public abstract class Configuration try { Object oMasterKey = getConfigurationRoot(xMSF, "org.openoffice.Setup/L10N/", false); - String sLinguistic = (String) Helper.getUnoObjectbyName(oMasterKey, "ooLocale"); - return sLinguistic; + return (String) Helper.getUnoObjectbyName(oMasterKey, "ooLocale"); } catch (Exception exception) { @@ -273,11 +271,11 @@ public abstract class Configuration public static Object addConfigNode(Object configView, String name) throws com.sun.star.lang.WrappedTargetException, ElementExistException, NoSuchElementException, com.sun.star.uno.Exception { - XNameContainer xNameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, configView); + XNameContainer xNameContainer = UnoRuntime.queryInterface(XNameContainer.class, configView); if (xNameContainer == null) { - XNameReplace xNameReplace = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class, configView); + XNameReplace xNameReplace = UnoRuntime.queryInterface(XNameReplace.class, configView); return xNameReplace.getByName(name); } else @@ -287,7 +285,7 @@ public abstract class Configuration xNameContainer.removeByName(name);*/ // create a new detached set element (instance of DataSourceDescription) - XSingleServiceFactory xElementFactory = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, configView); + XSingleServiceFactory xElementFactory = UnoRuntime.queryInterface(XSingleServiceFactory.class, configView); // the new element is the result ! Object newNode = xElementFactory.createInstance(); @@ -300,7 +298,7 @@ public abstract class Configuration public static void removeNode(Object configView, String name) throws NoSuchElementException, WrappedTargetException { - XNameContainer xNameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, configView); + XNameContainer xNameContainer = UnoRuntime.queryInterface(XNameContainer.class, configView); if (xNameContainer.hasByName(name)) { @@ -310,7 +308,7 @@ public abstract class Configuration public static void commit(Object configView) throws WrappedTargetException { - XChangesBatch xUpdateControl = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, configView); + XChangesBatch xUpdateControl = UnoRuntime.queryInterface(XChangesBatch.class, configView); xUpdateControl.commitChanges(); } @@ -319,7 +317,7 @@ public abstract class Configuration Object view = Configuration.getConfigurationRoot(xmsf, path, true); addConfigNode(path, name); node.writeConfiguration(view, param); - XChangesBatch xUpdateControl = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, view); + XChangesBatch xUpdateControl = UnoRuntime.queryInterface(XChangesBatch.class, view); xUpdateControl.commitChanges(); } @@ -327,7 +325,7 @@ public abstract class Configuration { Object view = Configuration.getConfigurationRoot(xmsf, path, true); removeNode(view, name); - XChangesBatch xUpdateControl = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, view); + XChangesBatch xUpdateControl = UnoRuntime.queryInterface(XChangesBatch.class, view); xUpdateControl.commitChanges(); } @@ -371,8 +369,7 @@ public abstract class Configuration { String[] snames = _xNameAccess.getElementNames(); Object oNode = _xNameAccess.getByName(snames[_index]); - XNameAccess xNameAccessNode = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oNode); - return xNameAccessNode; + return UnoRuntime.queryInterface(XNameAccess.class, oNode); } catch (Exception e) { @@ -387,7 +384,7 @@ public abstract class Configuration { if (_xNameAccessNode.hasByName(_SubNodeName)) { - return (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(_SubNodeName)); + return UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(_SubNodeName)); } } catch (Exception e) @@ -415,7 +412,7 @@ public abstract class Configuration String curdisplayname = (String) Helper.getUnoPropertyValue(_xNameAccessNode.getByName(snames[i]), _nodename); if (curdisplayname.equals(_displayname)) { - return (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(snames[i])); + return UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(snames[i])); } } } @@ -444,7 +441,7 @@ public abstract class Configuration if (curdisplayname.equals(_displayname)) { - return (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(snames[i])); + return UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(snames[i])); } } } diff --git a/wizards/com/sun/star/wizards/common/Desktop.java b/wizards/com/sun/star/wizards/common/Desktop.java index 8902696c37b4..13de04381155 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.java +++ b/wizards/com/sun/star/wizards/common/Desktop.java @@ -76,7 +76,7 @@ public class Desktop try { xInterface = (com.sun.star.uno.XInterface) xMSF.createInstance("com.sun.star.frame.Desktop"); - xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xInterface); + xDesktop = UnoRuntime.queryInterface(XDesktop.class, xInterface); } catch (Exception exception) { @@ -93,27 +93,26 @@ public class Desktop public static XFrame getActiveFrame(XMultiServiceFactory xMSF) { XDesktop xDesktop = getDesktop(xMSF); - XFramesSupplier xFrameSuppl = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, xDesktop); - XFrame xFrame = xFrameSuppl.getActiveFrame(); - return xFrame; + XFramesSupplier xFrameSuppl = UnoRuntime.queryInterface(XFramesSupplier.class, xDesktop); + return xFrameSuppl.getActiveFrame(); } public static XComponent getActiveComponent(XMultiServiceFactory _xMSF) { XFrame xFrame = getActiveFrame(_xMSF); - return (XComponent) UnoRuntime.queryInterface(XComponent.class, xFrame.getController().getModel()); + return UnoRuntime.queryInterface(XComponent.class, xFrame.getController().getModel()); } public static XTextDocument getActiveTextDocument(XMultiServiceFactory _xMSF) { XComponent xComponent = getActiveComponent(_xMSF); - return (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent); + return UnoRuntime.queryInterface(XTextDocument.class, xComponent); } public static XSpreadsheetDocument getActiveSpreadsheetDocument(XMultiServiceFactory _xMSF) { XComponent xComponent = getActiveComponent(_xMSF); - return (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, xComponent); + return UnoRuntime.queryInterface(XSpreadsheetDocument.class, xComponent); } public static XDispatch getDispatcher(XMultiServiceFactory xMSF, XFrame xFrame, String _stargetframe, com.sun.star.util.URL oURL) @@ -122,9 +121,8 @@ public class Desktop { com.sun.star.util.URL[] oURLArray = new com.sun.star.util.URL[1]; oURLArray[0] = oURL; - XDispatchProvider xDispatchProvider = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, xFrame); - XDispatch xDispatch = xDispatchProvider.queryDispatch(oURLArray[0], _stargetframe, FrameSearchFlag.ALL); // "_self" - return xDispatch; + XDispatchProvider xDispatchProvider = UnoRuntime.queryInterface(XDispatchProvider.class, xFrame); + return xDispatchProvider.queryDispatch(oURLArray[0], _stargetframe, FrameSearchFlag.ALL); // "_self" } catch (Exception e) { @@ -138,7 +136,7 @@ public class Desktop try { Object oTransformer = xMSF.createInstance("com.sun.star.util.URLTransformer"); - XURLTransformer xTransformer = (XURLTransformer) UnoRuntime.queryInterface(XURLTransformer.class, oTransformer); + XURLTransformer xTransformer = UnoRuntime.queryInterface(XURLTransformer.class, oTransformer); com.sun.star.util.URL[] oURL = new com.sun.star.util.URL[1]; oURL[0] = new com.sun.star.util.URL(); oURL[0].Complete = _sURL; @@ -161,7 +159,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) @@ -182,20 +180,19 @@ public class Desktop XMultiComponentFactory componentFactory = getMultiComponentFactory(); Object xUrlResolver = componentFactory.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver", null ); XUnoUrlResolver urlResolver = UnoRuntime.queryInterface(XUnoUrlResolver.class, xUrlResolver); - XMultiServiceFactory orb = UnoRuntime.queryInterface(XMultiServiceFactory.class, urlResolver.resolve( connectStr ) ); - return orb; + return UnoRuntime.queryInterface(XMultiServiceFactory.class, urlResolver.resolve( connectStr ) ); } public static String getIncrementSuffix(XNameAccess xElementContainer, String ElementName) { boolean bElementexists = true; int i = 1; - String sIncSuffix = ""; + String sIncSuffix = PropertyNames.EMPTY_STRING; String BaseName = ElementName; - while (bElementexists == true) + while (bElementexists) { bElementexists = xElementContainer.hasByName(ElementName); - if (bElementexists == true) + if (bElementexists) { i += 1; ElementName = BaseName + Integer.toString(i); @@ -212,12 +209,12 @@ public class Desktop { boolean bElementexists = true; int i = 1; - String sIncSuffix = ""; + String sIncSuffix = PropertyNames.EMPTY_STRING; String BaseName = ElementName; - while (bElementexists == true) + while (bElementexists) { bElementexists = xElementContainer.hasByHierarchicalName(ElementName); - if (bElementexists == true) + if (bElementexists) { i += 1; ElementName = BaseName + Integer.toString(i); @@ -235,10 +232,9 @@ public class Desktop try { int nStartFlags = com.sun.star.i18n.KParseTokens.ANY_LETTER_OR_NUMBER + com.sun.star.i18n.KParseTokens.ASC_UNDERSCORE; - 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, " "); + XCharacterClassification xCharacterClassification = UnoRuntime.queryInterface(XCharacterClassification.class, ocharservice); + ParseResult aResult = xCharacterClassification.parsePredefinedToken(KParseType.IDENTNAME, _sString, 0, _aLocale, nStartFlags, PropertyNames.EMPTY_STRING, nStartFlags, PropertyNames.SPACE); return aResult.EndPos; } catch (Exception e) @@ -258,7 +254,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; @@ -311,7 +307,7 @@ public class Desktop { return _sElementName; } - while (bElementexists == true) + while (bElementexists) { for (int i = 0; i < _slist.length; i++) { @@ -322,7 +318,7 @@ public class Desktop } scompname = _sElementName + _sSuffixSeparator + a++; } - return ""; + return PropertyNames.EMPTY_STRING; } /** @@ -342,8 +338,8 @@ public class Desktop aNodePath[0] = new PropertyValue(); aNodePath[0].Name = "nodepath"; aNodePath[0].Value = KeyName; - XMultiServiceFactory xMSFConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oConfigProvider); - if (bForUpdate == true) + XMultiServiceFactory xMSFConfig = UnoRuntime.queryInterface(XMultiServiceFactory.class, oConfigProvider); + if (bForUpdate) { return (XInterface) xMSFConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aNodePath); } @@ -377,9 +373,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) { @@ -391,52 +387,48 @@ public class Desktop { try { - String sTemplatePath = FileAccess.getOfficePath(_xMSF, "Template", "share", "/wizard"); - return sTemplatePath; + return FileAccess.getOfficePath(_xMSF, "Template", "share", "/wizard"); } catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static String getUserTemplatePath(XMultiServiceFactory _xMSF) { try { - String sUserTemplatePath = FileAccess.getOfficePath(_xMSF, "Template", "user", ""); - return sUserTemplatePath; + return FileAccess.getOfficePath(_xMSF, "Template", "user", PropertyNames.EMPTY_STRING); } catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static String getBitmapPath(XMultiServiceFactory _xMSF) { try { - String sBitmapPath = FileAccess.combinePaths(_xMSF, getTemplatePath(_xMSF), "/../wizard/bitmap"); - return sBitmapPath; + return FileAccess.combinePaths(_xMSF, getTemplatePath(_xMSF), "/../wizard/bitmap"); } catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static String getWorkPath(XMultiServiceFactory _xMSF) { try { - String sWorkPath = FileAccess.getOfficePath(_xMSF, "Work", "", ""); - return sWorkPath; + return FileAccess.getOfficePath(_xMSF, "Work", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); } catch (NoValidPathException nopathexception) { } - return ""; + return PropertyNames.EMPTY_STRING; } public static XStringSubstitution createStringSubstitution(XMultiServiceFactory xMSF) @@ -452,7 +444,7 @@ public class Desktop } if (xPathSubst != null) { - return (XStringSubstitution) UnoRuntime.queryInterface(XStringSubstitution.class, xPathSubst); + return UnoRuntime.queryInterface(XStringSubstitution.class, xPathSubst); } else { @@ -495,7 +487,7 @@ public class Desktop { Object comp = ((Any) e.nextElement()).getObject(); - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, comp); + XModel xModel = UnoRuntime.queryInterface(XModel.class, comp); XFrame xFrame = xModel.getCurrentController().getFrame(); if (xFrame != null && xFrame.getComponentWindow() != null) diff --git a/wizards/com/sun/star/wizards/common/FileAccess.java b/wizards/com/sun/star/wizards/common/FileAccess.java index 6278d7e71a97..40cccba9ad75 100644 --- a/wizards/com/sun/star/wizards/common/FileAccess.java +++ b/wizards/com/sun/star/wizards/common/FileAccess.java @@ -33,6 +33,7 @@ import com.sun.star.util.XMacroExpander; // import com.sun.star.wizards.common.NoValidPathException; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.Vector; import com.sun.star.awt.VclWindowPeerAttribute; @@ -74,24 +75,23 @@ 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; - return; - } + ResultPath += PropertyNames.SEMI_COLON + sAddPath; + } public static String deleteLastSlashfromUrl(String _sPath) { @@ -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; @@ -155,11 +155,11 @@ public class FileAccess try { XInterface xPathInterface = (XInterface) xMSF.createInstance("com.sun.star.util.PathSettings"); - XPropertySet xPropertySet = (XPropertySet) com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, xPathInterface); - String WritePath = ""; + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xPathInterface); + 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); + XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); Template_writable = (String) xPropertySet.getPropertyValue(sPath + "_writable"); Template_internal = (String[]) xPropertySet.getPropertyValue(sPath + "_internal"); @@ -204,11 +204,11 @@ public class FileAccess catch (Exception exception) { exception.printStackTrace(System.out); - ResultPath = ""; + ResultPath = PropertyNames.EMPTY_STRING; } - if (bexists == false) + if (!bexists) { - 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; @@ -229,8 +229,8 @@ public class FileAccess try { XInterface xPathInterface = (XInterface) xMSF.createInstance("com.sun.star.util.PathSettings"); - XPropertySet xPropertySet = (XPropertySet) com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, xPathInterface); - // String WritePath = ""; + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xPathInterface); + // 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); @@ -255,10 +255,7 @@ public class FileAccess aPathList.add(sPath); } - for (int i = 0; i < Template_user.length; i++) - { - aPathList.add(Template_user[i]); - } + aPathList.addAll(Arrays.asList(Template_user)); aPathList.add(Template_writable); // WritePath = Template_writable; @@ -288,11 +285,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; @@ -323,7 +320,7 @@ public class FileAccess String sPath = _sPath + "/" + aLocaleAll.toString(); XInterface xInterface = (XInterface) _xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); + XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); if (xSimpleFileAccess.exists(sPath)) { return sPath; @@ -374,7 +371,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 +380,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 +400,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); @@ -439,7 +436,7 @@ public class FileAccess try { XInterface xUcbInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); + XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); bExists = xSimpleFileAccess.exists(_sPath); } catch (Exception exception) @@ -452,46 +449,43 @@ 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"); - XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); + XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xUcbInterface); ReturnPath = _sFirstPath + _sSecondPath; bexists = xSimpleFileAccess.exists(ReturnPath); } catch (Exception exception) { exception.printStackTrace(System.out); - return ""; + return PropertyNames.EMPTY_STRING; } - if (bexists == false) + if (!bexists) { - 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"); - if (oResource != null) + sNoDirCreation = oResource.getResText(1050); + String sMsgDirNotThere = oResource.getResText(1051); + String sQueryForNewCreation = oResource.getResText(1052); + String OSPath = JavaTools.convertfromURLNotation(Path); + String sQueryMessage = JavaTools.replaceSubString(sMsgDirNotThere, OSPath, "%1"); + sQueryMessage = sQueryMessage + (char) 13 + sQueryForNewCreation; + int icreate = SystemDialog.showMessageBox(xMSF, "QueryBox", VclWindowPeerAttribute.YES_NO, sQueryMessage); + if (icreate == 2) { - sNoDirCreation = oResource.getResText(1050); - String sMsgDirNotThere = oResource.getResText(1051); - String sQueryForNewCreation = oResource.getResText(1052); - String OSPath = JavaTools.convertfromURLNotation(Path); - String sQueryMessage = JavaTools.replaceSubString(sMsgDirNotThere, OSPath, "%1"); - sQueryMessage = sQueryMessage + (char) 13 + sQueryForNewCreation; - int icreate = SystemDialog.showMessageBox(xMSF, "QueryBox", VclWindowPeerAttribute.YES_NO, sQueryMessage); - if (icreate == 2) - { - xSimpleFileAccess.createFolder(Path); - return true; - } + xSimpleFileAccess.createFolder(Path); + return true; } return false; } @@ -516,7 +510,7 @@ public class FileAccess try { String SubDir; - String SubDirPath = ""; + String SubDirPath = PropertyNames.EMPTY_STRING; int SubLen; int NewLen; int RestLen; @@ -525,7 +519,7 @@ public class FileAccess String LowerCasePath; String NewPath = Path; XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); + XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); if (baskbeforeOverwrite) { if (xSimpleFileAccess.exists(Path)) @@ -563,14 +557,13 @@ public class FileAccess if (bexists) { LowerCasePath = NewPath.toLowerCase(); - bexists = (((LowerCasePath.equals("file:///")) || (LowerCasePath.equals("file://")) || (LowerCasePath.equals("file:/")) || (LowerCasePath.equals("file:"))) == false); + bexists = (!((LowerCasePath.equals("file:///")) || (LowerCasePath.equals("file://")) || (LowerCasePath.equals("file:/")) || (LowerCasePath.equals("file:")))); } if (bexists) { - if (bSubDirexists == false) + if (!bSubDirexists) { - boolean bSubDiriscreated = createSubDirectory(xMSF, xSimpleFileAccess, SubDirPath); - return bSubDiriscreated; + return createSubDirectory(xMSF, xSimpleFileAccess, SubDirPath); } return true; } @@ -604,26 +597,26 @@ 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; java.util.Vector<String> NameVector = null; XInterface xDocInterface = (XInterface) xMSF.createInstance("com.sun.star.document.DocumentProperties"); - XDocumentProperties xDocProps = (XDocumentProperties) UnoRuntime.queryInterface(XDocumentProperties.class, xDocInterface); + XDocumentProperties xDocProps = UnoRuntime.queryInterface(XDocumentProperties.class, xDocInterface); XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess) UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface); + com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); String[] nameList = xSimpleFileAccess.getFolderContents(FolderName, false); 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,11 +669,11 @@ 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"); - com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess) UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface); + com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); for (int i = 0; i < _aList.size(); i++) { @@ -709,16 +702,16 @@ 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"); - XDocumentProperties xDocProps = (XDocumentProperties) UnoRuntime.queryInterface(XDocumentProperties.class, xDocInterface); + XDocumentProperties xDocProps = UnoRuntime.queryInterface(XDocumentProperties.class, xDocInterface); PropertyValue[] noArgs = { }; xDocProps.loadFromMedium(_sFile, noArgs); sTitle = xDocProps.getTitle(); @@ -732,7 +725,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."); @@ -744,7 +737,7 @@ public class FileAccess try { XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess) UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface); + xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); } catch (com.sun.star.uno.Exception e) { @@ -759,9 +752,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 +762,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 @@ -818,31 +811,28 @@ public class FileAccess { //get a simple file access... Object fa = xmsf.createInstance("com.sun.star.ucb.SimpleFileAccess"); - fileAccess = (XSimpleFileAccess2) UnoRuntime.queryInterface(XSimpleFileAccess2.class, fa); + fileAccess = UnoRuntime.queryInterface(XSimpleFileAccess2.class, fa); //get the file identifier converter Object fcv = xmsf.createInstance("com.sun.star.ucb.FileContentProvider"); - filenameConverter = (XFileIdentifierConverter) UnoRuntime.queryInterface(XFileIdentifierConverter.class, fcv); + filenameConverter = UnoRuntime.queryInterface(XFileIdentifierConverter.class, fcv); } public String getURL(String parentPath, String childPath) { String parent = filenameConverter.getSystemPathFromFileURL(parentPath); File f = new File(parent, childPath); - String r = filenameConverter.getFileURLFromSystemPath(parentPath, f.getAbsolutePath()); - return r; + return filenameConverter.getFileURLFromSystemPath(parentPath, f.getAbsolutePath()); } public String getURL(String path) { File f = new File(path); - String r = filenameConverter.getFileURLFromSystemPath( - path, f.getAbsolutePath()); - return r; + return filenameConverter.getFileURLFromSystemPath(path, f.getAbsolutePath()); } 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 +845,7 @@ public class FileAccess int p = filename.indexOf("."); if (p == -1) { - return ""; + return PropertyNames.EMPTY_STRING; } else { @@ -1018,8 +1008,7 @@ public class FileAccess { String filename = getFilename(path, pathSeparator); String sExtension = getExtension(filename); - String basename = filename.substring(0, filename.length() - (sExtension.length() + 1)); - return basename; + return filename.substring(0, filename.length() - (sExtension.length() + 1)); } /** @@ -1083,7 +1072,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; @@ -1102,8 +1091,7 @@ public class FileAccess do { String filename = filename(name, extension, i++); - String u = getURL(parentDir, filename); - url = u; + url = getURL(parentDir, filename); } while (exists(url, true)); @@ -1112,7 +1100,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 +1117,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); } @@ -1140,13 +1128,13 @@ public class FileAccess { Vector<String> oDataVector = new Vector<String>(); Object oSimpleFileAccess = _xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) com.sun.star.uno.UnoRuntime.queryInterface(XSimpleFileAccess.class, oSimpleFileAccess); + XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, oSimpleFileAccess); if (xSimpleFileAccess.exists(_filepath)) { XInputStream xInputStream = xSimpleFileAccess.openFileRead(_filepath); Object oTextInputStream = _xMSF.createInstance("com.sun.star.io.TextInputStream"); - XTextInputStream xTextInputStream = (XTextInputStream) UnoRuntime.queryInterface(XTextInputStream.class, oTextInputStream); - XActiveDataSink xActiveDataSink = (XActiveDataSink) UnoRuntime.queryInterface(XActiveDataSink.class, oTextInputStream); + XTextInputStream xTextInputStream = UnoRuntime.queryInterface(XTextInputStream.class, oTextInputStream); + XActiveDataSink xActiveDataSink = UnoRuntime.queryInterface(XActiveDataSink.class, oTextInputStream); xActiveDataSink.setInputStream(xInputStream); while (!xTextInputStream.isEOF()) { diff --git a/wizards/com/sun/star/wizards/common/HelpIds.java b/wizards/com/sun/star/wizards/common/HelpIds.java index ad8faa2b2d42..19a51bef3e5a 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 @@ -1042,6 +1042,6 @@ public class HelpIds else if ( nHelpId >= 40769 && nHelpId <= 41245 ) return array2[ nHelpId - 40769 ]; else - return new String(); + return ""; } } diff --git a/wizards/com/sun/star/wizards/common/Helper.java b/wizards/com/sun/star/wizards/common/Helper.java index 0df16b360de0..b00cb3b2b485 100644 --- a/wizards/com/sun/star/wizards/common/Helper.java +++ b/wizards/com/sun/star/wizards/common/Helper.java @@ -58,15 +58,14 @@ public class Helper oCal.set(DateValue.Year, DateValue.Month, DateValue.Day); java.util.Date dTime = oCal.getTime(); long lTime = dTime.getTime(); - long lDate = lTime / (3600 * 24000); - return lDate; + return lTime / (3600 * 24000); } public static void setUnoPropertyValue(Object oUnoObject, String PropertyName, Object PropertyValue) { try { - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); if (xPSet.getPropertySetInfo().hasPropertyByName(PropertyName)) { xPSet.setPropertyValue(PropertyName, PropertyValue); @@ -87,8 +86,8 @@ public class Helper { try { - com.sun.star.container.XNameAccess xName = (com.sun.star.container.XNameAccess) UnoRuntime.queryInterface(com.sun.star.container.XNameAccess.class, oUnoObject); - if (xName.hasByName(ElementName) == true) + com.sun.star.container.XNameAccess xName = UnoRuntime.queryInterface(com.sun.star.container.XNameAccess.class, oUnoObject); + if (xName.hasByName(ElementName)) { return xName.getByName(ElementName); } @@ -126,7 +125,7 @@ public class Helper { if (oUnoObject != null) { - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); Object oObject = xPSet.getPropertyValue(PropertyName); if (AnyConverter.isVoid(oObject)) { @@ -202,10 +201,9 @@ public class Helper { if (oUnoObject != null) { - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); // Property[] aProps = xPSet.getPropertySetInfo().getProperties(); - Object oObject = xPSet.getPropertyValue(PropertyName); - return oObject; + return xPSet.getPropertyValue(PropertyName); } } catch (Exception exception) @@ -221,7 +219,7 @@ public class Helper { if (oUnoObject != null) { - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); Object oObject = xPSet.getPropertyValue(PropertyName); if (AnyConverter.isArray(oObject)) { @@ -242,11 +240,10 @@ public class Helper { if (oUnoObject != null) { - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); - if (xPSet.getPropertySetInfo().hasPropertyByName(PropertyName) == true) + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oUnoObject); + if (xPSet.getPropertySetInfo().hasPropertyByName(PropertyName)) { - Object oObject = xPSet.getPropertyValue(PropertyName); - return oObject; + return xPSet.getPropertyValue(PropertyName); } } return null; @@ -262,7 +259,7 @@ public class Helper { try { - com.sun.star.beans.XMultiPropertySet xMultiPSetLst = (com.sun.star.beans.XMultiPropertySet) UnoRuntime.queryInterface(com.sun.star.beans.XMultiPropertySet.class, oUnoObject); + com.sun.star.beans.XMultiPropertySet xMultiPSetLst = UnoRuntime.queryInterface(com.sun.star.beans.XMultiPropertySet.class, oUnoObject); if (xMultiPSetLst != null) { xMultiPSetLst.setPropertyValues(PropertyNames, PropertyValues); @@ -322,7 +319,7 @@ public class Helper public DateUtils(XMultiServiceFactory xmsf, Object document) throws Exception { - XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, document); + XMultiServiceFactory docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, document); Object defaults = docMSF.createInstance("com.sun.star.text.Defaults"); Locale l = (Locale) Helper.getUnoStructValue(defaults, "CharLocale"); @@ -332,7 +329,7 @@ public class Helper calendar = Calendar.getInstance(jl); - formatSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, document); + formatSupplier = UnoRuntime.queryInterface(XNumberFormatsSupplier.class, document); Object formatSettings = formatSupplier.getNumberFormatSettings(); com.sun.star.util.Date date = (com.sun.star.util.Date) Helper.getUnoPropertyValue(formatSettings, "NullDate"); @@ -379,9 +376,7 @@ public class Helper * docNullTime and date1 are in millis, but * I need a day... */ - double daysDiff = (date1 - docNullTime) / DAY_IN_MILLIS + 1; - - return daysDiff; + return (date1 - docNullTime) / DAY_IN_MILLIS + 1; } public double getDocumentDateAsDouble(DateTime date) @@ -400,9 +395,7 @@ public class Helper * docNullTime and date1 are in millis, but * I need a day... */ - double daysDiff = (date1 - docNullTime) / DAY_IN_MILLIS + 1; - - return daysDiff; + return (date1 - docNullTime) / DAY_IN_MILLIS + 1; } @@ -425,20 +418,16 @@ public class Helper public static XComponentContext getComponentContext(XMultiServiceFactory _xMSF) { // Get the path to the extension and try to add the path to the class loader - final XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _xMSF); + final XPropertySet xProps = UnoRuntime.queryInterface(XPropertySet.class, _xMSF); final PropertySetHelper aHelper = new PropertySetHelper(xProps); final Object aDefaultContext = aHelper.getPropertyValueAsObject("DefaultContext"); - final XComponentContext xComponentContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, aDefaultContext); - return xComponentContext; + return UnoRuntime.queryInterface(XComponentContext.class, aDefaultContext); } public static XMacroExpander getMacroExpander(XMultiServiceFactory _xMSF) { final XComponentContext xComponentContext = getComponentContext(_xMSF); final Object aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"); - XMacroExpander xExpander = (XMacroExpander) UnoRuntime.queryInterface(XMacroExpander.class, aSingleton); - // String[][] aStrListList = xProvider.getExtensionList(); -// final String sLocation = xProvider.getPackageLocation("com.sun.reportdesigner"); - return xExpander; + return UnoRuntime.queryInterface(XMacroExpander.class, aSingleton); } } diff --git a/wizards/com/sun/star/wizards/common/JavaTools.java b/wizards/com/sun/star/wizards/common/JavaTools.java index 836b2a7ea242..43a66301ba27 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 @@ -79,10 +79,7 @@ public class JavaTools if (FirstArray != null) { String[] SecondArray = new String[FirstArray.length]; - for (int i = 0; i < FirstArray.length; i++) - { - SecondArray[i] = FirstArray[i]; - } + System.arraycopy(FirstArray, 0, SecondArray, 0, FirstArray.length); return SecondArray; } else @@ -200,7 +197,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 +215,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 +374,7 @@ public class JavaTools public static String[] ArrayoutofString(String MainString, String Token) { String[] StringArray; - if (MainString.equals("") == false) + if (!MainString.equals(PropertyNames.EMPTY_STRING)) { Vector StringVector = new Vector(); String LocString = null; @@ -443,17 +440,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); @@ -565,38 +562,32 @@ public class JavaTools public static PropertyValue[][] removeOutdatedFields(PropertyValue[][] baselist, String[] _complist) { - PropertyValue[][] retarray = new PropertyValue[][] - { - }; if ((baselist != null) && (_complist != null)) { - Vector firstdimvector = new Vector(); - int b = 0; + ArrayList<PropertyValue[]> firstdimvector = new ArrayList<PropertyValue[]>(); for (int n = 0; n < baselist.length; n++) { - Vector secdimvector = new Vector(); - PropertyValue[] internalArray; - int a = 0; + ArrayList<PropertyValue> secdimvector = new ArrayList<PropertyValue>(); for (int m = 0; m < baselist[n].length; m++) { if (FieldInList(_complist, baselist[n][m].Name) > -1) { secdimvector.add(baselist[n][m]); - a++; } } - if (a > 0) + if (!secdimvector.isEmpty()) { - internalArray = new PropertyValue[a]; + PropertyValue[] internalArray = new PropertyValue[secdimvector.size()]; secdimvector.toArray(internalArray); firstdimvector.add(internalArray); - b++; } } - retarray = new PropertyValue[b][]; - firstdimvector.toArray(retarray); + PropertyValue[][] retarray = new PropertyValue[firstdimvector.size()][]; + return firstdimvector.toArray(retarray); } - return (retarray); + return new PropertyValue[][] + { + }; } /** @@ -621,7 +612,7 @@ public class JavaTools { if (n == 0) { - sDescList[m] = new String(); + sDescList[m] = ""; } sDescList[m] += _scomplist[n][m]; } @@ -762,16 +753,16 @@ public class JavaTools { if (sSecondString != null) { - bissame = sSecondString.equals(""); + bissame = sSecondString.equals(PropertyNames.EMPTY_STRING); } else { - bissame = (sSecondString == null); + bissame = true; } } else { - if (sFirstString.equals("")) + if (sFirstString.equals(PropertyNames.EMPTY_STRING)) { bissame = (sSecondString == null); } diff --git a/wizards/com/sun/star/wizards/common/NamedValueCollection.java b/wizards/com/sun/star/wizards/common/NamedValueCollection.java index f8f2cd05224a..ebafcbd31e41 100644 --- a/wizards/com/sun/star/wizards/common/NamedValueCollection.java +++ b/wizards/com/sun/star/wizards/common/NamedValueCollection.java @@ -38,7 +38,7 @@ public class NamedValueCollection } @SuppressWarnings("unchecked") - public final < T extends Object > T getOrDefault( final String i_key, final T i_default ) + public final < T > T getOrDefault( final String i_key, final T i_default ) { if ( m_values.containsKey( i_key ) ) { diff --git a/wizards/com/sun/star/wizards/common/NumberFormatter.java b/wizards/com/sun/star/wizards/common/NumberFormatter.java index ccfbee303f98..f4398088ff30 100644 --- a/wizards/com/sun/star/wizards/common/NumberFormatter.java +++ b/wizards/com/sun/star/wizards/common/NumberFormatter.java @@ -66,9 +66,9 @@ public class NumberFormatter Object oNumberFormatter = _xMSF.createInstance("com.sun.star.util.NumberFormatter"); xNumberFormats = _xNumberFormatsSupplier.getNumberFormats(); xNumberFormatSettings = _xNumberFormatsSupplier.getNumberFormatSettings(); - xNumberFormatter = (XNumberFormatter) UnoRuntime.queryInterface(XNumberFormatter.class, oNumberFormatter); + xNumberFormatter = UnoRuntime.queryInterface(XNumberFormatter.class, oNumberFormatter); xNumberFormatter.attachNumberFormatsSupplier(_xNumberFormatsSupplier); - xNumberFormatTypes = (XNumberFormatTypes) UnoRuntime.queryInterface(XNumberFormatTypes.class, xNumberFormats); + xNumberFormatTypes = UnoRuntime.queryInterface(XNumberFormatTypes.class, xNumberFormats); } @@ -77,7 +77,7 @@ public class NumberFormatter aLocale = _aLocale; xNumberFormats = _xNumberFormatsSupplier.getNumberFormats(); xNumberFormatSettings = _xNumberFormatsSupplier.getNumberFormatSettings(); - xNumberFormatTypes = (XNumberFormatTypes) UnoRuntime.queryInterface(XNumberFormatTypes.class, xNumberFormats); + xNumberFormatTypes = UnoRuntime.queryInterface(XNumberFormatTypes.class, xNumberFormats); } @@ -92,7 +92,7 @@ public class NumberFormatter public static XNumberFormatter createNumberFormatter(XMultiServiceFactory _xMSF, XNumberFormatsSupplier _xNumberFormatsSupplier) throws Exception { Object oNumberFormatter = _xMSF.createInstance("com.sun.star.util.NumberFormatter"); - XNumberFormatter xNumberFormatter = (XNumberFormatter) UnoRuntime.queryInterface(XNumberFormatter.class, oNumberFormatter); + XNumberFormatter xNumberFormatter = UnoRuntime.queryInterface(XNumberFormatter.class, oNumberFormatter); xNumberFormatter.attachNumberFormatsSupplier(_xNumberFormatsSupplier); return xNumberFormatter; } @@ -114,9 +114,9 @@ public class NumberFormatter */ public static int getNumberFormatterKey( Object numberFormatsSupplier, short type) { - Object numberFormatTypes = ((XNumberFormatsSupplier)UnoRuntime.queryInterface(XNumberFormatsSupplier.class,numberFormatsSupplier)).getNumberFormats(); + Object numberFormatTypes = UnoRuntime.queryInterface(XNumberFormatsSupplier.class,numberFormatsSupplier).getNumberFormats(); Locale l = new Locale(); - return ((XNumberFormatTypes)UnoRuntime.queryInterface(XNumberFormatTypes.class,numberFormatTypes)).getFormatIndex(type, l); + return UnoRuntime.queryInterface(XNumberFormatTypes.class,numberFormatTypes).getFormatIndex(type, l); } @@ -200,7 +200,7 @@ public class NumberFormatter String FormatString = AnyConverter.toString(Helper.getUnoPropertyValue(xNumberFormat, "FormatString")); Locale oLocale = (Locale) Helper.getUnoPropertyValue(xNumberFormat, "Locale"); int NewFormatKey = defineNumberFormat(FormatString, oLocale); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _xFormatObject); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, _xFormatObject); xPSet.setPropertyValue("FormatsSupplier", _oNumberFormatter.xNumberFormatter.getNumberFormatsSupplier()); if (xPSet.getPropertySetInfo().hasPropertyByName("NumberFormat")) { diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java index 109affffd5ef..3a1c3b4ecf0f 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; // }} /** @@ -735,31 +735,31 @@ public class NumericalHelper switch (aTypeObject.iType) { case BYTE_TYPE: - retValue = ((Byte) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case CHAR_TYPE: - retValue = ((Character) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case SHORT_TYPE: - retValue = ((Short) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case INT_TYPE: - retValue = ((Integer) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case LONG_TYPE: - retValue = ((Long) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case FLOAT_TYPE: - retValue = ((Float) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case DOUBLE_TYPE: - retValue = ((Double) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case STRING_TYPE: retValue = (String) aTypeObject.aValue; break; case BOOLEAN_TYPE: - retValue = ((Boolean) aTypeObject.aValue).toString(); + retValue = aTypeObject.aValue.toString(); break; case ARRAY_TYPE: retValue = new String(toByteArray((aValue))); @@ -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 @@ -1619,7 +1619,6 @@ public class NumericalHelper public static double roundDouble(double _dblvalue, int _ndecimals) { double dblfactor = java.lang.Math.pow(10.0, (double) _ndecimals); - double dblretvalue = ((double) ((int) (_dblvalue * dblfactor))) / dblfactor; - return dblretvalue; + return ((double) ((int) (_dblvalue * dblfactor))) / dblfactor; } } diff --git a/wizards/com/sun/star/wizards/common/PropertyNames.java b/wizards/com/sun/star/wizards/common/PropertyNames.java index 791f1da3a2fe..bef4d4700864 100644 --- a/wizards/com/sun/star/wizards/common/PropertyNames.java +++ b/wizards/com/sun/star/wizards/common/PropertyNames.java @@ -46,4 +46,23 @@ public class PropertyNames public static String PROPERTY_TABINDEX = "TabIndex"; public static String PROPERTY_STATE = "State"; public static String PROPERTY_IMAGEURL = "ImageURL"; + public static String PROPERTY_TITLE = "Title"; + public static String PROPERTY_BORDER = "Border"; + 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..bde98249f43d 100644 --- a/wizards/com/sun/star/wizards/common/PropertySetHelper.java +++ b/wizards/com/sun/star/wizards/common/PropertySetHelper.java @@ -49,7 +49,7 @@ public class PropertySetHelper { return; } - m_xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _aObj); + m_xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, _aObj); } private HashMap<String, Object> getHashMap() @@ -371,11 +371,11 @@ public class PropertySetHelper */ public void showProperties() { - String sName = ""; + String sName = PropertyNames.EMPTY_STRING; if (m_xPropertySet != null) { - XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, m_xPropertySet); + XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, m_xPropertySet); if (xServiceInfo != null) { sName = xServiceInfo.getImplementationName(); diff --git a/wizards/com/sun/star/wizards/common/SystemDialog.java b/wizards/com/sun/star/wizards/common/SystemDialog.java index ac3a38c9cf7d..012b33770f5c 100644 --- a/wizards/com/sun/star/wizards/common/SystemDialog.java +++ b/wizards/com/sun/star/wizards/common/SystemDialog.java @@ -66,14 +66,14 @@ public class SystemDialog try { this.xMSF = xMSF; - systemDialog = (XInterface) xMSF.createInstance(ServiceName); - xFilePicker = (XFilePicker) UnoRuntime.queryInterface(XFilePicker.class, systemDialog); - xFolderPicker = (XFolderPicker) UnoRuntime.queryInterface(XFolderPicker.class, systemDialog); - xFilterManager = (XFilterManager) UnoRuntime.queryInterface(XFilterManager.class, systemDialog); - xInitialize = (XInitialization) UnoRuntime.queryInterface(XInitialization.class, systemDialog); - xExecutable = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, systemDialog); - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, systemDialog); - xFilePickerControlAccess = (XFilePickerControlAccess) UnoRuntime.queryInterface(XFilePickerControlAccess.class, systemDialog); + systemDialog = xMSF.createInstance(ServiceName); + xFilePicker = UnoRuntime.queryInterface(XFilePicker.class, systemDialog); + xFolderPicker = UnoRuntime.queryInterface(XFolderPicker.class, systemDialog); + xFilterManager = UnoRuntime.queryInterface(XFilterManager.class, systemDialog); + xInitialize = UnoRuntime.queryInterface(XInitialization.class, systemDialog); + xExecutable = UnoRuntime.queryInterface(XExecutableDialog.class, systemDialog); + xComponent = UnoRuntime.queryInterface(XComponent.class, systemDialog); + xFilePickerControlAccess = UnoRuntime.queryInterface(XFilePickerControlAccess.class, systemDialog); xStringSubstitution = createStringSubstitution(xMSF); Short[] listAny = new Short[] { @@ -114,12 +114,7 @@ public class SystemDialog { try { - //System.out.println("SystemDialog.subst:"); - //System.out.println(path); - String s = xStringSubstitution.substituteVariables(path, false); - //System.out.println(s); - return s; - + return xStringSubstitution.substituteVariables(path, false); } catch (Exception ex) { @@ -157,7 +152,7 @@ public class SystemDialog sStorePath = null; try { - xFilePickerControlAccess.setValue(com.sun.star.ui.dialogs.ExtendedFilePickerElementIds.CHECKBOX_AUTOEXTENSION, (short) 0, new Boolean(true)); + xFilePickerControlAccess.setValue(com.sun.star.ui.dialogs.ExtendedFilePickerElementIds.CHECKBOX_AUTOEXTENSION, (short) 0, Boolean.TRUE); xFilePicker.setDefaultName(defaultName); xFilePicker.setDisplayDirectory(subst(displayDir)); if (execute(xExecutable)) @@ -351,7 +346,7 @@ public class SystemDialog return 0; } XFrame xFrame = Desktop.getActiveFrame(xMSF); - XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); + XWindowPeer xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); return showMessageBox(xMSF, xWindowPeer, windowServiceName, windowAttribute, MessageText); } catch (Exception exception) @@ -382,15 +377,15 @@ public class SystemDialog try { XInterface xAWTToolkit = (XInterface) xMSF.createInstance("com.sun.star.awt.Toolkit"); - XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, xAWTToolkit); + XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, xAWTToolkit); com.sun.star.awt.WindowDescriptor oDescriptor = new com.sun.star.awt.WindowDescriptor(); oDescriptor.WindowServiceName = windowServiceName; oDescriptor.Parent = peer; oDescriptor.Type = com.sun.star.awt.WindowClass.MODALTOP; oDescriptor.WindowAttributes = windowAttribute; XWindowPeer xMsgPeer = xToolkit.createWindow(oDescriptor); - XMessageBox xMsgbox = (XMessageBox) UnoRuntime.queryInterface(XMessageBox.class, xMsgPeer); - XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xMsgbox); + XMessageBox xMsgbox = UnoRuntime.queryInterface(XMessageBox.class, xMsgPeer); + XComponent xComponent = UnoRuntime.queryInterface(XComponent.class, xMsgbox); xMsgbox.setMessageText(MessageText); iMessage = xMsgbox.execute(); xComponent.dispose(); @@ -417,7 +412,7 @@ public class SystemDialog } if (xPathSubst != null) { - return (XStringSubstitution) UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XStringSubstitution.class, xPathSubst); } else diff --git a/wizards/com/sun/star/wizards/common/UCB.java b/wizards/com/sun/star/wizards/common/UCB.java index cb7ff9e815d7..5d8ddb4385e3 100644 --- a/wizards/com/sun/star/wizards/common/UCB.java +++ b/wizards/com/sun/star/wizards/common/UCB.java @@ -115,11 +115,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 @@ -143,7 +143,7 @@ public class UCB throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception { - XCommandProcessor xCmdProcessor = (XCommandProcessor)UnoRuntime.queryInterface( + XCommandProcessor xCmdProcessor = UnoRuntime.queryInterface( XCommandProcessor.class, xContent); Command aCommand = new Command(); aCommand.Name = aCommandName; @@ -163,12 +163,12 @@ public class UCB // Fill info for the properties wanted. aArg.Properties = new Property[] {new Property()}; - aArg.Properties[0].Name = "Title"; + aArg.Properties[0].Name = PropertyNames.PROPERTY_TITLE; aArg.Properties[0].Handle = -1; XDynamicResultSet xSet; - xSet = (XDynamicResultSet)UnoRuntime.queryInterface( + xSet = UnoRuntime.queryInterface( XDynamicResultSet.class,executeCommand(xContent, "open", aArg)); XResultSet xResultSet = xSet.getStaticResultSet(); @@ -178,9 +178,9 @@ public class UCB if (xResultSet.first()) { // obtain XContentAccess interface for child content access and XRow for properties - XContentAccess xContentAccess = (XContentAccess)UnoRuntime.queryInterface( + XContentAccess xContentAccess = UnoRuntime.queryInterface( XContentAccess.class, xResultSet); - XRow xRow = (XRow)UnoRuntime.queryInterface(XRow.class, xResultSet); + XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet); do { // Obtain URL of child. @@ -189,7 +189,7 @@ public class UCB String aTitle = xRow.getString(1); if (aTitle.length() == 0 && xRow.wasNull()) { - ; //ignore + //ignore } else { @@ -222,7 +222,7 @@ public class UCB pv[0].Handle = -1; Object row = executeCommand(content,"getPropertyValues",pv); - XRow xrow = (XRow)UnoRuntime.queryInterface(XRow.class,row); + XRow xrow = UnoRuntime.queryInterface(XRow.class,row); if (type.equals(String.class)) { return xrow.getString(1); @@ -249,10 +249,10 @@ public class UCB public Object getContent(String path) throws Exception { //System.out.println("Getting Content for : " + path); - XContentIdentifier id = ((XContentIdentifierFactory) UnoRuntime.queryInterface(XContentIdentifierFactory.class, ucb)).createContentIdentifier(path); + XContentIdentifier id = UnoRuntime.queryInterface(XContentIdentifierFactory.class, ucb).createContentIdentifier(path); - return ((XContentProvider)UnoRuntime.queryInterface( - XContentProvider.class,ucb)).queryContent(id); + return UnoRuntime.queryInterface( + XContentProvider.class,ucb).queryContent(id); } public static interface Verifier 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..989fdcc916e9 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,11 +67,10 @@ 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; - int iWidth = FieldWidth; int Titlelength = (int) 1.1 * FieldTitle.length(); // We assume that the TableHeading is bold if (Titlelength > PartBlindText.length()) @@ -88,7 +88,7 @@ public class BlindtextCreator int i = 1; do { - NewPartBlindText = PartBlindText + " " + BlindTextArray[i]; + NewPartBlindText = PartBlindText + PropertyNames.SPACE + BlindTextArray[i]; if (NewPartBlindText.length() < MaxWidth) { PartBlindText = NewPartBlindText; @@ -101,7 +101,7 @@ public class BlindtextCreator private static int getMaxFieldCount(boolean bIsCurLandscape) { - if (bIsCurLandscape == true) + if (bIsCurLandscape) { return 5; } diff --git a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java index a3ff8c12b712..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) { @@ -80,7 +80,7 @@ public class ColumnPropertySet } if ((nType == DataType.VARCHAR) && (precision == null || precision.intValue() == 0)) { - precision = new Integer(50); + precision = 50; } if (precision != null) { @@ -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 ad54020e8645..cb76e3b44a28 100644 --- a/wizards/com/sun/star/wizards/db/CommandMetaData.java +++ b/wizards/com/sun/star/wizards/db/CommandMetaData.java @@ -24,7 +24,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package com.sun.star.wizards.db; import com.sun.star.lang.XMultiServiceFactory; @@ -39,468 +38,454 @@ import com.sun.star.lang.Locale; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XIndexAccess; import com.sun.star.container.XNameAccess; -import com.sun.star.embed.EntryInitModes; 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; import java.util.Map; -import java.util.Vector; public class CommandMetaData extends DBMetaData { + public Map FieldTitleSet = new HashMap(); - public String[] m_aAllFieldNames = new String[]{}; - public FieldColumn[] FieldColumns = new FieldColumn[]{}; - public String[] GroupFieldNames = new String[] {}; - private String[][] SortFieldNames = new String[][] {}; - private String[] RecordFieldNames = new String[] {}; - public String[][] AggregateFieldNames = new String[][] {}; - public String[] NumericFieldNames = new String[] {}; + public String[] m_aAllFieldNames = new String[] + { + }; + public FieldColumn[] FieldColumns = new FieldColumn[] + { + }; + public String[] GroupFieldNames = new String[] + { + }; + private String[][] SortFieldNames = new String[][] + { + }; + private String[] RecordFieldNames = new String[] + { + }; + public String[][] AggregateFieldNames = new String[][] + { + }; + public String[] NumericFieldNames = new String[] + { + }; public String[] NonAggregateFieldNames; 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; public CommandMetaData(XMultiServiceFactory xMSF, Locale _aLocale, NumberFormatter oNumberFormatter) - { - super(xMSF, _aLocale, oNumberFormatter); - } + { + super(xMSF, _aLocale, oNumberFormatter); + } public CommandMetaData(XMultiServiceFactory xMSF) - { - super(xMSF); - } - + { + super(xMSF); + } public void initializeFieldColumns(boolean _bgetDefaultValue, String _CommandName, String[] _FieldNames) + { + this.setCommandName(_CommandName); + FieldColumns = new FieldColumn[_FieldNames.length]; + for (int i = 0; i < _FieldNames.length; i++) { - this.setCommandName(_CommandName); - FieldColumns = new FieldColumn[_FieldNames.length]; - for (int i = 0; i < _FieldNames.length; i++) - { - FieldColumns[i] = new FieldColumn(this, _FieldNames[i], this.getCommandName(), false); + FieldColumns[i] = new FieldColumn(this, _FieldNames[i], this.getCommandName(), false); // if (_bgetDefaultValue) // { // FieldColumns[i].getDefaultValue(); // } - } } - + } public void initializeFieldColumns(String[] _FieldNames, XNameAccess _xColumns) + { + FieldColumns = new FieldColumn[_FieldNames.length]; + for (int i = 0; i < _FieldNames.length; i++) { - FieldColumns = new FieldColumn[_FieldNames.length]; - for (int i = 0; i < _FieldNames.length; i++) - { - FieldColumns[i] = new FieldColumn(this,_xColumns, _FieldNames[i] ); - } + FieldColumns[i] = new FieldColumn(this, _xColumns, _FieldNames[i]); } - + } public void initializeFieldColumns(String[] _FieldNames, String _CommandName) + { + this.setCommandName(_CommandName); + FieldColumns = new FieldColumn[_FieldNames.length]; + for (int i = 0; i < _FieldNames.length; i++) { - this.setCommandName(_CommandName); - FieldColumns = new FieldColumn[_FieldNames.length]; - for (int i = 0; i < _FieldNames.length; i++) + FieldColumns[i] = new FieldColumn(this, _FieldNames[i], _CommandName, false); + if (FieldTitleSet != null && FieldTitleSet.containsKey(_FieldNames[i])) { - FieldColumns[i] = new FieldColumn(this, _FieldNames[i], _CommandName, false); - if (FieldTitleSet != null) + FieldColumns[i].setFieldTitle((String) FieldTitleSet.get(_FieldNames[i])); + if (FieldColumns[i].getFieldTitle() == null) { - if (FieldTitleSet.containsKey(_FieldNames[i])) - { - FieldColumns[i].setFieldTitle( (String) FieldTitleSet.get(_FieldNames[i]) ); - if (FieldColumns[i].getFieldTitle() == null) - { - FieldColumns[i].setFieldTitle( _FieldNames[i] ); - FieldTitleSet.put(_FieldNames[i], _FieldNames[i]); - } - } + FieldColumns[i].setFieldTitle(_FieldNames[i]); + FieldTitleSet.put(_FieldNames[i], _FieldNames[i]); } } } + } public Map getFieldTitleSet() - { - return FieldTitleSet; - } - + { + return FieldTitleSet; + } public XPropertySet getColumnObjectByFieldName(String _FieldName, boolean _bgetByDisplayName) + { + try { - try + FieldColumn CurFieldColumn = null; + if (_bgetByDisplayName) { - FieldColumn CurFieldColumn = null; - if (_bgetByDisplayName) - { - CurFieldColumn = this.getFieldColumnByDisplayName(_FieldName); - } - else - { - CurFieldColumn = this.getFieldColumnByFieldName(_FieldName); - } - String CurCommandName = CurFieldColumn.getCommandName(); - CommandObject oCommand = getTableByName(CurCommandName); - Object oColumn = oCommand.getColumns().getByName(CurFieldColumn.getFieldName()); - XPropertySet xColumn = UnoRuntime.queryInterface( XPropertySet.class, oColumn ); - return xColumn; + CurFieldColumn = this.getFieldColumnByDisplayName(_FieldName); } - catch (Exception exception) + else { - exception.printStackTrace(System.out); - return null; + CurFieldColumn = this.getFieldColumnByFieldName(_FieldName); } + String CurCommandName = CurFieldColumn.getCommandName(); + CommandObject oCommand = getTableByName(CurCommandName); + Object oColumn = oCommand.getColumns().getByName(CurFieldColumn.getFieldName()); + return UnoRuntime.queryInterface(XPropertySet.class, oColumn); } - + catch (Exception exception) + { + exception.printStackTrace(System.out); + return null; + } + } // @SuppressWarnings("unchecked") public void prependSortFieldNames(String[] _fieldnames) + { + ArrayList aSortFields = new ArrayList(); + for (int i = 0; i < _fieldnames.length; i++) { - Vector aSortFields = new Vector(); - for (int i = 0; i < _fieldnames.length; i++) + String[] sSortFieldName = new String[2]; + sSortFieldName[0] = _fieldnames[i]; + int index = JavaTools.FieldInTable(SortFieldNames, _fieldnames[i]); + if (index > -1) { - String[] sSortFieldName = new String[2]; - sSortFieldName[0] = _fieldnames[i]; - int index = JavaTools.FieldInTable(SortFieldNames, _fieldnames[i]); - if (index > -1) - - { - sSortFieldName[1] = SortFieldNames[index][1]; - } - else - - { - sSortFieldName[1] = "ASC"; - } - aSortFields.add(sSortFieldName); + sSortFieldName[1] = SortFieldNames[index][1]; } - for (int i = 0; i < SortFieldNames.length; i++) + else { - if (JavaTools.FieldInList(_fieldnames, SortFieldNames[i][0]) == -1) - { - aSortFields.add(SortFieldNames[i]); - } + sSortFieldName[1] = PropertyNames.ASC; } - SortFieldNames = new String[aSortFields.size()][2]; - aSortFields.toArray(SortFieldNames); + aSortFields.add(sSortFieldName); } - - public String[][] getSortFieldNames() + for (int i = 0; i < SortFieldNames.length; i++) { - return SortFieldNames; + if (JavaTools.FieldInList(_fieldnames, SortFieldNames[i][0]) == -1) + { + aSortFields.add(SortFieldNames[i]); + } } + SortFieldNames = new String[aSortFields.size()][2]; + aSortFields.toArray(SortFieldNames); + } + + public String[][] getSortFieldNames() + { + return SortFieldNames; + } + public void setSortFieldNames(String[][] aNewListList) - { - SortFieldNames = aNewListList; - } + { + SortFieldNames = aNewListList; + } public FieldColumn getFieldColumn(String _FieldName, String _CommandName) + { + for (int i = 0; i < FieldColumns.length; i++) { - if (FieldColumns.length > 0) + if (FieldColumns[i].getFieldName().equals(_FieldName) && FieldColumns[i].getCommandName().equals(_CommandName)) { - for (int i = 0; i < FieldColumns.length; i++) - { - if (FieldColumns[i].getFieldName().equals(_FieldName)) - - { - if (FieldColumns[i].getCommandName().equals(_CommandName)) - { - return FieldColumns[i]; - } - } - } + return FieldColumns[i]; } - return null; } - - + return null; + } public FieldColumn getFieldColumnByFieldName(String _FieldName) + { + for (int i = 0; i < FieldColumns.length; i++) { - for (int i = 0; i < FieldColumns.length; i++) + String sFieldName = FieldColumns[i].getFieldName(); + if (sFieldName.equals(_FieldName)) { - String sFieldName = FieldColumns[i].getFieldName(); - if (sFieldName.equals(_FieldName)) + return FieldColumns[i]; + } + if (_FieldName.indexOf('.') == -1) + { + String sCompound = Command + "." + _FieldName; + if (sFieldName.equals(sCompound)) { return FieldColumns[i]; } - if (_FieldName.indexOf('.') == -1) - { - String sCompound = Command + "." + _FieldName; - if (sFieldName.equals(sCompound)) - { - return FieldColumns[i]; - } - } } - throw new com.sun.star.uno.RuntimeException(); } - + throw new com.sun.star.uno.RuntimeException(); + } public FieldColumn getFieldColumnByDisplayName(String _DisplayName) + { + String identifierQuote = getIdentifierQuote(); + for (int i = 0; i < FieldColumns.length; i++) { - for (int i = 0; i < FieldColumns.length; i++) + String sDisplayName = FieldColumns[i].getDisplayFieldName(); + if (sDisplayName.equals(_DisplayName)) { - String sDisplayName = FieldColumns[i].getDisplayFieldName(); - if (sDisplayName.equals(_DisplayName)) + return FieldColumns[i]; + } + if (_DisplayName.indexOf('.') == -1) + { + String sCompound = Command + "." + _DisplayName; + if (sDisplayName.equals(sCompound)) { return FieldColumns[i]; } - if (_DisplayName.indexOf('.') == -1) - { - String sCompound = Command + "." + _DisplayName; - if (sDisplayName.equals(sCompound)) - { - return FieldColumns[i]; - } - } } - throw new com.sun.star.uno.RuntimeException(); + String quotedName = new StringBuilder(CommandName.quoteName(FieldColumns[i].getCommandName(), identifierQuote)).append('.').append(CommandName.quoteName(FieldColumns[i].getFieldName(), identifierQuote)).toString(); + if (quotedName.equals(_DisplayName)) + { + return FieldColumns[i]; + } } - + throw new com.sun.star.uno.RuntimeException(); + } public FieldColumn getFieldColumnByTitle(String _FieldTitle) + { + for (int i = 0; i < FieldColumns.length; i++) { - for (int i = 0; i < FieldColumns.length; i++) + if (FieldColumns[i].getFieldTitle().equals(_FieldTitle)) { - if (FieldColumns[i].getFieldTitle().equals(_FieldTitle)) - { - return FieldColumns[i]; - } + return FieldColumns[i]; } - // throw new com.sun.star.uno.RuntimeException(); - // LLA: Group works with fields direct - for (int i = 0; i < FieldColumns.length; i++) + } + // throw new com.sun.star.uno.RuntimeException(); + // LLA: Group works with fields direct + for (int i = 0; i < FieldColumns.length; i++) + { + if (FieldColumns[i].getFieldName().equals(_FieldTitle)) { - if (FieldColumns[i].getFieldName().equals(_FieldTitle)) - { - return FieldColumns[i]; - } + return FieldColumns[i]; } - throw new com.sun.star.uno.RuntimeException(); } - + throw new com.sun.star.uno.RuntimeException(); + } public boolean getFieldNamesOfCommand(String _commandname, int _commandtype, boolean _bAppendMode) + { + try { - try + // Object oField; + java.util.ArrayList<String> ResultFieldNames = new java.util.ArrayList<String>(10); + String[] FieldNames; + CommandObject oCommand = this.getCommandByName(_commandname, _commandtype); + FieldNames = oCommand.getColumns().getElementNames(); + if (FieldNames.length > 0) { - // Object oField; - java.util.Vector<String> ResultFieldNames = new java.util.Vector<String>(10); - String[] FieldNames; - CommandObject oCommand = this.getCommandByName(_commandname, _commandtype); - FieldNames = oCommand.getColumns().getElementNames(); - if (FieldNames.length > 0) + for (int n = 0; n < FieldNames.length; n++) { - for (int n = 0; n < FieldNames.length; n++) + final String sFieldName = FieldNames[n]; + Object oField = oCommand.getColumns().getByName(sFieldName); + int iType = AnyConverter.toInt(Helper.getUnoPropertyValue(oField, "Type")); + // BinaryFieldTypes are not included in the WidthList + if (JavaTools.FieldInIntTable(WidthList, iType) >= 0) { - final String sFieldName = FieldNames[n]; - Object oField = oCommand.getColumns().getByName(sFieldName); - int iType = AnyConverter.toInt(Helper.getUnoPropertyValue(oField, "Type")); - // BinaryFieldTypes are not included in the WidthList - if (JavaTools.FieldInIntTable(WidthList, iType) >= 0) - { // if (_bAppendMode) // ResultFieldNames.addElement(_commandname + "." + FieldNames[n]); // else - ResultFieldNames.addElement(sFieldName); - } - else if (JavaTools.FieldInIntTable(BinaryTypes, iType) >= 0) - { - ResultFieldNames.addElement(sFieldName); - } + ResultFieldNames.add(sFieldName); + } + else if (JavaTools.FieldInIntTable(BinaryTypes, iType) >= 0) + { + ResultFieldNames.add(sFieldName); } - // FieldNames = new String[FieldNames.length]; - // FieldTypes = new int[FieldNames.length]; - m_aAllFieldNames = new String[ResultFieldNames.size()]; - ResultFieldNames.copyInto(m_aAllFieldNames); - return true; } + // FieldNames = new String[FieldNames.length]; + // FieldTypes = new int[FieldNames.length]; + m_aAllFieldNames = new String[ResultFieldNames.size()]; + m_aAllFieldNames = ResultFieldNames.toArray(m_aAllFieldNames); + return true; } - catch (Exception exception) - { - exception.printStackTrace(System.out); - } - Resource oResource = new Resource(xMSF, "Database", "dbw"); - String sMsgNoFieldsFromCommand = oResource.getResText(RID_DB_COMMON + 45); - sMsgNoFieldsFromCommand = JavaTools.replaceSubString(sMsgNoFieldsFromCommand, _commandname, "%NAME"); - showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sMsgNoFieldsFromCommand); - return false; } - - - - - + catch (Exception exception) + { + exception.printStackTrace(System.out); + } + Resource oResource = new Resource(xMSF, "Database", "dbw"); + String sMsgNoFieldsFromCommand = oResource.getResText(RID_DB_COMMON + 45); + sMsgNoFieldsFromCommand = JavaTools.replaceSubString(sMsgNoFieldsFromCommand, _commandname, "%NAME"); + showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sMsgNoFieldsFromCommand); + return false; + } public String[] getOrderableColumns(String[] _fieldnames) + { + ArrayList<String> aOrderableColumns = new ArrayList<String>(); + for (int i = 0; i < _fieldnames.length; i++) { - Vector<String> aOrderableColumns = new Vector<String>(); - int ncount = 0; - for (int i = 0; i < _fieldnames.length; i++) + FieldColumn ofieldcolumn = getFieldColumnByFieldName(_fieldnames[i]); + if (getDBDataTypeInspector().isColumnOrderable(ofieldcolumn.getXColumnPropertySet())) { - FieldColumn ofieldcolumn = getFieldColumnByFieldName(_fieldnames[i]); - if (getDBDataTypeInspector().isColumnOrderable(ofieldcolumn.getXColumnPropertySet())) - { - aOrderableColumns.addElement(_fieldnames[i]); - ncount++; - } + aOrderableColumns.add(_fieldnames[i]); } - String[] sretfieldnames = new String[ncount]; - aOrderableColumns.toArray(sretfieldnames); - return sretfieldnames; } - + String[] sretfieldnames = new String[aOrderableColumns.size()]; + return aOrderableColumns.toArray(sretfieldnames); + } /** * @return Returns the command. */ public String getCommandName() - { - return Command; - } + { + return Command; + } + /** * @param _command The command to set. */ public void setCommandName(String _command) - { - Command = _command; - } + { + Command = _command; + } /** * @return Returns the commandType. */ public int getCommandType() - { - return CommandType; - } + { + return CommandType; + } /** * @param _commandType The commandType to set. */ public void setCommandType(int _commandType) - { - CommandType = _commandType; - } - + { + CommandType = _commandType; + } public boolean isnumeric(FieldColumn _oFieldColumn) + { + try { - try + CommandObject oTable = super.getTableByName(_oFieldColumn.getCommandName()); + Object oField = oTable.getColumns().getByName(_oFieldColumn.getFieldName()); + int iType = AnyConverter.toInt(Helper.getUnoPropertyValue(oField, "Type")); + int ifound = java.util.Arrays.binarySearch(NumericTypes, iType); + if ((ifound < NumericTypes.length) && (ifound > 0)) { - CommandObject oTable = super.getTableByName(_oFieldColumn.getCommandName()); - Object oField = oTable.getColumns().getByName(_oFieldColumn.getFieldName()); - int iType = AnyConverter.toInt(Helper.getUnoPropertyValue(oField, "Type")); - int ifound = java.util.Arrays.binarySearch(NumericTypes, iType); - if ((ifound < NumericTypes.length) && (ifound > 0)) - { - return (NumericTypes[ifound] == iType); - } - else - { - return false; - } + return (NumericTypes[ifound] == iType); } - catch (Exception exception) + else { - exception.printStackTrace(System.out); return false; } } + catch (Exception exception) + { + exception.printStackTrace(System.out); + return false; + } + } public String[] setNumericFields() + { + try { - try + ArrayList<String> numericfieldsvector = new java.util.ArrayList<String>(); + for (int i = 0; i < FieldColumns.length; i++) { - Vector<String> numericfieldsvector = new java.util.Vector<String>(); - for (int i = 0; i < FieldColumns.length; i++) + if (isnumeric(FieldColumns[i])) { - if (isnumeric(FieldColumns[i])) - { - numericfieldsvector.addElement(FieldColumns[i].getDisplayFieldName()); - } + numericfieldsvector.add(FieldColumns[i].getDisplayFieldName()); } - NumericFieldNames = new String[numericfieldsvector.size()]; - numericfieldsvector.toArray(NumericFieldNames); - return NumericFieldNames; - } - catch (Exception exception) - { - exception.printStackTrace(System.out); - return new String[]{}; } + NumericFieldNames = new String[numericfieldsvector.size()]; + numericfieldsvector.toArray(NumericFieldNames); + return NumericFieldNames; } + catch (Exception exception) + { + exception.printStackTrace(System.out); + return new String[] + { + }; + } + } public String[] getFieldNames(String[] _sDisplayFieldNames, String _sCommandName) + { + ArrayList<String> sFieldNamesVector = new java.util.ArrayList<String>(); + for (int i = 0; i < FieldColumns.length; i++) { - Vector<String> sFieldNamesVector = new java.util.Vector<String>(); - for (int i = 0; i < FieldColumns.length; i++) + if (_sCommandName.equals(FieldColumns[i].getCommandName()) && JavaTools.FieldInList(_sDisplayFieldNames, FieldColumns[i].getDisplayFieldName()) > -1) { - if (_sCommandName.equals(FieldColumns[i].getCommandName())) - { - if (JavaTools.FieldInList(_sDisplayFieldNames, FieldColumns[i].getDisplayFieldName()) > -1) - { - sFieldNamesVector.addElement(FieldColumns[i].getFieldName()); - } - } + sFieldNamesVector.add(FieldColumns[i].getFieldName()); } - String[] sFieldNames = new String[sFieldNamesVector.size()]; - sFieldNamesVector.toArray(sFieldNames); - return sFieldNames; } - - + String[] sFieldNames = new String[sFieldNamesVector.size()]; + sFieldNamesVector.toArray(sFieldNames); + return sFieldNames; + } public String[] getFieldNames() + { + String[] sFieldNames = new String[FieldColumns.length]; + for (int i = 0; i < FieldColumns.length; i++) { - String[] sFieldNames = new String[FieldColumns.length]; - for (int i = 0; i < FieldColumns.length; i++) - { - sFieldNames[i] = FieldColumns[i].getFieldName(); - } - return sFieldNames; + sFieldNames[i] = FieldColumns[i].getFieldName(); } + return sFieldNames; + } public String[] getDisplayFieldNames() + { + String[] sDisplayFieldNames = new String[FieldColumns.length]; + for (int i = 0; i < FieldColumns.length; i++) { - String[] sDisplayFieldNames = new String[FieldColumns.length]; - for (int i = 0; i < FieldColumns.length; i++) - { - sDisplayFieldNames[i] = FieldColumns[i].getDisplayFieldName(); - } - return sDisplayFieldNames; + sDisplayFieldNames[i] = FieldColumns[i].getDisplayFieldName(); } - + return sDisplayFieldNames; + } public String[] setNonAggregateFieldNames() + { + try { - try + ArrayList<String> nonaggregatefieldsvector = new java.util.ArrayList<String>(); + for (int i = 0; i < FieldColumns.length; i++) { - Vector<String> nonaggregatefieldsvector = new java.util.Vector<String>(); - for (int i = 0; i < FieldColumns.length; i++) + if (JavaTools.FieldInTable(AggregateFieldNames, FieldColumns[i].getDisplayFieldName()) == -1) { - if (JavaTools.FieldInTable(AggregateFieldNames, FieldColumns[i].getDisplayFieldName()) == -1) - { - nonaggregatefieldsvector.addElement(FieldColumns[i].getDisplayFieldName()); - } + nonaggregatefieldsvector.add(FieldColumns[i].getDisplayFieldName()); } - NonAggregateFieldNames = new String[nonaggregatefieldsvector.size()]; - nonaggregatefieldsvector.toArray(NonAggregateFieldNames); - return NonAggregateFieldNames; - } - catch (Exception exception) - { - exception.printStackTrace(System.out); - return new String[]{}; } + NonAggregateFieldNames = new String[nonaggregatefieldsvector.size()]; + nonaggregatefieldsvector.toArray(NonAggregateFieldNames); + return NonAggregateFieldNames; } + catch (Exception exception) + { + exception.printStackTrace(System.out); + return new String[] + { + }; + } + } /** * the fieldnames passed over are not necessarily the ones that are defined in the class @@ -508,108 +493,103 @@ public class CommandMetaData extends DBMetaData * @return */ public boolean hasNumericalFields(String[] _DisplayFieldNames) - + { + if (_DisplayFieldNames != null && _DisplayFieldNames.length > 0) { - if (_DisplayFieldNames != null) + for (int i = 0; i < _DisplayFieldNames.length; i++) { - if (_DisplayFieldNames.length > 0) + if (isnumeric(getFieldColumnByDisplayName(_DisplayFieldNames[i]))) { - for (int i = 0; i < _DisplayFieldNames.length; i++) - { - if (isnumeric(getFieldColumnByDisplayName(_DisplayFieldNames[i]))) - { - return true; - } - } + return true; } } - return false; } + return false; + } public String getFieldTitle(String FieldName) + { + String FieldTitle = FieldName; + if (this.FieldTitleSet != null) { - String FieldTitle = FieldName; - if (this.FieldTitleSet != null) + FieldTitle = (String) this.FieldTitleSet.get(FieldName); //FieldTitles[TitleIndex]; + if (FieldTitle == null) { - FieldTitle = (String) this.FieldTitleSet.get(FieldName); //FieldTitles[TitleIndex]; - if (FieldTitle == null) - { - return FieldName; - } + return FieldName; } - return FieldTitle; } - + return FieldTitle; + } public void setFieldTitles(String[] sFieldTitles) + { + int nFieldColLength = FieldColumns.length; + for (int i = 0; i < sFieldTitles.length; i++) { - int nFieldColLength = FieldColumns.length; - for (int i = 0; i < sFieldTitles.length; i++) + if (i < nFieldColLength) { - if (i < nFieldColLength) - { - FieldColumns[i].setFieldTitle(sFieldTitles[i]); - } - + FieldColumns[i].setFieldTitle(sFieldTitles[i]); } - } + } + } public String[] getFieldTitles() + { + String[] sFieldTitles = new String[FieldColumns.length]; + for (int i = 0; i < FieldColumns.length; i++) { - String[] sFieldTitles = new String[FieldColumns.length]; - for (int i = 0; i < FieldColumns.length; i++) - { - sFieldTitles[i] = FieldColumns[i].getFieldTitle(); - } - return sFieldTitles; + sFieldTitles[i] = FieldColumns[i].getFieldTitle(); } - + return sFieldTitles; + } public void setGroupFieldNames(String[] GroupFieldNames) - { - this.GroupFieldNames = GroupFieldNames; - } - + { + this.GroupFieldNames = GroupFieldNames; + } public String[] getGroupFieldNames() - { - return GroupFieldNames; - } + { + return GroupFieldNames; + } public void createRecordFieldNames() - { - String CurFieldName; - int GroupFieldCount; - int TotFieldCount = FieldColumns.length; - // int SortFieldCount = SortFieldNames[0].length; - GroupFieldCount = JavaTools.getArraylength(GroupFieldNames); - RecordFieldNames = new String[TotFieldCount - GroupFieldCount]; + { + String CurFieldName; + int GroupFieldCount; + int TotFieldCount = FieldColumns.length; + // int SortFieldCount = SortFieldNames[0].length; + GroupFieldCount = JavaTools.getArraylength(GroupFieldNames); + RecordFieldNames = new String[TotFieldCount - GroupFieldCount]; - int a = 0; - for (int i = 0; i < TotFieldCount; i++) + int a = 0; + for (int i = 0; i < TotFieldCount; i++) + { + CurFieldName = FieldColumns[i].getFieldName(); + if (JavaTools.FieldInList(GroupFieldNames, CurFieldName) < 0) { - CurFieldName = FieldColumns[i].getFieldName(); - if (JavaTools.FieldInList(GroupFieldNames, CurFieldName) < 0) - { - RecordFieldNames[a] = CurFieldName; - // a += 1; - ++a; - } + RecordFieldNames[a] = CurFieldName; + // a += 1; + ++a; } } - public void setRecordFieldNames(String [] _aNewList) - { - RecordFieldNames = _aNewList; - } - public String[] getRecordFieldNames() - { - return RecordFieldNames; - } - public String getRecordFieldName(int i) - { - return RecordFieldNames[i]; - } + } + + public void setRecordFieldNames(String[] _aNewList) + { + RecordFieldNames = _aNewList; + } + + public String[] getRecordFieldNames() + { + return RecordFieldNames; + } + + public String getRecordFieldName(int i) + { + return RecordFieldNames[i]; + } /**@deprecated use 'RelationController' class instead * @@ -618,46 +598,45 @@ public class CommandMetaData extends DBMetaData * @return */ public String[] getReferencedTables(String _stablename, int _ncommandtype) + { + String[] sTotReferencedTables = new String[] { - String[] sTotReferencedTables = new String[]{}; - try + }; + try + { + if (_ncommandtype == com.sun.star.sdb.CommandType.TABLE && xDBMetaData.supportsIntegrityEnhancementFacility()) { - if (_ncommandtype == com.sun.star.sdb.CommandType.TABLE) + java.util.ArrayList<String> TableVector = new java.util.ArrayList<String>(); + Object oTable = getTableNamesAsNameAccess().getByName(_stablename); + XKeysSupplier xKeysSupplier = UnoRuntime.queryInterface(XKeysSupplier.class, oTable); + xIndexKeys = xKeysSupplier.getKeys(); + for (int i = 0; i < xIndexKeys.getCount(); i++) { - if (xDBMetaData.supportsIntegrityEnhancementFacility()) + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xIndexKeys.getByIndex(i)); + int curtype = AnyConverter.toInt(xPropertySet.getPropertyValue("Type")); + if (curtype == KeyType.FOREIGN) { - java.util.Vector<String> TableVector = new java.util.Vector<String>(); - Object oTable = getTableNamesAsNameAccess().getByName(_stablename); - XKeysSupplier xKeysSupplier = UnoRuntime.queryInterface( XKeysSupplier.class, oTable ); - xIndexKeys = xKeysSupplier.getKeys(); - for (int i = 0; i < xIndexKeys.getCount(); i++) - { - XPropertySet xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xIndexKeys.getByIndex( i ) ); - int curtype = AnyConverter.toInt(xPropertySet.getPropertyValue("Type")); - if (curtype == KeyType.FOREIGN) - { - // getImportedKeys (RelationController.cxx /source/ui/relationdesign) /Zeile 475 - String sreftablename = AnyConverter.toString(xPropertySet.getPropertyValue("ReferencedTable")); - if (getTableNamesAsNameAccess().hasByName(sreftablename)) - { - TableVector.addElement(sreftablename); - } - } - } - if (TableVector.size() > 0) + // getImportedKeys (RelationController.cxx /source/ui/relationdesign) /Zeile 475 + String sreftablename = AnyConverter.toString(xPropertySet.getPropertyValue("ReferencedTable")); + if (getTableNamesAsNameAccess().hasByName(sreftablename)) { - sTotReferencedTables = new String[TableVector.size()]; - TableVector.copyInto(sTotReferencedTables); + TableVector.add(sreftablename); } } } + if (TableVector.size() > 0) + { + sTotReferencedTables = new String[TableVector.size()]; + TableVector.toArray(sTotReferencedTables); + } } - catch (Exception e) - { - e.printStackTrace(System.out); - } - return sTotReferencedTables; } + catch (Exception e) + { + e.printStackTrace(System.out); + } + return sTotReferencedTables; + } /**@deprecated use 'RelationController' class instead * @@ -665,108 +644,95 @@ public class CommandMetaData extends DBMetaData * @return */ public String[][] getKeyColumns(String _sreferencedtablename) + { + String[][] skeycolumnnames = null; + try { - String[][] skeycolumnnames = null; - try + for (int i = 0; i < xIndexKeys.getCount(); i++) { - for (int i = 0; i < xIndexKeys.getCount(); i++) + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xIndexKeys.getByIndex(i)); + int curtype = AnyConverter.toInt(xPropertySet.getPropertyValue("Type")); + if (curtype == KeyType.FOREIGN) { - XPropertySet xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xIndexKeys.getByIndex( i ) ); - int curtype = AnyConverter.toInt(xPropertySet.getPropertyValue("Type")); - if (curtype == KeyType.FOREIGN) + String scurreftablename = AnyConverter.toString(xPropertySet.getPropertyValue("ReferencedTable")); + if (getTableNamesAsNameAccess().hasByName(scurreftablename)) { - String scurreftablename = AnyConverter.toString(xPropertySet.getPropertyValue("ReferencedTable")); - if (getTableNamesAsNameAccess().hasByName(scurreftablename)) + if (scurreftablename.equals(_sreferencedtablename)) { - if (scurreftablename.equals(_sreferencedtablename)) + XColumnsSupplier xColumnsSupplier = UnoRuntime.queryInterface(XColumnsSupplier.class, xPropertySet); + String[] smastercolnames = xColumnsSupplier.getColumns().getElementNames(); + skeycolumnnames = new String[2][smastercolnames.length]; + skeycolumnnames[0] = smastercolnames; + skeycolumnnames[1] = new String[smastercolnames.length]; + for (int n = 0; n < smastercolnames.length; n++) { - XColumnsSupplier xColumnsSupplier = UnoRuntime.queryInterface( XColumnsSupplier.class, xPropertySet ); - String[] smastercolnames = xColumnsSupplier.getColumns().getElementNames(); - skeycolumnnames = new String[2][smastercolnames.length]; - skeycolumnnames[0] = smastercolnames; - skeycolumnnames[1] = new String[smastercolnames.length]; - for (int n = 0; n < smastercolnames.length; n++) - { - XPropertySet xcolPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xColumnsSupplier.getColumns().getByName( smastercolnames[n] ) ); - skeycolumnnames[1][n] = AnyConverter.toString(xcolPropertySet.getPropertyValue("RelatedColumn")); - } - return skeycolumnnames; + XPropertySet xcolPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xColumnsSupplier.getColumns().getByName(smastercolnames[n])); + skeycolumnnames[1][n] = AnyConverter.toString(xcolPropertySet.getPropertyValue("RelatedColumn")); } + return skeycolumnnames; } } } } - catch (Exception e) - { - e.printStackTrace(); - } - return skeycolumnnames; } - - - public void openFormDocument(boolean _bReadOnly) + catch (Exception e) { - try - { - Object oEmbeddedFactory = super.xMSF.createInstance("com.sun.star.embed.OOoEmbeddedObjectFactory"); - int iEntryInitMode = EntryInitModes.DEFAULT_INIT; //TRUNCATE_INIT??? - } - catch (Exception e) - { - e.printStackTrace(System.out); - } + e.printStackTrace(); } + return skeycolumnnames; + } + public void openFormDocument(boolean _bReadOnly) + { + } public void setCommandComposingAttributes() + { + try { - try - { - boolean bCatalogAtStart2 = xDBMetaData.isCatalogAtStart(); - sCatalogSep = xDBMetaData.getCatalogSeparator(); - sIdentifierQuote = xDBMetaData.getIdentifierQuoteString(); - bCommandComposerAttributesalreadyRetrieved = true; - } - catch (SQLException e) - { - e.printStackTrace(System.out); - } + sCatalogSep = xDBMetaData.getCatalogSeparator(); + sIdentifierQuote = xDBMetaData.getIdentifierQuoteString(); + bCommandComposerAttributesalreadyRetrieved = true; } - + catch (SQLException e) + { + e.printStackTrace(System.out); + } + } /** * @return Returns the bCatalogAtStart. */ public boolean isCatalogAtStart() + { + if (!bCommandComposerAttributesalreadyRetrieved) { - if (!bCommandComposerAttributesalreadyRetrieved) - { - setCommandComposingAttributes(); - } - return bCatalogAtStart; + setCommandComposingAttributes(); } + return bCatalogAtStart; + } /** * @return Returns the sCatalogSep. */ public String getCatalogSeparator() + { + if (!bCommandComposerAttributesalreadyRetrieved) { - if (!bCommandComposerAttributesalreadyRetrieved) - { - setCommandComposingAttributes(); - } - return sCatalogSep; + setCommandComposingAttributes(); } + return sCatalogSep; + } /** * @return Returns the sIdentifierQuote. */ public String getIdentifierQuote() + { + if (!bCommandComposerAttributesalreadyRetrieved) { - if (!bCommandComposerAttributesalreadyRetrieved) - { - setCommandComposingAttributes(); - } - return sIdentifierQuote; + setCommandComposingAttributes(); } + return sIdentifierQuote; + } } diff --git a/wizards/com/sun/star/wizards/db/CommandName.java b/wizards/com/sun/star/wizards/db/CommandName.java index aa8a4f9c7ea9..9d8578f5c8ba 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; } @@ -94,12 +95,12 @@ public class CommandName { this.DisplayName = _DisplayName; int iIndex; - if (oCommandMetaData.xDBMetaData.supportsCatalogsInDataManipulation() == true) + if (oCommandMetaData.xDBMetaData.supportsCatalogsInDataManipulation()) { // ...dann Catalog mit in TableName iIndex = _DisplayName.indexOf(sCatalogSep); if (iIndex >= 0) { - if (bCatalogAtStart == true) + if (bCatalogAtStart) { CatalogName = _DisplayName.substring(0, iIndex); _DisplayName = _DisplayName.substring(iIndex + 1, _DisplayName.length()); @@ -111,13 +112,13 @@ public class CommandName } } } - if (oCommandMetaData.xDBMetaData.supportsSchemasInDataManipulation() == true) + if (oCommandMetaData.xDBMetaData.supportsSchemasInDataManipulation()) { String[] NameList; 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,9 +139,9 @@ public class CommandName { if (CatalogName != null) { - if (!CatalogName.equals("")) + if (!CatalogName.equals(PropertyNames.EMPTY_STRING)) { - if (bCatalogAtStart == true) + if (bCatalogAtStart) { ComposedName = quoteName(CatalogName) + sCatalogSep; } @@ -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); } @@ -161,9 +162,9 @@ public class CommandName { ComposedName += quoteName(TableName); } - if ((bCatalogAtStart == false) && (CatalogName != null)) + if ((!bCatalogAtStart) && (CatalogName != null)) { - if (!CatalogName.equals("")) + if (!CatalogName.equals(PropertyNames.EMPTY_STRING)) { ComposedName += sCatalogSep + quoteName(CatalogName); } @@ -203,11 +204,9 @@ public class CommandName { if (sName == null) { - sName = ""; + sName = PropertyNames.EMPTY_STRING; } - String ReturnQuote = ""; - ReturnQuote = _sIdentifierQuote + sName + _sIdentifierQuote; - return ReturnQuote; + return new StringBuilder(_sIdentifierQuote).append(sName).append(_sIdentifierQuote).toString(); } public void setAliasName(String _AliasName) diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 5a151937d73f..afddc49c5895 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -142,7 +142,6 @@ public class DBMetaData private int iMaxColumnsInSelect; private int iMaxColumnsInGroupBy; - private int iMaxColumnsInTable; private int iMaxColumnNameLength = -1; private int iMaxTableNameLength = -1; private boolean bPasswordIsRequired; @@ -187,7 +186,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 +214,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 +325,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 +356,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return bHasEscapeProcessing; } @@ -372,8 +371,7 @@ public class DBMetaData public XNameAccess getTableNamesAsNameAccess() { XTablesSupplier xDBTables = UnoRuntime.queryInterface( XTablesSupplier.class, DBConnection ); - XNameAccess xTableNames = xDBTables.getTables(); - return xTableNames; + return xDBTables.getTables(); } public String[] getQueryNames() @@ -453,7 +451,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return - 1; } } @@ -488,7 +486,7 @@ public class DBMetaData public int getMaxColumnsInTable() throws SQLException { - iMaxColumnsInTable = xDBMetaData.getMaxColumnsInTable(); + int iMaxColumnsInTable = xDBMetaData.getMaxColumnsInTable(); if (iMaxColumnsInTable == 0) { iMaxColumnsInTable = DBMetaData.NOLIMIT; @@ -507,7 +505,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -530,7 +528,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return isSQL92CheckEnabled; } @@ -579,9 +577,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 +594,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 ); @@ -645,23 +643,18 @@ public class DBMetaData String sDataSourceName = AnyConverter.toString(Properties.getPropertyValue(curproperties, "DatabaseLocation")); return getConnection(sDataSourceName); } - else if (xConnection != null) - { - bdisposeConnection = false; - return getConnection(xConnection); - } } 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 +677,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } @@ -701,9 +694,9 @@ public class DBMetaData xConnectionComponent.dispose(); } getDataSourceInterfaces(); - if (bPasswordIsRequired == false) + if (!bPasswordIsRequired) { - DBConnection = _dataSource.getConnection("", ""); + DBConnection = _dataSource.getConnection(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); bgetConnection = true; } else @@ -717,7 +710,7 @@ public class DBMetaData { DBConnection = xCompleted2.connectWithCompletion( xInteractionHandler ); bgetConnection = DBConnection != null; - if (bgetConnection == false) + if (!bgetConnection) { bExitLoop = true; } @@ -731,9 +724,9 @@ public class DBMetaData bgetConnection = false; } } - while (bExitLoop == false); + while (!bExitLoop); } - if (bgetConnection == false) + if (!bgetConnection) { String sMsgConnectionImpossible = oResource.getResText(RID_DB_COMMON + 35); showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sMsgConnectionImpossible); @@ -746,11 +739,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 +760,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 +777,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 +809,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 +845,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 +870,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; } @@ -900,15 +893,13 @@ public class DBMetaData { XReportDocumentsSupplier xReportDocumentSuppl = UnoRuntime.queryInterface( XReportDocumentsSupplier.class, this.xModel ); xReportDocumentSuppl.getReportDocuments(); - XHierarchicalNameAccess xReportHier = UnoRuntime.queryInterface( XHierarchicalNameAccess.class, xReportDocumentSuppl.getReportDocuments() ); - return xReportHier; + return UnoRuntime.queryInterface( XHierarchicalNameAccess.class, xReportDocumentSuppl.getReportDocuments() ); } public XHierarchicalNameAccess getFormDocuments() { XFormDocumentsSupplier xFormDocumentSuppl = UnoRuntime.queryInterface( XFormDocumentsSupplier.class, xModel ); - XHierarchicalNameAccess xFormHier = UnoRuntime.queryInterface( XHierarchicalNameAccess.class, xFormDocumentSuppl.getFormDocuments() ); - return xFormHier; + return UnoRuntime.queryInterface( XHierarchicalNameAccess.class, xFormDocumentSuppl.getFormDocuments() ); } public boolean hasFormDocumentByName(String _sFormName) @@ -949,7 +940,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 +953,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -992,7 +983,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return sColValues; } @@ -1006,7 +997,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 +1011,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 +1032,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/FieldColumn.java b/wizards/com/sun/star/wizards/db/FieldColumn.java index 041aab5f5300..47a333e88dd9 100644 --- a/wizards/com/sun/star/wizards/db/FieldColumn.java +++ b/wizards/com/sun/star/wizards/db/FieldColumn.java @@ -142,8 +142,7 @@ public class FieldColumn */ private String getOnlyFieldName(String _DisplayFieldName, String _CommandName) { - final String sName = _DisplayFieldName.substring(_CommandName.length() + 1, _DisplayFieldName.length()); - return sName; + return _DisplayFieldName.substring(_CommandName.length() + 1, _DisplayFieldName.length()); } public static String composeDisplayFieldName(String _sCommandName, String _sFieldName) @@ -155,12 +154,12 @@ public class FieldColumn { try { - m_xColPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _xColumns.getByName(m_sFieldName)); + m_xColPropertySet = UnoRuntime.queryInterface(XPropertySet.class, _xColumns.getByName(m_sFieldName)); ColIndex = JavaTools.FieldInList(_xColumns.getElementNames(), m_sFieldName) + 1; m_nFieldType = AnyConverter.toInt(m_xColPropertySet.getPropertyValue("Type")); getTyperelatedFieldData(); - if (bFormatKeysInitialized == false) + if (!bFormatKeysInitialized) { final NumberFormatter aNumberFormatter = oCommandMetaData.getNumberFormatter(); @@ -393,67 +392,67 @@ public class FieldColumn { case DataType.BIT: // == -7; case DataType.BOOLEAN: - DefaultValue = (Object) Integer.valueOf("1"); + DefaultValue = Integer.valueOf("1"); break; case DataType.TINYINT: // == -6; - DefaultValue = (Object) Integer.valueOf("98"); + DefaultValue = Integer.valueOf("98"); break; case DataType.SMALLINT: // == 5; - DefaultValue = (Object) Integer.valueOf("987"); + DefaultValue = Integer.valueOf("987"); break; case DataType.INTEGER: // == 4; - DefaultValue = (Object) Integer.valueOf("9876"); + DefaultValue = Integer.valueOf("9876"); break; case DataType.BIGINT: // == -5; - DefaultValue = (Object) Integer.valueOf("98765"); + DefaultValue = Integer.valueOf("98765"); break; case DataType.CHAR: // == 1; - DefaultValue = (Object) String.valueOf('x'); + DefaultValue = String.valueOf('x'); break; case DataType.VARCHAR: // == 12; - DefaultValue = (Object) BlindtextCreator.getBlindTextString(FieldTitle, FieldWidth, FieldWidth); + DefaultValue = BlindtextCreator.getBlindTextString(FieldTitle, FieldWidth, FieldWidth); break; case DataType.LONGVARCHAR: // == -1; - DefaultValue = (Object) BlindtextCreator.getBlindTextString(FieldTitle, FieldWidth, FieldWidth); + DefaultValue = BlindtextCreator.getBlindTextString(FieldTitle, FieldWidth, FieldWidth); break; case DataType.NUMERIC: // == 2; - DefaultValue = (Object) Double.valueOf("9876.5"); + DefaultValue = Double.valueOf("9876.5"); break; case DataType.DECIMAL: // == 3; [mit Nachkommastellen] - DefaultValue = (Object) Double.valueOf("9876.5"); + DefaultValue = Double.valueOf("9876.5"); break; case DataType.FLOAT: // == 6; - DefaultValue = (Object) Double.valueOf("9876.5"); + DefaultValue = Double.valueOf("9876.5"); break; case DataType.REAL: // == 7; - DefaultValue = (Object) Double.valueOf("9876.5"); + DefaultValue = Double.valueOf("9876.5"); break; case DataType.DOUBLE: // == 8; - DefaultValue = (Object) Double.valueOf("9876.54"); + DefaultValue = Double.valueOf("9876.54"); break; case DataType.DATE: // == 91; - DefaultValue = (Object) Double.valueOf("42510"); + DefaultValue = Double.valueOf("42510"); break; case DataType.TIME: // == 92; - DefaultValue = (Object) Double.valueOf("10"); + DefaultValue = Double.valueOf("10"); break; case DataType.TIMESTAMP: // == 93; - DefaultValue = (Object) Double.valueOf("5454110"); + DefaultValue = Double.valueOf("5454110"); break; default: diff --git a/wizards/com/sun/star/wizards/db/QueryMetaData.java b/wizards/com/sun/star/wizards/db/QueryMetaData.java index bad14c2faa20..f6fe9176086c 100644 --- a/wizards/com/sun/star/wizards/db/QueryMetaData.java +++ b/wizards/com/sun/star/wizards/db/QueryMetaData.java @@ -101,9 +101,10 @@ public class QueryMetaData extends CommandMetaData // FieldColumns = LocFieldColumns; // } // } + public void addSeveralFieldColumns(String[] _FieldNames, String _sCommandName) { - Vector oToBeAddedFieldColumns = new Vector(); + ArrayList<FieldColumn> oToBeAddedFieldColumns = new ArrayList<FieldColumn>(); for (int i = 0; i < _FieldNames.length; i++) { FieldColumn oFieldColumn = getFieldColumn(_FieldNames[i], _sCommandName); @@ -119,7 +120,7 @@ public class QueryMetaData extends CommandMetaData System.arraycopy(FieldColumns, 0, LocFieldColumns, 0, nOldFieldCount); for (int i = 0; i < oToBeAddedFieldColumns.size(); i++) { - LocFieldColumns[nOldFieldCount + i] = (FieldColumn) oToBeAddedFieldColumns.elementAt(i); + LocFieldColumns[nOldFieldCount + i] = oToBeAddedFieldColumns.get(i); } FieldColumns = LocFieldColumns; } @@ -138,7 +139,7 @@ public class QueryMetaData extends CommandMetaData public void removeSeveralFieldColumnsByDisplayFieldName(String[] _DisplayFieldNames) { - Vector oRemainingFieldColumns = new Vector(); + ArrayList<FieldColumn> oRemainingFieldColumns = new ArrayList<FieldColumn>(); int a = 0; for (int n = 0; n < FieldColumns.length; n++) { @@ -161,13 +162,10 @@ public class QueryMetaData extends CommandMetaData FieldColumn[] LocFieldColumns = new FieldColumn[FieldColumns.length - 1]; for (int i = 0; i < FieldColumns.length; i++) { - if (!FieldColumns[i].getFieldName().equals(_sFieldName)) + if (!FieldColumns[i].getFieldName().equals(_sFieldName) && !FieldColumns[i].getCommandName().equals(_sCommandName)) { - if (!FieldColumns[i].getCommandName().equals(_sCommandName)) - { - LocFieldColumns[a] = FieldColumns[i]; - a++; - } + LocFieldColumns[a] = FieldColumns[i]; + a++; } } FieldColumns = LocFieldColumns; @@ -177,7 +175,7 @@ public class QueryMetaData extends CommandMetaData public String[] getIncludedCommandNames() { // FieldColumn CurQueryField; - Vector CommandNamesV = new Vector(1); + ArrayList<String> CommandNamesV = new ArrayList<String>(1); // String CurCommandName; for (int i = 0; i < FieldColumns.length; i++) { @@ -185,7 +183,7 @@ public class QueryMetaData extends CommandMetaData final String CurCommandName = CurQueryField.getCommandName(); if (!CommandNamesV.contains(CurCommandName)) { - CommandNamesV.addElement(CurCommandName); + CommandNamesV.add(CurCommandName); } } String[] sIncludedCommandNames = new String[CommandNamesV.size()]; @@ -195,10 +193,10 @@ public class QueryMetaData extends CommandMetaData public static String[] getIncludedCommandNames(String[] _FieldNames) { - Vector CommandNames = new Vector(1); + 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) { @@ -208,7 +206,7 @@ public class QueryMetaData extends CommandMetaData } if (!CommandNames.contains(CurCommandName)) { - CommandNames.addElement(CurCommandName); + CommandNames.add(CurCommandName); } } } @@ -257,7 +255,7 @@ public class QueryMetaData extends CommandMetaData public String[] getUniqueAggregateFieldNames() { - Vector UniqueAggregateFieldVector = new Vector(0); + ArrayList<String> UniqueAggregateFieldVector = new ArrayList<String>(); for (int i = 0; i < AggregateFieldNames.length; i++) { if (!UniqueAggregateFieldVector.contains(AggregateFieldNames[i][0])) @@ -291,10 +289,13 @@ public class QueryMetaData extends CommandMetaData } return iAggregate; } + public SQLQueryComposer getSQLQueryComposer() { - if ( oSQLQueryComposer == null ) + if (oSQLQueryComposer == null) + { oSQLQueryComposer = new SQLQueryComposer(this); + } return oSQLQueryComposer; } } diff --git a/wizards/com/sun/star/wizards/db/RecordParser.java b/wizards/com/sun/star/wizards/db/RecordParser.java index 6c8ddb5b2c36..9f2c6abbc54f 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 { @@ -78,11 +79,11 @@ public class RecordParser extends QueryMetaData try { xRowSet = (XInterface) xMSF.createInstance("com.sun.star.sdb.RowSet"); - xRowSetColumnsSupplier = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xRowSet); - xRowSetComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xRowSet); - xExecute = (com.sun.star.sdb.XCompletedExecution) UnoRuntime.queryInterface(com.sun.star.sdb.XCompletedExecution.class, xRowSet); + xRowSetColumnsSupplier = UnoRuntime.queryInterface(XColumnsSupplier.class, xRowSet); + xRowSetComponent = UnoRuntime.queryInterface(XComponent.class, xRowSet); + xExecute = UnoRuntime.queryInterface(XCompletedExecution.class, xRowSet); XInterface oInteraction = (XInterface) xMSF.createInstance("com.sun.star.task.InteractionHandler"); - xInteraction = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, oInteraction); + xInteraction = UnoRuntime.queryInterface(XInteractionHandler.class, oInteraction); } catch (Exception exception) { @@ -217,14 +218,14 @@ 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); + com.sun.star.sdb.XResultSetAccess xResultAccess = UnoRuntime.queryInterface(com.sun.star.sdb.XResultSetAccess.class, xRowSet); ResultSet = xResultAccess.createResultSet(); - xResultSetRow = (com.sun.star.sdbc.XRow) UnoRuntime.queryInterface(com.sun.star.sdbc.XRow.class, ResultSet); - XColumnsSupplier xDBCols = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, ResultSet); + xResultSetRow = UnoRuntime.queryInterface(com.sun.star.sdbc.XRow.class, ResultSet); + XColumnsSupplier xDBCols = UnoRuntime.queryInterface(XColumnsSupplier.class, ResultSet); xColumns = xDBCols.getColumns(); setCommandType(_nCommandType); return true; @@ -240,7 +241,7 @@ public class RecordParser extends QueryMetaData { try { - if (binitializeDBColumns == true) + if (binitializeDBColumns) { initializeFieldColumns(_sFieldNames, xColumns); } diff --git a/wizards/com/sun/star/wizards/db/RelationController.java b/wizards/com/sun/star/wizards/db/RelationController.java index acf47581d3e2..e5b8cb4b3775 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 @@ -72,7 +73,7 @@ public class RelationController extends CommandName String[] sTableNames = super.getCommandMetaData().getTableNames(); Vector aReferencedTableVector = new Vector(); XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getExportedKeys((getCatalogName(this)), getSchemaName(), getTableName()); - XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, xResultSet); + XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet); while (xResultSet.next()) { String sForeignCatalog = xRow.getString(FKTABLE_CAT); @@ -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; } @@ -113,7 +114,7 @@ public class RelationController extends CommandName { CommandName oLocCommandName = new CommandName(super.getCommandMetaData(), _sreferencedtablename); XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getImportedKeys(getCatalogName(oLocCommandName), oLocCommandName.getSchemaName(), oLocCommandName.getTableName()); - XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, xResultSet); + XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet); boolean bleaveLoop = false; Vector aMasterFieldNamesVector = new Vector(); Vector aSlaveFieldNamesVector = new Vector(); diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index 461a256ce1c3..a6d2c2b1cb00 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -26,7 +26,6 @@ ************************************************************************/ package com.sun.star.wizards.db; -import java.util.Vector; // import com.sun.star.lang.IllegalArgumentException; // import com.sun.star.lang.WrappedTargetException; @@ -34,10 +33,9 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.beans.*; // import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XIndexAccess; -// import com.sun.star.container.XNameAccess; +import com.sun.star.container.XNameAccess; import com.sun.star.sdbcx.XColumnsSupplier; // import com.sun.star.sdb.XColumn; -import com.sun.star.sdb.XSQLQueryComposerFactory; import com.sun.star.sdb.XSingleSelectQueryComposer; import com.sun.star.sdb.XSingleSelectQueryAnalyzer; import com.sun.star.ui.dialogs.XExecutableDialog; @@ -50,6 +48,7 @@ import com.sun.star.awt.XWindow; import com.sun.star.sdb.SQLFilterOperator; import com.sun.star.wizards.common.*; +import java.util.ArrayList; public class SQLQueryComposer { @@ -60,7 +59,7 @@ public class SQLQueryComposer // String m_sSelectClause; // String m_sFromClause; public XSingleSelectQueryAnalyzer m_xQueryAnalyzer; - Vector composedCommandNames = new Vector(1); + ArrayList<CommandName> composedCommandNames = new ArrayList<CommandName>(1); private XSingleSelectQueryComposer m_queryComposer; XMultiServiceFactory xMSF; boolean bincludeGrouping = true; @@ -70,13 +69,10 @@ public class SQLQueryComposer try { this.CurDBMetaData = _CurDBMetaData; - xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, CurDBMetaData.DBConnection); + xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, CurDBMetaData.DBConnection); final Object oQueryComposer = xMSF.createInstance("com.sun.star.sdb.SingleSelectQueryComposer"); - m_xQueryAnalyzer = (XSingleSelectQueryAnalyzer) UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, oQueryComposer); - m_queryComposer = (XSingleSelectQueryComposer) UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, m_xQueryAnalyzer); - XSQLQueryComposerFactory xSQLComposerFactory; - xSQLComposerFactory = (XSQLQueryComposerFactory) UnoRuntime.queryInterface(XSQLQueryComposerFactory.class, CurDBMetaData.DBConnection); - // /* XSQLQueryComposer */ xSQLQueryComposer = xSQLComposerFactory.createQueryComposer(); + m_xQueryAnalyzer = UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, oQueryComposer); + m_queryComposer = UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, m_xQueryAnalyzer); } catch (Exception exception) { @@ -86,21 +82,8 @@ public class SQLQueryComposer private boolean addtoSelectClause(String DisplayFieldName) throws SQLException { - if (bincludeGrouping) - { - if (CurDBMetaData.xDBMetaData.supportsGroupByUnrelated()) - { - if (CurDBMetaData.GroupFieldNames != null) - { - if (JavaTools.FieldInList(CurDBMetaData.GroupFieldNames, DisplayFieldName) > -1) - { - return false; - } - } - } + return !(bincludeGrouping && CurDBMetaData.xDBMetaData.supportsGroupByUnrelated() && CurDBMetaData.GroupFieldNames != null && JavaTools.FieldInList(CurDBMetaData.GroupFieldNames, DisplayFieldName) > -1); } - return true; - } public String getSelectClause(boolean _baddAliasFieldNames) throws SQLException { @@ -182,7 +165,7 @@ public class SQLQueryComposer { try { - XPropertySet xColumnPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xColumnIndexAccess.getByIndex(i)); + XPropertySet xColumnPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xColumnIndexAccess.getByIndex(i)); String sName = (String) xColumnPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME); if (JavaTools.FieldInTable(CurDBMetaData.getSortFieldNames(), sName) == -1) { @@ -234,7 +217,6 @@ public class SQLQueryComposer } // just for debug! sOrder = m_queryComposer.getOrder(); - int dummy = 0; } public void appendGroupByColumns(boolean _baddAliasFieldNames) throws SQLException @@ -244,7 +226,6 @@ public class SQLQueryComposer XPropertySet xColumn = CurDBMetaData.getColumnObjectByFieldName(CurDBMetaData.GroupFieldNames[i], _baddAliasFieldNames); m_queryComposer.appendGroupByColumn(xColumn); } - String s = m_xQueryAnalyzer.getQuery(); } public void setDBMetaData(QueryMetaData _oDBMetaData) @@ -254,11 +235,16 @@ public class SQLQueryComposer private PropertyValue[][] replaceConditionsByAlias(PropertyValue _filterconditions[][]) { + XColumnsSupplier columnSup = UnoRuntime.queryInterface(XColumnsSupplier.class, m_xQueryAnalyzer); + XNameAccess columns = columnSup.getColumns(); for (int n = 0; n < _filterconditions.length; n++) { for (int m = 0; m < _filterconditions[n].length; m++) { - _filterconditions[n][m].Name = getComposedAliasFieldName(_filterconditions[n][m].Name); + // _filterconditions[n][m].Name = getComposedAliasFieldName(_filterconditions[n][m].Name); + final String aliasName = getComposedAliasFieldName(_filterconditions[n][m].Name); + if ( columns.hasByName(aliasName)) + _filterconditions[n][m].Name = aliasName; } } return _filterconditions; @@ -269,19 +255,19 @@ public class SQLQueryComposer return m_xQueryAnalyzer.getQuery(); } - public String getFromClause() + public StringBuilder getFromClause() { - String sFromClause = "FROM"; + StringBuilder sFromClause = new StringBuilder("FROM"); composedCommandNames.clear(); String[] sCommandNames = CurDBMetaData.getIncludedCommandNames(); for (int i = 0; i < sCommandNames.length; i++) { CommandName curCommandName = new CommandName(CurDBMetaData, sCommandNames[i]); //(setComposedCommandName) curCommandName.setAliasName(getuniqueAliasName(curCommandName.getTableName())); - sFromClause += " " + curCommandName.getComposedName() + " " + quoteName(curCommandName.getAliasName()); + sFromClause.append(" ").append(curCommandName.getComposedName()).append(" ").append(quoteName(curCommandName.getAliasName())); if (i < sCommandNames.length - 1) { - sFromClause += ", "; + sFromClause.append(", "); } // fill composedCommandNames composedCommandNames.add(curCommandName); @@ -291,30 +277,26 @@ public class SQLQueryComposer public boolean setQueryCommand(XWindow _xParentWindow, boolean _bincludeGrouping, boolean _baddAliasFieldNames) { - return setQueryCommand(_xParentWindow,_bincludeGrouping, _baddAliasFieldNames,true); + return setQueryCommand(_xParentWindow, _bincludeGrouping, _baddAliasFieldNames, true); } + public boolean setQueryCommand(XWindow _xParentWindow, boolean _bincludeGrouping, boolean _baddAliasFieldNames, boolean addQuery) { try { - String s; bincludeGrouping = _bincludeGrouping; - if ( addQuery ) + if (addQuery) { - String sFromClause = getFromClause(); + StringBuilder fromClause = getFromClause(); String sSelectClause = getSelectClause(_baddAliasFieldNames); - String queryclause = sSelectClause + " " + sFromClause; - m_xQueryAnalyzer.setQuery(queryclause); - if (CurDBMetaData.getFilterConditions() != null) + StringBuilder queryclause = new StringBuilder(sSelectClause).append(" ").append(fromClause); + m_xQueryAnalyzer.setQuery(queryclause.toString()); + if (CurDBMetaData.getFilterConditions() != null && CurDBMetaData.getFilterConditions().length > 0) { - if (CurDBMetaData.getFilterConditions().length > 0) - { - CurDBMetaData.setFilterConditions(replaceConditionsByAlias(CurDBMetaData.getFilterConditions())); - m_queryComposer.setStructuredFilter(CurDBMetaData.getFilterConditions()); - } + CurDBMetaData.setFilterConditions(replaceConditionsByAlias(CurDBMetaData.getFilterConditions())); + m_queryComposer.setStructuredFilter(CurDBMetaData.getFilterConditions()); } } - s = m_xQueryAnalyzer.getQuery(); if (_bincludeGrouping) { appendGroupByColumns(_baddAliasFieldNames); @@ -325,7 +307,6 @@ public class SQLQueryComposer } appendSortingcriteria(_baddAliasFieldNames); - s = m_xQueryAnalyzer.getQuery(); return true; } catch (Exception exception) @@ -340,8 +321,10 @@ public class SQLQueryComposer { FieldColumn CurFieldColumn = CurDBMetaData.getFieldColumnByDisplayName(_fieldname); CommandName curComposedCommandName = getComposedCommandByDisplayName(CurFieldColumn.getCommandName()); - if ( curComposedCommandName == null ) + if (curComposedCommandName == null) + { return _fieldname; + } String curAliasName = curComposedCommandName.getAliasName(); return quoteName(curAliasName) + "." + quoteName(CurFieldColumn.getFieldName()); } @@ -350,13 +333,11 @@ public class SQLQueryComposer { if (composedCommandNames != null) { - CommandName curComposedName; - for (int i = 0; i < composedCommandNames.size(); i++) + for (CommandName commandName : composedCommandNames) { - curComposedName = (CommandName) composedCommandNames.elementAt(i); - if (curComposedName.getAliasName().equals(_AliasName)) + if (commandName.getAliasName().equals(_AliasName)) { - return curComposedName; + return commandName; } } } @@ -367,13 +348,11 @@ public class SQLQueryComposer { if (composedCommandNames != null) { - CommandName curComposedName; - for (int i = 0; i < composedCommandNames.size(); i++) + for (CommandName commandName : composedCommandNames) { - curComposedName = (CommandName) composedCommandNames.elementAt(i); - if (curComposedName.getDisplayName().equals(_DisplayName)) + if (commandName.getDisplayName().equals(_DisplayName)) { - return curComposedName; + return commandName; } } } @@ -386,7 +365,7 @@ public class SQLQueryComposer String AliasName = ""; boolean bAliasNameexists = true; String locAliasName = _TableName; - while (bAliasNameexists == true) + while (bAliasNameexists) { bAliasNameexists = (getComposedCommandByAliasName(locAliasName) != null); if (bAliasNameexists) @@ -412,15 +391,15 @@ public class SQLQueryComposer try { Object oErrorDialog = CurDBMetaData.xMSF.createInstance("com.sun.star.sdb.ErrorMessageDialog"); - XInitialization xInitialize = (XInitialization) UnoRuntime.queryInterface(XInitialization.class, oErrorDialog); - XExecutableDialog xExecute = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, oErrorDialog); + XInitialization xInitialize = UnoRuntime.queryInterface(XInitialization.class, oErrorDialog); + XExecutableDialog xExecute = UnoRuntime.queryInterface(XExecutableDialog.class, oErrorDialog); PropertyValue[] rDispatchArguments = new PropertyValue[3]; - rDispatchArguments[0] = Properties.createProperty("Title", Configuration.getProductName(CurDBMetaData.xMSF) + " Base"); + rDispatchArguments[0] = Properties.createProperty(PropertyNames.PROPERTY_TITLE, Configuration.getProductName(CurDBMetaData.xMSF) + " Base"); rDispatchArguments[1] = Properties.createProperty("ParentWindow", _xParentWindow); rDispatchArguments[2] = Properties.createProperty("SQLException", _exception); xInitialize.initialize(rDispatchArguments); xExecute.execute(); - //TODO dispose??? + //TODO dispose??? } catch (Exception typeexception) { @@ -443,38 +422,40 @@ public class SQLQueryComposer public PropertyValue[][] getNormalizedStructuredFilter() { final PropertyValue[][] structuredFilter = m_queryComposer.getStructuredFilter(); - for ( int i=0; i<structuredFilter.length; ++i ) + for (int i = 0; i < structuredFilter.length; ++i) { - for ( int j=0; j<structuredFilter[i].length; ++j ) + for (int j = 0; j < structuredFilter[i].length; ++j) { - if ( !( structuredFilter[i][j].Value instanceof String ) ) + if (!(structuredFilter[i][j].Value instanceof String)) + { continue; - final StringBuffer textualValue = new StringBuffer( (String)structuredFilter[i][j].Value ); - switch ( structuredFilter[i][j].Handle ) + } + final StringBuffer textualValue = new StringBuffer((String) structuredFilter[i][j].Value); + switch (structuredFilter[i][j].Handle) { - case SQLFilterOperator.EQUAL: - break; - case SQLFilterOperator.NOT_EQUAL: - case SQLFilterOperator.LESS_EQUAL: - case SQLFilterOperator.GREATER_EQUAL: - textualValue.delete( 0, 2 ); - break; - case SQLFilterOperator.LESS: - case SQLFilterOperator.GREATER: - textualValue.delete( 0, 1 ); - break; - case SQLFilterOperator.NOT_LIKE: - textualValue.delete( 0, 8 ); - break; - case SQLFilterOperator.LIKE: - textualValue.delete( 0, 4 ); - break; - case SQLFilterOperator.SQLNULL: - textualValue.delete( 0, 7 ); - break; - case SQLFilterOperator.NOT_SQLNULL: - textualValue.delete( 0, 11 ); - break; + case SQLFilterOperator.EQUAL: + break; + case SQLFilterOperator.NOT_EQUAL: + case SQLFilterOperator.LESS_EQUAL: + case SQLFilterOperator.GREATER_EQUAL: + textualValue.delete(0, 2); + break; + case SQLFilterOperator.LESS: + case SQLFilterOperator.GREATER: + textualValue.delete(0, 1); + break; + case SQLFilterOperator.NOT_LIKE: + textualValue.delete(0, 8); + break; + case SQLFilterOperator.LIKE: + textualValue.delete(0, 4); + break; + case SQLFilterOperator.SQLNULL: + textualValue.delete(0, 7); + break; + case SQLFilterOperator.NOT_SQLNULL: + textualValue.delete(0, 11); + break; } structuredFilter[i][j].Value = textualValue.toString().trim(); } diff --git a/wizards/com/sun/star/wizards/db/TableDescriptor.java b/wizards/com/sun/star/wizards/db/TableDescriptor.java index c7f728648467..491b724e1f09 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; @@ -156,16 +156,16 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - XKeysSupplier xKeySupplier = (XKeysSupplier) UnoRuntime.queryInterface(XKeysSupplier.class, xPropTableDataDescriptor); + XKeysSupplier xKeySupplier = UnoRuntime.queryInterface(XKeysSupplier.class, xPropTableDataDescriptor); xIndexAccessKeys = xKeySupplier.getKeys(); - XDataDescriptorFactory xKeyFac = (XDataDescriptorFactory) UnoRuntime.queryInterface(XDataDescriptorFactory.class, xIndexAccessKeys); - xKeyDrop = (XDrop) UnoRuntime.queryInterface(XDrop.class, xIndexAccessKeys); - xKeyAppend = (XAppend) UnoRuntime.queryInterface(XAppend.class, xKeyFac); + XDataDescriptorFactory xKeyFac = UnoRuntime.queryInterface(XDataDescriptorFactory.class, xIndexAccessKeys); + xKeyDrop = UnoRuntime.queryInterface(XDrop.class, xIndexAccessKeys); + xKeyAppend = UnoRuntime.queryInterface(XAppend.class, xKeyFac); xKey = xKeyFac.createDataDescriptor(); xKey.setPropertyValue("Type", new Integer(KeyType.PRIMARY)); - xKeyColumnSupplier = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xKey); - XDataDescriptorFactory xKeyColFac = (XDataDescriptorFactory) UnoRuntime.queryInterface(XDataDescriptorFactory.class, xKeyColumnSupplier.getColumns()); - xKeyColAppend = (XAppend) UnoRuntime.queryInterface(XAppend.class, xKeyColFac); + xKeyColumnSupplier = UnoRuntime.queryInterface(XColumnsSupplier.class, xKey); + XDataDescriptorFactory xKeyColFac = UnoRuntime.queryInterface(XDataDescriptorFactory.class, xKeyColumnSupplier.getColumns()); + xKeyColAppend = UnoRuntime.queryInterface(XAppend.class, xKeyColFac); removePrimaryKeys(); for (int i = 0; i < _fieldnames.length; i++) { @@ -190,7 +190,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen if (xColPropertySet.getPropertySetInfo().hasPropertyByName("IsAutoIncrement")) { xColPropertySet.setPropertyValue("Type", new Integer(nDataType)); - xColPropertySet.setPropertyValue("IsAutoIncrement", new Boolean(_bAutoincrementation)); + xColPropertySet.setPropertyValue("IsAutoIncrement", Boolean.valueOf(_bAutoincrementation)); } } } @@ -222,7 +222,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - String sColumnName = (String) AnyConverter.toString(_xToBeAppendedPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME)); + String sColumnName = AnyConverter.toString(_xToBeAppendedPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME)); if (_xColumns.hasByName(sColumnName)) { String sMessage = JavaTools.replaceSubString(sColumnAlreadyExistsMessage, sColumnName, "%FIELDNAME"); @@ -251,13 +251,13 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen boolean breturn = true; try { - XAppend xAppendColumns = (XAppend) UnoRuntime.queryInterface(XAppend.class, xNameAccessColumns); + XAppend xAppendColumns = UnoRuntime.queryInterface(XAppend.class, xNameAccessColumns); for (int i = 0; i < columncontainer.size(); i++) { XPropertySet xColPropertySet = getByIndex(i); if (!isColunnNameDuplicate(xNameAccessColumns, xColPropertySet)) { - xAppendColumns.appendByDescriptor(xColPropertySet); //xColPropertySet.setPropertyValue("Type", new Integer(32423)) + xAppendColumns.appendByDescriptor(xColPropertySet); //xColPropertySet.setPropertyValue("Type", 32423) } else { @@ -269,7 +269,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen assignTableProperty(PropertyNames.PROPERTY_NAME, _tablename); assignTableProperty("CatalogName", _catalogname); assignTableProperty("SchemaName", _schemaname); - xTableContainer = (XContainer) UnoRuntime.queryInterface(XContainer.class, getTableNamesAsNameAccess()); + xTableContainer = UnoRuntime.queryInterface(XContainer.class, getTableNamesAsNameAccess()); xTableContainer.addContainerListener(this); if (keycolumncontainer.size() > 0) { @@ -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(); @@ -331,7 +331,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen } } } - XDrop xColumnDrop = (XDrop) UnoRuntime.queryInterface(XDrop.class, xNameAccessColumns); + XDrop xColumnDrop = UnoRuntime.queryInterface(XDrop.class, xNameAccessColumns); for (int i = xNameAccessColumns.getElementNames().length - 1; i >= 0; i--) { xColumnDrop.dropByIndex(i); @@ -374,7 +374,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { if (_svalue != null) { - if (!_svalue.equals("")) + if (!_svalue.equals(PropertyNames.EMPTY_STRING)) { try { @@ -604,7 +604,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen if (hasByName(_snewname)) { Object oColumn = getByName(_snewname); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oColumn); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, oColumn); Property[] aColProperties = xPropertySet.getPropertySetInfo().getProperties(); for (int i = 0; i < aColProperties.length; i++) { @@ -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); @@ -777,7 +777,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - XPropertySet xTablePropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, arg0.Element); + XPropertySet xTablePropertySet = UnoRuntime.queryInterface(XPropertySet.class, arg0.Element); String stablename = AnyConverter.toString(xTablePropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME)); String sschemaname = AnyConverter.toString(xPropTableDataDescriptor.getPropertyValue("SchemaName")); String scatalogname = AnyConverter.toString(xPropTableDataDescriptor.getPropertyValue("CatalogName")); diff --git a/wizards/com/sun/star/wizards/db/TypeInspector.java b/wizards/com/sun/star/wizards/db/TypeInspector.java index 1f22801fd8c5..bf1a8c3a483f 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 { @@ -87,15 +88,15 @@ public class TypeInspector Vector<Integer> aSearchableVector = new Vector<Integer>(); // Integer[] aIntegerDataTypes = null; // XResultSet xResultSet = xDBMetaDagetTypeInfo(); - XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, xResultSet); + XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet); while (xResultSet.next()) { - aTypeNameVector.addElement(new String(xRow.getString(1))); + aTypeNameVector.addElement(xRow.getString(1)); aTypeVector.addElement(new Integer(xRow.getShort(2))); aPrecisionVector.addElement(new Integer(xRow.getInt(3))); aNullableVector.addElement(new Integer(xRow.getShort(7))); aSearchableVector.addElement(new Integer(xRow.getShort(9))); - aAutoIncrementVector.addElement(new Boolean(xRow.getBoolean(12))); + aAutoIncrementVector.addElement(Boolean.valueOf(xRow.getBoolean(12))); aMinScaleVector.addElement(new Integer(xRow.getShort(14))); aMaxScaleVector.addElement(new Integer(xRow.getShort(15))); @@ -153,12 +154,11 @@ public class TypeInspector { return ColumnValue.NO_NULLS; } - int nNullable = _nNullable; - if (nNullable == ColumnValue.NULLABLE) + if (_nNullable == ColumnValue.NULLABLE) { return nNullableInfos[i]; //probably nullability is not allowed } - return nNullable; + return _nNullable; } public int getNullability(XPropertySet _xColPropertySet) @@ -230,25 +230,19 @@ public class TypeInspector int i = JavaTools.FieldInIntTable(nDataTypeInfos, nDataType, startindex); startindex = i + 1; bleaveloop = (i < 0); - if (!bleaveloop) + if (!bleaveloop && sTypeName.equals(sDataTypeNames[i])) { - if (sTypeName.equals(sDataTypeNames[i])) + if (_bCheckNumericAttributes) { - if (_bCheckNumericAttributes) - { - if (nPrecision <= nPrecisionInfos[i]) - { - if ((nScale >= nMinScaleInfos[i]) && (nScale <= nMinScaleInfos[i])) - { - return i; - } - } - } - else + if (nPrecision <= nPrecisionInfos[i] && (nScale >= nMinScaleInfos[i]) && (nScale <= nMinScaleInfos[i]) ) { return i; } } + else + { + return i; + } } } } @@ -284,7 +278,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 96485cdf84ce..ce4afe5a3022 100644 --- a/wizards/com/sun/star/wizards/document/Control.java +++ b/wizards/com/sun/star/wizards/document/Control.java @@ -131,7 +131,7 @@ public class Control extends Shape { if (xFormName != null) { - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xFormName); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, xFormName); String sControlName = Desktop.getUniqueName(xNameAccess, getControlName(_fieldname)); xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, sControlName); xFormName.insertByName(sControlName, xControlModel); @@ -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: @@ -280,7 +280,7 @@ public class Control extends Shape */ public XLayoutConstrains getPeer() { - return (XLayoutConstrains) UnoRuntime.queryInterface(XLayoutConstrains.class, xControl.getPeer()); + return UnoRuntime.queryInterface(XLayoutConstrains.class, xControl.getPeer()); } public Size getPeerSize() @@ -314,13 +314,13 @@ public class Control extends Shape } else if (getControlType() == FormHandler.SODATECONTROL) { - xPropertySet.setPropertyValue("Date", new Integer(4711)); //TODO find a better date + xPropertySet.setPropertyValue("Date", 4711); //TODO find a better date aPreferredSize = getPeer().getPreferredSize(); xPropertySet.setPropertyValue("Date", com.sun.star.uno.Any.VOID); } else if (getControlType() == FormHandler.SOTIMECONTROL) { - xPropertySet.setPropertyValue("Time", new Integer(47114)); //TODO find a better time + xPropertySet.setPropertyValue("Time", 47114); //TODO find a better time aPreferredSize = getPeer().getPreferredSize(); xPropertySet.setPropertyValue("Time", com.sun.star.uno.Any.VOID); } @@ -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 67a85c436f6f..5e8877374c9b 100644 --- a/wizards/com/sun/star/wizards/document/DatabaseControl.java +++ b/wizards/com/sun/star/wizards/document/DatabaseControl.java @@ -90,10 +90,10 @@ public class DatabaseControl extends Control { bHidden = true; } - xPropColumn.setPropertyValue("Hidden", new Boolean(bHidden)); + xPropColumn.setPropertyValue("Hidden", Boolean.valueOf(bHidden)); xPropColumn.setPropertyValue("DataField", sFieldName); xPropColumn.setPropertyValue(PropertyNames.PROPERTY_LABEL, _columntitle); - xPropColumn.setPropertyValue(PropertyNames.PROPERTY_WIDTH, new Integer(0)); // Width of column is adjusted to Columname + xPropColumn.setPropertyValue(PropertyNames.PROPERTY_WIDTH, 0); // Width of column is adjusted to Columname XPropertySetInfo xPSI = xPropColumn.getPropertySetInfo(); if ( xPSI.hasPropertyByName( "MouseWheelBehavior" ) ) @@ -152,7 +152,7 @@ public class DatabaseControl extends Control return FormHandler.oControlData[i].GridColumnName; } } - return ""; + return PropertyNames.EMPTY_STRING; } public int getControlHeight() @@ -160,16 +160,14 @@ public class DatabaseControl extends Control if (getControlType() == FormHandler.SOIMAGECONTROL) { // return oFormHandler.getImageControlHeight(); - final int nMemofieldheight = oFormHandler.getControlReferenceHeight() * 4; - return nMemofieldheight; + return oFormHandler.getControlReferenceHeight() * 4; } else { if (getFieldType() == DataType.LONGVARCHAR) { // Helper.setUnoPropertyValue(xControlModel, PropertyNames.PROPERTY_MULTILINE, Boolean.TRUE); - final int nMemofieldheight = oFormHandler.getControlReferenceHeight() * 4; - return nMemofieldheight; + return oFormHandler.getControlReferenceHeight() * 4; } else if (getControlType() == FormHandler.SOCHECKBOX) { diff --git a/wizards/com/sun/star/wizards/document/FormHandler.java b/wizards/com/sun/star/wizards/document/FormHandler.java index 17dece81a03e..828ae4fc67f0 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; @@ -108,12 +116,12 @@ public class FormHandler public FormHandler(XMultiServiceFactory _xMSF, XTextDocument xTextDocument) { this.xMSF = _xMSF; - xDrawPageSupplier = (XDrawPageSupplier) UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDocument); + xDrawPageSupplier = UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDocument); xDrawPage = xDrawPageSupplier.getDrawPage(); - xFormsSupplier = (XFormsSupplier) UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage); - xShapeGrouper = (XShapeGrouper) UnoRuntime.queryInterface(XShapeGrouper.class, xDrawPage); - xControlAccess = (XControlAccess) UnoRuntime.queryInterface(XControlAccess.class, xTextDocument.getCurrentController()); - xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + xFormsSupplier = UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage); + xShapeGrouper = UnoRuntime.queryInterface(XShapeGrouper.class, xDrawPage); + xControlAccess = UnoRuntime.queryInterface(XControlAccess.class, xTextDocument.getCurrentController()); + xMSFDoc = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); sModelServices[SOLABEL] = "com.sun.star.form.component.FixedText"; sModelServices[SOTEXTBOX] = "com.sun.star.form.component.TextField"; sModelServices[SOCHECKBOX] = "com.sun.star.form.component.CheckBox"; @@ -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) @@ -156,8 +164,7 @@ public class FormHandler { if (oControlData[i].DataType == _fieldtype) { - final int nType = oControlData[i].ControlType; - return nType; + return oControlData[i].ControlType; } } return -1; @@ -184,7 +191,7 @@ public class FormHandler public void initializeBasicControlValues() { Control oLabelControl = new Control(this, SOLABEL, new Point(), new Size()); - XDevice xDevice = (XDevice) UnoRuntime.queryInterface(XDevice.class, oLabelControl.xWindowPeer); + XDevice xDevice = UnoRuntime.queryInterface(XDevice.class, oLabelControl.xWindowPeer); iXPixelFactor = (int) (100000 / xDevice.getInfo().PixelPerMeterX); iYPixelFactor = (int) (100000 / xDevice.getInfo().PixelPerMeterY); @@ -209,8 +216,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 @@ -219,8 +225,7 @@ public class FormHandler { if (xNamedForm.hasByName(ControlName)) { - String ControlValue = AnyConverter.toString(com.sun.star.wizards.common.Helper.getUnoPropertyValue(xNamedForm.getByName(ControlName), "HiddenValue")); - return ControlValue; + return AnyConverter.toString(com.sun.star.wizards.common.Helper.getUnoPropertyValue(xNamedForm.getByName(ControlName), "HiddenValue")); } else { @@ -238,7 +243,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 +254,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); } } @@ -260,7 +265,7 @@ public class FormHandler public UnknownHiddenControlException(XNameAccess xNamedForm, String ControlName, String sMsgHiddenControlisMissing) { - XNamed xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, xNamedForm); + XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, xNamedForm); String FormName = xNamed.getName(); sMsgHiddenControlisMissing = JavaTools.replaceSubString(sMsgHiddenControlisMissing, FormName, "<REPORTFORM>"); sMsgHiddenControlisMissing = JavaTools.replaceSubString(sMsgHiddenControlisMissing, ControlName, "<CONTROLNAME>"); @@ -271,7 +276,7 @@ public class FormHandler public boolean hasFormByName(String _FormName) { xNamedFormContainer = getDocumentForms(); - xNamedForms = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xNamedFormContainer); + xNamedForms = UnoRuntime.queryInterface(XNameAccess.class, xNamedFormContainer); return xNamedForms.hasByName(_FormName); } @@ -285,9 +290,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); } } @@ -299,14 +304,14 @@ public class FormHandler { if (belongsToForm(xDrawPage.getByIndex(i), _FormName)) { - XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); + XShape xShape = UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); xDrawPage.remove(xShape); } } } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } } @@ -318,26 +323,26 @@ 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); } } public boolean belongsToForm(Object _oDrawPageElement, String _FormName) { - XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, _oDrawPageElement); + XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, _oDrawPageElement); if (xServiceInfo.supportsService("com.sun.star.drawing.ControlShape")) { - XControlShape xControlShape = (XControlShape) UnoRuntime.queryInterface(XControlShape.class, _oDrawPageElement); + XControlShape xControlShape = UnoRuntime.queryInterface(XControlShape.class, _oDrawPageElement); XControlModel xControlModel = xControlShape.getControl(); - xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, xControlShape.getControl()); + xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, xControlShape.getControl()); if (xServiceInfo.supportsService("com.sun.star.form.FormComponent")) { - XChild xChild = (XChild) UnoRuntime.queryInterface(XChild.class, xControlModel); - XNamed xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, xChild.getParent()); + XChild xChild = UnoRuntime.queryInterface(XChild.class, xControlModel); + XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, xChild.getParent()); String sName = xNamed.getName(); return _FormName.equals(sName); } @@ -355,7 +360,7 @@ public class FormHandler oDBForm = xMSFDoc.createInstance("com.sun.star.form.component.Form"); _xNamedFormContainer.insertByName(_FormName, oDBForm); XNameContainer xNamedForm; - xNamedForm = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oDBForm); + xNamedForm = UnoRuntime.queryInterface(XNameContainer.class, oDBForm); return xNamedForm; } else @@ -363,9 +368,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; } } @@ -388,12 +393,12 @@ public class FormHandler if (xNamedForms.hasByName(_sname)) { Object oDBForm = AnyConverter.toObject(new Type(XInterface.class), Helper.getUnoObjectbyName(xNamedForms, _sname)); - xNamedForm = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oDBForm); + xNamedForm = UnoRuntime.queryInterface(XNameContainer.class, oDBForm); } } catch (IllegalArgumentException e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } return xNamedForm; } @@ -484,13 +489,13 @@ public class FormHandler { for (int i = 0; i < this.xDrawPage.getCount(); i++) { - XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); + XShape xShape = UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); xShape.setPosition(new Point(this.iXNirwanaPos, this.iYNirwanaPos)); } } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); } } @@ -498,7 +503,7 @@ public class FormHandler { for (int i = this.xDrawPage.getCount(); i > -1; i--) { - XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); + XShape xShape = UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); removeShape(xShape); } } @@ -510,7 +515,7 @@ public class FormHandler public void removeShape(XShape _xShape) { xDrawPage.remove(_xShape); - XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, _xShape); + XComponent xComponent = UnoRuntime.queryInterface(XComponent.class, _xShape); xComponent.dispose(); } // Destroy all Shapes in Nirwana @@ -518,7 +523,7 @@ public class FormHandler { for (int i = this.xDrawPage.getCount(); i > -1; i--) { - XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); + XShape xShape = UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i)); if (xShape.getPosition().Y < this.iYNirwanaPos) { xDrawPage.remove(xShape); @@ -531,14 +536,14 @@ public class FormHandler try { Object oGroupShape = _xMSF.createInstance("com.sun.star.drawing.ShapeCollection"); - XShapes xShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oGroupShape); + XShapes xShapes = UnoRuntime.queryInterface(XShapes.class, oGroupShape); xShapes.add(_xLabelShape); xShapes.add(_xControlShape); return this.xShapeGrouper.group(xShapes); } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger(FormHandler.class.getName()).log(Level.SEVERE, null, e); return null; } } @@ -583,12 +588,12 @@ public class FormHandler { try { - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, this.xMSFDoc.createInstance("com.sun.star.text.DocumentSettings")); - xPropertySet.setPropertyValue("DoNotCaptureDrawObjsOnPage", new Boolean(!_bCaptureObjects)); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, this.xMSFDoc.createInstance("com.sun.star.text.DocumentSettings")); + xPropertySet.setPropertyValue("DoNotCaptureDrawObjsOnPage", Boolean.valueOf(!_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..074ff5350a39 100644 --- a/wizards/com/sun/star/wizards/document/OfficeDocument.java +++ b/wizards/com/sun/star/wizards/document/OfficeDocument.java @@ -81,13 +81,13 @@ public class OfficeDocument { try { - XEventsSupplier xEventsSuppl = (XEventsSupplier) UnoRuntime.queryInterface(XEventsSupplier.class, xComponent); + XEventsSupplier xEventsSuppl = UnoRuntime.queryInterface(XEventsSupplier.class, xComponent); PropertyValue[] oEventProperties = new PropertyValue[2]; oEventProperties[0] = new PropertyValue(); 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); } @@ -103,8 +103,8 @@ public class OfficeDocument { if (xComponent != null) { - XModifiable xModified = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, xComponent); - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent); + XModifiable xModified = UnoRuntime.queryInterface(XModifiable.class, xComponent); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xComponent); XFrame xFrame = xModel.getCurrentController().getFrame(); if (xModified.isModified()) { @@ -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"; @@ -144,18 +144,18 @@ public class OfficeDocument try { - xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, frame); - /*if (frame.getName() == null || frame.getName().equals("")); + xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, frame); + /*if (frame.getName() == null || frame.getName().equals(PropertyNames.EMPTY_STRING)); frame.setName("T" + System.currentTimeMillis());*/ XComponent xComponent = xComponentLoader.loadComponentFromURL(sURL, "_self", 0, loadValues); - if (sDocumentType == "swriter") + if (sDocumentType.equals("swriter")) { - oDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent); + oDocument = UnoRuntime.queryInterface(XTextDocument.class, xComponent); } - else if (sDocumentType == "scalc") + else if (sDocumentType.equals("scalc")) { - oDocument = (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, xComponent); + oDocument = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xComponent); //TODO: // else if (sDocumentType == "simpress") // else if (sDocumentType == "sdraw") @@ -182,14 +182,14 @@ public class OfficeDocument } else { - XFrame xF = (XFrame) UnoRuntime.queryInterface(XFrame.class, Desktop.getDesktop(xMSF)); + XFrame xF = UnoRuntime.queryInterface(XFrame.class, Desktop.getDesktop(xMSF)); xFrame = xF.findFrame(FrameName, 0); if (listener != null) { - XFramesSupplier xFS = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, xF); + XFramesSupplier xFS = UnoRuntime.queryInterface(XFramesSupplier.class, xF); XFrames xFF = xFS.getFrames(); xFF.remove(xFrame); - XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xF); + XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, xF); xDesktop.addTerminateListener(listener); } } @@ -201,7 +201,7 @@ public class OfficeDocument XToolkit xToolkit = null; try { - xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, xMSF.createInstance("com.sun.star.awt.Toolkit")); + xToolkit = UnoRuntime.queryInterface(XToolkit.class, xMSF.createInstance("com.sun.star.awt.Toolkit")); } catch (Exception e) { @@ -226,14 +226,14 @@ public class OfficeDocument XWindowPeer xPeer = null; try { - xPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xToolkit.createWindow(aDescriptor)); + xPeer = UnoRuntime.queryInterface(XWindowPeer.class, xToolkit.createWindow(aDescriptor)); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xPeer); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, xPeer); //define some further properties of the frame window //if it's needed .-) @@ -243,7 +243,7 @@ public class OfficeDocument XFrame xFrame = null; try { - xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, xMSF.createInstance("com.sun.star.frame.Frame")); + xFrame = UnoRuntime.queryInterface(XFrame.class, xMSF.createInstance("com.sun.star.frame.Frame")); } catch (Exception e) { @@ -273,13 +273,13 @@ public class OfficeDocument //XInterface xInterface = null; try { - xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, xInterface); + xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, xInterface); com.sun.star.lang.XComponent xComponent = xComponentLoader.loadComponentFromURL(sURL, sFrame, 0, xValues); - XServiceInfo xComponentService = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, xComponent); + XServiceInfo xComponentService = UnoRuntime.queryInterface(XServiceInfo.class, xComponent); if (xComponentService.supportsService("com.sun.star.text.TextDocument")) { - oDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent); //TODO: write if clauses for Calc, Impress and Draw + oDocument = UnoRuntime.queryInterface(XTextDocument.class, xComponent); //TODO: write if clauses for Calc, Impress and Draw } } catch (Exception exception) @@ -293,7 +293,7 @@ public class OfficeDocument { try { - XStorable xStoreable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xComponent); + XStorable xStoreable = UnoRuntime.queryInterface(XStorable.class, xComponent); PropertyValue[] oStoreProperties; if (FilterName.length() > 0) { @@ -303,13 +303,13 @@ public class OfficeDocument oStoreProperties[0].Value = FilterName; oStoreProperties[1] = new PropertyValue(); oStoreProperties[1].Name = "InteractionHandler"; - oStoreProperties[1].Value = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); + oStoreProperties[1].Value = UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); } else { oStoreProperties = new PropertyValue[0]; } - if (bStoreToUrl == true) + if (bStoreToUrl) { xStoreable.storeToURL(StorePath, oStoreProperties); } @@ -330,11 +330,11 @@ public class OfficeDocument public static boolean close(XComponent xComponent) { boolean bState = false; - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xComponent); if (xModel != null) { - XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, xModel); + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, xModel); if (xCloseable != null) { @@ -351,7 +351,7 @@ public class OfficeDocument } else { - XComponent xDisposeable = (XComponent) UnoRuntime.queryInterface(XComponent.class, xModel); + XComponent xDisposeable = UnoRuntime.queryInterface(XComponent.class, xModel); xDisposeable.dispose(); bState = true; } @@ -369,9 +369,9 @@ public class OfficeDocument int colcount = datalist[0].length; if (colcount > 0) { - XCellRange xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oTable); + XCellRange xCellRange = UnoRuntime.queryInterface(XCellRange.class, oTable); XCellRange xNewRange = xCellRange.getCellRangeByPosition(xpos, ypos, (colcount + xpos) - 1, (rowcount + ypos) - 1); - XCellRangeData xDataArray = (XCellRangeData) UnoRuntime.queryInterface(XCellRangeData.class, xNewRange); + XCellRangeData xDataArray = UnoRuntime.queryInterface(XCellRangeData.class, xNewRange); xDataArray.setDataArray(datalist); } } @@ -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); + String type = UnoRuntime.queryInterface(XTypeDetection.class, typeDetect).queryTypeByDescriptor(mediaDescr, true); - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, typeDetect); - if (type.equals("")) + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, typeDetect); + if (type.equals(PropertyNames.EMPTY_STRING)) { return null; } @@ -409,7 +409,7 @@ public class OfficeDocument throws Exception { Object typeDetect = xmsf.createInstance("com.sun.star.document.TypeDetection"); - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, typeDetect); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, typeDetect); return (PropertyValue[]) xNameAccess.getByName(type); } @@ -421,13 +421,13 @@ public class OfficeDocument */ public static int getSlideCount(Object model) { - XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier) UnoRuntime.queryInterface(XDrawPagesSupplier.class, model); + XDrawPagesSupplier xDrawPagesSupplier = UnoRuntime.queryInterface(XDrawPagesSupplier.class, model); return xDrawPagesSupplier.getDrawPages().getCount(); } public static XDocumentProperties getDocumentProperties(Object document) { - XDocumentPropertiesSupplier xDocumentPropertiesSupplier = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, document); + XDocumentPropertiesSupplier xDocumentPropertiesSupplier = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, document); return xDocumentPropertiesSupplier.getDocumentProperties(); } diff --git a/wizards/com/sun/star/wizards/document/Shape.java b/wizards/com/sun/star/wizards/document/Shape.java index b2ef1a27e662..990fe68cb916 100644 --- a/wizards/com/sun/star/wizards/document/Shape.java +++ b/wizards/com/sun/star/wizards/document/Shape.java @@ -73,8 +73,8 @@ public class Shape this.aSize = _aSize; this.oFormHandler = _oFormHandler; Object oShape = oFormHandler.xMSF.createInstance(_sServiceName); - xShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oShape); - xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oShape); + xShapes = UnoRuntime.queryInterface(XShapes.class, oShape); + xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, oShape); } catch (Exception e) { @@ -92,7 +92,7 @@ public class Shape { xMSF = oFormHandler.xMSFDoc; Object oShape = xMSF.createInstance(sServiceName); - xShape = (XShape) UnoRuntime.queryInterface(XShape.class, oShape); + xShape = UnoRuntime.queryInterface(XShape.class, oShape); xShape.setPosition(aPoint); if (aSize != null) { @@ -103,8 +103,8 @@ public class Shape xShape.setSize(new Size(1000, 100)); } Helper.setUnoPropertyValue(xShape, "AnchorType", TextContentAnchorType.AT_PARAGRAPH); - xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, xShape); - xControlShape = (XControlShape) UnoRuntime.queryInterface(XControlShape.class, xShape); + xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, xShape); + xControlShape = UnoRuntime.queryInterface(XControlShape.class, xShape); } catch (Exception e) diff --git a/wizards/com/sun/star/wizards/document/TimeStampControl.java b/wizards/com/sun/star/wizards/document/TimeStampControl.java index fb5c328aef23..3f0e3609e654 100644 --- a/wizards/com/sun/star/wizards/document/TimeStampControl.java +++ b/wizards/com/sun/star/wizards/document/TimeStampControl.java @@ -75,7 +75,7 @@ public class TimeStampControl extends DatabaseControl xShapes.add(oDateControl.xShape); xShapes.add(oTimeControl.xShape); xShapeGroup = _oFormHandler.xShapeGrouper.group(xShapes); - xShapeGroup = (XShape) UnoRuntime.queryInterface(XShape.class, xShapeGroup); + xShapeGroup = UnoRuntime.queryInterface(XShape.class, xShapeGroup); nreldatewidth = 1.0 / ((double) getSize().Width / (double) nDateWidth); nreltimewidth = 1.0 - nreldatewidth; } @@ -87,9 +87,8 @@ public class TimeStampControl extends DatabaseControl if (_i < xShapes.getCount()) { Object oControl = xShapes.getByIndex(_i); - XControlShape xControlShape = (XControlShape) UnoRuntime.queryInterface(XControlShape.class, oControl); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlShape.getControl()); - return xPropertySet; + XControlShape xControlShape = UnoRuntime.queryInterface(XControlShape.class, oControl); + return UnoRuntime.queryInterface(XPropertySet.class, xControlShape.getControl()); } } catch (Exception e) @@ -105,8 +104,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..a8f383f74cef 100644 --- a/wizards/com/sun/star/wizards/fax/FaxDocument.java +++ b/wizards/com/sun/star/wizards/fax/FaxDocument.java @@ -56,8 +56,7 @@ public class FaxDocument extends TextDocument public XWindowPeer getWindowPeer() { - XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xTextDocument); - return xWindowPeer; + return UnoRuntime.queryInterface(XWindowPeer.class, xTextDocument); } public void switchElement(String sElement, boolean bState) @@ -66,7 +65,7 @@ public class FaxDocument extends TextDocument { TextSectionHandler mySectionHandler = new TextSectionHandler(xMSF, xTextDocument); Object oSection = mySectionHandler.xTextSectionsSupplier.getTextSections().getByName(sElement); - Helper.setUnoPropertyValue(oSection, "IsVisible", new Boolean(bState)); + Helper.setUnoPropertyValue(oSection, "IsVisible", Boolean.valueOf(bState)); } catch (Exception exception) @@ -88,20 +87,20 @@ public class FaxDocument extends TextDocument xTextDocument.lockControllers(); try { - XStyleFamiliesSupplier xStyleFamiliesSupplier = (XStyleFamiliesSupplier) com.sun.star.uno.UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); + XStyleFamiliesSupplier xStyleFamiliesSupplier = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); com.sun.star.container.XNameAccess xNameAccess = null; xNameAccess = xStyleFamiliesSupplier.getStyleFamilies(); com.sun.star.container.XNameContainer xPageStyleCollection = null; - xPageStyleCollection = (com.sun.star.container.XNameContainer) UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xNameAccess.getByName("PageStyles")); + xPageStyleCollection = UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xNameAccess.getByName("PageStyles")); XText xFooterText; - XStyle xPageStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, xPageStyleCollection.getByName(sPageStyle)); + XStyle xPageStyle = UnoRuntime.queryInterface(XStyle.class, xPageStyleCollection.getByName(sPageStyle)); if (bState) { - Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", new Boolean(true)); - xFooterText = (XText) UnoRuntime.queryInterface(XText.class, Helper.getUnoPropertyValue(xPageStyle, "FooterText")); + Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", Boolean.TRUE); + xFooterText = UnoRuntime.queryInterface(XText.class, Helper.getUnoPropertyValue(xPageStyle, "FooterText")); xFooterText.setString(sText); if (bPageNumber) { @@ -109,10 +108,10 @@ public class FaxDocument extends TextDocument XTextCursor myCursor = xFooterText.createTextCursor(); myCursor.gotoEnd(false); xFooterText.insertControlCharacter(myCursor, ControlCharacter.PARAGRAPH_BREAK, false); - XPropertySet xCursorPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, myCursor); + XPropertySet xCursorPSet = UnoRuntime.queryInterface(XPropertySet.class, myCursor); xCursorPSet.setPropertyValue("ParaAdjust", ParagraphAdjust.CENTER); - XTextField xPageNumberField = (XTextField) UnoRuntime.queryInterface(XTextField.class, xMSFDoc.createInstance("com.sun.star.text.TextField.PageNumber")); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPageNumberField); + XTextField xPageNumberField = UnoRuntime.queryInterface(XTextField.class, xMSFDoc.createInstance("com.sun.star.text.TextField.PageNumber")); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xPageNumberField); xPSet.setPropertyValue("SubType", PageNumberType.CURRENT); xPSet.setPropertyValue("NumberingType", new Short(NumberingType.ARABIC)); xFooterText.insertTextContent(xFooterText.getEnd(), xPageNumberField, false); @@ -120,7 +119,7 @@ public class FaxDocument extends TextDocument } else { - Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", new Boolean(false)); + Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", Boolean.FALSE); } xTextDocument.unlockControllers(); } @@ -153,7 +152,7 @@ public class FaxDocument extends TextDocument } else { - myFieldHandler.changeUserFieldContent(sFieldName, ""); + myFieldHandler.changeUserFieldContent(sFieldName, PropertyNames.EMPTY_STRING); } } @@ -179,7 +178,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 fc095af0d337..02ccab6b177e 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java @@ -112,11 +112,11 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD Helper.setUnoPropertyValues(xDialogModel, new String[] { - "Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_CLOSEABLE, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - Boolean.TRUE, new Integer(210), Boolean.TRUE, new Integer(104), new Integer(52), INTEGERS[1], new Short((short) 1), resources.resFaxWizardDialog_title, new Integer(310) + Boolean.TRUE, 210, Boolean.TRUE, 104, 52, INTEGERS[1], new Short((short) 1), resources.resFaxWizardDialog_title, 310 }); @@ -138,7 +138,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTBUSINESSFAX_HID, resources.resoptBusinessFax_value, new Integer(97), new Integer(28), INTEGERS[1], new Short((short) 1), new Integer(184) + INTEGERS[8], OPTBUSINESSFAX_HID, resources.resoptBusinessFax_value, 97, 28, INTEGERS[1], new Short((short) 1), 184 }); lstBusinessStyle = insertListBox("lstBusinessStyle", LSTBUSINESSSTYLE_ACTION_PERFORMED, LSTBUSINESSSTYLE_ITEM_CHANGED, new String[] @@ -147,7 +147,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - Boolean.TRUE, INTEGER_12, LSTBUSINESSSTYLE_HID, new Integer(180), INTEGER_40, INTEGERS[1], new Short((short) 3), new Integer(74) + Boolean.TRUE, INTEGER_12, LSTBUSINESSSTYLE_HID, 180, INTEGER_40, INTEGERS[1], new Short((short) 3), 74 }); optPrivateFax = insertRadioButton("optPrivateFax", OPTPRIVATEFAX_ITEM_CHANGED, new String[] @@ -156,7 +156,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTPRIVATEFAX_HID, resources.resoptPrivateFax_value, new Integer(97), new Integer(81), INTEGERS[1], new Short((short) 2), new Integer(184) + INTEGERS[8], OPTPRIVATEFAX_HID, resources.resoptPrivateFax_value, 97, 81, INTEGERS[1], new Short((short) 2), 184 }); lstPrivateStyle = insertListBox("lstPrivateStyle", LSTPRIVATESTYLE_ACTION_PERFORMED, LSTPRIVATESTYLE_ITEM_CHANGED, new String[] @@ -165,7 +165,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - Boolean.TRUE, INTEGER_12, LSTPRIVATESTYLE_HID, new Integer(180), new Integer(95), INTEGERS[1], new Short((short) 4), new Integer(74) + Boolean.TRUE, INTEGER_12, LSTPRIVATESTYLE_HID, 180, 95, INTEGERS[1], new Short((short) 4), 74 }); lblBusinessStyle = insertLabel("lblBusinessStyle", new String[] @@ -174,16 +174,16 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblBusinessStyle_value, new Integer(110), new Integer(42), INTEGERS[1], new Short((short) 32), new Integer(60) + INTEGERS[8], resources.reslblBusinessStyle_value, 110, 42, INTEGERS[1], new Short((short) 32), 60 }); 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[] { - fontDescriptor5, INTEGER_16, resources.reslblTitle1_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[1], new Short((short) 37), new Integer(212) + fontDescriptor5, INTEGER_16, resources.reslblTitle1_value, Boolean.TRUE, 91, INTEGERS[8], INTEGERS[1], new Short((short) 37), 212 }); lblPrivateStyle = insertLabel("lblPrivateStyle", new String[] @@ -192,7 +192,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblPrivateStyle_value, new Integer(110), new Integer(95), INTEGERS[1], new Short((short) 50), new Integer(60) + INTEGERS[8], resources.reslblPrivateStyle_value, 110, 95, INTEGERS[1], new Short((short) 50), 60 }); lblIntroduction = insertLabel("lblIntroduction", new String[] @@ -201,12 +201,12 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - new Integer(39), resources.reslblIntroduction_value, Boolean.TRUE, new Integer(104), new Integer(145), INTEGERS[1], new Short((short) 55), new Integer(199) + 39, resources.reslblIntroduction_value, Boolean.TRUE, 104, 145, INTEGERS[1], new Short((short) 55), 199 }); ImageControl3 = insertInfoImage(92, 145, 1); // ImageControl3 = insertImage("ImageControl3", -// new String[] {"Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, -// new Object[] { new Short((short)0),INTEGERS[10],"private:resource/dbu/image/19205",new Integer(92),new Integer(145),Boolean.FALSE,INTEGERS[1],new Short((short)56),INTEGERS[10]} +// new String[] {PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, +// new Object[] { new Short((short)0),INTEGERS[10],"private:resource/dbu/image/19205",92,145,Boolean.FALSE,INTEGERS[1],new Short((short)56),INTEGERS[10]} // ); } @@ -219,7 +219,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKUSELOGO_HID, resources.reschkUseLogo_value, new Integer(97), new Integer(28), new Short((short) 0), INTEGERS[2], new Short((short) 5), new Integer(212) + INTEGERS[8], CHKUSELOGO_HID, resources.reschkUseLogo_value, 97, 28, new Short((short) 0), INTEGERS[2], new Short((short) 5), 212 }); chkUseDate = insertCheckBox("chkUseDate", CHKUSEDATE_ITEM_CHANGED, new String[] @@ -228,7 +228,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKUSEDATE_HID, resources.reschkUseDate_value, new Integer(97), new Integer(43), new Short((short) 0), INTEGERS[2], new Short((short) 6), new Integer(212) + INTEGERS[8], CHKUSEDATE_HID, resources.reschkUseDate_value, 97, 43, new Short((short) 0), INTEGERS[2], new Short((short) 6), 212 }); chkUseCommunicationType = insertCheckBox("chkUseCommunicationType", CHKUSECOMMUNICATIONTYPE_ITEM_CHANGED, new String[] @@ -237,7 +237,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKUSECOMMUNICATIONTYPE_HID, resources.reschkUseCommunicationType_value, new Integer(97), new Integer(57), new Short((short) 0), INTEGERS[2], new Short((short) 7), new Integer(100) + INTEGERS[8], CHKUSECOMMUNICATIONTYPE_HID, resources.reschkUseCommunicationType_value, 97, 57, new Short((short) 0), INTEGERS[2], new Short((short) 7), 100 }); lstCommunicationType = insertComboBox("lstCommunicationType", LSTCOMMUNICATIONTYPE_ACTION_PERFORMED, LSTCOMMUNICATIONTYPE_ITEM_CHANGED, LSTCOMMUNICATIONTYPE_TEXT_CHANGED, new String[] @@ -246,7 +246,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - Boolean.TRUE, INTEGER_12, LSTCOMMUNICATIONTYPE_HID, new Integer(105), new Integer(68), INTEGERS[2], new Short((short) 8), new Integer(174) + Boolean.TRUE, INTEGER_12, LSTCOMMUNICATIONTYPE_HID, 105, 68, INTEGERS[2], new Short((short) 8), 174 }); chkUseSubject = insertCheckBox("chkUseSubject", CHKUSESUBJECT_ITEM_CHANGED, new String[] @@ -255,7 +255,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKUSESUBJECT_HID, resources.reschkUseSubject_value, new Integer(97), new Integer(87), new Short((short) 0), INTEGERS[2], new Short((short) 9), new Integer(212) + INTEGERS[8], CHKUSESUBJECT_HID, resources.reschkUseSubject_value, 97, 87, new Short((short) 0), INTEGERS[2], new Short((short) 9), 212 }); chkUseSalutation = insertCheckBox("chkUseSalutation", CHKUSESALUTATION_ITEM_CHANGED, new String[] @@ -264,7 +264,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKUSESALUTATION_HID, resources.reschkUseSalutation_value, new Integer(97), new Integer(102), new Short((short) 0), INTEGERS[2], new Short((short) 10), new Integer(100) + INTEGERS[8], CHKUSESALUTATION_HID, resources.reschkUseSalutation_value, 97, 102, new Short((short) 0), INTEGERS[2], new Short((short) 10), 100 }); lstSalutation = insertComboBox("lstSalutation", LSTSALUTATION_ACTION_PERFORMED, LSTSALUTATION_ITEM_CHANGED, LSTSALUTATION_TEXT_CHANGED, new String[] @@ -273,7 +273,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - Boolean.TRUE, INTEGER_12, LSTSALUTATION_HID, new Integer(105), new Integer(113), INTEGERS[2], new Short((short) 11), new Integer(174) + Boolean.TRUE, INTEGER_12, LSTSALUTATION_HID, 105, 113, INTEGERS[2], new Short((short) 11), 174 }); chkUseGreeting = insertCheckBox("chkUseGreeting", CHKUSEGREETING_ITEM_CHANGED, new String[] @@ -282,7 +282,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKUSEGREETING_HID, resources.reschkUseGreeting_value, new Integer(97), new Integer(132), new Short((short) 0), INTEGERS[2], new Short((short) 12), new Integer(100) + INTEGERS[8], CHKUSEGREETING_HID, resources.reschkUseGreeting_value, 97, 132, new Short((short) 0), INTEGERS[2], new Short((short) 12), 100 }); lstGreeting = insertComboBox("lstGreeting", LSTGREETING_ACTION_PERFORMED, LSTGREETING_ITEM_CHANGED, LSTGREETING_TEXT_CHANGED, new String[] @@ -291,7 +291,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - Boolean.TRUE, INTEGER_12, LSTGREETING_HID, new Integer(105), new Integer(143), INTEGERS[2], new Short((short) 13), new Integer(174) + Boolean.TRUE, INTEGER_12, LSTGREETING_HID, 105, 143, INTEGERS[2], new Short((short) 13), 174 }); chkUseFooter = insertCheckBox("chkUseFooter", CHKUSEFOOTER_ITEM_CHANGED, new String[] @@ -300,16 +300,16 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKUSEFOOTER_HID, resources.reschkUseFooter_value, new Integer(97), new Integer(163), new Short((short) 0), INTEGERS[2], new Short((short) 14), new Integer(212) + INTEGERS[8], CHKUSEFOOTER_HID, resources.reschkUseFooter_value, 97, 163, new Short((short) 0), INTEGERS[2], new Short((short) 14), 212 }); 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[] { - fontDescriptor5, INTEGER_16, resources.reslblTitle3_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[2], new Short((short) 59), new Integer(212) + fontDescriptor5, INTEGER_16, resources.reslblTitle3_value, Boolean.TRUE, 91, INTEGERS[8], INTEGERS[2], new Short((short) 59), 212 }); } @@ -322,7 +322,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTSENDERPLACEHOLDER_HID, resources.resoptSenderPlaceholder_value, new Integer(104), new Integer(42), INTEGERS[3], new Short((short) 15), new Integer(149) + INTEGERS[8], OPTSENDERPLACEHOLDER_HID, resources.resoptSenderPlaceholder_value, 104, 42, INTEGERS[3], new Short((short) 15), 149 }); optSenderDefine = insertRadioButton("optSenderDefine", OPTSENDERDEFINE_ITEM_CHANGED, new String[] @@ -331,7 +331,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTSENDERDEFINE_HID, resources.resoptSenderDefine_value, new Integer(104), new Integer(54), INTEGERS[3], new Short((short) 16), new Integer(149) + INTEGERS[8], OPTSENDERDEFINE_HID, resources.resoptSenderDefine_value, 104, 54, INTEGERS[3], new Short((short) 16), 149 }); txtSenderName = insertTextField("txtSenderName", TXTSENDERNAME_TEXT_CHANGED, new String[] @@ -340,7 +340,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGER_12, TXTSENDERNAME_HID, new Integer(182), new Integer(67), INTEGERS[3], new Short((short) 17), new Integer(119) + INTEGER_12, TXTSENDERNAME_HID, 182, 67, INTEGERS[3], new Short((short) 17), 119 }); txtSenderStreet = insertTextField("txtSenderStreet", TXTSENDERSTREET_TEXT_CHANGED, new String[] @@ -349,7 +349,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGER_12, TXTSENDERSTREET_HID, new Integer(182), new Integer(81), INTEGERS[3], new Short((short) 18), new Integer(119) + INTEGER_12, TXTSENDERSTREET_HID, 182, 81, INTEGERS[3], new Short((short) 18), 119 }); txtSenderPostCode = insertTextField("txtSenderPostCode", TXTSENDERPOSTCODE_TEXT_CHANGED, new String[] @@ -358,7 +358,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGER_12, TXTSENDERPOSTCODE_HID, new Integer(182), new Integer(95), INTEGERS[3], new Short((short) 19), new Integer(25) + INTEGER_12, TXTSENDERPOSTCODE_HID, 182, 95, INTEGERS[3], new Short((short) 19), 25 }); txtSenderState = insertTextField("txtSenderState", TXTSENDERSTATE_TEXT_CHANGED, new String[] @@ -367,7 +367,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGER_12, TXTSENDERSTATE_HID, new Integer(211), new Integer(95), INTEGERS[3], new Short((short) 20), new Integer(21) + INTEGER_12, TXTSENDERSTATE_HID, 211, 95, INTEGERS[3], new Short((short) 20), 21 }); txtSenderCity = insertTextField("txtSenderCity", TXTSENDERCITY_TEXT_CHANGED, new String[] @@ -376,7 +376,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGER_12, TXTSENDERCITY_HID, new Integer(236), new Integer(95), INTEGERS[3], new Short((short) 21), new Integer(65) + INTEGER_12, TXTSENDERCITY_HID, 236, 95, INTEGERS[3], new Short((short) 21), 65 }); txtSenderFax = insertTextField("txtSenderFax", TXTSENDERFAX_TEXT_CHANGED, new String[] @@ -385,7 +385,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGER_12, TXTSENDERFAX_HID, new Integer(182), new Integer(109), INTEGERS[3], new Short((short) 22), new Integer(119) + INTEGER_12, TXTSENDERFAX_HID, 182, 109, INTEGERS[3], new Short((short) 22), 119 }); optReceiverPlaceholder = insertRadioButton("optReceiverPlaceholder", OPTRECEIVERPLACEHOLDER_ITEM_CHANGED, new String[] @@ -394,7 +394,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTRECEIVERPLACEHOLDER_HID, resources.resoptReceiverPlaceholder_value, new Integer(104), new Integer(148), INTEGERS[3], new Short((short) 23), new Integer(200) + INTEGERS[8], OPTRECEIVERPLACEHOLDER_HID, resources.resoptReceiverPlaceholder_value, 104, 148, INTEGERS[3], new Short((short) 23), 200 }); optReceiverDatabase = insertRadioButton("optReceiverDatabase", OPTRECEIVERDATABASE_ITEM_CHANGED, new String[] @@ -403,7 +403,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTRECEIVERDATABASE_HID, resources.resoptReceiverDatabase_value, new Integer(104), new Integer(160), INTEGERS[3], new Short((short) 24), new Integer(200) + INTEGERS[8], OPTRECEIVERDATABASE_HID, resources.resoptReceiverDatabase_value, 104, 160, INTEGERS[3], new Short((short) 24), 200 }); lblSenderAddress = insertLabel("lblSenderAddress", new String[] @@ -412,7 +412,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblSenderAddress_value, new Integer(97), new Integer(28), INTEGERS[3], new Short((short) 46), new Integer(136) + INTEGERS[8], resources.reslblSenderAddress_value, 97, 28, INTEGERS[3], new Short((short) 46), 136 }); FixedLine2 = insertFixedLine("FixedLine2", new String[] @@ -421,7 +421,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[5], new Integer(90), new Integer(126), INTEGERS[3], new Short((short) 51), new Integer(212) + INTEGERS[5], 90, 126, INTEGERS[3], new Short((short) 51), 212 }); lblSenderName = insertLabel("lblSenderName", new String[] @@ -430,7 +430,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblSenderName_value, new Integer(113), new Integer(69), INTEGERS[3], new Short((short) 52), new Integer(68) + INTEGERS[8], resources.reslblSenderName_value, 113, 69, INTEGERS[3], new Short((short) 52), 68 }); lblSenderStreet = insertLabel("lblSenderStreet", new String[] @@ -439,7 +439,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblSenderStreet_value, new Integer(113), new Integer(82), INTEGERS[3], new Short((short) 53), new Integer(68) + INTEGERS[8], resources.reslblSenderStreet_value, 113, 82, INTEGERS[3], new Short((short) 53), 68 }); lblPostCodeCity = insertLabel("lblPostCodeCity", new String[] @@ -448,16 +448,16 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblPostCodeCity_value, new Integer(113), new Integer(97), INTEGERS[3], new Short((short) 54), new Integer(68) + INTEGERS[8], resources.reslblPostCodeCity_value, 113, 97, INTEGERS[3], new Short((short) 54), 68 }); 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[] { - fontDescriptor5, INTEGER_16, resources.reslblTitle4_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[3], new Short((short) 60), new Integer(212) + fontDescriptor5, INTEGER_16, resources.reslblTitle4_value, Boolean.TRUE, 91, INTEGERS[8], INTEGERS[3], new Short((short) 60), 212 }); Label1 = insertLabel("lblSenderFax", new String[] @@ -466,7 +466,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.resLabel1_value, new Integer(113), new Integer(111), INTEGERS[3], new Short((short) 68), new Integer(68) + INTEGERS[8], resources.resLabel1_value, 113, 111, INTEGERS[3], new Short((short) 68), 68 }); Label2 = insertLabel("Label2", new String[] @@ -475,7 +475,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.resLabel2_value, new Integer(97), new Integer(137), INTEGERS[3], new Short((short) 69), new Integer(136) + INTEGERS[8], resources.resLabel2_value, 97, 137, INTEGERS[3], new Short((short) 69), 136 }); } @@ -488,7 +488,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - new Integer(47), TXTFOOTER_HID, Boolean.TRUE, new Integer(97), INTEGER_40, INTEGERS[4], new Short((short) 25), new Integer(203) + 47, TXTFOOTER_HID, Boolean.TRUE, 97, INTEGER_40, INTEGERS[4], new Short((short) 25), 203 }); chkFooterNextPages = insertCheckBox("chkFooterNextPages", CHKFOOTERNEXTPAGES_ITEM_CHANGED, new String[] @@ -497,7 +497,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKFOOTERNEXTPAGES_HID, resources.reschkFooterNextPages_value, new Integer(97), new Integer(92), new Short((short) 0), INTEGERS[4], new Short((short) 26), new Integer(202) + INTEGERS[8], CHKFOOTERNEXTPAGES_HID, resources.reschkFooterNextPages_value, 97, 92, new Short((short) 0), INTEGERS[4], new Short((short) 26), 202 }); chkFooterPageNumbers = insertCheckBox("chkFooterPageNumbers", CHKFOOTERPAGENUMBERS_ITEM_CHANGED, new String[] @@ -506,25 +506,25 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], CHKFOOTERPAGENUMBERS_HID, resources.reschkFooterPageNumbers_value, new Integer(97), new Integer(106), new Short((short) 0), INTEGERS[4], new Short((short) 27), new Integer(201) + INTEGERS[8], CHKFOOTERPAGENUMBERS_HID, resources.reschkFooterPageNumbers_value, 97, 106, new Short((short) 0), INTEGERS[4], new Short((short) 27), 201 }); 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[] { - fontDescriptor4, INTEGERS[8], resources.reslblFooter_value, new Integer(97), new Integer(28), INTEGERS[4], new Short((short) 33), new Integer(116) + fontDescriptor4, INTEGERS[8], resources.reslblFooter_value, 97, 28, INTEGERS[4], new Short((short) 33), 116 }); 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[] { - fontDescriptor5, INTEGER_16, resources.reslblTitle5_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[4], new Short((short) 61), new Integer(212) + fontDescriptor5, INTEGER_16, resources.reslblTitle5_value, Boolean.TRUE, 91, INTEGERS[8], INTEGERS[4], new Short((short) 61), 212 }); } @@ -537,12 +537,12 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGER_12, TXTTEMPLATENAME_HID, new Integer(202), new Integer(56), INTEGERS[5], new Short((short) 28), resources.restxtTemplateName_value, new Integer(100) + INTEGER_12, TXTTEMPLATENAME_HID, 202, 56, INTEGERS[5], new Short((short) 28), resources.restxtTemplateName_value, 100 }); /* fileTemplatePath = insertFileControl("fileTemplatePath", FILETEMPLATEPATH_TEXT_CHANGED, 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}, - new Object[] { INTEGER_12,FILETEMPLATEPATH_HID,new Integer(172),new Integer(74),INTEGERS[5],new Short((short)29),new Integer(130)} + new Object[] { INTEGER_12,FILETEMPLATEPATH_HID,172,74,INTEGERS[5],new Short((short)29),130} ); */ optCreateFax = insertRadioButton("optCreateFax", OPTCREATEFAX_ITEM_CHANGED, @@ -552,7 +552,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTCREATEFAX_HID, resources.resoptCreateFax_value, new Integer(104), new Integer(111), INTEGERS[5], new Short((short) 30), new Integer(198) + INTEGERS[8], OPTCREATEFAX_HID, resources.resoptCreateFax_value, 104, 111, INTEGERS[5], new Short((short) 30), 198 }); optMakeChanges = insertRadioButton("optMakeChanges", OPTMAKECHANGES_ITEM_CHANGED, new String[] @@ -561,7 +561,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], OPTMAKECHANGES_HID, resources.resoptMakeChanges_value, new Integer(104), new Integer(123), INTEGERS[5], new Short((short) 31), new Integer(198) + INTEGERS[8], OPTMAKECHANGES_HID, resources.resoptMakeChanges_value, 104, 123, INTEGERS[5], new Short((short) 31), 198 }); lblFinalExplanation1 = insertLabel("lblFinalExplanation1", new String[] @@ -570,7 +570,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - new Integer(28), resources.reslblFinalExplanation1_value, Boolean.TRUE, new Integer(97), new Integer(28), INTEGERS[5], new Short((short) 34), new Integer(205) + 28, resources.reslblFinalExplanation1_value, Boolean.TRUE, 97, 28, INTEGERS[5], new Short((short) 34), 205 }); lblProceed = insertLabel("lblProceed", new String[] @@ -579,7 +579,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblProceed_value, new Integer(97), new Integer(100), INTEGERS[5], new Short((short) 35), new Integer(204) + INTEGERS[8], resources.reslblProceed_value, 97, 100, INTEGERS[5], new Short((short) 35), 204 }); lblFinalExplanation2 = insertLabel("lblFinalExplanation2", new String[] @@ -588,16 +588,16 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - new Integer(33), resources.reslblFinalExplanation2_value, Boolean.TRUE, new Integer(104), new Integer(145), INTEGERS[5], new Short((short) 36), new Integer(199) + 33, resources.reslblFinalExplanation2_value, Boolean.TRUE, 104, 145, INTEGERS[5], new Short((short) 36), 199 }); ImageControl2 = insertImage("ImageControl2", new String[] { - "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Short((short) 0), INTEGERS[10], "private:resource/dbu/image/19205", new Integer(92), new Integer(145), Boolean.FALSE, INTEGERS[5], new Short((short) 47), INTEGERS[10] + new Short((short) 0), INTEGERS[10], "private:resource/dbu/image/19205", 92, 145, Boolean.FALSE, INTEGERS[5], new Short((short) 47), INTEGERS[10] }); lblTemplateName = insertLabel("lblTemplateName", new String[] @@ -606,22 +606,22 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD }, new Object[] { - INTEGERS[8], resources.reslblTemplateName_value, new Integer(97), new Integer(58), INTEGERS[5], new Short((short) 57), new Integer(101) + INTEGERS[8], resources.reslblTemplateName_value, 97, 58, INTEGERS[5], new Short((short) 57), 101 }); /* lblTemplatePath = insertLabel("lblTemplatePath", new String[] {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[] { INTEGERS[8],resources.reslblTemplatePath_value,new Integer(97),new Integer(77),INTEGERS[5],new Short((short)58),new Integer(71)} + new Object[] { INTEGERS[8],resources.reslblTemplatePath_value,97,77,INTEGERS[5],new Short((short)58),71} ); */ 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[] { - fontDescriptor5, INTEGER_16, resources.reslblTitle6_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[5], new Short((short) 62), new Integer(212) + fontDescriptor5, INTEGER_16, resources.reslblTitle6_value, Boolean.TRUE, 91, INTEGERS[8], INTEGERS[5], new Short((short) 62), 212 }); } diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java index 8ee9f0472c57..8f9cf8107c7f 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java @@ -162,13 +162,13 @@ 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(); } XWindow xContainerWindow = myFaxDoc.xFrame.getContainerWindow(); - XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow); + XWindowPeer xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow); createWindowPeer(xWindowPeer); //add the Roadmap to the dialog: @@ -198,8 +198,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog removeTerminateListener(); exception.printStackTrace(System.out); running = false; - return; - } + } } public void cancelWizard() @@ -217,7 +216,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(); @@ -250,7 +249,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog if (bSaveSuccess) { saveConfiguration(); - XInteractionHandler xIH = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); + XInteractionHandler xIH = UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); PropertyValue loadValues[] = new PropertyValue[4]; loadValues[0] = new PropertyValue(); loadValues[0].Name = "AsTemplate"; @@ -275,7 +274,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog } Object oDoc = OfficeDocument.load(Desktop.getDesktop(xMSF), sPath, "_default", loadValues); XTextDocument xTextDocument = (com.sun.star.text.XTextDocument) oDoc; - XMultiServiceFactory xDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); ViewHandler myViewHandler = new ViewHandler(xDocMSF, xTextDocument); myViewHandler.setViewSetting("ZoomType", new Short(com.sun.star.view.DocumentZoomType.OPTIMAL)); } @@ -301,7 +300,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog try { //xComponent.dispose(); - XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, myFaxDoc.xFrame); + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, myFaxDoc.xFrame); xCloseable.close(false); } catch (CloseVetoException e) @@ -352,11 +351,11 @@ public class FaxWizardDialogImpl extends FaxWizardDialog try { Object oGS = xMSF.createInstance("com.sun.star.graphic.GraphicProvider"); - XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGS); + XGraphicProvider xGraphicProvider = UnoRuntime.queryInterface(XGraphicProvider.class, oGS); 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 +379,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 +394,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 }); @@ -424,42 +423,42 @@ public class FaxWizardDialogImpl extends FaxWizardDialog public void initializeElements() { - setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, new Boolean(myFaxDoc.hasElement("Company Logo"))); - setControlProperty("chkUseSubject", PropertyNames.PROPERTY_ENABLED, new Boolean(myFaxDoc.hasElement("Subject Line"))); - setControlProperty("chkUseDate", PropertyNames.PROPERTY_ENABLED, new Boolean(myFaxDoc.hasElement("Date"))); + setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myFaxDoc.hasElement("Company Logo"))); + setControlProperty("chkUseSubject", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myFaxDoc.hasElement("Subject Line"))); + setControlProperty("chkUseDate", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myFaxDoc.hasElement("Date"))); myFaxDoc.updateDateFields(); } 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("")) + xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.SalutationLabels[0]); } - xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); - if (xTextComponent.getText().equals("")) + xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.GreetingLabels[0]); } - xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType); - if (xTextComponent.getText().equals("")) + xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType); + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.CommunicationLabels[0]); } @@ -590,7 +589,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog public void txtTemplateNameTextChanged() { - XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); + XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); XDocumentProperties xDocProps = xDocPropsSuppl.getDocumentProperties(); String TitleName = txtTemplateName.getText(); xDocProps.setTitle(TitleName); @@ -769,7 +768,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog //enable/disable roadmap item for footer page XInterface BPaperItem = getRoadmapItemByID(RM_FOOTER); - Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bFooterPossible)); + Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bFooterPossible)); } catch (Exception exception) @@ -795,14 +794,14 @@ public class FaxWizardDialogImpl extends FaxWizardDialog public void chkUseSalutationItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); myFaxDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0)); - setControlProperty("lstSalutation", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseSalutation.getState() != 0)); + setControlProperty("lstSalutation", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(chkUseSalutation.getState() != 0)); } public void lstSalutationItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); myFaxDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0)); } @@ -812,14 +811,14 @@ public class FaxWizardDialogImpl extends FaxWizardDialog public void chkUseCommunicationItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType); myFaxDoc.switchUserField("CommunicationType", xTextComponent.getText(), (chkUseCommunicationType.getState() != 0)); - setControlProperty("lstCommunicationType", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseCommunicationType.getState() != 0)); + setControlProperty("lstCommunicationType", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(chkUseCommunicationType.getState() != 0)); } public void lstCommunicationItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType); myFaxDoc.switchUserField("CommunicationType", xTextComponent.getText(), (chkUseCommunicationType.getState() != 0)); } @@ -829,14 +828,14 @@ public class FaxWizardDialogImpl extends FaxWizardDialog public void chkUseGreetingItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); myFaxDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0)); - setControlProperty("lstGreeting", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseGreeting.getState() != 0)); + setControlProperty("lstGreeting", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(chkUseGreeting.getState() != 0)); } public void lstGreetingItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); myFaxDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0)); } @@ -846,7 +845,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog private void setPossibleFooter(boolean bState) { - setControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); + setControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); if (!bState) { chkUseFooter.setState((short) 0); diff --git a/wizards/com/sun/star/wizards/form/CallFormWizard.java b/wizards/com/sun/star/wizards/form/CallFormWizard.java index 0538eb5fa1b3..543a521c6ce7 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 = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { diff --git a/wizards/com/sun/star/wizards/form/DataEntrySetter.java b/wizards/com/sun/star/wizards/form/DataEntrySetter.java index ae042fa7de76..9a5624f627c5 100644 --- a/wizards/com/sun/star/wizards/form/DataEntrySetter.java +++ b/wizards/com/sun/star/wizards/form/DataEntrySetter.java @@ -66,7 +66,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTNEWDATAONLY", sNewDataOnly, new Integer(98), new Integer(25), IDataStep, new Short(curtabindex++), new Integer(195) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTNEWDATAONLY", sNewDataOnly, 98, 25, IDataStep, new Short(curtabindex++), 195 }); optDisplayAllData = CurUnoDialog.insertRadioButton("optDisplayAllData", "toggleCheckBoxes", this, @@ -76,7 +76,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTDISPLAYALLDATA", sDisplayAllData, new Integer(98), new Integer(50), new Short((short) 1), IDataStep, new Short(curtabindex++), new Integer(197) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTDISPLAYALLDATA", sDisplayAllData, 98, 50, new Short((short) 1), IDataStep, new Short(curtabindex++), 197 }); chknomodification = CurUnoDialog.insertCheckBox("chknomodification", null, new String[] @@ -85,7 +85,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOMODIFICATION", sNoModification, new Integer(108), new Integer(62), new Short((short) 0), IDataStep, new Short(curtabindex++), new Integer(189) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOMODIFICATION", sNoModification, 108, 62, new Short((short) 0), IDataStep, new Short(curtabindex++), 189 }); chknodeletion = CurUnoDialog.insertCheckBox("chknodeletion", null, new String[] @@ -94,7 +94,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNODELETION", sNoDeletion, new Integer(108), new Integer(74), new Short((short) 0), IDataStep, new Short(curtabindex++), new Integer(189) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNODELETION", sNoDeletion, 108, 74, new Short((short) 0), IDataStep, new Short(curtabindex++), 189 }); chknoaddition = CurUnoDialog.insertCheckBox("chknoaddition", null, new String[] @@ -103,7 +103,7 @@ public class DataEntrySetter }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOADDITION", sNoAddition, new Integer(108), new Integer(86), new Short((short) 0), IDataStep, new Short(curtabindex++), new Integer(191) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKNOADDITION", sNoAddition, 108, 86, new Short((short) 0), IDataStep, new Short(curtabindex++), 191 }); CurUnoDialog.insertLabel("lbldontdisplayExistingData", new String[] @@ -112,7 +112,7 @@ public class DataEntrySetter }, new Object[] { - new Integer(8), sdontdisplayExistingData, new Integer(108), new Integer(33), IDataStep, new Short(curtabindex++), new Integer(134) + 8, sdontdisplayExistingData, 108, 33, IDataStep, new Short(curtabindex++), 134 }); } @@ -125,14 +125,14 @@ public class DataEntrySetter boolean bAllowUpdates = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknomodification), PropertyNames.PROPERTY_STATE)).shortValue()) != 1; boolean bAllowDeletes = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknodeletion), PropertyNames.PROPERTY_STATE)).shortValue()) != 1; boolean bAllowInserts = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknoaddition), PropertyNames.PROPERTY_STATE)).shortValue()) != 1; - retProperties[0] = Properties.createProperty("AllowUpdates", new Boolean(bAllowUpdates)); - retProperties[1] = Properties.createProperty("AllowDeletes", new Boolean(bAllowDeletes)); - retProperties[2] = Properties.createProperty("AllowInserts", new Boolean(bAllowInserts)); + retProperties[0] = Properties.createProperty("AllowUpdates", Boolean.valueOf(bAllowUpdates)); + retProperties[1] = Properties.createProperty("AllowDeletes", Boolean.valueOf(bAllowDeletes)); + retProperties[2] = Properties.createProperty("AllowInserts", Boolean.valueOf(bAllowInserts)); } else { retProperties = new PropertyValue[1]; - retProperties[0] = Properties.createProperty("IgnoreResult", new Boolean(true)); + retProperties[0] = Properties.createProperty("IgnoreResult", Boolean.TRUE); } return retProperties; @@ -141,8 +141,8 @@ public class DataEntrySetter public void toggleCheckBoxes() { boolean bdisplayalldata = optDisplayAllData.getState(); - Helper.setUnoPropertyValue(UnoDialog.getModel(chknomodification), PropertyNames.PROPERTY_ENABLED, new Boolean(bdisplayalldata)); - Helper.setUnoPropertyValue(UnoDialog.getModel(chknodeletion), PropertyNames.PROPERTY_ENABLED, new Boolean(bdisplayalldata)); - Helper.setUnoPropertyValue(UnoDialog.getModel(chknoaddition), PropertyNames.PROPERTY_ENABLED, new Boolean(bdisplayalldata)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chknomodification), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdisplayalldata)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chknodeletion), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdisplayalldata)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chknoaddition), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdisplayalldata)); } } diff --git a/wizards/com/sun/star/wizards/form/FieldLinker.java b/wizards/com/sun/star/wizards/form/FieldLinker.java index b0fecf192bb8..146173ec9097 100644 --- a/wizards/com/sun/star/wizards/form/FieldLinker.java +++ b/wizards/com/sun/star/wizards/form/FieldLinker.java @@ -48,18 +48,9 @@ public class FieldLinker extends DBLimitedFieldSelection private XFixedText[] lblMasterFields; private XListBox[] lstSlaveFields; private XListBox[] lstMasterFields; - private final int SOMASTERINDEX = 1; - private final int SOSLAVEINDEX = 0; - private int SOFIRSTLINKLST = 0; - private int SOSECLINKLST = 1; - private int SOTHIRDLINKLST = 2; - private int SOFOURTHLINKLST = 3; private int[] SOLINKLST = null; private String[] sSlaveListHeader; private String[] sMasterListHeader; //CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 40); - private String sSlaveHidString; - private String sMasterHidString; - private Integer IListBoxPosX; public FieldLinker(WizardDialog _CurUnoDialog, int iStep, int iCompPosX, int iCompPosY, int iCompWidth, int _firsthelpid) { @@ -76,31 +67,31 @@ public class FieldLinker extends DBLimitedFieldSelection lblMasterFields = new XFixedText[rowcount]; lstSlaveFields = new XListBox[rowcount]; lstMasterFields = new XListBox[rowcount]; - SOFIRSTLINKLST = 0; - SOSECLINKLST = 1; - 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); + int SOFIRSTLINKLST = 0; + int SOSECLINKLST = 1; + int SOTHIRDLINKLST = 2; + int SOFOURTHLINKLST = 3; + Integer IListBoxPosX = new Integer(iCompPosX + 6); + 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 + SOFIRSTLINKLST, SOSECLINKLST, SOTHIRDLINKLST, SOFOURTHLINKLST }; } - sSlaveHidString = HelpIds.getHelpIdString(FirstHelpIndex + (i * 2)); - sMasterHidString = HelpIds.getHelpIdString(FirstHelpIndex + (i * 2) + 1); + String sSlaveHidString = HelpIds.getHelpIdString(FirstHelpIndex + (i * 2)); + String sMasterHidString = HelpIds.getHelpIdString(FirstHelpIndex + (i * 2) + 1); boolean bDoEnable = (i < 2); - lblSlaveFields[i] = CurUnoDialog.insertLabel("lblSlaveFieldLink" + new Integer(i + 1).toString(), + lblSlaveFields[i] = CurUnoDialog.insertLabel("lblSlaveFieldLink" + Integer.toString(i + 1), new String[] { PropertyNames.PROPERTY_ENABLED, 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[] { - new Boolean(bDoEnable), new Integer(8), sSlaveListHeader[i], new Integer(97), new Integer(iCurPosY), IStep, new Short(curtabindex++), new Integer(97) + Boolean.valueOf(bDoEnable), 8, sSlaveListHeader[i], 97, new Integer(iCurPosY), IStep, new Short(curtabindex++), 97 }); - lstSlaveFields[i] = CurUnoDialog.insertListBox("lstSlaveFieldLink" + new Integer(i + 1).toString(), SOLINKLST[i], null, new ItemListenerImpl(), + lstSlaveFields[i] = CurUnoDialog.insertListBox("lstSlaveFieldLink" + (i + 1), SOLINKLST[i], null, new ItemListenerImpl(), new String[] { "Dropdown", @@ -117,28 +108,28 @@ public class FieldLinker extends DBLimitedFieldSelection new Object[] { Boolean.TRUE, - new Boolean(bDoEnable), + Boolean.valueOf(bDoEnable), UIConsts.INTEGER_12, - sSlaveHidString, + sSlaveHidString, Short.valueOf(UnoDialog.getListBoxLineCount()), - new Integer(97), + 97, new Integer(iCurPosY + 10), IStep, new Short(curtabindex++), - new Integer(97) + 97 }); - lblMasterFields[i] = CurUnoDialog.insertLabel("lblMasterFieldLink" + new Integer(i + 1).toString(), + lblMasterFields[i] = CurUnoDialog.insertLabel("lblMasterFieldLink" + Integer.toString(i + 1), new String[] { PropertyNames.PROPERTY_ENABLED, 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[] { - new Boolean(bDoEnable), new Integer(8), sMasterListHeader[i], new Integer(206), new Integer(iCurPosY), IStep, new Short(curtabindex++), new Integer(97) + Boolean.valueOf(bDoEnable), 8, sMasterListHeader[i], 206, new Integer(iCurPosY), IStep, new Short(curtabindex++), 97 }); - lstMasterFields[i] = CurUnoDialog.insertListBox("lstMasterFieldLink" + new Integer(i + 1).toString(), SOLINKLST[i], null, new ItemListenerImpl(), + lstMasterFields[i] = CurUnoDialog.insertListBox("lstMasterFieldLink" + Integer.toString(i + 1), SOLINKLST[i], null, new ItemListenerImpl(), new String[] { "Dropdown", @@ -155,15 +146,15 @@ public class FieldLinker extends DBLimitedFieldSelection new Object[] { Boolean.TRUE, - new Boolean(bDoEnable), + Boolean.valueOf(bDoEnable), UIConsts.INTEGER_12, - sMasterHidString, + sMasterHidString, Short.valueOf(UnoDialog.getListBoxLineCount()), - new Integer(206), + 206, new Integer(iCurPosY + 10), IStep, new Short(curtabindex++), - new Integer(97) + 97 }); iCurPosY = iCurPosY + 38; } @@ -206,14 +197,14 @@ public class FieldLinker extends DBLimitedFieldSelection { if (i < rowcount) { - Helper.setUnoPropertyValue(UnoDialog.getModel(lblSlaveFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(lblMasterFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - if (bDoEnable == false) + Helper.setUnoPropertyValue(UnoDialog.getModel(lblSlaveFields[i]), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[i]), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(lblMasterFields[i]), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[i]), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + if (!bDoEnable) { - 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 +216,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); } } @@ -238,7 +229,9 @@ public class FieldLinker extends DBLimitedFieldSelection { // short[] MasterSelList = null; // short[] SlaveSelList = null; + int SOMASTERINDEX = 1; String[] MasterLinkNames = JavaTools.ArrayOutOfMultiDimArray(_LinkFieldNames, SOMASTERINDEX); + int SOSLAVEINDEX = 0; String[] SlaveLinkNames = JavaTools.ArrayOutOfMultiDimArray(_LinkFieldNames, SOSLAVEINDEX); String[] ViewMasterFieldNames = addNoneFieldItemToList(_AllMasterFieldNames); // add '-undefiened-' String[] ViewSlaveFieldNames = addNoneFieldItemToList(_AllSlaveFieldNames); diff --git a/wizards/com/sun/star/wizards/form/Finalizer.java b/wizards/com/sun/star/wizards/form/Finalizer.java index c5f12728e527..7cd25f012cd6 100644 --- a/wizards/com/sun/star/wizards/form/Finalizer.java +++ b/wizards/com/sun/star/wizards/form/Finalizer.java @@ -64,7 +64,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], slblFormName, new Integer(97), new Integer(25), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(111) + UIConsts.INTEGERS[8], slblFormName, 97, 25, UIConsts.INTEGERS[8], new Short(curtabindex++), 111 }); txtFormName = CurUnoDialog.insertTextField("txtFormName", "toggleFinishButton", this, new String[] @@ -73,7 +73,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGFORM_TXTPATH", new Integer(97), new Integer(35), UIConsts.INTEGERS[8], new Short((short) 82), "", new Integer(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[] @@ -82,7 +82,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], slblProceed, new Integer(97), new Integer(62), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(185) + UIConsts.INTEGERS[8], slblProceed, 97, 62, UIConsts.INTEGERS[8], new Short(curtabindex++), 185 }); CurUnoDialog.insertRadioButton("optWorkWithForm", null, new String[] @@ -91,7 +91,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTWORKWITHFORM", sWorkWithForm, new Integer(101), new Integer(77), new Short((short) 1), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(107) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTWORKWITHFORM", sWorkWithForm, 101, 77, new Short((short) 1), UIConsts.INTEGERS[8], new Short(curtabindex++), 107 }); optModifyForm = CurUnoDialog.insertRadioButton("optModifyForm", null, new String[] @@ -100,7 +100,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTMODIFYFORM", sModifyForm, new Integer(101), new Integer(89), UIConsts.INTEGERS[8], new Short(curtabindex++), new Integer(107) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTMODIFYFORM", sModifyForm, 101, 89, UIConsts.INTEGERS[8], new Short(curtabindex++), 107 }); } @@ -128,7 +128,7 @@ public class Finalizer public boolean getOpenForEditing() { - return optModifyForm.getState() ? true : false; + return optModifyForm.getState(); } public boolean finish() diff --git a/wizards/com/sun/star/wizards/form/FormConfiguration.java b/wizards/com/sun/star/wizards/form/FormConfiguration.java index 9c18ab47d79d..7d7425985f83 100644 --- a/wizards/com/sun/star/wizards/form/FormConfiguration.java +++ b/wizards/com/sun/star/wizards/form/FormConfiguration.java @@ -83,7 +83,7 @@ public class FormConfiguration }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKCREATESUBFORM", sSelectManually, new Integer(97), new Integer(26), ISubFormStep, new Short(curtabindex++), new Integer(160) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_CHKCREATESUBFORM", sSelectManually, 97, 26, ISubFormStep, new Short(curtabindex++), 160 }); optOnExistingRelation = CurUnoDialog.insertRadioButton("optOnExistingRelation", STOGGLESTEPS, this, new String[] @@ -92,7 +92,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTONEXISTINGRELATION", sOnExistingRelation, new Integer(107), new Integer(43), ISubFormStep, new Short(curtabindex++), new Integer(160) + Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTONEXISTINGRELATION", sOnExistingRelation, 107, 43, ISubFormStep, new Short(curtabindex++), 160 }); optSelectManually = CurUnoDialog.insertRadioButton("optSelectManually", STOGGLESTEPS, this, new String[] @@ -101,7 +101,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTSELECTMANUALLY", sOnManualRelation, new Integer(107), new Integer(99), new Short((short) 1), ISubFormStep, new Short(curtabindex++), new Integer(160) + Boolean.FALSE, UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGFORM_OPTSELECTMANUALLY", sOnManualRelation, 107, 99, new Short((short) 1), ISubFormStep, new Short(curtabindex++), 160 }); lblRelations = CurUnoDialog.insertLabel("lblSelectRelation", new String[] @@ -110,7 +110,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, new Integer(19), sSelectRelation, Boolean.TRUE, new Integer(119), new Integer(56), ISubFormStep, new Short(curtabindex++), new Integer(80) + Boolean.FALSE, 19, sSelectRelation, Boolean.TRUE, 119, 56, ISubFormStep, new Short(curtabindex++), 80 }); lstRelations = CurUnoDialog.insertListBox("lstrelations", SONEXISTINGRELATIONSELECTION, SONEXISTINGRELATIONSELECTION, this, new String[] @@ -119,7 +119,7 @@ public class FormConfiguration }, new Object[] { - Boolean.FALSE, new Integer(37), "HID:WIZARDS_HID_DLGFORM_lstRELATIONS", new Integer(201), new Integer(55), ISubFormStep, new Short(curtabindex++), new Integer(103) + Boolean.FALSE, 37, "HID:WIZARDS_HID_DLGFORM_lstRELATIONS", 201, 55, ISubFormStep, new Short(curtabindex++), 103 }); lblSubFormDescription = CurUnoDialog.insertLabel("lblSubFormDescription", new String[] @@ -128,7 +128,7 @@ public class FormConfiguration }, new Object[] { - new Integer(59), sSubFormDescription, Boolean.TRUE, new Integer(110), new Integer(120), ISubFormStep, new Short(curtabindex++), new Integer(190) + 59, sSubFormDescription, Boolean.TRUE, 110, 120, ISubFormStep, new Short(curtabindex++), 190 }); CurUnoDialog.insertInfoImage(97, 120, ISubFormStep.intValue()); } @@ -151,8 +151,8 @@ public class FormConfiguration public void toggleSubFormMode() { boolean bdoEnable = (this.chkcreateSubForm.getState() == 1); - Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable && bsupportsRelations)); - Helper.setUnoPropertyValue(UnoDialog.getModel(optSelectManually), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable && bsupportsRelations)); + Helper.setUnoPropertyValue(UnoDialog.getModel(optSelectManually), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable)); toggleSteps(); } @@ -161,10 +161,10 @@ 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))); + Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bsupportsRelations && (chkcreateSubForm.getState() == 1))); } public void toggleSteps() @@ -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() @@ -231,8 +231,8 @@ public class FormConfiguration private void toggleRelationsListbox() { boolean bdoenable = bsupportsRelations && this.optOnExistingRelation.getState() && (chkcreateSubForm.getState() == 1); - Helper.setUnoPropertyValue(UnoDialog.getModel(lblRelations), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstRelations), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(lblRelations), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstRelations), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenable)); } public boolean hasSubForm() diff --git a/wizards/com/sun/star/wizards/form/FormControlArranger.java b/wizards/com/sun/star/wizards/form/FormControlArranger.java index f5478525eab1..a87478f5690a 100644 --- a/wizards/com/sun/star/wizards/form/FormControlArranger.java +++ b/wizards/com/sun/star/wizards/form/FormControlArranger.java @@ -47,14 +47,13 @@ import com.sun.star.wizards.document.TimeStampControl; public class FormControlArranger { + public static final String LABELCONTROL = "LabelControl"; protected DatabaseControl[] DBControlList = null; - private XNameContainer xFormName; private XMultiServiceFactory xMSF; private Control[] LabelControlList = null; private XStatusIndicator xProgressBar; private FieldColumn[] FieldColumns; - private DatabaseControl curDBControl; // Control curLabelControl; private int icurArrangement; private boolean bIsFirstRun; @@ -68,23 +67,23 @@ public class FormControlArranger private static final double CMAXREDUCTION = 0.7; private FormHandler oFormHandler; private int iReduceWidth; - private int nXTCPos; - private int nYTCPos; - private int nXDBPos; - private int nYDBPos; - private int nTCHeight; - private int nTCWidth; - private int nDBHeight; - private int nDBWidth; - private int nMaxTCWidth; + private int m_currentLabelPosX; + private int m_currentLabelPosY; + private int m_currentControlPosX; + private int m_currentControlPosY; + private int m_LabelHeight; + private int m_LabelWidth; + private int m_dbControlHeight; + private int m_dbControlWidth; + private int m_MaxLabelWidth; private int nFormWidth; private int nFormHeight; - private int nMaxRowY; + private int m_currentMaxRowHeight; private int nSecMaxRowY; - private int nMaxColRightX; + private int m_maxPostionX; private int a; private int StartA; - private int nMaxDBYPos = 0; //the maximum YPosition of a DBControl in the form + private int m_controlMaxPosY = 0; //the maximum YPosition of a DBControl in the form private Short NBorderType = new Short((short) 1); //3-D Border public FormControlArranger(FormHandler _oFormHandler, XNameContainer _xFormName, CommandMetaData oDBMetaData, XStatusIndicator _xProgressBar, Point _StartPoint, Size _FormSize) @@ -102,14 +101,13 @@ public class FormControlArranger } // Note: on all Controls except for the checkbox the Label has to be set // a bit under the DBControl because its Height is also smaller + private int getLabelDiffHeight(int _index) { - if (curDBControl != null) + final DatabaseControl curDBControl = DBControlList[_index]; + if (curDBControl != null && curDBControl.getControlType() == FormHandler.SOCHECKBOX) { - if (curDBControl.getControlType() == FormHandler.SOCHECKBOX) - { - return getCheckBoxDiffHeight(_index); - } + return getCheckBoxDiffHeight(_index); } return oFormHandler.getBasicLabelDiffHeight(); } @@ -126,20 +124,17 @@ public class FormControlArranger private int getCheckBoxDiffHeight(int LastIndex) { - if ((LastIndex < DBControlList.length)) + if (LastIndex < DBControlList.length && DBControlList[LastIndex].getControlType() == FormHandler.SOCHECKBOX) { - if (DBControlList[LastIndex].getControlType() == FormHandler.SOCHECKBOX) - { - return (int) ((oFormHandler.getControlReferenceHeight() - DBControlList[LastIndex].getControlHeight()) / 2); - } + return (oFormHandler.getControlReferenceHeight() - DBControlList[LastIndex].getControlHeight()) / 2; } return 0; } - private boolean isReducable(int _index) + private boolean isReducable(int _index, int i_labelWidth, int i_dbControlWidth) { boolean bisreducable = false; - int ntype = this.FieldColumns[_index].getFieldType(); + int ntype = FieldColumns[_index].getFieldType(); switch (ntype) { case DataType.TINYINT: @@ -178,7 +173,7 @@ public class FormControlArranger default: bisreducable = true; } - if (nTCWidth > 0.9 * CMAXREDUCTION * nDBWidth) + if (bisreducable && i_labelWidth > 0.9 * CMAXREDUCTION * i_dbControlWidth) { bisreducable = false; } @@ -187,62 +182,54 @@ public class FormControlArranger private int getControlGroupWidth() { - if (nDBWidth > nTCWidth) + if (m_dbControlWidth > m_LabelWidth) { - return nDBWidth; + return m_dbControlWidth; } else { - return nTCWidth; + return m_LabelWidth; } } private void checkJustifiedPosition(int a) { int nBaseWidth = nFormWidth + cXOffset; - int nLeftDist = nMaxColRightX - nBaseWidth; - int nRightDist = nBaseWidth - (DBControlList[a].getPosition().X - this.cHoriDistance); + int nLeftDist = m_maxPostionX - nBaseWidth; + int nRightDist = nBaseWidth - (DBControlList[a].getPosition().X - cHoriDistance); if (nLeftDist < 0.5 * nRightDist) { // Fieldwidths in the line can be made smaller.. adjustLineWidth(StartA, a, nLeftDist, -1); - nYTCPos = nMaxRowY + cVertDistance; - nYDBPos = nYTCPos + nTCHeight; -// if ((nYDBPos + nDBHeight) > nMaxDBYPos) -// nMaxDBYPos = nYDBPos + nDBHeight; - nXTCPos = cXOffset; - nXDBPos = cXOffset; + m_currentLabelPosY = m_currentMaxRowHeight + cVertDistance; + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; + m_currentLabelPosX = cXOffset; + m_currentControlPosX = cXOffset; bIsFirstRun = true; StartA = a + 1; } else { // FieldWidths in the line can be made wider... - if (nYDBPos + nDBHeight == nMaxRowY) + if (m_currentControlPosY + m_dbControlHeight == m_currentMaxRowHeight) { // The last Control was the highest in the row - nYTCPos = nSecMaxRowY + cVertDistance; + m_currentLabelPosY = nSecMaxRowY; } else { - nYTCPos = nMaxRowY + cVertDistance; + m_currentLabelPosY = m_currentMaxRowHeight; } - nYDBPos = nYTCPos + nTCHeight; - nXDBPos = cXOffset; - nXTCPos = cXOffset; - this.LabelControlList[a].setPosition(new Point(cXOffset, nYTCPos)); - this.DBControlList[a].setPosition(new Point(cXOffset, nYDBPos)); + m_currentLabelPosY += cVertDistance; + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; + m_currentControlPosX = cXOffset; + m_currentLabelPosX = cXOffset; + LabelControlList[a].setPosition(new Point(cXOffset, m_currentLabelPosY)); + DBControlList[a].setPosition(new Point(cXOffset, m_currentControlPosY)); bIsFirstRun = true; - if (nDBWidth > nTCWidth) - { - checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true); - } - else - { - checkOuterPoints(nXDBPos, nTCWidth, nYDBPos, nDBHeight, true); - } - nXTCPos = nMaxColRightX + cHoriDistance; - nXDBPos = nXTCPos; + checkOuterPoints(m_currentControlPosX, m_dbControlWidth > m_LabelWidth ? m_dbControlWidth : m_LabelWidth, m_currentControlPosY, m_dbControlHeight, true); + m_currentLabelPosX = m_maxPostionX + cHoriDistance; + m_currentControlPosX = m_currentLabelPosX; adjustLineWidth(StartA, a - 1, nRightDist, 1); StartA = a; } @@ -278,42 +265,44 @@ public class FormControlArranger for (int i = StartIndex; i <= EndIndex; i++) { int nControlBaseWidth = 0; - curDBControl = this.DBControlList[i]; - Control curLabelControl = this.LabelControlList[i]; + DatabaseControl dbControl = DBControlList[i]; + Control curLabelControl = LabelControlList[i]; if (i != StartIndex) { curLabelControl.setPosition(new Point(iLocTCPosX, curLabelControl.getPosition().Y)); - curDBControl.setPosition(new Point(iLocTCPosX, curLabelControl.getPosition().Y + nTCHeight)); + dbControl.setPosition(new Point(iLocTCPosX, curLabelControl.getPosition().Y + m_LabelHeight)); } - if (((curLabelControl.getSize().Width > curDBControl.getSize().Width)) && (WidthFactor > 0)) + final Size labelSize = curLabelControl.getSize(); + Size controlSize = dbControl.getSize(); + if (((labelSize.Width > controlSize.Width)) && (WidthFactor > 0)) { - nControlBaseWidth = curLabelControl.getSize().Width; + nControlBaseWidth = labelSize.Width; } else { - nControlBaseWidth = curDBControl.getSize().Width; + nControlBaseWidth = controlSize.Width; } if (FieldColumns[i].getFieldType() == DataType.TIMESTAMP) { - TimeStampControl oDBTimeStampControl = (TimeStampControl) curDBControl; + TimeStampControl oDBTimeStampControl = (TimeStampControl) dbControl; nControlBaseWidth = oDBTimeStampControl.getSize().Width; - if (this.isReducable(i) || WidthFactor > 0) - { - oDBTimeStampControl.setSize(new Size(nControlBaseWidth + WidthFactor * CorrWidth, oDBTimeStampControl.getSize().Height)); - } } - else + if (WidthFactor > 0 || isReducable(i, labelSize.Width, controlSize.Width)) { - if (this.isReducable(i) || WidthFactor > 0) - { - curDBControl.setSize(new Size(nControlBaseWidth + WidthFactor * CorrWidth, curDBControl.getSize().Height)); - } + controlSize.Width = nControlBaseWidth + WidthFactor * CorrWidth; + dbControl.setSize(controlSize); + controlSize = dbControl.getSize(); + } + + if (labelSize.Width > controlSize.Width) + { + iLocTCPosX += labelSize.Width; } - iLocTCPosX = curDBControl.getPosition().X + curDBControl.getSize().Width + cHoriDistance; - if (curLabelControl.getSize().Width > curDBControl.getSize().Width) + else { - iLocTCPosX = curLabelControl.getPosition().X + curLabelControl.getSize().Width + cHoriDistance; + iLocTCPosX += controlSize.Width; } + iLocTCPosX += cHoriDistance; } if (WidthFactor > 0) { @@ -325,43 +314,38 @@ public class FormControlArranger } } - private void checkOuterPoints(int nXPos, int nWidth, int nYPos, int nHeight, boolean bIsDBField) + private void checkOuterPoints(int i_nXPos, int i_nWidth, int i_nYPos, int i_nHeight, boolean i_bIsDBField) { - int nColRightX; - if (icurArrangement == FormWizard.SOTOPJUSTIFIED) + if (icurArrangement == FormWizard.IN_BLOCK_TOP && i_bIsDBField) { - if (bIsDBField) + // Only at DBControls you can measure the Value of nMaxRowY + if (bIsFirstRun) { - // Only at DBControls you can measure the Value of nMaxRowY - if (bIsFirstRun) - { - nMaxRowY = nYPos + nHeight; - nSecMaxRowY = nMaxRowY; - } - else + m_currentMaxRowHeight = i_nYPos + i_nHeight; + nSecMaxRowY = m_currentMaxRowHeight; + } + else + { + int nRowY = i_nYPos + i_nHeight; + if (nRowY >= m_currentMaxRowHeight) { - int nRowY = nYPos + nHeight; - if (nRowY >= nMaxRowY) - { - int nOldMaxRowY = nMaxRowY; - nSecMaxRowY = nOldMaxRowY; - nMaxRowY = nRowY; - } + nSecMaxRowY = m_currentMaxRowHeight; + m_currentMaxRowHeight = nRowY; } } } // Find the outer right point if (bIsFirstRun) { - nMaxColRightX = nXPos + nWidth; + m_maxPostionX = i_nXPos + i_nWidth; bIsFirstRun = false; } else { - nColRightX = nXPos + nWidth; - if (nColRightX > nMaxColRightX) + int nColRightX = i_nXPos + i_nWidth; + if (nColRightX > m_maxPostionX) { - nMaxColRightX = nColRightX; + m_maxPostionX = nColRightX; } } } @@ -370,16 +354,16 @@ public class FormControlArranger { try { - this.NBorderType = _NBorderType; - this.setStartPoint(_aStartPoint); + NBorderType = _NBorderType; + setStartPoint(_aStartPoint); icurArrangement = _icurArrangement; initializePosSizes(); initializeControlColumn(-1); bIsVeryFirstRun = true; - nMaxRowY = 0; + m_currentMaxRowHeight = 0; nSecMaxRowY = 0; - this.nMaxColRightX = 0; - xProgressBar.start("", FieldColumns.length); + m_maxPostionX = 0; + xProgressBar.start(PropertyNames.EMPTY_STRING, FieldColumns.length); for (int i = 0; i < FieldColumns.length; i++) { try @@ -387,13 +371,12 @@ public class FormControlArranger insertLabel(i, _iAlign); insertDBControl(i); bIsVeryFirstRun = false; - DBControlList[i].setPropertyValue("LabelControl", LabelControlList[i].xPropertySet); + DBControlList[i].setPropertyValue(LABELCONTROL, LabelControlList[i].xPropertySet); resetPosSizes(i); xProgressBar.setValue(i + 1); } catch (RuntimeException e) { - int dummy = 0; } } xProgressBar.end(); @@ -426,19 +409,19 @@ public class FormControlArranger private void resetPosSizes(int LastIndex) { - int nYRefPos = nYDBPos; + int nYRefPos = m_currentControlPosY; switch (icurArrangement) { - case FormWizard.SOCOLUMNARLEFT: - nYDBPos = nYDBPos + nDBHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); - nYRefPos = nYDBPos; - if ((nYDBPos > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) + case FormWizard.COLUMNAR_LEFT: + m_currentControlPosY = m_currentControlPosY + m_dbControlHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); + nYRefPos = m_currentControlPosY; + if ((m_currentControlPosY > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) { repositionColumnarLeftControls(LastIndex); - nXTCPos = nMaxColRightX + 2 * cHoriDistance; - nXDBPos = nXTCPos + this.cLabelGap + nMaxTCWidth; - nYDBPos = cYOffset; - nYRefPos = nYDBPos; + m_currentLabelPosX = m_maxPostionX + 2 * cHoriDistance; + m_currentControlPosX = m_currentLabelPosX + cLabelGap + m_MaxLabelWidth; + m_currentControlPosY = cYOffset; + nYRefPos = m_currentControlPosY; initializeControlColumn(LastIndex); } else @@ -447,59 +430,63 @@ public class FormControlArranger /* a += 1;*/ ++a; } - nYTCPos = nYDBPos + this.getLabelDiffHeight(LastIndex); - if ((nYRefPos + nDBHeight) > nMaxDBYPos) + m_currentLabelPosY = m_currentControlPosY + getLabelDiffHeight(LastIndex); + if ((nYRefPos + m_dbControlHeight) > m_controlMaxPosY) { - nMaxDBYPos = nYRefPos + nDBHeight; + m_controlMaxPosY = nYRefPos + m_dbControlHeight; } break; - case FormWizard.SOCOLUMNARTOP: - nYTCPos = nYDBPos + nDBHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); - ; - if ((nYTCPos > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) + case FormWizard.COLUMNAR_TOP: + m_currentLabelPosY = m_currentControlPosY + m_dbControlHeight + cVertDistance + getCheckBoxDiffHeight(LastIndex); + + if ((m_currentLabelPosY > cYOffset + nFormHeight) || (LastIndex == (FieldColumns.length - 1))) { - nXDBPos = nMaxColRightX + cHoriDistance; - nXTCPos = nXDBPos; - nYRefPos = nYDBPos; - nYDBPos = cYOffset + nTCHeight + cVertDistance; - nYTCPos = cYOffset; + m_currentControlPosX = m_maxPostionX + cHoriDistance; + m_currentLabelPosX = m_currentControlPosX; + nYRefPos = m_currentControlPosY; + m_currentControlPosY = cYOffset + m_LabelHeight + cVertDistance; + m_currentLabelPosY = cYOffset; initializeControlColumn(LastIndex); } else { - a = a + 1; + ++a; } - if ((nYRefPos + nDBHeight + cVertDistance) > nMaxDBYPos) + if ((nYRefPos + m_dbControlHeight + cVertDistance) > m_controlMaxPosY) { - nMaxDBYPos = nYRefPos + nDBHeight + cVertDistance; + m_controlMaxPosY = nYRefPos + m_dbControlHeight + cVertDistance; } break; - case FormWizard.SOTOPJUSTIFIED: - if (this.isReducable(a)) + case FormWizard.IN_BLOCK_TOP: + if (isReducable(a, m_LabelWidth, m_dbControlWidth)) { - iReduceWidth = iReduceWidth + 1; + ++iReduceWidth; } - if (nMaxColRightX > cXOffset + nFormWidth) + //if (m_maxPostionX > (nFormWidth-cXOffset-cXOffset)) // cXOffset + nFormWidth + if (m_maxPostionX > cXOffset + nFormWidth) { - int nOldYTCPos = nYTCPos; checkJustifiedPosition(a); - nYRefPos = nYDBPos; + nYRefPos = m_currentControlPosY; } else { - nXTCPos = nMaxColRightX + cHoriDistance; + m_currentLabelPosX = m_maxPostionX + cHoriDistance; + } + if (a == FieldColumns.length - 1) + { + checkJustifiedPosition(a); + nYRefPos = m_currentControlPosY; } - a = a + 1; - if ((nYRefPos + nDBHeight) > nMaxDBYPos) + m_currentControlPosX = m_currentLabelPosX; + ++a; + if ((nYRefPos + m_dbControlHeight) > m_controlMaxPosY) { - nMaxDBYPos = nYRefPos + nDBHeight; + m_controlMaxPosY = nYRefPos + m_dbControlHeight; } break; } -// if ((nYRefPos + nDBHeight) > nMaxDBYPos) -// nMaxDBYPos = nYRefPos + nDBHeight; } private void repositionColumnarLeftControls(int LastIndex) @@ -509,42 +496,41 @@ public class FormControlArranger { if (i == StartA) { - nXTCPos = LabelControlList[i].getPosition().X; - nXDBPos = nXTCPos + nMaxTCWidth + cHoriDistance; + m_currentLabelPosX = LabelControlList[i].getPosition().X; + m_currentControlPosX = m_currentLabelPosX + m_MaxLabelWidth + cHoriDistance; } - LabelControlList[i].setSize(new Size(nMaxTCWidth, nTCHeight)); - resetDBShape(DBControlList[i], nXDBPos); - checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true); + LabelControlList[i].setSize(new Size(m_MaxLabelWidth, m_LabelHeight)); + resetDBShape(DBControlList[i], m_currentControlPosX); + checkOuterPoints(m_currentControlPosX, m_dbControlWidth, m_currentControlPosY, m_dbControlHeight, true); } } private void resetDBShape(Shape _curDBControl, int iXPos) { - int nYDBPos = _curDBControl.getPosition().Y; - nDBWidth = _curDBControl.getSize().Width; - nDBHeight = _curDBControl.getSize().Height; - _curDBControl.setPosition(new Point(iXPos, nYDBPos)); + m_dbControlWidth = _curDBControl.getSize().Width; + m_dbControlHeight = _curDBControl.getSize().Height; + _curDBControl.setPosition(new Point(iXPos, _curDBControl.getPosition().Y)); } private void initializePosSizes() { - this.nMaxDBYPos = 0; - nXTCPos = cXOffset; - nTCWidth = 2000; - nDBWidth = 2000; - nDBHeight = oFormHandler.getControlReferenceHeight(); - nTCHeight = oFormHandler.getLabelHeight(); + m_controlMaxPosY = 0; + m_currentLabelPosX = cXOffset; + m_LabelWidth = 2000; + m_dbControlWidth = 2000; + m_dbControlHeight = oFormHandler.getControlReferenceHeight(); + m_LabelHeight = oFormHandler.getLabelHeight(); iReduceWidth = 0; - if (icurArrangement == FormWizard.SOCOLUMNARLEFT) + if (icurArrangement == FormWizard.COLUMNAR_LEFT) { - nYTCPos = cYOffset + this.getLabelDiffHeight(0); - nXDBPos = cXOffset + 3050; - nYDBPos = cYOffset; + m_currentLabelPosY = cYOffset + getLabelDiffHeight(0); + m_currentControlPosX = cXOffset + 3050; + m_currentControlPosY = cYOffset; } else { - nXDBPos = cXOffset; - nYTCPos = cYOffset; + m_currentControlPosX = cXOffset; + m_currentLabelPosY = cYOffset; } } @@ -552,65 +538,65 @@ public class FormControlArranger { try { + Point aPoint = new Point(m_currentLabelPosX, m_currentLabelPosY); + Size aSize = new Size(m_LabelWidth, m_LabelHeight); if (bControlsareCreated) { - LabelControlList[i].setPosition(new Point(nXTCPos, nYTCPos)); - if (icurArrangement != FormWizard.SOCOLUMNARLEFT) + LabelControlList[i].setPosition(aPoint); + if (icurArrangement != FormWizard.COLUMNAR_LEFT) { - nTCWidth = LabelControlList[i].getPreferredWidth(FieldColumns[i].getFieldTitle()); - LabelControlList[i].setSize(new Size(nTCWidth, nTCHeight)); + m_LabelWidth = LabelControlList[i].getPreferredWidth(FieldColumns[i].getFieldTitle()); + aSize.Width = m_LabelWidth; + LabelControlList[i].setSize(aSize); } else { - nTCWidth = LabelControlList[i].getSize().Width; + m_LabelWidth = LabelControlList[i].getSize().Width; } } else { - Point aPoint = new Point(nXTCPos, nYTCPos); - Size aSize = new Size(nTCWidth, nTCHeight); final String sFieldName = FieldColumns[i].getFieldName(); - this.LabelControlList[i] = new Control(oFormHandler, xFormName, FormHandler.SOLABEL, sFieldName, aPoint, aSize); - if (bIsVeryFirstRun) + LabelControlList[i] = new Control(oFormHandler, xFormName, FormHandler.SOLABEL, sFieldName, aPoint, aSize); + if (bIsVeryFirstRun && icurArrangement == FormWizard.COLUMNAR_TOP) { - if (icurArrangement == FormWizard.SOCOLUMNARTOP) - { - nYDBPos = nYTCPos + nTCHeight; - } - } - String sTitle = FieldColumns[i].getFieldTitle(); - nTCWidth = LabelControlList[i].getPreferredWidth(sTitle); + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; } + final String sTitle = FieldColumns[i].getFieldTitle(); + m_LabelWidth = LabelControlList[i].getPreferredWidth(sTitle); + aSize.Width = m_LabelWidth; + LabelControlList[i].setSize(aSize); + } Control curLabelControl = LabelControlList[i]; - if (icurArrangement == FormWizard.SOCOLUMNARLEFT) + if (icurArrangement == FormWizard.COLUMNAR_LEFT) { // Note This If Sequence must be called before retrieving the outer Points if (bIsFirstRun) { - nMaxTCWidth = nTCWidth; + m_MaxLabelWidth = m_LabelWidth; bIsFirstRun = false; } - else if (nTCWidth > nMaxTCWidth) + else if (m_LabelWidth > m_MaxLabelWidth) { - nMaxTCWidth = nTCWidth; + m_MaxLabelWidth = m_LabelWidth; } } - checkOuterPoints(nXTCPos, nTCWidth, nYTCPos, nTCHeight, false); - if ((icurArrangement == FormWizard.SOCOLUMNARTOP) || (icurArrangement == FormWizard.SOTOPJUSTIFIED)) + checkOuterPoints(m_currentLabelPosX, m_LabelWidth, m_currentLabelPosY, m_LabelHeight, false); + if ((icurArrangement == FormWizard.COLUMNAR_TOP) || (icurArrangement == FormWizard.IN_BLOCK_TOP)) { - nXDBPos = nXTCPos; - nYDBPos = nYTCPos + nTCHeight; - curLabelControl.xPropertySet.setPropertyValue("Align", new Short((short) com.sun.star.awt.TextAlign.LEFT)); + m_currentControlPosX = m_currentLabelPosX; + m_currentControlPosY = m_currentLabelPosY + m_LabelHeight; + curLabelControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_ALIGN, new Short((short) com.sun.star.awt.TextAlign.LEFT)); } else { - curLabelControl.xPropertySet.setPropertyValue("Align", new Short((short) _iAlign)); + curLabelControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_ALIGN, new Short((short) _iAlign)); } if (!bControlsareCreated) { - curLabelControl.setSize(new Size(nTCWidth, nTCHeight)); + curLabelControl.setSize(new Size(m_LabelWidth, m_LabelHeight)); } -// if (CurHelpText != ""){ +// if (CurHelpText != PropertyNames.EMPTY_STRING){ // oModel.HelpText = CurHelptext; // } } @@ -627,7 +613,7 @@ public class FormControlArranger String sFieldName = FieldColumns[i].getFieldName(); int nFieldType = FieldColumns[i].getFieldType(); - Point aPoint = new Point(nXDBPos, nYDBPos); + Point aPoint = new Point(m_currentControlPosX, m_currentControlPosY); if (bControlsareCreated) { DBControlList[i].setPosition(aPoint); @@ -644,29 +630,30 @@ 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); } } } DatabaseControl aDBControl = DBControlList[i]; - nDBHeight = aDBControl.getControlHeight(); - nDBWidth = aDBControl.getControlWidth(); + m_dbControlHeight = aDBControl.getControlHeight(); + m_dbControlWidth = aDBControl.getControlWidth(); if (nFieldType != DataType.TIMESTAMP) { - aDBControl.setSize(new Size(nDBWidth, nDBHeight)); + aDBControl.setSize(new Size(m_dbControlWidth, m_dbControlHeight)); } if (aDBControl.getControlType() == FormHandler.SOCHECKBOX) { - nYDBPos = nYDBPos + /*(int)*/ ((oFormHandler.getControlReferenceHeight() - nDBHeight) / 2); - aPoint = new Point(nXDBPos, nYDBPos); + m_currentControlPosY = m_currentControlPosY + /*(int)*/ ((oFormHandler.getControlReferenceHeight() - m_dbControlHeight) / 2); + aPoint = new Point(m_currentControlPosX, m_currentControlPosY); aDBControl.setPosition(aPoint); } if (nFieldType == DataType.LONGVARCHAR) /* memo */ + { Helper.setUnoPropertyValue(LabelControlList[i], PropertyNames.PROPERTY_MULTILINE, Boolean.TRUE); } - checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true); - aDBControl.setPropertyValue("Border", NBorderType); + checkOuterPoints(m_currentControlPosX, m_dbControlWidth, m_currentControlPosY, m_dbControlHeight, true); + aDBControl.setPropertyValue(PropertyNames.PROPERTY_BORDER, NBorderType); } catch (Exception e) { @@ -688,12 +675,12 @@ public class FormControlArranger public int getFormHeight() { - return nMaxDBYPos - this.cYOffset; + return m_controlMaxPosY - cYOffset; } public int getEntryPointY() { - if (this.icurArrangement == FormWizard.SOCOLUMNARTOP) + if (icurArrangement == FormWizard.COLUMNAR_TOP) { Control curLabelControl2 = LabelControlList[0]; return curLabelControl2.getPosition().Y; @@ -707,8 +694,8 @@ public class FormControlArranger public void setStartPoint(Point _aPoint) { - this.cXOffset = _aPoint.X; - this.cYOffset = _aPoint.Y; + cXOffset = _aPoint.X; + cYOffset = _aPoint.Y; } public void adjustYPositions(int _diffY) @@ -717,10 +704,10 @@ public class FormControlArranger { Point aPoint = DBControlList[i].getPosition(); DBControlList[i].setPosition(new Point(aPoint.X, aPoint.Y - _diffY)); - aPoint = this.LabelControlList[i].getPosition(); + aPoint = LabelControlList[i].getPosition(); LabelControlList[i].setPosition(new Point(aPoint.X, aPoint.Y - _diffY)); } - nMaxDBYPos = -_diffY; + m_controlMaxPosY = -_diffY; cYOffset = -_diffY; } diff --git a/wizards/com/sun/star/wizards/form/FormDocument.java b/wizards/com/sun/star/wizards/form/FormDocument.java index 0070fed3ada1..f12455c264d5 100644 --- a/wizards/com/sun/star/wizards/form/FormDocument.java +++ b/wizards/com/sun/star/wizards/form/FormDocument.java @@ -152,7 +152,7 @@ public class FormDocument extends TextDocument { if (oControlForms.size() == 0) { - final ControlForm aMainControlForm = new ControlForm(this, SOMAINFORM, aMainFormPoint, getMainFormSize(FormWizard.SOGRID)); + final ControlForm aMainControlForm = new ControlForm(this, SOMAINFORM, aMainFormPoint, getMainFormSize(FormWizard.AS_GRID)); oControlForms.addElement(aMainControlForm); } else @@ -213,7 +213,7 @@ public class FormDocument extends TextDocument int nMainFormHeight = nFormHeight; if (bhasSubForm) { - if (_curArrangement == FormWizard.SOGRID) + if (_curArrangement == FormWizard.AS_GRID) { nMainFormHeight = (int) ((double) (nFormHeight - SOFORMGAP) / 2); } @@ -223,8 +223,7 @@ public class FormDocument extends TextDocument nMainFormHeight = (int) (((double) getMainFieldCount() / (double) nTotalFieldCount) * ((double) (nFormHeight - SOFORMGAP) / 2)); } } - Size aMainFormSize = new Size(nFormWidth, nMainFormHeight); - return aMainFormSize; + return new Size(nFormWidth, nMainFormHeight); } private Size getSubFormSize() @@ -233,8 +232,7 @@ public class FormDocument extends TextDocument // int nSubFormFieldCount = this.oSubFormDBMetaData.FieldNames.length; // int totfieldcount = oMainFormDBMetaData.FieldNames.length + nSubFormFieldCount; int nMainFormHeight = ((ControlForm) oControlForms.get(0)).getActualFormHeight(); - Size aSubFormSize = new Size(nFormWidth, nFormHeight - nMainFormHeight - SOFORMGAP); - return aSubFormSize; + return new Size(nFormWidth, nFormHeight - nMainFormHeight - SOFORMGAP); } private Point getSubFormPoint() @@ -248,7 +246,7 @@ public class FormDocument extends TextDocument { ControlForm oMainControlForm = (ControlForm) oControlForms.get(0); oMainControlForm.setFormSize(getMainFormSize(oMainControlForm.curArrangement)); - if (oMainControlForm.curArrangement == FormWizard.SOGRID) + if (oMainControlForm.curArrangement == FormWizard.AS_GRID) { oMainControlForm.oGridControl.setSize(oMainControlForm.getFormSize()); } @@ -265,8 +263,8 @@ public class FormDocument extends TextDocument { ControlForm oMainControlForm = (ControlForm) oControlForms.get(0); ControlForm oSubControlForm = (ControlForm) oControlForms.get(1); - oSubControlForm.setFormSize(new Size(nFormWidth, (int) nFormHeight - oMainControlForm.getFormSize().Height)); - if (oSubControlForm.curArrangement == FormWizard.SOGRID) + oSubControlForm.setFormSize(new Size(nFormWidth, nFormHeight - oMainControlForm.getFormSize().Height)); + if (oSubControlForm.curArrangement == FormWizard.AS_GRID) { Point aPoint = oSubControlForm.oGridControl.getPosition(); int idiffheight = oSubControlForm.getEntryPointY() - oMainControlForm.getActualFormHeight() - oMainControlForm.aStartPoint.Y - SOFORMGAP; @@ -316,7 +314,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(); } @@ -378,7 +376,7 @@ public class FormDocument extends TextDocument { xFormContainer = oFormHandler.insertFormbyName(_sname); } - xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xFormContainer); + xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xFormContainer); if (_sname.equals(SOMAINFORM)) { oDBMetaData = oFormDocument.oMainFormDBMetaData; @@ -406,13 +404,13 @@ public class FormDocument extends TextDocument } else { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { oFormHandler.moveShapesToNirwana(getLabelControls()); oFormHandler.moveShapesToNirwana(getDatabaseControls()); } } - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { insertGridControl(_NBorderType); badaptControlStyles = true; @@ -485,7 +483,7 @@ public class FormDocument extends TextDocument private int getActualFormHeight() { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { return oGridControl.xShape.getSize().Height; } @@ -497,7 +495,7 @@ public class FormDocument extends TextDocument private int getEntryPointY() { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { return oGridControl.xShape.getPosition().Y; } @@ -512,8 +510,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); @@ -551,16 +549,16 @@ public class FormDocument extends TextDocument { try { - curArrangement = FormWizard.SOGRID; + curArrangement = FormWizard.AS_GRID; if (Name.equals(SOMAINFORM)) { - oGridControl = new GridControl(xMSF, Name + "_Grid", oFormHandler, xFormContainer, oDBMetaData.FieldColumns, aStartPoint, getMainFormSize(FormWizard.SOGRID)); + oGridControl = new GridControl(xMSF, Name + "_Grid", oFormHandler, xFormContainer, oDBMetaData.FieldColumns, aStartPoint, getMainFormSize(FormWizard.AS_GRID)); } else { oGridControl = new GridControl(xMSF, Name + "_Grid", oFormHandler, xFormContainer, oDBMetaData.FieldColumns, aStartPoint, getSubFormSize()); } - oGridControl.xPropertySet.setPropertyValue("Border", _NBorderType); + oGridControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, _NBorderType); } catch (Exception e) { @@ -576,7 +574,7 @@ public class FormDocument extends TextDocument { for (int i = 0; i < getLabelControls().length; i++) { - if (curArrangement == FormWizard.SOGRID) + if (curArrangement == FormWizard.AS_GRID) { if ((oLabelControls[i] != null) && (oDBControls[i] != null)) { diff --git a/wizards/com/sun/star/wizards/form/FormWizard.java b/wizards/com/sun/star/wizards/form/FormWizard.java index f75f3e1b84ab..cff52f46229b 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; @@ -66,30 +66,30 @@ public class FormWizard extends DatabaseObjectWizard public static final int SODATA_PAGE = 6; public static final int SOSTYLE_PAGE = 7; public static final int SOSTORE_PAGE = 8; - public static final int SOCOLUMNARLEFT = 1; - public static final int SOCOLUMNARTOP = 2; - public static final int SOGRID = 3; - public static final int SOTOPJUSTIFIED = 4; + public static final int COLUMNAR_LEFT = 1; + public static final int COLUMNAR_TOP = 2; + public static final int AS_GRID = 3; + public static final int IN_BLOCK_TOP = 4; private String slblTables; private boolean m_openForEditing; private boolean m_success = false; private String FormName; - public FormWizard( XMultiServiceFactory i_servicFactory, final PropertyValue[] i_wizardContext ) + public FormWizard(XMultiServiceFactory i_servicFactory, final PropertyValue[] i_wizardContext) { - super( i_servicFactory, 34400, i_wizardContext ); + super(i_servicFactory, 34400, i_wizardContext); super.addResourceHandler("FormWizard", "dbw"); Helper.setUnoPropertyValues(xDialogModel, new String[] { - PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(210), Boolean.TRUE, "DialogForm", new Integer(102), new Integer(41), new Integer(1), new Short((short) 0), m_oResource.getResText(UIConsts.RID_FORM), new Integer(310) + 210, Boolean.TRUE, "DialogForm", 102, 41, 1, new Short((short) 0), m_oResource.getResText(UIConsts.RID_FORM), 310 }); drawNaviBar(); - if (getFormResources() == true) + if (getFormResources()) { setRightPaneHeaders(m_oResource, UIConsts.RID_FORM + 90, 8); } @@ -117,7 +117,7 @@ public class FormWizard extends DatabaseObjectWizard RelationController oRelationController = new RelationController(curFormDocument.oMainFormDBMetaData, sCommandName); curFormConfiguration.initialize(curSubFormFieldSelection, oRelationController); } - break; + break; case SOSUBFORMFIELDS_PAGE: { String sPreSelectedTableName = curFormConfiguration.getreferencedTableName(); @@ -133,14 +133,14 @@ public class FormWizard extends DatabaseObjectWizard curSubFormFieldSelection.preselectCommand(sPreSelectedTableName, bReadOnly); } } - break; + break; case SOFIELDLINKER_PAGE: { final String[] aMainFieldNames = curFormDocument.oMainFormDBMetaData.getFieldNames(); final String[] aSubFieldNames = curFormDocument.oSubFormDBMetaData.getFieldNames(); curFieldLinker.initialize(aMainFieldNames, aSubFieldNames, curFormDocument.LinkFieldNames); } - break; + break; case SOCONTROL_PAGE: curControlArranger.enableSubFormImageList(curFormConfiguration.hasSubForm()); break; @@ -153,7 +153,7 @@ public class FormWizard extends DatabaseObjectWizard String sTableName = this.curDBCommandFieldSelection.getSelectedCommandName(); this.curFinalizer.initialize(sTableName, curFormDocument); } - break; + break; default: break; } @@ -186,9 +186,10 @@ public class FormWizard extends DatabaseObjectWizard curFormDocument.LinkFieldNames = JavaTools.removeOutdatedFields(curFormDocument.LinkFieldNames, aMainFieldNames, 1); } catch (java.lang.Exception e) - {} + { + } } - break; + break; case SOSUBFORM_PAGE: break; case SOSUBFORMFIELDS_PAGE: @@ -203,9 +204,10 @@ public class FormWizard extends DatabaseObjectWizard curFormDocument.LinkFieldNames = JavaTools.removeOutdatedFields(curFormDocument.LinkFieldNames, aSubFieldNames, 0); } catch (java.lang.Exception e) - {} + { + } } - break; + break; case SOFIELDLINKER_PAGE: curFormDocument.LinkFieldNames = curFieldLinker.getLinkFieldNames(); break; @@ -235,7 +237,7 @@ public class FormWizard extends DatabaseObjectWizard }, new Object[] { - new Integer(28), sShowBinaryFields, Boolean.TRUE, new Integer(95), new Integer(154), new Integer(SOMAIN_PAGE), new Integer(210) + 28, sShowBinaryFields, Boolean.TRUE, 95, 154, new Integer(SOMAIN_PAGE), 210 }); curFormConfiguration = new FormConfiguration(this); @@ -250,7 +252,7 @@ public class FormWizard extends DatabaseObjectWizard }, new Object[] { - new Integer(28), sShowBinaryFields, Boolean.TRUE, new Integer(95), new Integer(154), new Integer(SOSUBFORMFIELDS_PAGE), new Integer(210) + 28, sShowBinaryFields, Boolean.TRUE, 95, 154, new Integer(SOSUBFORMFIELDS_PAGE), 210 }); curFormDocument.xProgressBar.setValue(40); @@ -337,24 +339,24 @@ public class FormWizard extends DatabaseObjectWizard try { curFormDocument = new FormDocument(xMSF); - if ( curFormDocument.oMainFormDBMetaData.getConnection( m_wizardContext ) ) + if (curFormDocument.oMainFormDBMetaData.getConnection(m_wizardContext)) { curFormDocument.oSubFormDBMetaData.getConnection(new PropertyValue[] { - Properties.createProperty("ActiveConnection", curFormDocument.oMainFormDBMetaData.DBConnection) + Properties.createProperty(PropertyNames.ACTIVE_CONNECTION, curFormDocument.oMainFormDBMetaData.DBConnection) }); curFormDocument.xProgressBar.setValue(20); buildSteps(); - this.curDBCommandFieldSelection.preselectCommand( m_wizardContext, false ); + this.curDBCommandFieldSelection.preselectCommand(m_wizardContext, false); XWindowPeer xWindowPeer2 = createWindowPeer(curFormDocument.xWindowPeer); - curFormDocument.oMainFormDBMetaData.setWindowPeer( xWindowPeer2 ); + curFormDocument.oMainFormDBMetaData.setWindowPeer(xWindowPeer2); insertFormRelatedSteps(); short dialogReturn = executeDialog(curFormDocument.xFrame); xComponent.dispose(); - if ( ( dialogReturn == 0 ) && m_success ) + if ((dialogReturn == 0) && m_success) { - curFormDocument.oMainFormDBMetaData.addFormDocument( curFormDocument.xComponent ); - loadSubComponent( DatabaseObject.FORM, FormName, m_openForEditing ); + curFormDocument.oMainFormDBMetaData.addFormDocument(curFormDocument.xComponent); + loadSubComponent(DatabaseObject.FORM, FormName, m_openForEditing); } } } @@ -396,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); @@ -432,6 +434,7 @@ public class FormWizard extends DatabaseObjectWizard } } // @Override + public void moveItemDown(String item) { } @@ -458,7 +461,7 @@ public class FormWizard extends DatabaseObjectWizard curDBCommandFieldSelection.setModified(true); boolean benable = curDBCommandFieldSelection.getSelectedFieldNames().length > 0; enablefromStep(SOSUBFORM_PAGE, benable); - setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, new Boolean(benable)); + setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable)); if (benable) { if (curFormConfiguration.hasSubForm()) @@ -471,12 +474,7 @@ public class FormWizard extends DatabaseObjectWizard setStepEnabled(SOFIELDLINKER_PAGE, false); } } - setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, new Boolean(benable)); + setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable)); } } } - - - - - diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java index 5098a1ffbb74..9f6f6d6160dd 100644 --- a/wizards/com/sun/star/wizards/form/StyleApplier.java +++ b/wizards/com/sun/star/wizards/form/StyleApplier.java @@ -116,17 +116,17 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[8], sPageStyles, new Integer(92), new Integer(25), IStyleStep, new Short(curtabindex++), new Integer(90) + UIConsts.INTEGERS[8], sPageStyles, 92, 25, IStyleStep, new Short(curtabindex++), 90 }); 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[] { - new Integer(143), "HID:WIZARDS_HID_DLGFORM_LSTSTYLES", new Integer(92), new Integer(35), SelLayoutPos, IStyleStep, this.StyleNames, new Short(curtabindex++), new Integer(90) + 143, "HID:WIZARDS_HID_DLGFORM_LSTSTYLES", 92, 35, SelLayoutPos, IStyleStep, this.StyleNames, new Short(curtabindex++), 90 }); optNoBorder = CurUnoDialog.insertRadioButton("otpNoBorder", SCHANGEBORDERTYPE, this, @@ -136,7 +136,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDNOBORDER", sNoBorder, new Integer(196), new Integer(39), IStyleStep, new Short(curtabindex++), "0", new Integer(93) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDNOBORDER", sNoBorder, 196, 39, IStyleStep, new Short(curtabindex++), "0", 93 }); opt3DLook = CurUnoDialog.insertRadioButton("otp3DLook", SCHANGEBORDERTYPE, this, @@ -146,7 +146,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", s3DLook, new Integer(196), new Integer(53), new Short((short) 1), IStyleStep, new Short(curtabindex++), "1", new Integer(93) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", s3DLook, 196, 53, new Short((short) 1), IStyleStep, new Short(curtabindex++), "1", 93 }); optFlat = CurUnoDialog.insertRadioButton("otpFlat", SCHANGEBORDERTYPE, this, @@ -156,7 +156,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDSIMPLEBORDER", sFlat, new Integer(196), new Integer(67), IStyleStep, new Short(curtabindex++), "2", new Integer(93) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDSIMPLEBORDER", sFlat, 196, 67, IStyleStep, new Short(curtabindex++), "2", 93 }); CurUnoDialog.insertFixedLine("lnFieldBorder", @@ -166,7 +166,7 @@ public class StyleApplier }, new Object[] { - UIConsts.INTEGERS[8], sFieldBorder, new Integer(192), new Integer(25), IStyleStep, new Short(curtabindex++), new Integer(98) + UIConsts.INTEGERS[8], sFieldBorder, 192, 25, IStyleStep, new Short(curtabindex++), 98 }); // } // catch (Exception e) @@ -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); } } @@ -187,7 +187,7 @@ public class StyleApplier try { Object oRootNode = Configuration.getConfigurationRoot(xMSF, "org.openoffice.Office.FormWizard/FormWizard/Styles", false); - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oRootNode); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, oRootNode); StyleNodeNames = xNameAccess.getElementNames(); StyleNames = new String[StyleNodeNames.length]; FileNames = new String[StyleNodeNames.length]; @@ -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]; @@ -281,10 +281,10 @@ public class StyleApplier for (int m = 0; m < curFormDocument.oControlForms.size(); m++) { FormDocument.ControlForm curControlForm = ((FormDocument.ControlForm) curFormDocument.oControlForms.get(m)); - if (curControlForm.getArrangemode() == FormWizard.SOGRID) + if (curControlForm.getArrangemode() == FormWizard.AS_GRID) { GridControl oGridControl = curControlForm.getGridControl(); - oGridControl.xPropertySet.setPropertyValue("Border", IBorderValue); + oGridControl.xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue); } else { @@ -297,17 +297,17 @@ public class StyleApplier for (int i = 0; i < 2; i++) { XPropertySet xPropertySet = oTimeStampControl.getControlofGroupShapeByIndex(i); - if (xPropertySet.getPropertySetInfo().hasPropertyByName("Border")) + if (xPropertySet.getPropertySetInfo().hasPropertyByName(PropertyNames.PROPERTY_BORDER)) { - xPropertySet.setPropertyValue("Border", IBorderValue); + xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue); } } } else { - if (DBControls[n].xPropertySet.getPropertySetInfo().hasPropertyByName("Border")) + if (DBControls[n].xPropertySet.getPropertySetInfo().hasPropertyByName(PropertyNames.PROPERTY_BORDER)) { - DBControls[n].xPropertySet.setPropertyValue("Border", IBorderValue); + DBControls[n].xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue); } } } @@ -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) @@ -439,7 +439,7 @@ public class StyleApplier for (int m = 0; m < curFormDocument.oControlForms.size(); m++) { FormDocument.ControlForm curControlForm = ((FormDocument.ControlForm) curFormDocument.oControlForms.get(m)); - if (curControlForm.getArrangemode() == FormWizard.SOGRID) + if (curControlForm.getArrangemode() == FormWizard.AS_GRID) { if (_iStyleColors[SOLABELTEXTCOLOR] > -1) { diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java index d4cd1ccc7cb6..82a063c1bb7d 100644 --- a/wizards/com/sun/star/wizards/form/UIControlArranger.java +++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java @@ -83,7 +83,7 @@ public class UIControlArranger }, new Object[] { - UIConsts.INTEGERS[8], sLabelPlacment, new Integer(97), new Integer(25), IControlStep, new Short(curtabindex++), new Integer(207) + UIConsts.INTEGERS[8], sLabelPlacment, 97, 25, IControlStep, new Short(curtabindex++), 207 }); // Radio Button "Align Left" optAlignLeft = CurUnoDialog.insertRadioButton("optAlignLeft", SOALIGNMETHOD, this, @@ -93,7 +93,7 @@ public class UIControlArranger }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNLEFT", sAlignLeft, new Integer(107), new Integer(38), new Short((short) 1), IControlStep, new Short(curtabindex++), new Integer(171) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNLEFT", sAlignLeft, 107, 38, new Short((short) 1), IControlStep, new Short(curtabindex++), 171 }); // Radio Button "Align Right" optAlignRight = CurUnoDialog.insertRadioButton("optAlignRight", SOALIGNMETHOD, this, @@ -103,7 +103,7 @@ public class UIControlArranger }, new Object[] { - UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", sAlignRight, Boolean.TRUE, new Integer(107), new Integer(50), IControlStep, new Short(curtabindex++), new Integer(171) + UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", sAlignRight, Boolean.TRUE, 107, 50, IControlStep, new Short(curtabindex++), 171 }); @@ -119,7 +119,7 @@ public class UIControlArranger // }, // new Object[] // { -// UIConsts.INTEGERS[8], sArrangementHeader[0], new Integer(97), new Integer(60), IControlStep, new Short(curtabindex++), new Integer(207) +// UIConsts.INTEGERS[8], sArrangementHeader[0], 97, 60, IControlStep, new Short(curtabindex++), 207 // }); // // boolean bEnabled = true; @@ -142,14 +142,14 @@ public class UIControlArranger // new Object[] // { // Boolean.valueOf(bEnabled), -// new Integer(14), +// 14, ///* TODO: WRONG!*/ "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", // "1", // new Integer(nXPos + nBtnWidth), // new Integer(nYPos), // IControlStep, // new Short(curtabindex++), -// new Integer(16) +// 16 // }); DefaultListModel imageModel = new DefaultListModel(); @@ -191,7 +191,7 @@ public class UIControlArranger { if (listItem == null) { - return ""; + return PropertyNames.EMPTY_STRING; } return HelpTexts[((Integer) listItem).intValue()]; @@ -201,21 +201,12 @@ public class UIControlArranger public void enableSubFormImageList(boolean _bdoEnable) { m_aArrangeList[1].m_aButtonList.setenabled(_bdoEnable); - CurUnoDialog.setControlProperty("lnLabelPlacment_2", PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoEnable)); + CurUnoDialog.setControlProperty("lnLabelPlacment_2", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoEnable)); } public short getAlignValue() { - Short IAlignValue = null; - if (optAlignLeft.getState()) - { - IAlignValue = new Short((short) 0); - } - else - { - IAlignValue = new Short((short) 2); - } - return IAlignValue.shortValue(); + return optAlignLeft.getState() ? (short)0 : (short)2; } public void alignLabelControls() @@ -226,12 +217,12 @@ public class UIControlArranger for (int m = 0; m < curFormDocument.oControlForms.size(); m++) { FormDocument.ControlForm curControlForm = (FormDocument.ControlForm) curFormDocument.oControlForms.get(m); - if (curControlForm.getArrangemode() == FormWizard.SOCOLUMNARLEFT) + if (curControlForm.getArrangemode() == FormWizard.COLUMNAR_LEFT) { Control[] LabelControls = curControlForm.getLabelControls(); for (int n = 0; n < LabelControls.length; n++) { - LabelControls[n].xPropertySet.setPropertyValue("Align", new Short(iAlignValue)); + LabelControls[n].xPropertySet.setPropertyValue(PropertyNames.PROPERTY_ALIGN, new Short(iAlignValue)); } } } @@ -244,9 +235,9 @@ public class UIControlArranger private void enableAlignControlGroup(boolean _bEnableAlignControlGroup) { - Helper.setUnoPropertyValue(UnoDialog.getModel(flnLabelPlacement), PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnableAlignControlGroup)); - Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnableAlignControlGroup)); - Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignRight), PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnableAlignControlGroup)); + Helper.setUnoPropertyValue(UnoDialog.getModel(flnLabelPlacement), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bEnableAlignControlGroup)); + Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bEnableAlignControlGroup)); + Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignRight), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bEnableAlignControlGroup)); } // private class ArrangeImageList implements XItemListener @@ -267,7 +258,7 @@ public class UIControlArranger // }, // new Object[] // { -// UIConsts.INTEGERS[8], _sArrangementHeader, new Integer(97), YPos, IControlStep, new Short(curtabindex++), new Integer(207) +// UIConsts.INTEGERS[8], _sArrangementHeader, 97, YPos, IControlStep, new Short(curtabindex++), 207 // }); // // int nypos = SOBASEIMAGEYPOSITION + 12 + _formindex * SOIMAGELISTHEIGHT; @@ -396,11 +387,11 @@ public class UIControlArranger { UIConsts.INTEGERS[8], _sArrangementHeader, - new Integer(97), + 97, YPos, IControlStep, new Short(curtabindex++), - new Integer(207) + 207 }); int nypos = SOBASEIMAGEYPOSITION + 12 - 5 + _formindex * SOIMAGELISTHEIGHT; @@ -421,7 +412,7 @@ public class UIControlArranger m_aButtonList.setListModel(model); m_aButtonList.create(CurUnoDialog); - m_aButtonList.setSelected(FormWizard.SOGRID - 1); + m_aButtonList.setSelected(FormWizard.AS_GRID - 1); m_aButtonList.addItemListener(this); } @@ -450,13 +441,13 @@ public class UIControlArranger final int nSelected0 = (m_aArrangeList[0].m_aButtonList.getSelected() + 1); final int nSelected1 = (m_aArrangeList[1].m_aButtonList.getSelected() + 1); - bEnableAlignControlGroup = ((nSelected0 == FormWizard.SOCOLUMNARLEFT) || - (nSelected1 == FormWizard.SOCOLUMNARLEFT)); + bEnableAlignControlGroup = ((nSelected0 == FormWizard.COLUMNAR_LEFT) || + (nSelected1 == FormWizard.COLUMNAR_LEFT)); } else { final int nSelected0 = (m_aArrangeList[0].m_aButtonList.getSelected() + 1); - bEnableAlignControlGroup = (nSelected0 == FormWizard.SOCOLUMNARLEFT); + bEnableAlignControlGroup = (nSelected0 == FormWizard.COLUMNAR_LEFT); } enableAlignControlGroup(bEnableAlignControlGroup); final Short nBorderType = CurUnoDialog.getBorderType(); 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 b7b260e69e85..6a024ce1113f 100644 --- a/wizards/com/sun/star/wizards/letter/LetterDocument.java +++ b/wizards/com/sun/star/wizards/letter/LetterDocument.java @@ -61,9 +61,8 @@ public class LetterDocument extends TextDocument public XWindowPeer getWindowPeer() { - XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xTextDocument); - return xWindowPeer; - } + return UnoRuntime.queryInterface(XWindowPeer.class, xTextDocument); +} public void switchElement(String sElement, boolean bState) { @@ -71,7 +70,7 @@ public class LetterDocument extends TextDocument { TextSectionHandler mySectionHandler = new TextSectionHandler(xMSF, xTextDocument); Object oSection = mySectionHandler.xTextSectionsSupplier.getTextSections().getByName(sElement); - Helper.setUnoPropertyValue(oSection, "IsVisible", new Boolean(bState)); + Helper.setUnoPropertyValue(oSection, "IsVisible", Boolean.valueOf(bState)); } catch (Exception exception) @@ -93,20 +92,20 @@ public class LetterDocument extends TextDocument try { xTextDocument.lockControllers(); - XStyleFamiliesSupplier xStyleFamiliesSupplier = (XStyleFamiliesSupplier) com.sun.star.uno.UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); + XStyleFamiliesSupplier xStyleFamiliesSupplier = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); com.sun.star.container.XNameAccess xNameAccess = null; xNameAccess = xStyleFamiliesSupplier.getStyleFamilies(); com.sun.star.container.XNameContainer xPageStyleCollection = null; - xPageStyleCollection = (com.sun.star.container.XNameContainer) UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xNameAccess.getByName("PageStyles")); + xPageStyleCollection = UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xNameAccess.getByName("PageStyles")); XText xFooterText; - XStyle xPageStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, xPageStyleCollection.getByName(sPageStyle)); + XStyle xPageStyle = UnoRuntime.queryInterface(XStyle.class, xPageStyleCollection.getByName(sPageStyle)); if (bState) { - Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", new Boolean(true)); - xFooterText = (XText) UnoRuntime.queryInterface(XText.class, Helper.getUnoPropertyValue(xPageStyle, "FooterText")); + Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", Boolean.TRUE); + xFooterText = UnoRuntime.queryInterface(XText.class, Helper.getUnoPropertyValue(xPageStyle, "FooterText")); xFooterText.setString(sText); if (bPageNumber) { @@ -114,10 +113,10 @@ public class LetterDocument extends TextDocument XTextCursor myCursor = xFooterText.createTextCursor(); myCursor.gotoEnd(false); xFooterText.insertControlCharacter(myCursor, ControlCharacter.PARAGRAPH_BREAK, false); - XPropertySet xCursorPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, myCursor); + XPropertySet xCursorPSet = UnoRuntime.queryInterface(XPropertySet.class, myCursor); xCursorPSet.setPropertyValue("ParaAdjust", ParagraphAdjust.CENTER); - XTextField xPageNumberField = (XTextField) UnoRuntime.queryInterface(XTextField.class, xMSFDoc.createInstance("com.sun.star.text.TextField.PageNumber")); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPageNumberField); + XTextField xPageNumberField = UnoRuntime.queryInterface(XTextField.class, xMSFDoc.createInstance("com.sun.star.text.TextField.PageNumber")); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xPageNumberField); xPSet.setPropertyValue("SubType", PageNumberType.CURRENT); xPSet.setPropertyValue("NumberingType", new Short(NumberingType.ARABIC)); xFooterText.insertTextContent(xFooterText.getEnd(), xPageNumberField, false); @@ -125,7 +124,7 @@ public class LetterDocument extends TextDocument } else { - Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", new Boolean(false)); + Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", Boolean.FALSE); } xTextDocument.unlockControllers(); } @@ -158,7 +157,7 @@ public class LetterDocument extends TextDocument } else { - myFieldHandler.changeUserFieldContent(sFieldName, ""); + myFieldHandler.changeUserFieldContent(sFieldName, PropertyNames.EMPTY_STRING); } } @@ -183,7 +182,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() @@ -259,8 +258,8 @@ public class LetterDocument extends TextDocument try { - xFrame = (XTextFrame) UnoRuntime.queryInterface(XTextFrame.class, xMSFDoc.createInstance("com.sun.star.text.TextFrame")); - xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xFrame); + xFrame = UnoRuntime.queryInterface(XTextFrame.class, xMSFDoc.createInstance("com.sun.star.text.TextFrame")); + xShape = UnoRuntime.queryInterface(XShape.class, xFrame); setFramePosition(); Helper.setUnoPropertyValue(xShape, "AnchorType", TextContentAnchorType.AT_PAGE); @@ -268,7 +267,7 @@ public class LetterDocument extends TextDocument Helper.setUnoPropertyValue(xFrame, "TextWrap", WrapTextMode.THROUGHT); Helper.setUnoPropertyValue(xFrame, "Opaque", Boolean.TRUE); - Helper.setUnoPropertyValue(xFrame, "BackColor", new Integer(15790320)); + Helper.setUnoPropertyValue(xFrame, "BackColor", 15790320); BorderLine myBorder = new BorderLine(); myBorder.OuterLineWidth = 0; @@ -276,7 +275,7 @@ public class LetterDocument extends TextDocument Helper.setUnoPropertyValue(xFrame, "RightBorder", myBorder); Helper.setUnoPropertyValue(xFrame, "TopBorder", myBorder); Helper.setUnoPropertyValue(xFrame, "BottomBorder", myBorder); - Helper.setUnoPropertyValue(xFrame, "Print", new Boolean(false)); + Helper.setUnoPropertyValue(xFrame, "Print", Boolean.FALSE); XTextCursor xTextCursor = xTextDocument.getText().createTextCursor(); xTextCursor.gotoEnd(true); @@ -285,10 +284,10 @@ public class LetterDocument extends TextDocument XText xFrameText = xFrame.getText(); XTextCursor xFrameCursor = xFrameText.createTextCursor(); - XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xFrameCursor); + XPropertySet xCursorProps = UnoRuntime.queryInterface(XPropertySet.class, xFrameCursor); xCursorProps.setPropertyValue("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD)); - xCursorProps.setPropertyValue("CharColor", new Integer(16777215)); - xCursorProps.setPropertyValue("CharFontName", new String("Albany")); + xCursorProps.setPropertyValue("CharColor", 16777215); + xCursorProps.setPropertyValue("CharFontName", "Albany"); xCursorProps.setPropertyValue("CharHeight", new Float(18)); xFrameText.insertString(xFrameCursor, FrameText, false); diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java index 619227d9f3ba..2f3f87f244ff 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java @@ -143,11 +143,11 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW Helper.setUnoPropertyValues(xDialogModel, new String[] { - "Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_CLOSEABLE, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - Boolean.TRUE, new Integer(210), Boolean.TRUE, "LetterWizardDialog", new Integer(104), new Integer(52), INTEGERS[1], new Short((short) 1), resources.resLetterWizardDialog_title, new Integer(310) + Boolean.TRUE, 210, Boolean.TRUE, "LetterWizardDialog", 104, 52, INTEGERS[1], new Short((short) 1), resources.resLetterWizardDialog_title, 310 }); @@ -169,7 +169,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 1), resources.resoptBusinessLetter_value, "optBusinessLetter", new Integer(97), new Integer(28), INTEGERS[1], new Short((short) 1), new Integer(184) + INTEGERS[8], HelpIds.getHelpIdString(HID + 1), resources.resoptBusinessLetter_value, "optBusinessLetter", 97, 28, INTEGERS[1], new Short((short) 1), 184 }); optPrivOfficialLetter = insertRadioButton("optPrivOfficialLetter", OPTPRIVOFFICIALLETTER_ITEM_CHANGED, new String[] @@ -178,7 +178,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 2), resources.resoptPrivOfficialLetter_value, "optPrivOfficialLetter", new Integer(97), new Integer(74), INTEGERS[1], new Short((short) 2), new Integer(184) + INTEGERS[8], HelpIds.getHelpIdString(HID + 2), resources.resoptPrivOfficialLetter_value, "optPrivOfficialLetter", 97, 74, INTEGERS[1], new Short((short) 2), 184 }); optPrivateLetter = insertRadioButton("optPrivateLetter", OPTPRIVATELETTER_ITEM_CHANGED, new String[] @@ -187,7 +187,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 3), resources.resoptPrivateLetter_value, "optPrivateLetter", new Integer(97), new Integer(106), INTEGERS[1], new Short((short) 3), new Integer(184) + INTEGERS[8], HelpIds.getHelpIdString(HID + 3), resources.resoptPrivateLetter_value, "optPrivateLetter", 97, 106, INTEGERS[1], new Short((short) 3), 184 }); lstBusinessStyle = insertListBox("lstBusinessStyle", LSTBUSINESSSTYLE_ACTION_PERFORMED, LSTBUSINESSSTYLE_ITEM_CHANGED, new String[] @@ -196,7 +196,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 4), "lstBusinessStyle", new Integer(180), INTEGER_40, INTEGERS[1], new Short((short) 4), new Integer(74) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 4), "lstBusinessStyle", 180, INTEGER_40, INTEGERS[1], new Short((short) 4), 74 }); chkBusinessPaper = insertCheckBox("chkBusinessPaper", CHKBUSINESSPAPER_ITEM_CHANGED, new String[] @@ -205,7 +205,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 5), resources.reschkBusinessPaper_value, "chkBusinessPaper", new Integer(110), new Integer(56), new Short((short) 0), INTEGERS[1], new Short((short) 5), new Integer(168) + INTEGERS[8], HelpIds.getHelpIdString(HID + 5), resources.reschkBusinessPaper_value, "chkBusinessPaper", 110, 56, new Short((short) 0), INTEGERS[1], new Short((short) 5), 168 }); lstPrivOfficialStyle = insertListBox("lstPrivOfficialStyle", LSTPRIVOFFICIALSTYLE_ACTION_PERFORMED, LSTPRIVOFFICIALSTYLE_ITEM_CHANGED, new String[] @@ -214,7 +214,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 6), "lstPrivOfficialStyle", new Integer(180), new Integer(86), INTEGERS[1], new Short((short) 6), new Integer(74) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 6), "lstPrivOfficialStyle", 180, 86, INTEGERS[1], new Short((short) 6), 74 }); lstPrivateStyle = insertListBox("lstPrivateStyle", LSTPRIVATESTYLE_ACTION_PERFORMED, LSTPRIVATESTYLE_ITEM_CHANGED, new String[] @@ -223,7 +223,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 7), "lstPrivateStyle", new Integer(180), new Integer(118), INTEGERS[1], new Short((short) 7), new Integer(74) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 7), "lstPrivateStyle", 180, 118, INTEGERS[1], new Short((short) 7), 74 }); lblBusinessStyle = insertLabel("lblBusinessStyle", new String[] @@ -232,7 +232,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblBusinessStyle_value, "lblBusinessStyle", new Integer(110), new Integer(42), INTEGERS[1], new Short((short) 48), new Integer(60) + INTEGERS[8], resources.reslblBusinessStyle_value, "lblBusinessStyle", 110, 42, INTEGERS[1], new Short((short) 48), 60 }); lblPrivOfficialStyle = insertLabel("lblPrivOfficialStyle", new String[] @@ -241,16 +241,16 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblPrivOfficialStyle_value, "lblPrivOfficialStyle", new Integer(110), new Integer(88), INTEGERS[1], new Short((short) 49), new Integer(60) + INTEGERS[8], resources.reslblPrivOfficialStyle_value, "lblPrivOfficialStyle", 110, 88, INTEGERS[1], new Short((short) 49), 60 }); 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[] { - fontDescriptor6, INTEGER_16, resources.reslblTitle1_value, Boolean.TRUE, "lblTitle1", new Integer(91), INTEGERS[8], INTEGERS[1], new Short((short) 55), new Integer(212) + fontDescriptor6, INTEGER_16, resources.reslblTitle1_value, Boolean.TRUE, "lblTitle1", 91, INTEGERS[8], INTEGERS[1], new Short((short) 55), 212 }); lblPrivateStyle = insertLabel("lblPrivateStyle", new String[] @@ -259,7 +259,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblPrivateStyle_value, "lblPrivateStyle", new Integer(110), new Integer(120), INTEGERS[1], new Short((short) 74), new Integer(60) + INTEGERS[8], resources.reslblPrivateStyle_value, "lblPrivateStyle", 110, 120, INTEGERS[1], new Short((short) 74), 60 }); lblIntroduction = insertLabel("lblIntroduction", new String[] @@ -268,13 +268,13 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - new Integer(39), resources.reslblIntroduction_value, Boolean.TRUE, "lblIntroduction", new Integer(104), new Integer(145), INTEGERS[1], new Short((short) 80), new Integer(199) + 39, resources.reslblIntroduction_value, Boolean.TRUE, "lblIntroduction", 104, 145, INTEGERS[1], new Short((short) 80), 199 }); ImageControl3 = insertInfoImage(92, 145, 1); // ImageControl3 = insertImage("ImageControl3", -// new String[] {"Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, -// new Object[] { new Short((short)0), INTEGERS[10],"private:resource/dbu/image/19205","ImageControl3",new Integer(92),new Integer(145),Boolean.FALSE,INTEGERS[1],new Short((short)81),INTEGERS[10]} +// new String[] {PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, +// new Object[] { new Short((short)0), INTEGERS[10],"private:resource/dbu/image/19205","ImageControl3",92,145,Boolean.FALSE,INTEGERS[1],new Short((short)81),INTEGERS[10]} // ); } @@ -287,7 +287,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 8), resources.reschkPaperCompanyLogo_value, "chkPaperCompanyLogo", new Integer(97), new Integer(28), new Short((short) 0), INTEGERS[2], new Short((short) 8), new Integer(68) + INTEGERS[8], HelpIds.getHelpIdString(HID + 8), resources.reschkPaperCompanyLogo_value, "chkPaperCompanyLogo", 97, 28, new Short((short) 0), INTEGERS[2], new Short((short) 8), 68 }); numLogoHeight = insertNumericField("numLogoHeight", NUMLOGOHEIGHT_TEXT_CHANGED, new String[] @@ -296,7 +296,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 9), "numLogoHeight", new Integer(138), INTEGER_40, Boolean.TRUE, INTEGERS[2], Boolean.TRUE, new Short((short) 9), INTEGERS[3], new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 9), "numLogoHeight", 138, INTEGER_40, Boolean.TRUE, INTEGERS[2], Boolean.TRUE, new Short((short) 9), INTEGERS[3], 30 }); numLogoX = insertNumericField("numLogoX", NUMLOGOX_TEXT_CHANGED, new String[] @@ -305,7 +305,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 10), "numLogoX", new Integer(266), INTEGER_40, Boolean.TRUE, INTEGERS[2], new Short((short) 10), INTEGERS[0], new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 10), "numLogoX", 266, INTEGER_40, Boolean.TRUE, INTEGERS[2], new Short((short) 10), INTEGERS[0], 30 }); numLogoWidth = insertNumericField("numLogoWidth", NUMLOGOWIDTH_TEXT_CHANGED, new String[] @@ -314,7 +314,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 11), "numLogoWidth", new Integer(138), new Integer(56), Boolean.TRUE, INTEGERS[2], new Short((short) 11), new Double(3.8), new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 11), "numLogoWidth", 138, 56, Boolean.TRUE, INTEGERS[2], new Short((short) 11), new Double(3.8), 30 }); numLogoY = insertNumericField("numLogoY", NUMLOGOY_TEXT_CHANGED, new String[] @@ -323,7 +323,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 12), "numLogoY", new Integer(266), new Integer(56), Boolean.TRUE, INTEGERS[2], new Short((short) 12), new Double(-3.4), new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 12), "numLogoY", 266, 56, Boolean.TRUE, INTEGERS[2], new Short((short) 12), new Double(-3.4), 30 }); chkPaperCompanyAddress = insertCheckBox("chkPaperCompanyAddress", CHKPAPERCOMPANYADDRESS_ITEM_CHANGED, new String[] @@ -332,7 +332,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 13), resources.reschkPaperCompanyAddress_value, "chkPaperCompanyAddress", new Integer(98), new Integer(84), new Short((short) 0), INTEGERS[2], new Short((short) 13), new Integer(68) + INTEGERS[8], HelpIds.getHelpIdString(HID + 13), resources.reschkPaperCompanyAddress_value, "chkPaperCompanyAddress", 98, 84, new Short((short) 0), INTEGERS[2], new Short((short) 13), 68 }); numAddressHeight = insertNumericField("numAddressHeight", NUMADDRESSHEIGHT_TEXT_CHANGED, new String[] @@ -341,7 +341,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 14), "numAddressHeight", new Integer(138), new Integer(96), Boolean.TRUE, INTEGERS[2], Boolean.TRUE, new Short((short) 14), INTEGERS[3], new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 14), "numAddressHeight", 138, 96, Boolean.TRUE, INTEGERS[2], Boolean.TRUE, new Short((short) 14), INTEGERS[3], 30 }); numAddressX = insertNumericField("numAddressX", NUMADDRESSX_TEXT_CHANGED, new String[] @@ -350,7 +350,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 15), "numAddressX", new Integer(266), new Integer(96), Boolean.TRUE, INTEGERS[2], new Short((short) 15), new Double(3.8), new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 15), "numAddressX", 266, 96, Boolean.TRUE, INTEGERS[2], new Short((short) 15), new Double(3.8), 30 }); numAddressWidth = insertNumericField("numAddressWidth", NUMADDRESSWIDTH_TEXT_CHANGED, new String[] @@ -359,7 +359,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 16), "numAddressWidth", new Integer(138), new Integer(112), Boolean.TRUE, INTEGERS[2], new Short((short) 16), new Double(13.8), new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 16), "numAddressWidth", 138, 112, Boolean.TRUE, INTEGERS[2], new Short((short) 16), new Double(13.8), 30 }); numAddressY = insertNumericField("numAddressY", NUMADDRESSY_TEXT_CHANGED, new String[] @@ -368,7 +368,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 17), "numAddressY", new Integer(266), new Integer(112), Boolean.TRUE, INTEGERS[2], new Short((short) 17), new Double(-3.4), new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 17), "numAddressY", 266, 112, Boolean.TRUE, INTEGERS[2], new Short((short) 17), new Double(-3.4), 30 }); chkCompanyReceiver = insertCheckBox("chkCompanyReceiver", CHKCOMPANYRECEIVER_ITEM_CHANGED, new String[] @@ -377,7 +377,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 18), resources.reschkCompanyReceiver_value, "chkCompanyReceiver", new Integer(103), new Integer(131), new Short((short) 0), INTEGERS[2], new Short((short) 18), new Integer(185) + INTEGERS[8], HelpIds.getHelpIdString(HID + 18), resources.reschkCompanyReceiver_value, "chkCompanyReceiver", 103, 131, new Short((short) 0), INTEGERS[2], new Short((short) 18), 185 }); chkPaperFooter = insertCheckBox("chkPaperFooter", CHKPAPERFOOTER_ITEM_CHANGED, new String[] @@ -386,7 +386,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 19), resources.reschkPaperFooter_value, "chkPaperFooter", new Integer(97), new Integer(158), new Short((short) 0), INTEGERS[2], new Short((short) 19), new Integer(68) + INTEGERS[8], HelpIds.getHelpIdString(HID + 19), resources.reschkPaperFooter_value, "chkPaperFooter", 97, 158, new Short((short) 0), INTEGERS[2], new Short((short) 19), 68 }); numFooterHeight = insertNumericField("numFooterHeight", NUMFOOTERHEIGHT_TEXT_CHANGED, new String[] @@ -395,7 +395,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 20), "numFooterHeight", new Integer(236), new Integer(156), Boolean.TRUE, INTEGERS[2], new Short((short) 20), INTEGERS[5], new Integer(30) + INTEGER_12, HelpIds.getHelpIdString(HID + 20), "numFooterHeight", 236, 156, Boolean.TRUE, INTEGERS[2], new Short((short) 20), INTEGERS[5], 30 }); lblLogoHeight = insertLabel("lblLogoHeight", new String[] @@ -404,7 +404,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblLogoHeight_value, "lblLogoHeight", new Integer(103), new Integer(42), INTEGERS[2], new Short((short) 68), new Integer(32) + INTEGERS[8], resources.reslblLogoHeight_value, "lblLogoHeight", 103, 42, INTEGERS[2], new Short((short) 68), 32 }); lblLogoWidth = insertLabel("lblLogoWidth", new String[] @@ -413,7 +413,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblLogoWidth_value, "lblLogoWidth", new Integer(103), new Integer(58), INTEGERS[2], new Short((short) 69), new Integer(32) + INTEGERS[8], resources.reslblLogoWidth_value, "lblLogoWidth", 103, 58, INTEGERS[2], new Short((short) 69), 32 }); FixedLine5 = insertFixedLine("FixedLine5", new String[] @@ -422,7 +422,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[2], "FixedLine5", new Integer(90), new Integer(78), INTEGERS[2], new Short((short) 70), new Integer(215) + INTEGERS[2], "FixedLine5", 90, 78, INTEGERS[2], new Short((short) 70), 215 }); FixedLine6 = insertFixedLine("FixedLine6", new String[] @@ -431,7 +431,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[2], "FixedLine6", new Integer(90), new Integer(150), INTEGERS[2], new Short((short) 71), new Integer(215) + INTEGERS[2], "FixedLine6", 90, 150, INTEGERS[2], new Short((short) 71), 215 }); lblFooterHeight = insertLabel("lblFooterHeight", new String[] @@ -440,7 +440,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblFooterHeight_value, "lblFooterHeight", new Integer(200), new Integer(158), INTEGERS[2], new Short((short) 72), new Integer(32) + INTEGERS[8], resources.reslblFooterHeight_value, "lblFooterHeight", 200, 158, INTEGERS[2], new Short((short) 72), 32 }); lblLogoX = insertLabel("lblLogoX", new String[] @@ -449,7 +449,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblLogoX_value, "lblLogoX", new Integer(170), new Integer(42), INTEGERS[2], new Short((short) 84), new Integer(94) + INTEGERS[8], resources.reslblLogoX_value, "lblLogoX", 170, 42, INTEGERS[2], new Short((short) 84), 94 }); lblLogoY = insertLabel("lblLogoY", new String[] @@ -458,7 +458,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblLogoY_value, "lblLogoY", new Integer(170), new Integer(58), INTEGERS[2], new Short((short) 85), new Integer(94) + INTEGERS[8], resources.reslblLogoY_value, "lblLogoY", 170, 58, INTEGERS[2], new Short((short) 85), 94 }); lblAddressHeight = insertLabel("lblAddressHeight", new String[] @@ -467,7 +467,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblAddressHeight_value, "lblAddressHeight", new Integer(103), new Integer(98), INTEGERS[2], new Short((short) 86), new Integer(32) + INTEGERS[8], resources.reslblAddressHeight_value, "lblAddressHeight", 103, 98, INTEGERS[2], new Short((short) 86), 32 }); lblAddressWidth = insertLabel("lblAddressWidth", new String[] @@ -476,7 +476,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblAddressWidth_value, "lblAddressWidth", new Integer(103), new Integer(114), INTEGERS[2], new Short((short) 87), new Integer(32) + INTEGERS[8], resources.reslblAddressWidth_value, "lblAddressWidth", 103, 114, INTEGERS[2], new Short((short) 87), 32 }); lblAddressX = insertLabel("lblAddressX", new String[] @@ -485,7 +485,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblAddressX_value, "lblAddressX", new Integer(170), new Integer(98), INTEGERS[2], new Short((short) 88), new Integer(94) + INTEGERS[8], resources.reslblAddressX_value, "lblAddressX", 170, 98, INTEGERS[2], new Short((short) 88), 94 }); lblAddressY = insertLabel("lblAddressY", new String[] @@ -494,16 +494,16 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblAddressY_value, "lblAddressY", new Integer(170), new Integer(114), INTEGERS[2], new Short((short) 89), new Integer(94) + INTEGERS[8], resources.reslblAddressY_value, "lblAddressY", 170, 114, INTEGERS[2], new Short((short) 89), 94 }); 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[] { - fontDescriptor6, INTEGER_16, resources.reslblTitle2_value, Boolean.TRUE, "lblTitle2", new Integer(91), INTEGERS[8], INTEGERS[2], new Short((short) 91), new Integer(212) + fontDescriptor6, INTEGER_16, resources.reslblTitle2_value, Boolean.TRUE, "lblTitle2", 91, INTEGERS[8], INTEGERS[2], new Short((short) 91), 212 }); } @@ -516,7 +516,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 21), "lstLetterNorm", new Integer(210), new Integer(34), INTEGERS[3], new Short((short) 21), new Integer(74) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 21), "lstLetterNorm", 210, 34, INTEGERS[3], new Short((short) 21), 74 }); chkUseLogo = insertCheckBox("chkUseLogo", CHKUSELOGO_ITEM_CHANGED, new String[] @@ -525,7 +525,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 22), resources.reschkUseLogo_value, "chkUseLogo", new Integer(97), new Integer(54), new Short((short) 0), INTEGERS[3], new Short((short) 22), new Integer(212) + INTEGERS[8], HelpIds.getHelpIdString(HID + 22), resources.reschkUseLogo_value, "chkUseLogo", 97, 54, new Short((short) 0), INTEGERS[3], new Short((short) 22), 212 }); chkUseAddressReceiver = insertCheckBox("chkUseAddressReceiver", CHKUSEADDRESSRECEIVER_ITEM_CHANGED, new String[] @@ -534,7 +534,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 23), resources.reschkUseAddressReceiver_value, "chkUseAddressReceiver", new Integer(97), new Integer(69), new Short((short) 0), INTEGERS[3], new Short((short) 23), new Integer(212) + INTEGERS[8], HelpIds.getHelpIdString(HID + 23), resources.reschkUseAddressReceiver_value, "chkUseAddressReceiver", 97, 69, new Short((short) 0), INTEGERS[3], new Short((short) 23), 212 }); chkUseSigns = insertCheckBox("chkUseSigns", CHKUSESIGNS_ITEM_CHANGED, new String[] @@ -543,7 +543,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 24), resources.reschkUseSigns_value, "chkUseSigns", new Integer(97), new Integer(82), new Short((short) 0), INTEGERS[3], new Short((short) 24), new Integer(212) + INTEGERS[8], HelpIds.getHelpIdString(HID + 24), resources.reschkUseSigns_value, "chkUseSigns", 97, 82, new Short((short) 0), INTEGERS[3], new Short((short) 24), 212 }); chkUseSubject = insertCheckBox("chkUseSubject", CHKUSESUBJECT_ITEM_CHANGED, new String[] @@ -552,7 +552,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 25), resources.reschkUseSubject_value, "chkUseSubject", new Integer(97), new Integer(98), new Short((short) 0), INTEGERS[3], new Short((short) 25), new Integer(212) + INTEGERS[8], HelpIds.getHelpIdString(HID + 25), resources.reschkUseSubject_value, "chkUseSubject", 97, 98, new Short((short) 0), INTEGERS[3], new Short((short) 25), 212 }); chkUseSalutation = insertCheckBox("chkUseSalutation", CHKUSESALUTATION_ITEM_CHANGED, new String[] @@ -561,7 +561,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 26), resources.reschkUseSalutation_value, "chkUseSalutation", new Integer(97), new Integer(113), new Short((short) 0), INTEGERS[3], new Short((short) 26), new Integer(66) + INTEGERS[8], HelpIds.getHelpIdString(HID + 26), resources.reschkUseSalutation_value, "chkUseSalutation", 97, 113, new Short((short) 0), INTEGERS[3], new Short((short) 26), 66 }); lstSalutation = insertComboBox("lstSalutation", LSTSALUTATION_ACTION_PERFORMED, LSTSALUTATION_ITEM_CHANGED, LSTSALUTATION_TEXT_CHANGED, new String[] @@ -570,7 +570,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 27), "lstSalutation", new Integer(210), new Integer(110), INTEGERS[3], new Short((short) 27), new Integer(74) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 27), "lstSalutation", 210, 110, INTEGERS[3], new Short((short) 27), 74 }); chkUseBendMarks = insertCheckBox("chkUseBendMarks", CHKUSEBENDMARKS_ITEM_CHANGED, new String[] @@ -579,7 +579,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 28), resources.reschkUseBendMarks_value, "chkUseBendMarks", new Integer(97), new Integer(127), new Short((short) 0), INTEGERS[3], new Short((short) 28), new Integer(212) + INTEGERS[8], HelpIds.getHelpIdString(HID + 28), resources.reschkUseBendMarks_value, "chkUseBendMarks", 97, 127, new Short((short) 0), INTEGERS[3], new Short((short) 28), 212 }); chkUseGreeting = insertCheckBox("chkUseGreeting", CHKUSEGREETING_ITEM_CHANGED, new String[] @@ -588,7 +588,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 29), resources.reschkUseGreeting_value, "chkUseGreeting", new Integer(97), new Integer(142), new Short((short) 0), INTEGERS[3], new Short((short) 29), new Integer(66) + INTEGERS[8], HelpIds.getHelpIdString(HID + 29), resources.reschkUseGreeting_value, "chkUseGreeting", 97, 142, new Short((short) 0), INTEGERS[3], new Short((short) 29), 66 }); lstGreeting = insertComboBox("lstGreeting", LSTGREETING_ACTION_PERFORMED, LSTGREETING_ITEM_CHANGED, LSTGREETING_TEXT_CHANGED, new String[] @@ -597,7 +597,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 30), "lstGreeting", new Integer(210), new Integer(141), INTEGERS[3], new Short((short) 30), new Integer(74) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID + 30), "lstGreeting", 210, 141, INTEGERS[3], new Short((short) 30), 74 }); chkUseFooter = insertCheckBox("chkUseFooter", CHKUSEFOOTER_ITEM_CHANGED, new String[] @@ -606,7 +606,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 31), resources.reschkUseFooter_value, "chkUseFooter", new Integer(97), new Integer(158), new Short((short) 0), INTEGERS[3], new Short((short) 31), new Integer(212) + INTEGERS[8], HelpIds.getHelpIdString(HID + 31), resources.reschkUseFooter_value, "chkUseFooter", 97, 158, new Short((short) 0), INTEGERS[3], new Short((short) 31), 212 }); lblLetterNorm = insertLabel("lblLetterNorm", new String[] @@ -615,16 +615,16 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_16, resources.reslblLetterNorm_value, Boolean.TRUE, "lblLetterNorm", new Integer(97), new Integer(28), INTEGERS[3], new Short((short) 50), new Integer(109) + INTEGER_16, resources.reslblLetterNorm_value, Boolean.TRUE, "lblLetterNorm", 97, 28, INTEGERS[3], new Short((short) 50), 109 }); 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[] { - fontDescriptor6, INTEGER_16, resources.reslblTitle3_value, Boolean.TRUE, "lblTitle3", new Integer(91), INTEGERS[8], INTEGERS[3], new Short((short) 90), new Integer(212) + fontDescriptor6, INTEGER_16, resources.reslblTitle3_value, Boolean.TRUE, "lblTitle3", 91, INTEGERS[8], INTEGERS[3], new Short((short) 90), 212 }); } @@ -637,7 +637,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 32), resources.resoptSenderPlaceholder_value, "optSenderPlaceholder", new Integer(104), new Integer(42), INTEGERS[4], new Short((short) 32), new Integer(149) + INTEGERS[8], HelpIds.getHelpIdString(HID + 32), resources.resoptSenderPlaceholder_value, "optSenderPlaceholder", 104, 42, INTEGERS[4], new Short((short) 32), 149 }); optSenderDefine = insertRadioButton("optSenderDefine", OPTSENDERDEFINE_ITEM_CHANGED, new String[] @@ -646,7 +646,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 33), resources.resoptSenderDefine_value, "optSenderDefine", new Integer(104), new Integer(54), INTEGERS[4], new Short((short) 33), new Integer(149) + INTEGERS[8], HelpIds.getHelpIdString(HID + 33), resources.resoptSenderDefine_value, "optSenderDefine", 104, 54, INTEGERS[4], new Short((short) 33), 149 }); txtSenderName = insertTextField("txtSenderName", TXTSENDERNAME_TEXT_CHANGED, new String[] @@ -655,7 +655,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 34), "txtSenderName", new Integer(182), new Integer(67), INTEGERS[4], new Short((short) 34), new Integer(119) + INTEGER_12, HelpIds.getHelpIdString(HID + 34), "txtSenderName", 182, 67, INTEGERS[4], new Short((short) 34), 119 }); txtSenderStreet = insertTextField("txtSenderStreet", TXTSENDERSTREET_TEXT_CHANGED, new String[] @@ -664,7 +664,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 35), "txtSenderStreet", new Integer(182), new Integer(81), INTEGERS[4], new Short((short) 35), new Integer(119) + INTEGER_12, HelpIds.getHelpIdString(HID + 35), "txtSenderStreet", 182, 81, INTEGERS[4], new Short((short) 35), 119 }); txtSenderPostCode = insertTextField("txtSenderPostCode", TXTSENDERPOSTCODE_TEXT_CHANGED, new String[] @@ -673,7 +673,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 36), "txtSenderPostCode", new Integer(182), new Integer(95), INTEGERS[4], new Short((short) 36), new Integer(25) + INTEGER_12, HelpIds.getHelpIdString(HID + 36), "txtSenderPostCode", 182, 95, INTEGERS[4], new Short((short) 36), 25 }); txtSenderState = insertTextField("txtSenderState", TXTSENDERSTATE_TEXT_CHANGED, new String[] @@ -682,7 +682,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 37), "txtSenderState", new Integer(211), new Integer(95), INTEGERS[4], new Short((short) 37), new Integer(21) + INTEGER_12, HelpIds.getHelpIdString(HID + 37), "txtSenderState", 211, 95, INTEGERS[4], new Short((short) 37), 21 }); txtSenderCity = insertTextField("txtSenderCity", TXTSENDERCITY_TEXT_CHANGED, new String[] @@ -691,7 +691,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 38), "txtSenderCity", new Integer(236), new Integer(95), INTEGERS[4], new Short((short) 38), new Integer(65) + INTEGER_12, HelpIds.getHelpIdString(HID + 38), "txtSenderCity", 236, 95, INTEGERS[4], new Short((short) 38), 65 }); optReceiverPlaceholder = insertRadioButton("optReceiverPlaceholder", OPTRECEIVERPLACEHOLDER_ITEM_CHANGED, new String[] @@ -700,7 +700,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 39), resources.resoptReceiverPlaceholder_value, "optReceiverPlaceholder", new Integer(104), new Integer(145), INTEGERS[4], new Short((short) 39), new Integer(200) + INTEGERS[8], HelpIds.getHelpIdString(HID + 39), resources.resoptReceiverPlaceholder_value, "optReceiverPlaceholder", 104, 145, INTEGERS[4], new Short((short) 39), 200 }); optReceiverDatabase = insertRadioButton("optReceiverDatabase", OPTRECEIVERDATABASE_ITEM_CHANGED, new String[] @@ -709,7 +709,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 40), resources.resoptReceiverDatabase_value, "optReceiverDatabase", new Integer(104), new Integer(157), INTEGERS[4], new Short((short) 40), new Integer(200) + INTEGERS[8], HelpIds.getHelpIdString(HID + 40), resources.resoptReceiverDatabase_value, "optReceiverDatabase", 104, 157, INTEGERS[4], new Short((short) 40), 200 }); lblSenderAddress = insertLabel("lblSenderAddress", new String[] @@ -718,7 +718,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblSenderAddress_value, "lblSenderAddress", new Integer(97), new Integer(28), INTEGERS[4], new Short((short) 64), new Integer(136) + INTEGERS[8], resources.reslblSenderAddress_value, "lblSenderAddress", 97, 28, INTEGERS[4], new Short((short) 64), 136 }); FixedLine2 = insertFixedLine("FixedLine2", new String[] @@ -727,7 +727,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[5], "FixedLine2", new Integer(90), new Integer(126), INTEGERS[4], new Short((short) 75), new Integer(212) + INTEGERS[5], "FixedLine2", 90, 126, INTEGERS[4], new Short((short) 75), 212 }); lblReceiverAddress = insertLabel("lblReceiverAddress", new String[] @@ -736,7 +736,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblReceiverAddress_value, "lblReceiverAddress", new Integer(97), new Integer(134), INTEGERS[4], new Short((short) 76), new Integer(136) + INTEGERS[8], resources.reslblReceiverAddress_value, "lblReceiverAddress", 97, 134, INTEGERS[4], new Short((short) 76), 136 }); lblSenderName = insertLabel("lblSenderName", new String[] @@ -745,7 +745,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblSenderName_value, "lblSenderName", new Integer(113), new Integer(69), INTEGERS[4], new Short((short) 77), new Integer(68) + INTEGERS[8], resources.reslblSenderName_value, "lblSenderName", 113, 69, INTEGERS[4], new Short((short) 77), 68 }); lblSenderStreet = insertLabel("lblSenderStreet", new String[] @@ -754,7 +754,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblSenderStreet_value, "lblSenderStreet", new Integer(113), new Integer(82), INTEGERS[4], new Short((short) 78), new Integer(68) + INTEGERS[8], resources.reslblSenderStreet_value, "lblSenderStreet", 113, 82, INTEGERS[4], new Short((short) 78), 68 }); lblPostCodeCity = insertLabel("lblPostCodeCity", new String[] @@ -763,16 +763,16 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblPostCodeCity_value, "lblPostCodeCity", new Integer(113), new Integer(97), INTEGERS[4], new Short((short) 79), new Integer(68) + INTEGERS[8], resources.reslblPostCodeCity_value, "lblPostCodeCity", 113, 97, INTEGERS[4], new Short((short) 79), 68 }); 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[] { - fontDescriptor6, INTEGER_16, resources.reslblTitle4_value, Boolean.TRUE, "lblTitle4", new Integer(91), INTEGERS[8], INTEGERS[4], new Short((short) 92), new Integer(212) + fontDescriptor6, INTEGER_16, resources.reslblTitle4_value, Boolean.TRUE, "lblTitle4", 91, INTEGERS[8], INTEGERS[4], new Short((short) 92), 212 }); } @@ -785,7 +785,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - new Integer(47), HelpIds.getHelpIdString(HID + 41), Boolean.TRUE, "txtFooter", new Integer(97), INTEGER_40, INTEGERS[5], new Short((short) 41), new Integer(203) + 47, HelpIds.getHelpIdString(HID + 41), Boolean.TRUE, "txtFooter", 97, INTEGER_40, INTEGERS[5], new Short((short) 41), 203 }); chkFooterNextPages = insertCheckBox("chkFooterNextPages", CHKFOOTERNEXTPAGES_ITEM_CHANGED, new String[] @@ -794,7 +794,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 42), resources.reschkFooterNextPages_value, "chkFooterNextPages", new Integer(97), new Integer(92), new Short((short) 0), INTEGERS[5], new Short((short) 42), new Integer(202) + INTEGERS[8], HelpIds.getHelpIdString(HID + 42), resources.reschkFooterNextPages_value, "chkFooterNextPages", 97, 92, new Short((short) 0), INTEGERS[5], new Short((short) 42), 202 }); chkFooterPageNumbers = insertCheckBox("chkFooterPageNumbers", CHKFOOTERPAGENUMBERS_ITEM_CHANGED, new String[] @@ -803,25 +803,25 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 43), resources.reschkFooterPageNumbers_value, "chkFooterPageNumbers", new Integer(97), new Integer(106), new Short((short) 0), INTEGERS[5], new Short((short) 43), new Integer(201) + INTEGERS[8], HelpIds.getHelpIdString(HID + 43), resources.reschkFooterPageNumbers_value, "chkFooterPageNumbers", 97, 106, new Short((short) 0), INTEGERS[5], new Short((short) 43), 201 }); 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[] { - fontDescriptor5, INTEGERS[8], resources.reslblFooter_value, "lblFooter", new Integer(97), new Integer(28), INTEGERS[5], new Short((short) 52), new Integer(116) + fontDescriptor5, INTEGERS[8], resources.reslblFooter_value, "lblFooter", 97, 28, INTEGERS[5], new Short((short) 52), 116 }); 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[] { - fontDescriptor6, INTEGER_16, resources.reslblTitle5_value, Boolean.TRUE, "lblTitle5", new Integer(91), INTEGERS[8], INTEGERS[5], new Short((short) 93), new Integer(212) + fontDescriptor6, INTEGER_16, resources.reslblTitle5_value, Boolean.TRUE, "lblTitle5", 91, INTEGERS[8], INTEGERS[5], new Short((short) 93), 212 }); } @@ -834,7 +834,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID + 44), "txtTemplateName", new Integer(202), new Integer(56), INTEGERS[6], new Short((short) 44), resources.restxtTemplateName_value, new Integer(100) + INTEGER_12, HelpIds.getHelpIdString(HID + 44), "txtTemplateName", 202, 56, INTEGERS[6], new Short((short) 44), resources.restxtTemplateName_value, 100 }); optCreateLetter = insertRadioButton("optCreateLetter", OPTCREATELETTER_ITEM_CHANGED, new String[] @@ -843,7 +843,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 45), resources.resoptCreateLetter_value, "optCreateLetter", new Integer(104), new Integer(111), INTEGERS[6], new Short((short) 50), new Integer(198) + INTEGERS[8], HelpIds.getHelpIdString(HID + 45), resources.resoptCreateLetter_value, "optCreateLetter", 104, 111, INTEGERS[6], new Short((short) 50), 198 }); optMakeChanges = insertRadioButton("optMakeChanges", OPTMAKECHANGES_ITEM_CHANGED, new String[] @@ -852,7 +852,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID + 46), resources.resoptMakeChanges_value, "optMakeChanges", new Integer(104), new Integer(123), INTEGERS[6], new Short((short) 51), new Integer(198) + INTEGERS[8], HelpIds.getHelpIdString(HID + 46), resources.resoptMakeChanges_value, "optMakeChanges", 104, 123, INTEGERS[6], new Short((short) 51), 198 }); lblFinalExplanation1 = insertLabel("lblFinalExplanation1", new String[] @@ -861,7 +861,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - new Integer(26), resources.reslblFinalExplanation1_value, Boolean.TRUE, "lblFinalExplanation1", new Integer(97), new Integer(28), INTEGERS[6], new Short((short) 52), new Integer(205) + 26, resources.reslblFinalExplanation1_value, Boolean.TRUE, "lblFinalExplanation1", 97, 28, INTEGERS[6], new Short((short) 52), 205 }); lblProceed = insertLabel("lblProceed", new String[] @@ -870,7 +870,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblProceed_value, "lblProceed", new Integer(97), new Integer(100), INTEGERS[6], new Short((short) 53), new Integer(204) + INTEGERS[8], resources.reslblProceed_value, "lblProceed", 97, 100, INTEGERS[6], new Short((short) 53), 204 }); lblFinalExplanation2 = insertLabel("lblFinalExplanation2", new String[] @@ -879,16 +879,16 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - new Integer(33), resources.reslblFinalExplanation2_value, Boolean.TRUE, "lblFinalExplanation2", new Integer(104), new Integer(145), INTEGERS[6], new Short((short) 54), new Integer(199) + 33, resources.reslblFinalExplanation2_value, Boolean.TRUE, "lblFinalExplanation2", 104, 145, INTEGERS[6], new Short((short) 54), 199 }); ImageControl2 = insertImage("ImageControl2", new String[] { - "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Short((short) 0), INTEGERS[10], "private:resource/dbu/image/19205", "ImageControl2", new Integer(92), new Integer(145), Boolean.FALSE, INTEGERS[6], new Short((short) 66), INTEGERS[10] + new Short((short) 0), INTEGERS[10], "private:resource/dbu/image/19205", "ImageControl2", 92, 145, Boolean.FALSE, INTEGERS[6], new Short((short) 66), INTEGERS[10] }); lblTemplateName = insertLabel("lblTemplateName", new String[] @@ -897,16 +897,16 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW }, new Object[] { - INTEGERS[8], resources.reslblTemplateName_value, "lblTemplateName", new Integer(97), new Integer(58), INTEGERS[6], new Short((short) 82), new Integer(101) + INTEGERS[8], resources.reslblTemplateName_value, "lblTemplateName", 97, 58, INTEGERS[6], new Short((short) 82), 101 }); 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[] { - fontDescriptor6, INTEGER_16, resources.reslblTitle6_value, Boolean.TRUE, "lblTitle6", new Integer(91), INTEGERS[8], INTEGERS[6], new Short((short) 94), new Integer(212) + fontDescriptor6, INTEGER_16, resources.reslblTitle6_value, Boolean.TRUE, "lblTitle6", 91, INTEGERS[8], INTEGERS[6], new Short((short) 94), 212 }); } diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java index 482e4a82c07d..ed3161c7282d 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,13 +205,13 @@ 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(); } XWindow xContainerWindow = myLetterDoc.xFrame.getContainerWindow(); - XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow); + XWindowPeer xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow); createWindowPeer(xWindowPeer); //add the Roadmap to the dialog: @@ -240,8 +240,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog removeTerminateListener(); exception.printStackTrace(System.out); running = false; - return; - } + } } public void cancelWizard() @@ -258,7 +257,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(); @@ -311,7 +310,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog if (bSaveSuccess) { saveConfiguration(); - XInteractionHandler xIH = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); + XInteractionHandler xIH = UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler")); PropertyValue loadValues[] = new PropertyValue[4]; loadValues[0] = new PropertyValue(); loadValues[0].Name = "AsTemplate"; @@ -335,7 +334,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog } Object oDoc = OfficeDocument.load(Desktop.getDesktop(xMSF), sPath, "_default", loadValues); XTextDocument xTextDocument = (com.sun.star.text.XTextDocument) oDoc; - XMultiServiceFactory xDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); ViewHandler myViewHandler = new ViewHandler(xDocMSF, xTextDocument); myViewHandler.setViewSetting("ZoomType", new Short(com.sun.star.view.DocumentZoomType.OPTIMAL)); } @@ -361,7 +360,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog try { //xComponent.dispose(); - XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, myLetterDoc.xFrame); + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, myLetterDoc.xFrame); xCloseable.close(false); } catch (CloseVetoException e) @@ -383,7 +382,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 +402,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 +422,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 +686,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); } @@ -734,7 +733,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { numFooterHeight.setValue(0.1); } - BusFooter = myLetterDoc.new BusinessPaperObject("Footer", (int) myLetterDoc.DocSize.Width, (int) (numFooterHeight.getValue() * 1000), (int) 0, (int) (myLetterDoc.DocSize.Height - (numFooterHeight.getValue() * 1000))); + BusFooter = myLetterDoc.new BusinessPaperObject("Footer", myLetterDoc.DocSize.Width, (int) (numFooterHeight.getValue() * 1000), 0, (int) (myLetterDoc.DocSize.Height - (numFooterHeight.getValue() * 1000))); this.setControlProperty("numFooterHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); this.setControlProperty("lblFooterHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); setPossibleFooter(false); @@ -827,7 +826,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog //enable/disable roadmap item for footer page XInterface BPaperItem = getRoadmapItemByID(RM_FOOTER); - Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bFooterPossible)); + Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bFooterPossible)); } catch (Exception exception) @@ -848,7 +847,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog private void setPossibleFooter(boolean bState) { - setControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); + setControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); chkUseFooterItemChanged(); } @@ -856,7 +855,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { if (myLetterDoc.hasElement("Sender Address Repeated")) { - setControlProperty("chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); + setControlProperty("chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); chkUseAddressReceiverItemChanged(); } } @@ -865,7 +864,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog { if (myLetterDoc.hasElement("Company Logo")) { - setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); + setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); chkUseLogoItemChanged(); } } @@ -907,7 +906,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog public void txtTemplateNameTextChanged() { - XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); + XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); XDocumentProperties xDocProps = xDocPropsSuppl.getDocumentProperties(); String TitleName = txtTemplateName.getText(); xDocProps.setTitle(TitleName); @@ -915,14 +914,14 @@ public class LetterWizardDialogImpl extends LetterWizardDialog public void chkUseSalutationItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); myLetterDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0)); - setControlProperty("lstSalutation", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseSalutation.getState() != 0)); + setControlProperty("lstSalutation", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(chkUseSalutation.getState() != 0)); } public void lstSalutationItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); myLetterDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0)); } @@ -932,21 +931,21 @@ public class LetterWizardDialogImpl extends LetterWizardDialog public void chkUseGreetingItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); myLetterDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0)); - setControlProperty("lstGreeting", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseGreeting.getState() != 0)); + setControlProperty("lstGreeting", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(chkUseGreeting.getState() != 0)); } private void setDefaultForGreetingAndSalutation() { XTextComponent xTextComponent; - xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); - if (xTextComponent.getText().equals("")) + xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstSalutation); + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.SalutationLabels[0]); } - xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); - if (xTextComponent.getText().equals("")) + xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); + if (xTextComponent.getText().equals(PropertyNames.EMPTY_STRING)) { xTextComponent.setText(resources.GreetingLabels[0]); } @@ -954,7 +953,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog public void lstGreetingItemChanged() { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, lstGreeting); myLetterDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0)); } @@ -1009,20 +1008,20 @@ public class LetterWizardDialogImpl extends LetterWizardDialog private void setPossibleSenderData(boolean bState) { - setControlProperty("optSenderDefine", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("optSenderPlaceholder", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("lblSenderAddress", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); + setControlProperty("optSenderDefine", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("optSenderPlaceholder", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("lblSenderAddress", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); if (!bState) { - setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("txtSenderName", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("txtSenderStreet", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("txtSenderState", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("lblSenderName", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("lblSenderStreet", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); - setControlProperty("lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, new Boolean(bState)); + setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("txtSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("txtSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("txtSenderState", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("lblSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("lblSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); + setControlProperty("lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bState)); } } @@ -1099,12 +1098,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,11 +1113,11 @@ public class LetterWizardDialogImpl extends LetterWizardDialog String[] allLocales = lc.getIDs(); Object[] nameList = { - "", "" + PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING }; String[] nameList2 = { - "", "" + PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING }; Vector allPaths = new Vector(); String sLetterSubPath = "/wizard/letter/"; @@ -1127,7 +1126,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++) { @@ -1140,7 +1139,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog sLetterPath = sMainPath + sLetterSubPath; XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = (com.sun.star.ucb.XSimpleFileAccess) UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface); + com.sun.star.ucb.XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(com.sun.star.ucb.XSimpleFileAccess.class, xInterface); nameList2 = xSimpleFileAccess.getFolderContents(sLetterPath, true); for (int i = 0; i < nameList2.length; i++) { @@ -1170,8 +1169,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++) { @@ -1179,7 +1178,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]; @@ -1191,7 +1190,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]; @@ -1204,7 +1203,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog if (found) { NormsVector.add(cIsoCode); - NormsPathVector.add((String) nameList[i]); + NormsPathVector.add(nameList[i]); LanguageLabelsVector.add(lc.getLanguageString(MSID)); } } @@ -1219,7 +1218,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog LanguageLabels = new String[LanguageLabelsVector.size()]; LanguageLabelsVector.toArray(LanguageLabels); - setControlProperty("lstLetterNorm", "StringItemList", LanguageLabels); + setControlProperty("lstLetterNorm", PropertyNames.STRING_ITEM_LIST, LanguageLabels); } private CGLetter getCurrentLetter() @@ -1242,7 +1241,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) @@ -1263,19 +1262,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 }); @@ -1289,11 +1288,11 @@ public class LetterWizardDialogImpl extends LetterWizardDialog public void initializeElements() { - setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Company Logo"))); - setControlProperty("chkUseBendMarks", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Bend Marks"))); - setControlProperty("chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Sender Address Repeated"))); - setControlProperty("chkUseSubject", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Subject Line"))); - setControlProperty("chkUseSigns", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Letter Signs"))); + setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myLetterDoc.hasElement("Company Logo"))); + setControlProperty("chkUseBendMarks", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myLetterDoc.hasElement("Bend Marks"))); + setControlProperty("chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myLetterDoc.hasElement("Sender Address Repeated"))); + setControlProperty("chkUseSubject", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myLetterDoc.hasElement("Subject Line"))); + setControlProperty("chkUseSigns", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(myLetterDoc.hasElement("Letter Signs"))); myLetterDoc.updateDateFields(); } diff --git a/wizards/com/sun/star/wizards/query/CallQueryWizard.java b/wizards/com/sun/star/wizards/query/CallQueryWizard.java index fe18fd13f6d0..84870f99646e 100644 --- a/wizards/com/sun/star/wizards/query/CallQueryWizard.java +++ b/wizards/com/sun/star/wizards/query/CallQueryWizard.java @@ -28,10 +28,10 @@ package com.sun.star.wizards.query; import com.sun.star.beans.PropertyAttribute; import com.sun.star.beans.PropertyValue; -import com.sun.star.lang.XComponent; 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>). @@ -82,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(); @@ -160,6 +160,7 @@ public class CallQueryWizard * whole combination of objects. * @return Array of bytes, in order to distinguish between two sets. */ + @Override public byte[] getImplementationId() { byte[] byteReturn = @@ -168,7 +169,7 @@ public class CallQueryWizard try { - byteReturn = new String("" + this.hashCode()).getBytes(); + byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes(); } catch (Exception exception) { @@ -191,6 +192,7 @@ public class CallQueryWizard * @return Sequence of all types (usually interface types) provided by the * service. */ + @Override public Type[] getTypes() { Type[] typeReturn = diff --git a/wizards/com/sun/star/wizards/query/Finalizer.java b/wizards/com/sun/star/wizards/query/Finalizer.java index 1b528a749f36..6caf2dfa60a2 100644 --- a/wizards/com/sun/star/wizards/query/Finalizer.java +++ b/wizards/com/sun/star/wizards/query/Finalizer.java @@ -71,7 +71,7 @@ public class Finalizer }, new Object[] { - new Integer(8), reslblQueryTitle, new Integer(95), new Integer(27), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), new Integer(52) + 8, reslblQueryTitle, 95, 27, new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), 52 }); m_aTxtTitle = m_queryWizard.insertTextField("txtQueryTitle", "changeTitle", this, new String[] { @@ -79,7 +79,7 @@ public class Finalizer }, new Object[] { - new Integer(12), HelpIds.getHelpIdString(curHelpIndex++), new Integer(95), new Integer(37), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), new Integer(90) + 12, HelpIds.getHelpIdString(curHelpIndex++), 95, 37, new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), 90 }); m_queryWizard.insertLabel("lblHowGoOn", new String[] { @@ -87,7 +87,7 @@ public class Finalizer }, new Object[] { - new Integer(16), reslblHowGoOn, Boolean.TRUE, new Integer(192), new Integer(27), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), new Integer(112) + 16, reslblHowGoOn, Boolean.TRUE, 192, 27, new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), 112 }); this.xRadioDisplayQuery = m_queryWizard.insertRadioButton("optDisplayQuery", new String[] @@ -96,7 +96,7 @@ public class Finalizer }, new Object[] { - new Integer(9), HelpIds.getHelpIdString(curHelpIndex++), resoptDisplayQuery, new Integer(192), new Integer(46), new Short((short) 1), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), new Integer(118) + 9, HelpIds.getHelpIdString(curHelpIndex++), resoptDisplayQuery, 192, 46, new Short((short) 1), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), 118 }); m_queryWizard.insertRadioButton("optModifyQuery", @@ -106,7 +106,7 @@ public class Finalizer }, new Object[] { - new Integer(10), HelpIds.getHelpIdString(curHelpIndex++), resoptModifyQuery, new Integer(192), new Integer(56), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), new Integer(118) + 10, HelpIds.getHelpIdString(curHelpIndex++), resoptModifyQuery, 192, 56, new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), 118 }); m_queryWizard.insertFixedLine("flnSummary", new String[] { @@ -114,15 +114,15 @@ public class Finalizer }, new Object[] { - new Integer(10), resflnSummary, new Integer(95), new Integer(68), new Integer(8), new Short(curtabindex++), new Integer(209) + 10, resflnSummary, 95, 68, 8, new Short(curtabindex++), 209 }); 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[] { - new Integer(96), HelpIds.getHelpIdString(curHelpIndex++), Boolean.TRUE, new Integer(95), new Integer(80), Boolean.TRUE, new Integer(8), Boolean.TRUE, new Integer(209) + 96, HelpIds.getHelpIdString(curHelpIndex++), Boolean.TRUE, 95, 80, Boolean.TRUE, 8, Boolean.TRUE, 209 }); } @@ -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,14 +158,13 @@ public class Finalizer catch (com.sun.star.uno.Exception exception) { exception.printStackTrace(System.out); - return ""; + return PropertyNames.EMPTY_STRING; } } private String getTitle() { - final String sTitle = (String) Helper.getUnoPropertyValue(UnoDialog.getModel(m_aTxtTitle), "Text"); - return sTitle; + return (String) Helper.getUnoPropertyValue(UnoDialog.getModel(m_aTxtTitle), "Text"); } public String finish() @@ -176,7 +175,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 f246ef327db8..7a0ab0d06beb 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; @@ -58,25 +59,16 @@ public class QuerySummary extends QueryMetaData sReturnChar = String.valueOf((char) 13) + String.valueOf((char) 13); } - /* boolean bAssignAliases = xDBMetaData.supportsColumnAliasing(); - boolean bSupportsGroupByUnrelated = xDBMetaData.supportsGroupByUnrelated(); - boolean bSupportsOrderByUnrelated = xDBMetaData.supportsOrderByUnrelated(); - boolean bSupportsNumericFunctions = xDBMetaData.getNumericFunctions() != ""; - xDBMetaData.getMaxColumnsInGroupBy(); - xDBMetaData.getMaxColumnsInOrderBy(); - xDBMetaData.getMaxColumnsInSelect(); - xDBMetaData.getMaxCharLiteralLength(); // gef?hrlich, da h?chstwahrscheinlich nicht sauber in jedem Treiber implementiert!!!!! - * */ public void setSummaryString() { 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[] { @@ -92,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) { @@ -107,41 +99,37 @@ public class QuerySummary extends QueryMetaData private String combineFilterNameFraction(PropertyValue[][] _filterconditions, int _InitResID, int _AlternativeResID) { - if (_filterconditions != null) + if (_filterconditions != null && _filterconditions.length > 0) { - if (_filterconditions.length > 0) + String sconditions = PropertyNames.EMPTY_STRING; + String sStart = oResource.getResText(_InitResID); + String BaseString = oResource.getResText(RID_QUERY + 96); + if (_filterconditions.length == 1) { - String sconditions = ""; - String sStart = oResource.getResText(_InitResID); - String BaseString = oResource.getResText(RID_QUERY + 96); - if (_filterconditions.length == 1) + PropertyValue[] curfilterconditions = _filterconditions[0]; + for (int i = 0; i < curfilterconditions.length; i++) { - PropertyValue[] curfilterconditions = _filterconditions[0]; - for (int i = 0; i < curfilterconditions.length; i++) - { - sconditions += FilterComponent.getDisplayCondition(BaseString, _filterconditions[0][i], this); - sconditions = appendClauseSeparator(sconditions, " " + sAnd + " ", i, curfilterconditions.length); - } + sconditions += FilterComponent.getDisplayCondition(BaseString, _filterconditions[0][i], this); + sconditions = appendClauseSeparator(sconditions, PropertyNames.SPACE + sAnd + PropertyNames.SPACE, i, curfilterconditions.length); } - else - { + } + else + { - for (int i = 0; i < _filterconditions.length; i++) - { - sconditions += FilterComponent.getDisplayCondition(BaseString, _filterconditions[i][0], this); - sconditions = appendClauseSeparator(sconditions, " " + sOr + " ", i, _filterconditions.length); - } + for (int i = 0; i < _filterconditions.length; i++) + { + sconditions += FilterComponent.getDisplayCondition(BaseString, _filterconditions[i][0], this); + sconditions = appendClauseSeparator(sconditions, PropertyNames.SPACE + sOr + PropertyNames.SPACE, i, _filterconditions.length); } - String sreturn = sStart + sconditions; - return sreturn; } + return sStart + sconditions; } return oResource.getResText(_AlternativeResID); } 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++) @@ -173,14 +161,12 @@ public class QuerySummary extends QueryMetaData return _basestring; } // TODO: How can you merge the following two methods to a single one in a smarter way?? + public String combinePartString(int _InitResID, String[] _FieldNames, int _AlternativeResID) { - if (_FieldNames != null) + if (_FieldNames != null && _FieldNames.length > 0) { - if (_FieldNames.length > 0) - { - return ArrayFieldsToString(_InitResID, _FieldNames); - } + return ArrayFieldsToString(_InitResID, _FieldNames); } return oResource.getResText(_AlternativeResID); } @@ -202,19 +188,16 @@ public class QuerySummary extends QueryMetaData public String combinePartString(int _InitResID, String[][] _FieldNames, int _AlternativeResID, int _BaseStringID, String[] _ReplaceTags) { - if (_FieldNames != null) + if (_FieldNames != null && _FieldNames.length > 0) { - if (_FieldNames.length > 0) - { - return ArrayFieldsToString(_InitResID, _FieldNames, _BaseStringID, _ReplaceTags); - } + return ArrayFieldsToString(_InitResID, _FieldNames, _BaseStringID, _ReplaceTags); } return oResource.getResText(_AlternativeResID); } 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 bca4e1a6fa5f..f4dd3296dbce 100644 --- a/wizards/com/sun/star/wizards/query/QueryWizard.java +++ b/wizards/com/sun/star/wizards/query/QueryWizard.java @@ -53,6 +53,7 @@ import com.sun.star.wizards.ui.TitlesComponent; public class QueryWizard extends DatabaseObjectWizard { + public static final String SFILLUPFIELDSLISTBOX = "fillUpFieldsListbox"; private static final int SOFIELDSELECTION_PAGE = 1; private static final int SOSORTING_PAGE = 2; @@ -76,21 +77,23 @@ public class QueryWizard extends DatabaseObjectWizard private String reslblFields; private String reslblSelFields; private String reslblTables; - private String resQueryWizard; private String reslblGroupBy; private String resmsgNonNumericAsGroupBy; private String m_createdQuery; - public QueryWizard( XMultiServiceFactory xMSF, PropertyValue[] i_wizardContext ) + public QueryWizard(XMultiServiceFactory xMSF, PropertyValue[] i_wizardContext) { - super( xMSF, 40970, i_wizardContext ); + super(xMSF, 40970, i_wizardContext); addResourceHandler("QueryWizard", "dbw"); m_DBMetaData = new QuerySummary(xMSF, m_oResource); } public static void main(String i_args[]) { - final String settings[] = new String[] { null, null, null }; + final String settings[] = new String[] + { + null, null, null + }; final int IDX_PIPE_NAME = 0; final int IDX_LOCATION = 1; final int IDX_DSN = 2; @@ -98,28 +101,28 @@ public class QueryWizard extends DatabaseObjectWizard // some simple parsing boolean failure = false; int settingsIndex = -1; - for ( int i=0; i<i_args.length; ++i ) + for (int i = 0; i < i_args.length; ++i) { - if ( settingsIndex >= 0 ) + if (settingsIndex >= 0) { - settings[ settingsIndex ] = i_args[i]; + settings[ settingsIndex] = i_args[i]; settingsIndex = -1; continue; } - if ( i_args[i].equals( "--pipe-name" ) ) + if (i_args[i].equals("--pipe-name")) { settingsIndex = IDX_PIPE_NAME; continue; } - if ( i_args[i].equals( "--database-location" ) ) + if (i_args[i].equals("--database-location")) { settingsIndex = IDX_LOCATION; continue; } - if ( i_args[i].equals( "--data-source-name" ) ) + if (i_args[i].equals("--data-source-name")) { settingsIndex = IDX_DSN; continue; @@ -128,18 +131,22 @@ public class QueryWizard extends DatabaseObjectWizard failure = true; } - if ( settings[ IDX_PIPE_NAME ] == null ) + if (settings[ IDX_PIPE_NAME] == null) + { failure = true; + } - if ( ( settings[ IDX_DSN ] == null ) && ( settings[ IDX_LOCATION ] == null ) ) + if ((settings[ IDX_DSN] == null) && (settings[ IDX_LOCATION] == null)) + { failure = true; + } - if ( failure ) + if (failure) { - System.err.println( "supported arguments: " ); - System.err.println( " --pipe-name <name> : specifies the name of the pipe to connect to the running OOo instance" ); - System.err.println( " --database-location <url> : specifies the URL of the database document to work with" ); - System.err.println( " --data-source-name <name> : specifies the name of the data source to work with" ); + System.err.println("supported arguments: "); + System.err.println(" --pipe-name <name> : specifies the name of the pipe to connect to the running OOo instance"); + System.err.println(" --database-location <url> : specifies the URL of the database document to work with"); + System.err.println(" --data-source-name <name> : specifies the name of the data source to work with"); return; } @@ -150,12 +157,16 @@ public class QueryWizard extends DatabaseObjectWizard if (serviceFactory != null) { PropertyValue[] curproperties = new PropertyValue[1]; - if ( settings[ IDX_LOCATION ] != null ) - curproperties[0] = Properties.createProperty( "DatabaseLocation", settings[ IDX_LOCATION ] ); + if (settings[ IDX_LOCATION] != null) + { + curproperties[0] = Properties.createProperty("DatabaseLocation", settings[ IDX_LOCATION]); + } else - curproperties[0] = Properties.createProperty( "DataSourceName", settings[ IDX_DSN ] ); + { + curproperties[0] = Properties.createProperty("DataSourceName", settings[ IDX_DSN]); + } - QueryWizard CurQueryWizard = new QueryWizard( serviceFactory, curproperties ); + QueryWizard CurQueryWizard = new QueryWizard(serviceFactory, curproperties); CurQueryWizard.startQueryWizard(); } } @@ -174,7 +185,7 @@ public class QueryWizard extends DatabaseObjectWizard { try { - if ( m_DBMetaData.getConnection( m_wizardContext ) ) + if (m_DBMetaData.getConnection(m_wizardContext)) { reslblFields = m_oResource.getResText(UIConsts.RID_QUERY + 4); reslblFieldHeader = m_oResource.getResText(UIConsts.RID_QUERY + 19); //Fielnames in AliasComponent @@ -182,27 +193,27 @@ public class QueryWizard extends DatabaseObjectWizard reslblSelFields = m_oResource.getResText(UIConsts.RID_QUERY + 50); reslblTables = m_oResource.getResText(UIConsts.RID_QUERY + 3); reslblGroupBy = m_oResource.getResText(UIConsts.RID_QUERY + 18); - resQueryWizard = m_oResource.getResText(UIConsts.RID_QUERY + 2); + String resQueryWizard = m_oResource.getResText(UIConsts.RID_QUERY + 2); resmsgNonNumericAsGroupBy = m_oResource.getResText(UIConsts.RID_QUERY + 88); Helper.setUnoPropertyValues(xDialogModel, new String[] { - PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(210), Boolean.TRUE, "DialogQuery", new Integer(102), new Integer(41), new Integer(1), new Short((short) 0), resQueryWizard, new Integer(310) + 210, Boolean.TRUE, "DialogQuery", 102, 41, 1, new Short((short) 0), resQueryWizard, 310 }); drawNaviBar(); setRightPaneHeaders(m_oResource, UIConsts.RID_QUERY + 70, 8); this.setMaxStep(8); buildSteps(); - this.m_DBCommandFieldSelectio.preselectCommand( m_wizardContext, false ); + this.m_DBCommandFieldSelectio.preselectCommand(m_wizardContext, false); - XWindowPeer windowPeer = UnoRuntime.queryInterface( XWindowPeer.class, m_frame.getContainerWindow() ); + XWindowPeer windowPeer = UnoRuntime.queryInterface(XWindowPeer.class, m_frame.getContainerWindow()); createWindowPeer(windowPeer); m_DBMetaData.setWindowPeer(this.xControl.getPeer()); insertQueryRelatedSteps(); - executeDialog( m_frame.getContainerWindow().getPosSize() ); + executeDialog(m_frame.getContainerWindow().getPosSize()); } } catch (java.lang.Exception jexception) @@ -237,7 +248,7 @@ public class QueryWizard extends DatabaseObjectWizard switch (CurItemID) { case SOAGGREGATE_PAGE: - if (_bEnabled == true) + if (_bEnabled) { bEnabled = ((m_DBMetaData.hasNumericalFields()) && (m_DBMetaData.xDBMetaData.supportsCoreSQLGrammar())); } @@ -247,7 +258,7 @@ public class QueryWizard extends DatabaseObjectWizard break; case SOGROUPFILTER_PAGE: bEnabled = false; - if (_bEnabled == true) + if (_bEnabled) { bEnabled = (m_DBMetaData.GroupByFilterConditions.length > 0); } @@ -310,8 +321,8 @@ public class QueryWizard extends DatabaseObjectWizard try { m_DBCommandFieldSelectio = new CommandFieldSelection( - this, m_DBMetaData, 120, reslblFields, reslblSelFields, reslblTables, - m_DBMetaData.supportsQueriesInFrom(), 40850); + this, m_DBMetaData, 120, reslblFields, reslblSelFields, reslblTables, + m_DBMetaData.supportsQueriesInFrom(), 40850); m_DBCommandFieldSelectio.setAppendMode(true); m_DBCommandFieldSelectio.addFieldSelectionListener(new FieldSelectionListener()); m_sortingComponent = new SortingComponent(this, SOSORTING_PAGE, 95, 27, 210, 40865); @@ -341,14 +352,13 @@ public class QueryWizard extends DatabaseObjectWizard public boolean finishWizard() { int ncurStep = getCurrentStep(); - if ( ( ncurStep == SOSUMMARY_PAGE ) - || ( switchToStep( ncurStep, SOSUMMARY_PAGE ) ) - ) + if ((ncurStep == SOSUMMARY_PAGE) + || (switchToStep(ncurStep, SOSUMMARY_PAGE))) { m_createdQuery = m_finalizer.finish(); - if ( m_createdQuery.length() > 0 ) + if (m_createdQuery.length() > 0) { - loadSubComponent( CommandType.QUERY, m_createdQuery, m_finalizer.displayQueryDesign() ); + loadSubComponent(CommandType.QUERY, m_createdQuery, m_finalizer.displayQueryDesign()); xDialog.endExecute(); return true; } @@ -490,7 +500,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..8b10e96ac5a3 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,9 +116,9 @@ public class CallReportWizard { try { - if (sEvent.compareTo("start") == 0) + if (sEvent.compareTo(PropertyNames.START) == 0) { - if (bWizardstartedalready != true) + if (!bWizardstartedalready) { ReportWizard CurReportWizard = new ReportWizard( xmultiservicefactory, m_wizardContext ); CurReportWizard.startReportWizard(); @@ -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..25b6da4950c3 100644 --- a/wizards/com/sun/star/wizards/report/DBColumn.java +++ b/wizards/com/sun/star/wizards/report/DBColumn.java @@ -126,7 +126,7 @@ public class DBColumn try { XCell xCell = CurRecordTable.xCellRange.getCellByPosition(_nColumn, 0); - XTextRange xTextCell = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xCell); + XTextRange xTextCell = UnoRuntime.queryInterface(XTextRange.class, xCell); String CompString = "Column"; XTextCursor xLocCellCursor = TextDocument.createTextCursor(xCell); if (isNameCell(xLocCellCursor, CurDBField.getFieldName(), CompString) || (_bforce)) @@ -134,7 +134,7 @@ public class DBColumn xNameCell = xCell; xNameTextCell = xTextCell; xValCell = CurRecordTable.xCellRange.getCellByPosition(_nColumn, 1); - xValTextCell = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xValCell); + xValTextCell = UnoRuntime.queryInterface(XTextRange.class, xValCell); xValCellCursor = TextDocument.createTextCursor(xValCell); ValColumn = _nColumn; return true; @@ -190,7 +190,7 @@ public class DBColumn for (int m = 0; m < xRows.getCount(); m++) { xCell = xCellRange.getCellByPosition(n, m); - xTextCell = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xCell); + xTextCell = UnoRuntime.queryInterface(XTextRange.class, xCell); String CompString = TableName.substring(4); XTextCursor xLocCellCursor = TextDocument.createTextCursor(xCell); if (isNameCell(xLocCellCursor, CurDBField.getFieldName(), CompString)) @@ -216,12 +216,12 @@ public class DBColumn try { XNameAccess xAllTextTables = oTextTableHandler.xTextTablesSupplier.getTextTables(); - if (xAllTextTables.hasByName(TableName) == true) + if (xAllTextTables.hasByName(TableName)) { Object oTextTable = xAllTextTables.getByName(TableName); - xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oTextTable); - xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, oTextTable); - xTableName = (XNamed) UnoRuntime.queryInterface(XNamed.class, oTextTable); + xCellRange = UnoRuntime.queryInterface(XCellRange.class, oTextTable); + xTextTable = UnoRuntime.queryInterface(XTextTable.class, oTextTable); + xTableName = UnoRuntime.queryInterface(XNamed.class, oTextTable); xTableColumns = xTextTable.getColumns(); } } @@ -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()); } @@ -290,7 +290,7 @@ public class DBColumn try { xValCell = xCellRange.getCellByPosition(ValColumn, ValRow); - xValTextCell = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xValCell); + xValTextCell = UnoRuntime.queryInterface(XTextRange.class, xValCell); modifyCellContent(CurGroupValue); if (bAlignLeft) { @@ -361,7 +361,7 @@ public class DBColumn try { Object CurGroupValue; - if (bIsGroupColumn == false && CurDBField.isNumberFormat() == false) + if (!bIsGroupColumn && !CurDBField.isNumberFormat()) { CurGroupValue = BlindtextCreator.adjustBlindTextlength(CurDBField.getFieldTitle(), CurDBField.getFieldWidth(), _bIsLandscape, bIsGroupColumn, CurDBMetaData.getRecordFieldNames()); } @@ -381,7 +381,7 @@ public class DBColumn { CharFontName = "StarSymbol"; Helper.setUnoPropertyValue(xValCellCursor, "CharFontName", CharFontName); - if (bIsGroupColumn == false) + if (!bIsGroupColumn) { Helper.setUnoPropertyValue(xValCellCursor, "ParaAdjust", new Integer(ParagraphAdjust.CENTER_value)); } @@ -390,7 +390,7 @@ public class DBColumn { if (PropertyState == com.sun.star.beans.PropertyState.DEFAULT_VALUE) { - XPropertyState xPropState = (XPropertyState) UnoRuntime.queryInterface(XPropertyState.class, xValCellCursor); + XPropertyState xPropState = UnoRuntime.queryInterface(XPropertyState.class, xValCellCursor); xPropState.setPropertyToDefault("CharFontName"); } else @@ -425,7 +425,7 @@ public class DBColumn } else { - xPropertyState = (XPropertyState) UnoRuntime.queryInterface(XPropertyState.class, xValCellCursor); + xPropertyState = UnoRuntime.queryInterface(XPropertyState.class, xValCellCursor); PropertyState = xPropertyState.getPropertyState("CharFontName"); CharFontName = AnyConverter.toString(Helper.getUnoPropertyValue(xValCellCursor, "CharFontName")); } @@ -449,7 +449,7 @@ public class DBColumn } else { - XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField); + XDependentTextField xDependent = UnoRuntime.queryInterface(XDependentTextField.class, oTextField); XPropertySet xMaster = xDependent.getTextFieldMaster(); String UserFieldName = (String) xMaster.getPropertyValue(PropertyNames.PROPERTY_NAME); boolean bIsNameCell = false; diff --git a/wizards/com/sun/star/wizards/report/Dataimport.java b/wizards/com/sun/star/wizards/report/Dataimport.java index 2081b655ae7e..5b80ec41e5b8 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); @@ -119,11 +121,11 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi Helper.setUnoPropertyValues(xDialogModel, new String[] { - PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_STEP, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(84), new Integer(0), sProgressTitle, new Integer(180) + 84, 0, sProgressTitle, 180 }); com.sun.star.awt.FontDescriptor oFontDesc = new com.sun.star.awt.FontDescriptor(); oFontDesc.Weight = com.sun.star.awt.FontWeight.BOLD; @@ -132,11 +134,11 @@ 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[] { - oFontDesc, new Integer(10), sProgressDBConnection, new Integer(6), new Integer(6), new Integer(0), new Integer(150) + oFontDesc, 10, sProgressDBConnection, 6, 6, 0, 150 }); insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblProgressDataImport", @@ -146,7 +148,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi }, new Object[] { - new Integer(10), sProgressDataImport, new Integer(6), new Integer(24), new Integer(0), new Integer(120) + 10, sProgressDataImport, 6, 24, 0, 120 }); } else @@ -154,11 +156,11 @@ 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[] { - oFontDesc, new Integer(10), sProgressDataImport, new Integer(6), new Integer(24), new Integer(0), new Integer(120) + oFontDesc, 10, sProgressDataImport, 6, 24, 0, 120 }); } insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblCurProgress", @@ -168,7 +170,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi }, new Object[] { - new Integer(10), "", new Integer(12), new Integer(42), new Integer(0), new Integer(120) + 10, PropertyNames.EMPTY_STRING, 12, 42, 0, 120 }); insertButton("cmdCancel", 10000, this, @@ -178,22 +180,21 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi }, new Object[] { - new Integer(14), HelpIds.getHelpIdString(34321), new Integer(74), new Integer(58), new Integer(0), new Short((short) 1), new Integer(40), sStop + 14, HelpIds.getHelpIdString(34321), 74, 58, 0, new Short((short) 1), 40, sStop }); createWindowPeer(CurReportDocument.getWizardParent()); calculateDialogPosition(CurReportDocument.getFrame().getComponentWindow().getPosSize()); xWindow.setVisible(true); 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/GroupFieldHandler.java b/wizards/com/sun/star/wizards/report/GroupFieldHandler.java index bab8a4bb240e..b123bb3b06fb 100644 --- a/wizards/com/sun/star/wizards/report/GroupFieldHandler.java +++ b/wizards/com/sun/star/wizards/report/GroupFieldHandler.java @@ -53,8 +53,8 @@ public class GroupFieldHandler extends FieldSelection this.oWizardDialog = _CurUnoDialog; this.CurReportDocument = _CurReportDocument; this.CurDBMetaData = CurReportDocument.getRecordParser(); - CurUnoDialog.setControlProperty("lstFields_2", "MultiSelection", new Boolean(false)); - CurUnoDialog.setControlProperty("lstSelFields_2", "MultiSelection", new Boolean(false)); + CurUnoDialog.setControlProperty("lstFields_2", "MultiSelection", Boolean.FALSE); + CurUnoDialog.setControlProperty("lstSelFields_2", "MultiSelection", Boolean.FALSE); addFieldSelectionListener(new FieldSelectionListener()); String sNote = ReportWizard.getBlindTextNote(_CurReportDocument, _CurUnoDialog.m_oResource); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblBlindTextNote_1", @@ -64,7 +64,7 @@ public class GroupFieldHandler extends FieldSelection }, new Object[] { - new Boolean(false), new Integer(18), sNote, new Boolean(true), new Integer(95), new Integer(158), new Integer(ReportWizard.SOGROUPPAGE), new Integer(209) + Boolean.FALSE, 18, sNote, Boolean.TRUE, 95, 158, new Integer(ReportWizard.SOGROUPPAGE), 209 }); } catch (Exception exception) @@ -113,7 +113,7 @@ public class GroupFieldHandler extends FieldSelection { emptyFieldsListBoxes(); GroupFieldVector.removeAllElements(); - CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, new Boolean(false)); + CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); } public void getGroupFieldNames(CommandMetaData CurDBMetaData) @@ -162,7 +162,7 @@ public class GroupFieldHandler extends FieldSelection int iSelCount = xSelectedFieldsListBox.getItemCount(); String[] CurGroupNames = xFieldsListBox.getItems(); CurReportDocument.liveupdate_addGroupNametoDocument(CurGroupNames, CurGroupTitle, GroupFieldVector, CurReportDocument.getReportPath(), iSelCount); - CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, new Boolean(true)); + CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); if (iSelCount >= MAXSELFIELDS) { toggleMoveButtons(false, false); @@ -178,7 +178,7 @@ public class GroupFieldHandler extends FieldSelection String[] NewSelList = xSelectedFieldsListBox.getItems(); CurReportDocument.liveupdate_removeGroupName(NewSelList, OldGroupTitle, GroupFieldVector); String[] NewSelGroupNames = xSelectedFieldsListBox.getItems(); - CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, new Boolean(NewSelGroupNames.length == 0)); + CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(NewSelGroupNames.length == 0)); // CurReportDocument.refreshGroupFields(xSelectedFieldsListBox.getItems()); } 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/RecordTable.java b/wizards/com/sun/star/wizards/report/RecordTable.java index b4af7f7fa94b..86b365fbac80 100644 --- a/wizards/com/sun/star/wizards/report/RecordTable.java +++ b/wizards/com/sun/star/wizards/report/RecordTable.java @@ -69,21 +69,21 @@ public class RecordTable { oTable = xAllTextTables.getByName(ReportTextDocument.TBLRECORDSECTION); } - xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, oTable); - xTableName = (XNamed) UnoRuntime.queryInterface(XNamed.class, xTextTable); + xTextTable = UnoRuntime.queryInterface(XTextTable.class, oTable); + xTableName = UnoRuntime.queryInterface(XNamed.class, xTextTable); } else { - XIndexAccess xTableIndex = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xAllTextTables); + XIndexAccess xTableIndex = UnoRuntime.queryInterface(XIndexAccess.class, xAllTextTables); int n = xTableIndex.getCount() - 1; Object x = xTableIndex.getByIndex(n); - xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, x); - xTableName = (XNamed) UnoRuntime.queryInterface(XNamed.class, xTextTable); + xTextTable = UnoRuntime.queryInterface(XTextTable.class, x); + xTableName = UnoRuntime.queryInterface(XNamed.class, xTextTable); xTableName.setName(ReportTextDocument.TBLRECORDSECTION); } xTableRows = xTextTable.getRows(); xTableColumns = xTextTable.getColumns(); - xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, xTextTable); + xCellRange = UnoRuntime.queryInterface(XCellRange.class, xTextTable); } catch (Exception exception) { diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java index 73a32f35c029..5498eb89dd55 100644 --- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java +++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java @@ -94,7 +94,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(8), sReportTitle, new Integer(95), new Integer(27), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), new Integer(68) + 8, sReportTitle, 95, 27, new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), 68 }); xTitleTextBox = CurUnoDialog.insertTextField("txtTitle", CHANGEREPORTTITLE_FUNCNAME, this, @@ -104,7 +104,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(12), "HID:WIZARDS_HID_DLGREPORT_4_TITLE", new Integer(95), new Integer(37), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), new Integer(209) + 12, "HID:WIZARDS_HID_DLGREPORT_4_TITLE", 95, 37, new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), 209 }); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblChooseReportKind", @@ -114,7 +114,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(8), slblChooseReportKind, new Integer(95), new Integer(57), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), new Integer(209) + 8, slblChooseReportKind, 95, 57, new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), 209 }); CurUnoDialog.insertRadioButton("optCreateDocument", TOGGLESUBTEMPLATECONTROLS_FUNCNAME, this, @@ -124,7 +124,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(10), "HID:WIZARDS_HID_DLGREPORT_5_OPTSTATDOCUMENT", sSaveAsDocument, new Integer(95), new Integer(69), new Short((short) 0), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), new Integer(138) + 10, "HID:WIZARDS_HID_DLGREPORT_5_OPTSTATDOCUMENT", sSaveAsDocument, 95, 69, new Short((short) 0), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), 138 }); CurUnoDialog.insertRadioButton("optCreateReportTemplate", TOGGLESUBTEMPLATECONTROLS_FUNCNAME, this, @@ -134,7 +134,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(8), "HID:WIZARDS_HID_DLGREPORT_5_OPTDYNTEMPLATE", sSaveAsTemplate, new Integer(95), new Integer(81), new Short((short) 1), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), new Integer(209) + 8, "HID:WIZARDS_HID_DLGREPORT_5_OPTDYNTEMPLATE", sSaveAsTemplate, 95, 81, new Short((short) 1), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), 209 }); @@ -145,7 +145,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(8), slblHowProceed, new Integer(105), new Integer(93), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), new Integer(209) + 8, slblHowProceed, 105, 93, new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), 209 }); @@ -156,7 +156,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(10), "HID:WIZARDS_HID_DLGREPORT_5_OPTEDITTEMPLATE", sEditTemplate, new Integer(111), new Integer(105), new Integer(6), new Short(curtabindex++), new Integer(138) + 10, "HID:WIZARDS_HID_DLGREPORT_5_OPTEDITTEMPLATE", sEditTemplate, 111, 105, 6, new Short(curtabindex++), 138 }); CurUnoDialog.insertRadioButton("optUseTemplate", TOGGLESUBTEMPLATECONTROLS_FUNCNAME, this, @@ -166,7 +166,7 @@ public class ReportFinalizer }, new Object[] { - new Integer(10), "HID:WIZARDS_HID_DLGREPORT_5_OPTUSETEMPLATE", sUseTemplate, new Integer(111), new Integer(115), new Short((short) 1), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), new Integer(138) + 10, "HID:WIZARDS_HID_DLGREPORT_5_OPTUSETEMPLATE", sUseTemplate, 111, 115, new Short((short) 1), new Integer(ReportWizard.SOSTOREPAGE), new Short(curtabindex++), 138 }); } @@ -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){ @@ -200,7 +200,7 @@ public class ReportFinalizer { String FirstCommandName = (_CurDBMetaData.getIncludedCommandNames())[0]; DefaultName = Desktop.getUniqueName(_CurDBMetaData.getReportDocuments(), FirstCommandName); - if (DefaultName.equals(OldDefaultName) == false) + if (!DefaultName.equals(OldDefaultName)) { OldDefaultName = DefaultName; } @@ -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; } @@ -227,14 +227,14 @@ public class ReportFinalizer StoreName = getStoreName(); String StorePath; XInterface xInterface = (XInterface) m_xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); + XSimpleFileAccess xSimpleFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface); StorePath = FileAccess.getOfficePath(m_xMSF, "Temp", xSimpleFileAccess) + "/" + StoreName; return StorePath; } 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 16180f4df91c..0ea91a2f2a30 100644 --- a/wizards/com/sun/star/wizards/report/ReportLayouter.java +++ b/wizards/com/sun/star/wizards/report/ReportLayouter.java @@ -96,7 +96,7 @@ public class ReportLayouter }, new Object[] { - new Integer(8), slblDataStructure, new Integer(95), new Integer(27), new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), new Integer(99) + 8, slblDataStructure, 95, 27, new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), 99 }); short iSelPos = 0; @@ -111,14 +111,14 @@ 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[] { - new Integer(108), "HID:WIZARDS_HID_DLGREPORT_4_DATALAYOUT", new Integer(95), new Integer(37), new short[] + 108, "HID:WIZARDS_HID_DLGREPORT_4_DATALAYOUT", 95, 37, new short[] { iSelPos - }, new Integer(ReportWizard.SOTEMPLATEPAGE), ContentFiles[0], new Short(curtabindex++), new Integer(99) + }, new Integer(ReportWizard.SOTEMPLATEPAGE), ContentFiles[0], new Short(curtabindex++), 99 }); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblLayout", @@ -128,7 +128,7 @@ public class ReportLayouter }, new Object[] { - new Integer(8), slblPageLayout, new Integer(205), new Integer(27), new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), new Integer(99) + 8, slblPageLayout, 205, 27, new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), 99 }); short iSelLayoutPos = 0; @@ -146,14 +146,14 @@ 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[] { - new Integer(108), "HID:WIZARDS_HID_DLGREPORT_4_PAGELAYOUT", new Integer(205), new Integer(37), new short[] + 108, "HID:WIZARDS_HID_DLGREPORT_4_PAGELAYOUT", 205, 37, new short[] { iSelLayoutPos - }, new Integer(ReportWizard.SOTEMPLATEPAGE), LayoutFiles[0], new Short(curtabindex++), new Integer(99) + }, new Integer(ReportWizard.SOTEMPLATEPAGE), LayoutFiles[0], new Short(curtabindex++), 99 }); iOldLayoutPos = (int) iSelPos; CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblOrientation", @@ -163,7 +163,7 @@ public class ReportLayouter }, new Object[] { - new Integer(8), sOrientationHeader, new Integer(95), new Integer(148), new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), new Integer(74) + 8, sOrientationHeader, 95, 148, new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), 74 }); short m_nLandscapeState = CurReportDocument.getDefaultPageOrientation() == SOOPTLANDSCAPE ? (short) 1 : 0; @@ -174,7 +174,7 @@ public class ReportLayouter }, new Object[] { - new Integer(10), "HID:WIZARDS_HID_DLGREPORT_4_LANDSCAPE", sOrientHorizontal, new Integer(101), new Integer(158), new Short(m_nLandscapeState), new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), new Integer(60) + 10, "HID:WIZARDS_HID_DLGREPORT_4_LANDSCAPE", sOrientHorizontal, 101, 158, new Short(m_nLandscapeState), new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), 60 }); short m_nPortraitState = CurReportDocument.getDefaultPageOrientation() == SOOPTPORTRAIT ? (short) 1 : (short) 0; @@ -185,17 +185,17 @@ public class ReportLayouter }, new Object[] { - new Integer(10), "HID:WIZARDS_HID_DLGREPORT_4_PORTRAIT", sOrientVertical, new Integer(101), new Integer(171), new Short(m_nPortraitState), new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), new Integer(60) + 10, "HID:WIZARDS_HID_DLGREPORT_4_PORTRAIT", sOrientVertical, 101, 171, new Short(m_nPortraitState), new Integer(ReportWizard.SOTEMPLATEPAGE), new Short(curtabindex++), 60 }); aOrientationImage = CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlImageControlModel", "imgOrientation", new String[] { - "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Short("0"), new Integer(23), new Integer(164), new Integer(158), new Boolean(false), new Integer(ReportWizard.SOTEMPLATEPAGE), new Integer(30) + new Short("0"), 23, 164, 158, Boolean.FALSE, new Integer(ReportWizard.SOTEMPLATEPAGE), 30 }); String sNote = ReportWizard.getBlindTextNote(CurReportDocument, CurUnoDialog.m_oResource); @@ -206,7 +206,7 @@ public class ReportLayouter }, new Object[] { - new Integer(34), sNote, new Boolean(true), new Integer(205), new Integer(148), new Integer(ReportWizard.SOTEMPLATEPAGE), new Integer(99) + 34, sNote, Boolean.TRUE, 205, 148, new Integer(ReportWizard.SOTEMPLATEPAGE), 99 }); if (m_nLandscapeState == 1) { @@ -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]); @@ -246,7 +246,7 @@ public class ReportLayouter try { int iPos; - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(false)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); // LLA: should we lock controllers here? // CurReportDocument.getDoc().xTextDocument.lockControllers(); int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); @@ -306,7 +306,7 @@ public class ReportLayouter e.printStackTrace(); } // CurReportDocument.getDoc().unlockallControllers(); - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(true)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); } public void disposing(EventObject eventObject) @@ -325,17 +325,17 @@ public class ReportLayouter { try { - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(false)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); // CurReportDocument.getDoc().xTextDocument.lockControllers(); boolean blandscape = (((Short) CurUnoDialog.getControlProperty("optLandscape", PropertyNames.PROPERTY_STATE)).shortValue() == 1); - CurReportDocument.setPageOrientation((blandscape == true) ? SOOPTLANDSCAPE : SOOPTPORTRAIT); + CurReportDocument.setPageOrientation((blandscape) ? SOOPTLANDSCAPE : SOOPTPORTRAIT); } catch (Exception exception) { exception.printStackTrace(System.out); } // CurReportDocument.getDoc().unlockallControllers(); - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(true)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); } } } diff --git a/wizards/com/sun/star/wizards/report/ReportTextDocument.java b/wizards/com/sun/star/wizards/report/ReportTextDocument.java index 3ab9e704b9b9..79196826def1 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,11 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { oTextSection = xTextSections.getByName(RECORDSECTION); } - boolean bLayoutMode = AnyConverter.toBoolean(Helper.getUnoPropertyValue(oTextSection, "IsVisible")); - return bLayoutMode; + return AnyConverter.toBoolean(Helper.getUnoPropertyValue(oTextSection, ISVISIBLE)); } - 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 +178,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,39 +187,59 @@ 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); } } public void createReportForm(String SOREPORTFORMNAME) { 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()))); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, xNamedForm); + 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 +256,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 +268,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 +286,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); } } @@ -290,22 +316,15 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen for (i = 0; i < GroupCount; i++) { CurDBColumn = new DBColumn(oTextTableHandler, CurDBMetaData, CurDBMetaData.GroupFieldNames[i], i, TBLGROUPSECTION + (i + 1)); - if (CurDBColumn == null) - { - return false; - } - else - { - CurDBColumn.formatValueCell(); - DBColumnsVector.set(i, CurDBColumn); - replaceFieldValueInGroupTable(CurDBColumn, i); - } + CurDBColumn.formatValueCell(); + DBColumnsVector.set(i, CurDBColumn); + replaceFieldValueInGroupTable(CurDBColumn, i); } 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 +371,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 +387,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++) { @@ -471,16 +491,8 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen oTextSectionHandler.insertTextSection(GROUPSECTION + GroupCount, sPath, GroupCount == 1); CurDBColumn = new DBColumn(oTextTableHandler, CurDBMetaData, CurFieldColumn.getFieldName(), GroupCount - 1, TBLGROUPSECTION + (GroupCount)); CurDBColumn.formatValueCell(); - if (CurDBColumn != null) - { - DBColumnsVector.addElement(CurDBColumn); - replaceFieldValueInGroupTable(CurDBColumn, GroupCount - 1); - } - else - { - String sMessage = JavaTools.replaceSubString(sMsgTableNotExisting, TBLGROUPSECTION + (GroupCount), "<TABLENAME>"); - CurDBMetaData.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sMessage); - } + DBColumnsVector.addElement(CurDBColumn); + replaceFieldValueInGroupTable(CurDBColumn, GroupCount - 1); } catch (Exception exception) { @@ -555,43 +567,35 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen } CurDBColumn = new DBColumn(CurRecordTable, oTextTableHandler, CurDBMetaData, i - CurDBMetaData.GroupFieldNames.length); } - if (CurDBColumn != null) + if (CurDBColumn.xNameCell != null) { - if (CurDBColumn.xNameCell != null) + DBColumnsVector.addElement(CurDBColumn); + } + else + { + String DelFieldName; + if (i < CurDBMetaData.GroupFieldNames.length) { - DBColumnsVector.addElement(CurDBColumn); + DelFieldName = CurDBMetaData.GroupFieldNames[i]; + CurDBMetaData.GroupFieldNames = JavaTools.removefromList(CurDBMetaData.GroupFieldNames, new String[] + { + DelFieldName + }); + CurDBMetaData.GroupFieldColumns = removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.GroupFieldColumns); } else { - String DelFieldName; - if (i < CurDBMetaData.GroupFieldNames.length) - { - DelFieldName = CurDBMetaData.GroupFieldNames[i]; - CurDBMetaData.GroupFieldNames = JavaTools.removefromList(CurDBMetaData.GroupFieldNames, new String[] - { - DelFieldName - }); - CurDBMetaData.GroupFieldColumns = removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.GroupFieldColumns); - } - else - { - DelFieldName = CurDBMetaData.getRecordFieldName(i - CurDBMetaData.GroupFieldNames.length); - String[] aNewList = JavaTools.removefromList(CurDBMetaData.getRecordFieldNames(), new String[] - { - DelFieldName - }); - CurDBMetaData.setRecordFieldNames(aNewList); - CurDBMetaData.RecordFieldColumns = removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.RecordFieldColumns); - CurDBMetaData.FieldColumns = removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.FieldColumns); + DelFieldName = CurDBMetaData.getRecordFieldName(i - CurDBMetaData.GroupFieldNames.length); + String[] aNewList = JavaTools.removefromList(CurDBMetaData.getRecordFieldNames(), new String[] + { + DelFieldName + }); + CurDBMetaData.setRecordFieldNames(aNewList); + CurDBMetaData.RecordFieldColumns = removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.RecordFieldColumns); + CurDBMetaData.FieldColumns = removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.FieldColumns); - } - i--; } - } - else - { - String sMessage = JavaTools.replaceSubString(sMsgTableNotExisting, TBLGROUPSECTION + (CurDBMetaData.GroupFieldNames.length), "<TABLENAME>"); - CurDBMetaData.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sMessage); + i--; } } java.util.Arrays.sort(CurDBMetaData.RecordFieldColumns, this); @@ -639,7 +643,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 +658,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; } } @@ -668,7 +672,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { sInvisibleSectionNames[i] = GROUPSECTION + i; } - XNameAccess xNameAccessTextSections = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oTextSectionHandler.xTextSectionsSupplier.getTextSections()); + XNameAccess xNameAccessTextSections = UnoRuntime.queryInterface(XNameAccess.class, oTextSectionHandler.xTextSectionsSupplier.getTextSections()); String[] sSectionNames = xNameAccessTextSections.getElementNames(); for (int i = 0; i < sSectionNames.length; i++) { @@ -695,7 +699,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen public void removeNonLayoutTextTables() { String[] sLayoutTableNames = getLayoutTextTableNames(); - XNameAccess xNameAccessTextTables = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oTextTableHandler.xTextTablesSupplier.getTextTables()); + XNameAccess xNameAccessTextTables = UnoRuntime.queryInterface(XNameAccess.class, oTextTableHandler.xTextTablesSupplier.getTextTables()); String[] sTableNames = xNameAccessTextTables.getElementNames(); for (int i = 0; i < sTableNames.length; i++) { @@ -710,8 +714,8 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen public void removeLayoutTextTables() { String[] sLayoutTableNames = getLayoutTextTableNames(); - XNameAccess xNameAccessTextTables = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oTextTableHandler.xTextTablesSupplier.getTextTables()); - XRelativeTextContentRemove xRelativeTextContentRemove = (XRelativeTextContentRemove) UnoRuntime.queryInterface(XRelativeTextContentRemove.class, xText); + XNameAccess xNameAccessTextTables = UnoRuntime.queryInterface(XNameAccess.class, oTextTableHandler.xTextTablesSupplier.getTextTables()); + XRelativeTextContentRemove xRelativeTextContentRemove = UnoRuntime.queryInterface(XRelativeTextContentRemove.class, xText); String[] sTableNames = xNameAccessTextTables.getElementNames(); for (int i = 0; i < sTableNames.length; i++) { @@ -720,7 +724,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen { if (!sTableName.equals(sLayoutTableNames[0])) { - XTextContent xTextContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, oTextTableHandler.getByName(sTableName)); + XTextContent xTextContent = UnoRuntime.queryInterface(XTextContent.class, oTextTableHandler.getByName(sTableName)); boolean bleaveloop = false; while (!bleaveloop) { @@ -728,7 +732,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 +755,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..6a79d0f37d84 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; @@ -193,8 +189,8 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme Helper.setUnoPropertyValue(xTextSection, "LinkRegion", sLinkRegion); if (CurDBColumn != null) { - boolean bIsGroupTable = (sLinkRegion.equals(ReportTextDocument.RECORDSECTION) != true); - if (bIsGroupTable == true) + boolean bIsGroupTable = (!sLinkRegion.equals(ReportTextDocument.RECORDSECTION)); + if (bIsGroupTable) { XTextTable xTextTable = getDoc().oTextTableHandler.getlastTextTable(); XCellRange xCellRange = UnoRuntime.queryInterface( XCellRange.class, xTextTable ); @@ -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(); @@ -338,7 +347,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme XTextCursor xTextCursor = ReportTextDocument.createTextCursor(getDoc().xTextDocument.getText()); xTextDocument.lockControllers(); - if (getRecordParser().ResultSet.next() == true) + if (getRecordParser().ResultSet.next()) { replaceUserFields(); Helper.setUnoPropertyValue(xTextCursor, "PageDescName", "First Page"); @@ -352,18 +361,18 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme CurDBColumn = (DBColumn) getDoc().DBColumnsVector.elementAt(ColIndex); addLinkedTextSection(xTextCursor, ReportTextDocument.GROUPSECTION + Integer.toString(ColIndex + 1), CurDBColumn, CurGroupValue); //COPYOF!!!! } - if (getRecordParser().getcurrentRecordData(DataVector) == true) + if (getRecordParser().getcurrentRecordData(DataVector)) { // int RowIndex = 1; m_bStopProcess = false; - while ((getRecordParser().ResultSet.next() == true) && (m_bStopProcess == false)) + while ((getRecordParser().ResultSet.next()) && (!m_bStopProcess)) { // RowIndex += 1; breset = false; for (ColIndex = 0; ColIndex < GroupFieldCount; ColIndex++) { CurGroupValue = getRecordParser().getGroupColumnValue(ColIndex); - if ((CurGroupValue.equals(OldGroupFieldValues[ColIndex]) == false) || (breset)) + if ((!CurGroupValue.equals(OldGroupFieldValues[ColIndex])) || (breset)) { breset = true; insertDataToRecordTable(xTextCursor, DataVector, RecordFieldCount); @@ -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 46fe77fbee38..000f093b54d5 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; @@ -103,19 +103,19 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, { super(i_serviceFactory, 34320, i_wizardContext); super.addResourceHandler("Report Wizard", "dbw"); - if (getReportResources(false) == true) + if (getReportResources(false)) { Helper.setUnoPropertyValues(xDialogModel, new String[] { PropertyNames.PROPERTY_HEIGHT, - "Moveable", + PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, - "Title", + PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] @@ -123,12 +123,12 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, Integer.valueOf(210), Boolean.TRUE, "DialogReport", - new Integer(102), - new Integer(41), - new Integer(1), + 102, + 41, + 1, new Short((short) 0), sMsgWizardName, - new Integer(310) + 310 }); drawNaviBar(); setRightPaneHeaders(this.WizardHeaderText); @@ -245,7 +245,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, private void dialogFinish() { this.xComponent.dispose(); - if (bCloseDocument == true) + if (bCloseDocument) { m_reportDocument.dispose(); return; @@ -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) { @@ -329,7 +337,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, }, new Object[] { - new Integer(16), sShowBinaryFields, new Integer(95), new Integer(162), new Integer(1), new Integer(210) + 16, sShowBinaryFields, 95, 162, 1, 210 }); } // CurReportDocument.getDoc().xProgressBar.setValue(40); @@ -398,12 +406,8 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, { return false; } - if (e.hasMoreElements()) - { - return true; + return e.hasMoreElements(); } - return false; - } /** * Return the path to the "com.sun.reportdesigner" extension @@ -416,8 +420,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, final XComponentContext xComponentContext = Helper.getComponentContext(_xMSF); final Object aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider"); XPackageInformationProvider xProvider = UnoRuntime.queryInterface(XPackageInformationProvider.class, aSingleton); - final String sLocation = xProvider.getPackageLocation("com.sun.reportdesigner"); - return sLocation; + return xProvider.getPackageLocation("com.sun.reportdesigner"); } private static XLogger m_xLogger; @@ -463,10 +466,8 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, { XMultiServiceFactory.class }); - m_reportDocument = (IReportDocument) aMethod.invoke(a, new Object[] - { - xMSF - }); + m_reportDocument = (IReportDocument) aMethod.invoke(a, xMSF + ); } catch (Exception e) { @@ -569,7 +570,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, public boolean getReportResources(boolean bgetProgressResourcesOnly) { sMsgWizardName = super.m_oResource.getResText(UIConsts.RID_REPORT); - if (bgetProgressResourcesOnly == false) + if (!bgetProgressResourcesOnly) { sShowBinaryFields = m_oResource.getResText(UIConsts.RID_REPORT + 60); slblTables = m_oResource.getResText(UIConsts.RID_FORM + 6); @@ -589,7 +590,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); @@ -619,7 +620,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, bEnabled = true; } - Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled)); + Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bEnabled)); } } catch (com.sun.star.uno.Exception exception) @@ -631,8 +632,8 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, private void enableWizardSteps(String[] NewItems) { boolean bEnabled = NewItems.length > 0; - setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled)); - setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled)); + setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bEnabled)); + setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bEnabled)); enableRoadmapItems(bEnabled); // Note: Performancewise this could be improved } @@ -698,7 +699,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 +718,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 +733,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..0b55936da3fb 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,11 @@ public class ReportBuilderImplementation extends ReportImplementationHelper public XWindowPeer getWizardParent() { - final XWindowPeer aWindowPeer = UnoRuntime.queryInterface( XWindowPeer.class, getFrame().getComponentWindow() ); - return aWindowPeer; + return UnoRuntime.queryInterface(XWindowPeer.class, getFrame().getComponentWindow()); } 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. @@ -120,8 +120,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper */ private IReportBuilderLayouter getReportBuilderLayouter() { - final IReportBuilderLayouter aReportBuilderLayouter = (IReportBuilderLayouter) getLayoutMap().get(m_sReportBuilderLayoutName); - return aReportBuilderLayouter; + return (IReportBuilderLayouter) getLayoutMap().get(m_sReportBuilderLayoutName); } private Object m_aReportDocument; private XPropertySet m_documentDefinition; @@ -139,15 +138,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,8 +166,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper private XModeSelector getModeSelector() { final XController xController = getReportDefinition().getCurrentController(); - final XModeSelector xModeSelector = UnoRuntime.queryInterface( XModeSelector.class, xController ); - return xModeSelector; + return UnoRuntime.queryInterface(XModeSelector.class, xController); } private void switchOffAddFieldWindow() @@ -209,11 +210,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 +274,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 +367,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 +408,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 +429,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 +450,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 +467,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 +512,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 +542,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 +555,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper public String getContentPath() { - return ""; + return PropertyNames.EMPTY_STRING; } public int getDefaultPageOrientation() @@ -573,8 +583,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper Object[] aParams = new Object[2]; aParams[0] = this; aParams[1] = m_resource; - final IReportBuilderLayouter aReportBuilderLayouter = (IReportBuilderLayouter) cTor.newInstance(aParams); - return aReportBuilderLayouter; + return (IReportBuilderLayouter) cTor.newInstance(aParams); } catch (Exception e) { @@ -727,7 +736,6 @@ public class ReportBuilderImplementation extends ReportImplementationHelper getReportDefinition().setCommandType(_nCommand); } - public void checkInvariants() throws java.lang.Exception { final String sDefaultHeaderLayoutPath = getDefaultHeaderLayout(); @@ -737,12 +745,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..02ad2438bb59 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; @@ -52,8 +53,7 @@ public class ColumnarSingleColumn extends ReportBuilderLayouter public String getLocalizedName() { - final String sLocalizedName = getResource().getResText(UIConsts.RID_REPORT + 81); - return sLocalizedName; + return getResource().getResText(UIConsts.RID_REPORT + 81); } protected void insertDetailFields() @@ -98,7 +98,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/ColumnarThreeColumns.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java index 2dc468fb09e7..51c14c42a536 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarThreeColumns.java @@ -51,8 +51,7 @@ public class ColumnarThreeColumns extends ColumnarTwoColumns public String getLocalizedName() { - final String sLocalizedName = getResource().getResText(UIConsts.RID_REPORT + 83); - return sLocalizedName; + return getResource().getResText(UIConsts.RID_REPORT + 83); } protected void insertDetailFields() diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ColumnarTwoColumns.java index d79713524021..9dd9bb78201c 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; @@ -52,8 +53,7 @@ public class ColumnarTwoColumns extends ReportBuilderLayouter public String getLocalizedName() { - final String sLocalizedName = getResource().getResText(UIConsts.RID_REPORT + 82); - return sLocalizedName; + return getResource().getResText(UIConsts.RID_REPORT + 82); } protected void insertDetailFields() @@ -130,7 +130,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..12999090e646 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; /** * @@ -180,7 +181,7 @@ public class DesignTemplate // is aObj a textfield // m_aDetailLabel_FD // m_aDetailTextField_FD - XFixedText aFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aObj); + XFixedText aFixedText = UnoRuntime.queryInterface(XFixedText.class, aObj); if (aFixedText != null && m_aDetailLabel == null) { @@ -188,7 +189,7 @@ public class DesignTemplate } else { - XFormattedField aFormattedField = (XFormattedField) UnoRuntime.queryInterface(XFormattedField.class, aObj); + XFormattedField aFormattedField = UnoRuntime.queryInterface(XFormattedField.class, aObj); if (aFormattedField != null && m_aDetailTextField == null) { @@ -217,7 +218,7 @@ public class DesignTemplate try { Object aGroup = xGroups.getByIndex(nGroup); - XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup); + XGroup xGroup = UnoRuntime.queryInterface(XGroup.class, aGroup); XSection xGroupSection = xGroup.getHeader(); final int nCount = xGroupSection.getCount(); @@ -226,7 +227,7 @@ public class DesignTemplate try { Object aObj = xGroupSection.getByIndex(i); - XFixedText aFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aObj); + XFixedText aFixedText = UnoRuntime.queryInterface(XFixedText.class, aObj); // is aObj a label // is aObj a textfield if (aFixedText != null && @@ -236,7 +237,7 @@ public class DesignTemplate } else { - XFormattedField aFormattedField = (XFormattedField) UnoRuntime.queryInterface(XFormattedField.class, aObj); + XFormattedField aFormattedField = UnoRuntime.queryInterface(XFormattedField.class, aObj); if (aFormattedField != null && m_aGroupTextField[nGroup] == null) { @@ -316,11 +317,11 @@ public class DesignTemplate m_xGlobalMSF = _xMSF; m_sFilename = _sPath; final Object aObj = _xMSF.createInstance("com.sun.star.report.ReportDefinition"); - m_xReportDefinition = (XReportDefinition) UnoRuntime.queryInterface(XReportDefinition.class, aObj); + m_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..3fa72ca047b2 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; @@ -53,8 +54,7 @@ public class InBlocksLabelsAbove extends ColumnarTwoColumns public String getLocalizedName() { - final String sLocalizedName = getResource().getResText(UIConsts.RID_REPORT + 85); - return sLocalizedName; + return getResource().getResText(UIConsts.RID_REPORT + 85); } protected void insertDetailFields() @@ -159,7 +159,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..34c2f9c10280 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; @@ -53,8 +54,7 @@ public class InBlocksLabelsLeft extends ColumnarTwoColumns public String getLocalizedName() { - final String sLocalizedName = getResource().getResText(UIConsts.RID_REPORT + 84); - return sLocalizedName; + return getResource().getResText(UIConsts.RID_REPORT + 84); } protected void insertDetailFields() @@ -126,7 +126,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..8d27f9e6507b 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java @@ -1,5 +1,4 @@ -/* - ************************************************************************ +/************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -72,6 +71,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 +84,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter private IReportDefinitionReadAccess m_xReportDefinitionReadAccess; private Resource m_aResource; + private String[][] m_aSortNames; /** * dispose the ReportBuilderLayouter @@ -91,7 +93,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter { closeDesignTemplate(); m_xReportDefinitionReadAccess = null; - // m_xReportBuilderLayouter = null; + // m_xReportBuilderLayouter = null; } /** @@ -148,11 +150,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 +165,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 +185,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 @@ -206,13 +209,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter try { final Object aObj = _xSectionToClear.getByIndex(0); - final XShape aShape = (XShape) UnoRuntime.queryInterface(XShape.class, aObj); + final XShape aShape = 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 +228,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter // public void clearFieldTitles() // { // } + /** * * @param _nGroupCount @@ -291,7 +294,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter // get all Page Styles final Object aPageStylesObj = xNameAccess.getByName(_sStyleName); - final XNameAccess xContainer = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, aPageStylesObj); + final XNameAccess xContainer = UnoRuntime.queryInterface(XNameAccess.class, aPageStylesObj); // step over all Page Styles, search the one which is in use final String[] aElementNames = xContainer.getElementNames(); @@ -299,7 +302,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter { final String sName = aElementNames[i]; final Object aObj = xContainer.getByName(sName); - final XStyle xStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, aObj); + final XStyle xStyle = UnoRuntime.queryInterface(XStyle.class, aObj); if (xStyle.isInUse()) { aUsedStyle = xStyle; @@ -307,10 +310,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 +354,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 +364,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 +376,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 = 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); - - 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); + xGroup.setExpression(m_aGroupNames[i]); + xGroup.setHeaderOn(true); - // 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 +503,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 +530,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 @@ -542,7 +559,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter for (int i = 0; i < _aList.length; i++) { final String sField = _aList[i]; - if (listContains(m_aGroupNames, sField) == true) + if (listContains(m_aGroupNames, sField)) { continue; } @@ -578,8 +595,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 +646,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) @@ -640,7 +661,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter try { final Object aFixedText = getMSFofReportDefinition().createInstance("com.sun.star.report.FixedText"); - final XFixedText xFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aFixedText); + final XFixedText xFixedText = UnoRuntime.queryInterface(XFixedText.class, aFixedText); int nHeight = LayoutConstants.LabelHeight; // default height of label is fixed. @@ -678,15 +699,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,17 +715,18 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter return aDataField.toString(); } + protected String convertFromFieldName(String _sName) { if (_sName.startsWith("field:[")) { int nCloseBrace = _sName.lastIndexOf("]"); - final String sName = _sName.substring(7, nCloseBrace).trim(); - return sName; + return _sName.substring(7, nCloseBrace).trim(); } return _sName; } // ------------------------------------------------------------------------- + /** * Insert a already formatted field name into a given section * @@ -732,9 +754,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,20 +766,21 @@ 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 } } _aRect.Height = nHeight; - final XReportControlModel xReportControlModel = (XReportControlModel) UnoRuntime.queryInterface(XReportControlModel.class, aField); + final XReportControlModel xReportControlModel = UnoRuntime.queryInterface(XReportControlModel.class, aField); if (xReportControlModel != null) { // #i86907# not documented right in idl description. 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,12 +795,12 @@ 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); + final XImageControl xImageControl = UnoRuntime.queryInterface(XImageControl.class, xReportControlModel); if (xImageControl != null) { // xImageControl.setScaleImage(true); @@ -795,19 +818,19 @@ 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) if (_sFormattedfield.equals("rpt:now()")) { - final XFormattedField xFormattedField = (XFormattedField) UnoRuntime.queryInterface(XFormattedField.class, xReportControlModel); + final XFormattedField xFormattedField = UnoRuntime.queryInterface(XFormattedField.class, xReportControlModel); XNumberFormatsSupplier x = xFormattedField.getFormatsSupplier(); XNumberFormats xFormats = x.getNumberFormats(); - XNumberFormatTypes x3 = (XNumberFormatTypes) UnoRuntime.queryInterface(XNumberFormatTypes.class, xFormats); + XNumberFormatTypes x3 = UnoRuntime.queryInterface(XNumberFormatTypes.class, xFormats); Locale.getDefault(); com.sun.star.lang.Locale aLocale = new com.sun.star.lang.Locale(); aLocale.Country = Locale.getDefault().getCountry(); @@ -819,10 +842,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; @@ -845,12 +867,12 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter { if (m_xMSF == null) { - final XMultiServiceFactory xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, getReportDefinition()); - m_xMSF = xMSF; + m_xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, getReportDefinition()); } return m_xMSF; } // ------------------------------------------------------------------------- + protected Rectangle insertVerticalLine(XSection _xSection, Rectangle _aRect, int _nWidth, int _nHeight) { return insertLine(_xSection, _aRect, _nWidth, _nHeight, 1); @@ -868,7 +890,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter try { final Object aFixedLine = getMSFofReportDefinition().createInstance("com.sun.star.report.FixedLine"); - final XFixedLine xFixedLine = (XFixedLine) UnoRuntime.queryInterface(XFixedLine.class, aFixedLine); + final XFixedLine xFixedLine = UnoRuntime.queryInterface(XFixedLine.class, aFixedLine); xFixedLine.setOrientation(_nOrientation); // TODO: line width is fixed @@ -882,15 +904,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 +924,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 +952,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } else @@ -953,7 +976,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 +1002,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } else @@ -989,6 +1013,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } } // ------------------------------------------------------------------------- + protected void clearPageHeader() { XSection xSection; @@ -1002,7 +1027,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 +1042,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter // // DebugHelper.writeInfo("Date: " + aBuf.toString()); // return aBuf.toString(); // } - // protected String getCurrentDate() // { // Calendar aCalendar = Calendar.getInstance(); @@ -1060,7 +1084,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); } } @@ -1108,49 +1132,49 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter // XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(XControlContainer.class, aControlContainer); final Object aFixedTextModel = getGlobalMSF().createInstance("com.sun.star.awt.UnoControlFixedTextModel"); - final XControlModel xFixedTextModel = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, aFixedTextModel); + final XControlModel xFixedTextModel = UnoRuntime.queryInterface(XControlModel.class, aFixedTextModel); 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); // String[] sServices2 = xServiceInfo2.getSupportedServiceNames(); - final XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, aUnoCtrlFixedText); + final XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, aUnoCtrlFixedText); xWindow.setVisible(false); - final XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, aUnoCtrlFixedText); + final XControl xControl = UnoRuntime.queryInterface(XControl.class, aUnoCtrlFixedText); xControl.setModel(xFixedTextModel); - final com.sun.star.awt.XFixedText xFixedText = (com.sun.star.awt.XFixedText) UnoRuntime.queryInterface(com.sun.star.awt.XFixedText.class, aUnoCtrlFixedText); + final com.sun.star.awt.XFixedText xFixedText = UnoRuntime.queryInterface(com.sun.star.awt.XFixedText.class, aUnoCtrlFixedText); xFixedText.setText(_sText); - final XLayoutConstrains xLayoutConstraints = (XLayoutConstrains) UnoRuntime.queryInterface(XLayoutConstrains.class, aUnoCtrlFixedText); + final XLayoutConstrains xLayoutConstraints = UnoRuntime.queryInterface(XLayoutConstrains.class, aUnoCtrlFixedText); final Size aSizeInPixel = xLayoutConstraints.getPreferredSize(); - final XWindowPeer xPeerOfReportDefinition = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, getReportDefinition().getCurrentController().getFrame().getComponentWindow()); + final XWindowPeer xPeerOfReportDefinition = UnoRuntime.queryInterface(XWindowPeer.class, getReportDefinition().getCurrentController().getFrame().getComponentWindow()); xControl.createPeer(null, xPeerOfReportDefinition); final XWindowPeer x = xControl.getPeer(); - final XUnitConversion xConversion = (XUnitConversion) UnoRuntime.queryInterface(XUnitConversion.class, x); + final XUnitConversion xConversion = UnoRuntime.queryInterface(XUnitConversion.class, x); aSizeMM_100TH = xConversion.convertSizeToLogic(aSizeInPixel, com.sun.star.util.MeasureUnit.MM_100TH); // xToolkit.createScreenCompatibleDevice(_nWidth, _nWidth). // XWindow x = getReportDefinition().getCurrentController().getFrame().getContainerWindow(); // Object aObj = _xSection.getParent(); // we don't need the created objects any longer - final XComponent xFixedTextDeleter = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFixedText); + final XComponent xFixedTextDeleter = UnoRuntime.queryInterface(XComponent.class, xFixedText); xFixedTextDeleter.dispose(); - final XComponent xFixedTextModelDeleter = (XComponent) UnoRuntime.queryInterface(XComponent.class, aFixedTextModel); + final XComponent xFixedTextModelDeleter = UnoRuntime.queryInterface(XComponent.class, aFixedTextModel); xFixedTextModelDeleter.dispose(); } catch (Exception e) { - // TODO: Exception not set. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } return aSizeMM_100TH; } @@ -1161,24 +1185,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; } /** @@ -1188,8 +1212,8 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter */ private void copyProperties(Object _aFrom, Object _aTo) { - XPropertySet xFrom = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _aFrom); - XPropertySet xTo = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _aTo); + XPropertySet xFrom = UnoRuntime.queryInterface(XPropertySet.class, _aFrom); + XPropertySet xTo = UnoRuntime.queryInterface(XPropertySet.class, _aTo); XPropertySetInfo xForeignPropInfo = xFrom.getPropertySetInfo(); @@ -1210,6 +1234,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } } @@ -1230,7 +1255,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter while (xEnum.hasMoreElements()) { Object aEnumObj = xEnum.nextElement(); - XReportComponent aComponent = (XReportComponent) UnoRuntime.queryInterface(XReportComponent.class, aEnumObj); + XReportComponent aComponent = UnoRuntime.queryInterface(XReportComponent.class, aEnumObj); // XCloneable aClone = (XCloneable)UnoRuntime.queryInterface(XCloneable.class, aEnumObj); if (aComponent != null) @@ -1238,14 +1263,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(); + XShape aShape = UnoRuntime.queryInterface(XShape.class, aClone); // normally 'createClone' will create a real clone of the component, // but there seems some problems, we have to controll. @@ -1260,9 +1278,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,9 +1306,9 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); + } } - return; - } else { // we won't a page header @@ -1364,7 +1383,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 +1409,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } catch (Exception e) { + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } else @@ -1423,8 +1443,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(); @@ -1445,17 +1465,16 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter aRect.Y += nLineHeight; aRect.Y += LayoutConstants.LabelHeight; - final int nWidth = nUsablePageWidth; aRect.X = getLeftPageIndent(); - aRect = insertFormattedField(xSection, "rpt:" + sNoFirstUnusedQuotes, aRect, nWidth, null, (short) com.sun.star.awt.TextAlign.CENTER); + aRect = insertFormattedField(xSection, "rpt:" + sNoFirstUnusedQuotes, aRect, nUsablePageWidth, null, (short) com.sun.star.awt.TextAlign.CENTER); aRect.Y += LayoutConstants.FormattedFieldHeight + LayoutConstants.LineHeight; xSection.setHeight(aRect.Y); } catch (Exception e) { - // TODO: Exception not set. + Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, e); } } } @@ -1574,7 +1593,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter if (m_aFixedTextHelper == null) { final Object aFixedText = getMSFofReportDefinition().createInstance("com.sun.star.report.FixedText"); - m_aFixedTextHelper = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, aFixedText); + m_aFixedTextHelper = UnoRuntime.queryInterface(XFixedText.class, aFixedText); } m_aFixedTextHelper.setLabel(_sLabel); @@ -1595,7 +1614,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 +1642,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 +1697,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 +1709,3 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter } } } - diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java index 8df754795e63..6830d56b5107 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionEmptyObject.java @@ -44,8 +44,7 @@ public class SectionEmptyObject extends SectionObject public static SectionObject create() { - SectionEmptyObject a = new SectionEmptyObject(); - return a; + return new SectionEmptyObject(); } public FontDescriptor getFontDescriptor() diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java index ae3766fd3391..9780a1350681 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionLabel.java @@ -48,8 +48,7 @@ public class SectionLabel extends SectionObject public static SectionObject create(XFixedText _aFixedText) { - final SectionLabel a = new SectionLabel(_aFixedText); - return a; + return new SectionLabel(_aFixedText); } /** 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/SectionTextField.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java index 2a11fcd56f04..fc17ba0ab5aa 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionTextField.java @@ -46,8 +46,7 @@ public class SectionTextField extends SectionObject public static SectionObject create(XFormattedField _aFormattedField) { - SectionTextField a = new SectionTextField(_aFormattedField); - return a; + return new SectionTextField(_aFormattedField); } public FontDescriptor getFontDescriptor() diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java b/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java index 0fe168b28263..c2d85fb58e61 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/Tabular.java @@ -55,8 +55,7 @@ public class Tabular extends ReportBuilderLayouter public String getLocalizedName() { - String sLocalizedName = getResource().getResText(UIConsts.RID_REPORT + 80); - return sLocalizedName; + return getResource().getResText(UIConsts.RID_REPORT + 80); } protected void insertDetailFields() @@ -92,60 +91,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/CGCategory.java b/wizards/com/sun/star/wizards/table/CGCategory.java index ea74b33f09ad..228891c12927 100644 --- a/wizards/com/sun/star/wizards/table/CGCategory.java +++ b/wizards/com/sun/star/wizards/table/CGCategory.java @@ -75,9 +75,8 @@ public class CGCategory { try { - xNameAccessTablesNode = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xNameAccessCurBusinessNode.getByName("Tables")); - String[] sTableNames = Configuration.getNodeDisplayNames(xNameAccessTablesNode); - return sTableNames; + xNameAccessTablesNode = UnoRuntime.queryInterface(XNameAccess.class, xNameAccessCurBusinessNode.getByName("Tables")); + return Configuration.getNodeDisplayNames(xNameAccessTablesNode); } catch (Exception e) { diff --git a/wizards/com/sun/star/wizards/table/CallTableWizard.java b/wizards/com/sun/star/wizards/table/CallTableWizard.java index af685eadf343..e3c5c690fad3 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 = (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 f816b03e8f8c..95e556f920b7 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; @@ -132,7 +132,7 @@ public class FieldDescription { try { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _xNameAccessFieldNode); + xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, _xNameAccessFieldNode); // Integer Index = (Integer) xPropertySet.getPropertyValue("Index"); if (propertyexists(PropertyNames.PROPERTY_NAME)) { @@ -140,22 +140,22 @@ public class FieldDescription } if (propertyexists("Type")) { - aPropertyValues.addElement(Properties.createProperty("Type", (Integer) xPropertySet.getPropertyValue("Type"))); + aPropertyValues.addElement(Properties.createProperty("Type", xPropertySet.getPropertyValue("Type"))); } if (propertyexists("Scale")) { - aPropertyValues.addElement(Properties.createProperty("Scale", (Integer) xPropertySet.getPropertyValue("Scale"))); + aPropertyValues.addElement(Properties.createProperty("Scale", xPropertySet.getPropertyValue("Scale"))); // Scale = } if (propertyexists("Precision")) { - aPropertyValues.addElement(Properties.createProperty("Precision", (Integer) xPropertySet.getPropertyValue("Precision"))); + aPropertyValues.addElement(Properties.createProperty("Precision", xPropertySet.getPropertyValue("Precision"))); // Precision = (Integer) xPropertySet.getPropertyValue("Precision"); } if (propertyexists("DefaultValue")) { - aPropertyValues.addElement(Properties.createProperty("DefaultValue", (Boolean) xPropertySet.getPropertyValue("DefaultValue")));// DefaultValue = (Boolean) xPropertySet.getPropertyValue("DefaultValue"); - //Type = new Integer(4); // TODO wo ist der Fehler?(Integer) xPropertySet.getPropertyValue("Type"); + aPropertyValues.addElement(Properties.createProperty("DefaultValue", xPropertySet.getPropertyValue("DefaultValue")));// DefaultValue = (Boolean) xPropertySet.getPropertyValue("DefaultValue"); + //Type = 4; // TODO wo ist der Fehler?(Integer) xPropertySet.getPropertyValue("Type"); } } catch (Exception e) diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java index 43349d71376f..d19a6e0eb21d 100644 --- a/wizards/com/sun/star/wizards/table/FieldFormatter.java +++ b/wizards/com/sun/star/wizards/table/FieldFormatter.java @@ -84,7 +84,7 @@ public class FieldFormatter implements XItemListener }, new Object[] { - UIConsts.INTEGERS[8], sFieldNames, new Integer(91), new Integer(27), IFieldFormatStep, new Short(curtabindex++), new Integer(90) + UIConsts.INTEGERS[8], sFieldNames, 91, 27, IFieldFormatStep, new Short(curtabindex++), 90 }); try @@ -96,7 +96,7 @@ public class FieldFormatter implements XItemListener }, new Object[] { - new Integer(133), "HID:WIZARDS_HID_DLGTABLE_LB_SELFIELDNAMES", new Integer(92), new Integer(37), IFieldFormatStep, new Short(curtabindex++), new Integer(62) + 133, "HID:WIZARDS_HID_DLGTABLE_LB_SELFIELDNAMES", 92, 37, IFieldFormatStep, new Short(curtabindex++), 62 }); } catch (Exception e) @@ -110,21 +110,21 @@ 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[] { - Boolean.FALSE, oFontDesc, new Integer(14), "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDUP", String.valueOf((char) 8743), new Integer(158), new Integer(139), IFieldFormatStep, new Short(curtabindex++), new Integer(14) + Boolean.FALSE, oFontDesc, 14, "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDUP", String.valueOf((char) 8743), 158, 139, IFieldFormatStep, new Short(curtabindex++), 14 }); 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[] { - Boolean.FALSE, oFontDesc, new Integer(14), "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDDOWN", String.valueOf((char) 8744), new Integer(158), new Integer(156), IFieldFormatStep, new Short(curtabindex++), new Integer(14) + Boolean.FALSE, oFontDesc, 14, "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDDOWN", String.valueOf((char) 8744), 158, 156, IFieldFormatStep, new Short(curtabindex++), 14 }); oFontDesc = new FontDescriptor(); oFontDesc.Weight = com.sun.star.awt.FontWeight.BOLD; @@ -132,31 +132,31 @@ 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[] { - oFontDesc, new Integer(14), "HID:WIZARDS_HID_DLGTABLE_CMDMINUS", "-", new Integer(118), new Integer(175), IFieldFormatStep, new Short(curtabindex++), new Integer(14) + oFontDesc, 14, "HID:WIZARDS_HID_DLGTABLE_CMDMINUS", "-", 118, 175, IFieldFormatStep, new Short(curtabindex++), 14 }); 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[] { - oFontDesc, new Integer(14), "HID:WIZARDS_HID_DLGTABLE_CMDPLUS", "+", new Integer(137), new Integer(175), IFieldFormatStep, new Short(curtabindex++), new Integer(14) + oFontDesc, 14, "HID:WIZARDS_HID_DLGTABLE_CMDPLUS", "+", 137, 175, IFieldFormatStep, new Short(curtabindex++), 14 }); 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[] { - new Integer(8), sfieldinfo, new Integer(0), new Integer(158), new Integer(27), IFieldFormatStep, new Short(curtabindex++), new Integer(165) + 8, sfieldinfo, 0, 158, 27, IFieldFormatStep, new Short(curtabindex++), 165 }); @@ -167,7 +167,7 @@ public class FieldFormatter implements XItemListener }, new Object[] { - UIConsts.INTEGERS[8], sFieldName, new Integer(158), new Integer(39), IFieldFormatStep, new Short(curtabindex++), new Integer(94) + UIConsts.INTEGERS[8], sFieldName, 158, 39, IFieldFormatStep, new Short(curtabindex++), 94 }); txtfieldname = CurUnoDialog.insertTextField("txtfieldname", MODIFYFIELDNAME, this, @@ -177,7 +177,7 @@ public class FieldFormatter implements XItemListener }, new Object[] { - UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_COLNAME", new Integer(274), new Integer(37), IFieldFormatStep, new Short(curtabindex++), "", new Integer(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); @@ -195,10 +195,10 @@ public class FieldFormatter implements XItemListener }, // PropertyNames.PROPERTY_HELPURL new Object[] { - new Integer(85), new Integer(158), new Integer(49), IFieldFormatStep, new Short(curtabindex++), new Integer(166), new Integer(50) + 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) @@ -233,20 +233,20 @@ public class FieldFormatter implements XItemListener benableShiftUpButton = (iselpos != 0); benableShiftDownButton = (iselpos != ilistcount - 1); } - Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftUp), PropertyNames.PROPERTY_ENABLED, new Boolean(benableShiftUpButton)); - Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftDown), PropertyNames.PROPERTY_ENABLED, new Boolean(benableShiftDownButton)); - Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, new Boolean(blistispopulated)); + Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftUp), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benableShiftUpButton)); + Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftDown), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benableShiftDownButton)); + Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(blistispopulated)); CurUnoDialog.setcompleted(TableWizard.SOFIELDSFORMATPAGE, blistispopulated); } 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,11 +297,11 @@ public class FieldFormatter implements XItemListener } else { - Helper.setUnoPropertyValue(UnoDialog.getModel(txtfieldname), "Text", ""); - Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, new Boolean(benable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(txtfieldname), "Text", PropertyNames.EMPTY_STRING); + Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable)); CurUnoDialog.setcompleted(TableWizard.SOFIELDSFORMATPAGE, benable); } - Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, new Boolean(benable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benable)); CurUnoDialog.setControlVisible("oColumnDescriptor", benable); CurUnoDialog.repaintDialogStep(); } @@ -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) }); @@ -379,7 +379,7 @@ public class FieldFormatter implements XItemListener public boolean updateColumnofColumnDescriptor() { Object oColumn = Helper.getUnoPropertyValue(oColumnDescriptorModel, "Column"); - XPropertySet xColPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oColumn); + XPropertySet xColPropertySet = UnoRuntime.queryInterface(XPropertySet.class, oColumn); if (xColPropertySet != null) { curTableDescriptor.modifyColumn(txtfieldname.getText(), xColPropertySet); @@ -401,8 +401,7 @@ public class FieldFormatter implements XItemListener public XPropertySet clonePropertySet(XPropertySet _xPropertySet) { - XPropertySet xlocpropertyset = null; - return xlocpropertyset; + return null; } public void itemStateChanged(ItemEvent arg0) @@ -415,13 +414,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 340dd5d2dc7b..dd6933385927 100644 --- a/wizards/com/sun/star/wizards/table/Finalizer.java +++ b/wizards/com/sun/star/wizards/table/Finalizer.java @@ -83,7 +83,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], slblTableName, new Integer(97), new Integer(25), IFINALSTEP, new Integer(220) + UIConsts.INTEGERS[8], slblTableName, 97, 25, IFINALSTEP, 220 }); txtTableName = CurUnoDialog.insertTextField("txtTableName", SETCOMPLETIONFLAG, this, new String[] @@ -92,7 +92,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_TXT_NAME", new Integer(97), new Integer(35), IFINALSTEP, new Short(curtabindex++), "", new Integer(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(); @@ -119,7 +119,7 @@ public class Finalizer }, new Object[] { - new Integer(8), slblCatalog, new Integer(nListBoxPosX), new Integer(52), IFINALSTEP, new Short(curtabindex++), new Integer(120) + 8, slblCatalog, new Integer(nListBoxPosX), 52, IFINALSTEP, new Short(curtabindex++), 120 }); try @@ -127,18 +127,18 @@ 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[] { - Boolean.TRUE, new Integer(12), "HID:WIZARDS_HID_DLGTABLE_LST_CATALOG", new Short(UnoDialog.getListBoxLineCount()), new Integer(nListBoxPosX), new Integer(62), IFINALSTEP, sCatalogNames, new Short(curtabindex++), new Integer(80) + Boolean.TRUE, 12, "HID:WIZARDS_HID_DLGTABLE_LST_CATALOG", new Short(UnoDialog.getListBoxLineCount()), new Integer(nListBoxPosX), 62, IFINALSTEP, sCatalogNames, new Short(curtabindex++), 80 }); int isel = JavaTools.FieldInList(sCatalogNames, sCatalog); if (isel < 0) { 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"); @@ -174,7 +174,7 @@ public class Finalizer }, new Object[] { - new Integer(8), slblSchema, new Integer(nListBoxPosX), new Integer(52), IFINALSTEP, new Short(curtabindex++), new Integer(80) + 8, slblSchema, new Integer(nListBoxPosX), 52, IFINALSTEP, new Short(curtabindex++), 80 }); try @@ -182,18 +182,18 @@ 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[] { - Boolean.TRUE, new Integer(12), "HID:WIZARDS_HID_DLGTABLE_LST_SCHEMA", new Short(UnoDialog.getListBoxLineCount()), new Integer(nListBoxPosX), new Integer(62), IFINALSTEP, sSchemaNames, new Short(curtabindex++), new Integer(80) + Boolean.TRUE, 12, "HID:WIZARDS_HID_DLGTABLE_LST_SCHEMA", new Short(UnoDialog.getListBoxLineCount()), new Integer(nListBoxPosX), 62, IFINALSTEP, sSchemaNames, new Short(curtabindex++), 80 }); int isel = JavaTools.FieldInList(sSchemaNames, sSchema); if (isel < 0) { isel = 0; } - CurUnoDialog.setControlProperty("lstSchema", "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSchema", PropertyNames.SELECTED_ITEMS, new short[] { (short) isel }); @@ -214,7 +214,7 @@ public class Finalizer }, new Object[] { - new Integer(16), sCongratulations, Boolean.TRUE, new Integer(97), new Integer(62), IFINALSTEP, new Short(curtabindex++), new Integer(226) + 16, sCongratulations, Boolean.TRUE, 97, 62, IFINALSTEP, new Short(curtabindex++), 226 }); } else @@ -228,7 +228,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], slblProceed, new Integer(97), new Integer(82 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), new Integer(227) + UIConsts.INTEGERS[8], slblProceed, 97, new Integer(82 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), 227 }); optWorkWithTable = CurUnoDialog.insertRadioButton("optWorkWithTable", null, new String[] @@ -237,7 +237,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_WORKWITHTABLE", sWorkWithTable, new Integer(101), new Integer(97 + ndiffPosY), new Short((short) 1), IFINALSTEP, new Short(curtabindex++), new Integer(177) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_WORKWITHTABLE", sWorkWithTable, 101, new Integer(97 + ndiffPosY), new Short((short) 1), IFINALSTEP, new Short(curtabindex++), 177 }); optModifyTable = CurUnoDialog.insertRadioButton("optModifyTable", null, new String[] @@ -246,7 +246,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_MODIFYTABLE", sModifyTable, new Integer(101), new Integer(109 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), new Integer(177) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_MODIFYTABLE", sModifyTable, 101, new Integer(109 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), 177 }); optStartFormWizard = CurUnoDialog.insertRadioButton("optStartFormWizard", null, new String[] @@ -255,7 +255,7 @@ public class Finalizer }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_STARTFORMWIZARD", sStartFormWizard, new Integer(101), new Integer(121 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), new Integer(177) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_STARTFORMWIZARD", sStartFormWizard, 101, new Integer(121 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), 177 }); } catch (SQLException e) @@ -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 a4a896752dd2..6246b3ef037f 100644 --- a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java +++ b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java @@ -90,7 +90,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, new Object[] { - new Integer(40), sExplanations, Boolean.TRUE, new Integer(91), new Integer(27), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(233) + 40, sExplanations, Boolean.TRUE, 91, 27, IPRIMEKEYSTEP, new Short(curtabindex++), 233 }); chkcreatePrimaryKey = CurUnoDialog.insertCheckBox("chkcreatePrimaryKey", SPRIMEKEYMODE, this, @@ -100,7 +100,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CHK_USEPRIMEKEY", screatePrimaryKey, new Integer(97), new Integer(70), new Short((short) 1), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(160) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CHK_USEPRIMEKEY", screatePrimaryKey, 97, 70, new Short((short) 1), IPRIMEKEYSTEP, new Short(curtabindex++), 160 }); optAddAutomatically = CurUnoDialog.insertRadioButton("optAddAutomatically", SPRIMEKEYMODE, this, @@ -110,7 +110,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_AUTOMATIC", sAddAutomatically, new Integer(106), new Integer(82), new Short((short) 1), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(200) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_AUTOMATIC", sAddAutomatically, 106, 82, new Short((short) 1), IPRIMEKEYSTEP, new Short(curtabindex++), 200 }); optUseExisting = CurUnoDialog.insertRadioButton("optUseExisting", SPRIMEKEYMODE, this, @@ -120,7 +120,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, //94 new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SINGLE", sUseExisting, new Integer(106), new Integer(104), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(200) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SINGLE", sUseExisting, 106, 104, IPRIMEKEYSTEP, new Short(curtabindex++), 200 }); optUseSeveral = CurUnoDialog.insertRadioButton("optUseSeveral", SPRIMEKEYMODE, this, @@ -130,7 +130,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SEVERAL", sUseSeveral, new Integer(106), new Integer(132), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(200) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SEVERAL", sUseSeveral, 106, 132, IPRIMEKEYSTEP, new Short(curtabindex++), 200 }); chkApplyAutoValueAutomatic = CurUnoDialog.insertCheckBox("chkApplyAutoValueAutomatic", SPRIMEKEYMODE, this, @@ -140,7 +140,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, //107 new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE_AUTOMATIC", sApplyAutoValue, new Integer(116), new Integer(92), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(68) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE_AUTOMATIC", sApplyAutoValue, 116, 92, IPRIMEKEYSTEP, new Short(curtabindex++), 68 }); lblPrimeFieldName = CurUnoDialog.insertLabel("lblPrimeFieldName", @@ -150,7 +150,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, new Object[] { - Boolean.FALSE, UIConsts.INTEGERS[8], slblPrimeFieldName, new Integer(116), new Integer(117), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(46) + Boolean.FALSE, UIConsts.INTEGERS[8], slblPrimeFieldName, 116, 117, IPRIMEKEYSTEP, new Short(curtabindex++), 46 }); lstSinglePrimeKey = CurUnoDialog.insertListBox("lstSinglePrimeKey", "onPrimeKeySelected", null, this, @@ -171,14 +171,14 @@ public class PrimaryKeyHandler implements XFieldSelectionListener { Boolean.TRUE, Boolean.FALSE, - new Integer(12), + 12, "HID:WIZARDS_HID_DLGTABLE_LB_PK_FIELDNAME", Short.valueOf(UnoDialog.getListBoxLineCount()), - new Integer(162), - new Integer(115), + 162, + 115, IPRIMEKEYSTEP, new Short(curtabindex++), - new Integer(80) + 80 }); chkApplyAutoValueExisting = CurUnoDialog.insertCheckBox("chkApplyAutoValueExisting", SPRIMEKEYMODE, this, @@ -188,7 +188,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener }, //107 new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE", sApplyAutoValue, new Integer(248), new Integer(117), IPRIMEKEYSTEP, new Short(curtabindex++), new Integer(66) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE", sApplyAutoValue, 248, 117, IPRIMEKEYSTEP, new Short(curtabindex++), 66 }); curPrimaryKeySelection = new FieldSelection(CurUnoDialog, IPRIMEKEYSTEP.intValue(), 116, 142, 208, 47, slblAvailableFields, slblSelPrimaryFields, 41234, false); curPrimaryKeySelection.addFieldSelectionListener(this); @@ -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) @@ -260,16 +260,16 @@ public class PrimaryKeyHandler implements XFieldSelectionListener public void togglePrimeKeyFields() { boolean bdoEnable = (this.chkcreatePrimaryKey.getState() == 1); - Helper.setUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, new Boolean(bAutoPrimaryKeysupportsAutoIncrmentation && bdoEnable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(optUseExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(optUseSeveral), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bAutoPrimaryKeysupportsAutoIncrmentation && bdoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(optUseExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(optUseSeveral), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable)); //toggle subcontrols of the radiobuttons... toggleAutomaticAutoValueCheckBox(); boolean benableSinglePrimekeyControls = bdoEnable && optUseExisting.getState(); toggleSinglePrimeKeyFields(benableSinglePrimekeyControls); boolean benableSeveralPrimekeyControls = bdoEnable && optUseSeveral.getState(); - curPrimaryKeySelection.toggleListboxControls(new Boolean(benableSeveralPrimekeyControls)); + curPrimaryKeySelection.toggleListboxControls(Boolean.valueOf(benableSeveralPrimekeyControls)); // toggle the following steps of the dialog... if (!bdoEnable) { @@ -354,7 +354,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener String selfieldname = lstSinglePrimeKey.getSelectedItem(); boolean bdoenable = isAutoIncrementatable(selfieldname); CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, lstSinglePrimeKey.getSelectedItemPos() != -1); - Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenable)); XPropertySet xColPropertySet = curTableDescriptor.getByName(selfieldname); boolean bIsAutoIncremented = ((Boolean) xColPropertySet.getPropertyValue("IsAutoIncrement")).booleanValue(); if (bIsAutoIncremented) @@ -378,7 +378,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener { boolean bisAutomaticMode = AnyConverter.toBoolean(Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_ENABLED)); boolean bdoenable = bAutoPrimaryKeysupportsAutoIncrmentation && optAddAutomatically.getState() && bisAutomaticMode; - Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenable)); } catch (IllegalArgumentException e) { @@ -388,17 +388,17 @@ public class PrimaryKeyHandler implements XFieldSelectionListener private void toggleSinglePrimeKeyFields(boolean _bdoenable) { - Helper.setUnoPropertyValue(UnoDialog.getModel(lblPrimeFieldName), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(lblPrimeFieldName), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); boolean bdoenableAutoValueCheckBox = (isAutoIncrementatable(lstSinglePrimeKey.getSelectedItem()) && _bdoenable); - Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenableAutoValueCheckBox)); + Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenableAutoValueCheckBox)); } private void toggleSeveralPrimeKeyFields() { boolean bdoEnable = (this.optUseSeveral.getState()); - curPrimaryKeySelection.toggleListboxControls(new Boolean(bdoEnable)); + curPrimaryKeySelection.toggleListboxControls(Boolean.valueOf(bdoEnable)); } public String[] getPrimaryKeyFields(TableDescriptor _curtabledescriptor) diff --git a/wizards/com/sun/star/wizards/table/ScenarioSelector.java b/wizards/com/sun/star/wizards/table/ScenarioSelector.java index 9ad0506064bb..3ee366eb761a 100644 --- a/wizards/com/sun/star/wizards/table/ScenarioSelector.java +++ b/wizards/com/sun/star/wizards/table/ScenarioSelector.java @@ -26,6 +26,7 @@ ************************************************************************/ package com.sun.star.wizards.table; +import java.util.ArrayList; import java.util.Vector; import com.sun.star.awt.ItemEvent; @@ -104,7 +105,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X }, new Object[] { - new Integer(32), sExplanation, Boolean.TRUE, new Integer(91), new Integer(27), IMAINSTEP, new Short(pretabindex++), new Integer(233) + 32, sExplanation, Boolean.TRUE, 91, 27, IMAINSTEP, new Short(pretabindex++), 233 }); lblCategories = CurUnoDialog.insertLabel("lblCategories", @@ -114,7 +115,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X }, new Object[] { - new Integer(8), sCategories, new Integer(91), new Integer(60), IMAINSTEP, new Short(pretabindex++), new Integer(100) + 8, sCategories, 91, 60, IMAINSTEP, new Short(pretabindex++), 100 }); optBusiness = CurTableWizardUnoDialog.insertRadioButton("optBusiness", SELECTCATEGORY, this, @@ -124,7 +125,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPTBUSINESS", sBusiness, new Integer(98), new Integer(70), new Short((short) 1), IMAINSTEP, new Short(pretabindex++), new Integer(78) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPTBUSINESS", sBusiness, 98, 70, new Short((short) 1), IMAINSTEP, new Short(pretabindex++), 78 }); optPrivate = CurTableWizardUnoDialog.insertRadioButton("optPrivate", SELECTCATEGORY, this, @@ -134,7 +135,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X }, new Object[] { - UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPTPRIVATE", sPrivate, new Integer(182), new Integer(70), IMAINSTEP, new Short(pretabindex++), new Integer(90) + UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPTPRIVATE", sPrivate, 182, 70, IMAINSTEP, new Short(pretabindex++), 90 }); CurUnoDialog.insertLabel("lblTableNames", @@ -144,7 +145,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X }, new Object[] { - new Integer(8), sTableNames, new Integer(91), new Integer(82), IMAINSTEP, new Short(pretabindex++), new Integer(80) + 8, sTableNames, 91, 82, IMAINSTEP, new Short(pretabindex++), 80 }); try @@ -156,7 +157,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X }, new Object[] { - Boolean.TRUE, new Integer(12), "HID:WIZARDS_HID_DLGTABLE_LBTABLES", new Short(UnoDialog.getListBoxLineCount()), new Integer(91), new Integer(92), IMAINSTEP, new Short(pretabindex++), getListboxWidth() + Boolean.TRUE, 12, "HID:WIZARDS_HID_DLGTABLE_LBTABLES", new Short(UnoDialog.getListBoxLineCount()), 91, 92, IMAINSTEP, new Short(pretabindex++), getListboxWidth() }); } catch (Exception e) @@ -196,7 +197,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 }); @@ -207,8 +208,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X public String[] getSelectedFieldNames() { String[] displayfieldnames = super.getSelectedFieldNames(); - Vector<String> afieldnameVector = new Vector<String>(); - int a = 0; + ArrayList<String> afieldnameVector = new ArrayList<String>(); for (int i = 0; i < displayfieldnames.length; i++) { try @@ -216,8 +216,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X FieldDescription ofielddescription = (FieldDescription) CurTableWizardUnoDialog.fielditems.get(displayfieldnames[i]); if (ofielddescription != null) { - afieldnameVector.addElement(ofielddescription.getName()); - a++; + afieldnameVector.add(ofielddescription.getName()); } } catch (RuntimeException e) @@ -225,9 +224,8 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X e.printStackTrace(System.out); } } - String[] fieldnames = new String[a]; - afieldnameVector.toArray(fieldnames); - return fieldnames; + String[] fieldnames = new String[afieldnameVector.size()]; + return afieldnameVector.toArray(fieldnames); } public boolean iscompleted() @@ -266,7 +264,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 +274,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 +345,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 ebcb28ca48b1..d5f4c706b174 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; @@ -79,16 +79,16 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener, Helper.setUnoPropertyValues(xDialogModel, new String[] { - PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(218), Boolean.TRUE, "DialogTable", new Integer(102), new Integer(41), new Integer(1), new Short((short) 0), sTitle, new Integer(330) + 218, Boolean.TRUE, "DialogTable", 102, 41, 1, new Short((short) 0), sTitle, 330 }); drawNaviBar(); fielditems = new Hashtable(); //TODO if reportResouces cannot be gotten dispose officedocument - if (getTableResources() == true) + if (getTableResources()) { setRightPaneHeaders(m_oResource, UIConsts.RID_TABLE + 8, 4); } @@ -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..6e873c049167 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 @@ -111,7 +112,7 @@ public class TextDocument xFrame = OfficeDocument.createNewFrame(xMSF, listener); xTextDocument = loadAsPreview(_sPreviewURL, true); - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xTextDocument); + xComponent = UnoRuntime.queryInterface(XComponent.class, xTextDocument); if (bShowStatusIndicator) { @@ -126,10 +127,10 @@ public class TextDocument this.xMSF = xMSF; XDesktop xDesktop = Desktop.getDesktop(xMSF); - XFramesSupplier xFrameSupplier = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, xDesktop); + XFramesSupplier xFrameSupplier = UnoRuntime.queryInterface(XFramesSupplier.class, xDesktop); xFrame = xFrameSupplier.getActiveFrame(); - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFrame.getController().getModel()); - xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent); + xComponent = UnoRuntime.queryInterface(XComponent.class, xFrame.getController().getModel()); + xTextDocument = UnoRuntime.queryInterface(XTextDocument.class, xComponent); if (bShowStatusIndicator) { @@ -152,7 +153,7 @@ public class TextDocument { m_identifier = _identifier; } - }; + } // creates an instance of TextDocument containing a blank text document public TextDocument(XMultiServiceFactory xMSF, ModuleIdentifier _moduleIdentifier, boolean bShowStatusIndicator) @@ -162,19 +163,19 @@ public class TextDocument try { // create the empty document, and set its module identifier - xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, + xTextDocument = UnoRuntime.queryInterface(XTextDocument.class, xMSF.createInstance("com.sun.star.text.TextDocument")); - XLoadable xLoadable = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, xTextDocument); + XLoadable xLoadable = UnoRuntime.queryInterface(XLoadable.class, xTextDocument); xLoadable.initNew(); - XModule xModule = (XModule) UnoRuntime.queryInterface(XModule.class, + XModule xModule = UnoRuntime.queryInterface(XModule.class, xTextDocument); xModule.setIdentifier(_moduleIdentifier.getIdentifier()); // load the document into a blank frame XDesktop xDesktop = Desktop.getDesktop(xMSF); - XComponentLoader xLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, xDesktop); + XComponentLoader xLoader = UnoRuntime.queryInterface(XComponentLoader.class, xDesktop); PropertyValue[] loadArgs = new PropertyValue[] { new PropertyValue("Model", -1, xTextDocument, com.sun.star.beans.PropertyState.DIRECT_VALUE) @@ -183,7 +184,7 @@ public class TextDocument // remember some things for later usage xFrame = xTextDocument.getCurrentController().getFrame(); - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xTextDocument); + xComponent = UnoRuntime.queryInterface(XComponent.class, xTextDocument); } catch (Exception e) { @@ -203,21 +204,21 @@ public class TextDocument { this.xMSF = xMSF; xFrame = _textDocument.getCurrentController().getFrame(); - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, _textDocument); - xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent); + xComponent = UnoRuntime.queryInterface(XComponent.class, _textDocument); + xTextDocument = UnoRuntime.queryInterface(XTextDocument.class, xComponent); //PosSize = xFrame.getComponentWindow().getPosSize(); if (bshowStatusIndicator) { - XStatusIndicatorFactory xStatusIndicatorFactory = (XStatusIndicatorFactory) UnoRuntime.queryInterface(XStatusIndicatorFactory.class, xFrame); + 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()); - xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); - xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); + xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); + xMSFDoc = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + xNumberFormatsSupplier = UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); - XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); + XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); m_xDocProps = xDocPropsSuppl.getDocumentProperties(); CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale"); xText = xTextDocument.getText(); @@ -225,21 +226,21 @@ public class TextDocument private void init() { - xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); - xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); - xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); - XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); + xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); + xMSFDoc = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + xNumberFormatsSupplier = UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); + XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); m_xDocProps = xDocPropsSuppl.getDocumentProperties(); CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale"); - xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); + xStorable = UnoRuntime.queryInterface(XStorable.class, xTextDocument); xText = xTextDocument.getText(); } private void showStatusIndicator() { - XStatusIndicatorFactory xStatusIndicatorFactory = (XStatusIndicatorFactory) UnoRuntime.queryInterface(XStatusIndicatorFactory.class, xFrame); + 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"; @@ -262,7 +263,7 @@ public class TextDocument { try { - XModifiable xModi = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, xTextDocument); + XModifiable xModi = UnoRuntime.queryInterface(XModifiable.class, xTextDocument); xModi.setModified(false); } catch (PropertyVetoException e1) @@ -273,7 +274,7 @@ public class TextDocument Object oDoc = OfficeDocument.load(xFrame, sDefaultTemplate, "_self", loadValues); xTextDocument = (com.sun.star.text.XTextDocument) oDoc; DocSize = getPageSize(); - xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + xMSFDoc = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); ViewHandler myViewHandler = new ViewHandler(xMSFDoc, xTextDocument); try @@ -296,12 +297,12 @@ public class TextDocument { try { - XStyleFamiliesSupplier xStyleFamiliesSupplier = (XStyleFamiliesSupplier) com.sun.star.uno.UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); + XStyleFamiliesSupplier xStyleFamiliesSupplier = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); com.sun.star.container.XNameAccess xNameAccess = null; xNameAccess = xStyleFamiliesSupplier.getStyleFamilies(); com.sun.star.container.XNameContainer xPageStyleCollection = null; - xPageStyleCollection = (com.sun.star.container.XNameContainer) UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xNameAccess.getByName("PageStyles")); - XStyle xPageStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, xPageStyleCollection.getByName("First Page")); + xPageStyleCollection = UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xNameAccess.getByName("PageStyles")); + XStyle xPageStyle = UnoRuntime.queryInterface(XStyle.class, xPageStyleCollection.getByName("First Page")); return (Size) Helper.getUnoPropertyValue(xPageStyle, "Size"); } @@ -321,23 +322,22 @@ public class TextDocument xFrame = OfficeDocument.createNewFrame(xMSF, listener); Object oDoc = OfficeDocument.load(xFrame, URL, "_self", xArgs); xTextDocument = (XTextDocument) oDoc; - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xTextDocument); + xComponent = UnoRuntime.queryInterface(XComponent.class, xTextDocument); XWindow xWindow = xFrame.getComponentWindow(); - xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); - xMSFDoc = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); - xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); + xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xFrame.getComponentWindow()); + xMSFDoc = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument); + xNumberFormatsSupplier = UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); - XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); + XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); m_xDocProps = xDocPropsSuppl.getDocumentProperties(); CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale"); } public static XTextCursor createTextCursor(Object oCursorContainer) { - XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface(XSimpleText.class, oCursorContainer); - XTextCursor xTextCursor = xText.createTextCursor(); - return xTextCursor; + XSimpleText xText = UnoRuntime.queryInterface(XSimpleText.class, oCursorContainer); + return xText.createTextCursor(); } // Todo: This method is unsecure because the last index is not necessarily the last section @@ -356,7 +356,7 @@ public class TextDocument xTextCursor.gotoStart(false); com.sun.star.wizards.common.Helper.setUnoPropertyValue(xTextCursor, "PageDescName", "First Page"); xTextCursor.setString(ScaleString); - XTextViewCursorSupplier xViewCursor = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController()); + XTextViewCursorSupplier xViewCursor = UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController()); XTextViewCursor xTextViewCursor = xViewCursor.getViewCursor(); xTextViewCursor.gotoStart(false); int iFirstPos = xTextViewCursor.getPosition().X; @@ -365,14 +365,14 @@ public class TextDocument iScale = (iLastPos - iFirstPos) / iScaleLen; xTextCursor.gotoStart(false); xTextCursor.gotoEnd(true); - xTextCursor.setString(""); + xTextCursor.setString(PropertyNames.EMPTY_STRING); unlockallControllers(); return iScale; } public void unlockallControllers() { - while (xTextDocument.hasControllersLocked() == true) + while (xTextDocument.hasControllersLocked()) { xTextDocument.unlockControllers(); } @@ -380,7 +380,7 @@ public class TextDocument public void refresh() { - XRefreshable xRefreshable = (XRefreshable) UnoRuntime.queryInterface(XRefreshable.class, xTextDocument); + XRefreshable xRefreshable = UnoRuntime.queryInterface(XRefreshable.class, xTextDocument); xRefreshable.refresh(); } @@ -396,10 +396,10 @@ public class TextDocument try { Object uD = Configuration.getConfigurationRoot(xMSF, "/org.openoffice.UserProfile/Data", false); - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, uD); + XNameAccess xNA = UnoRuntime.queryInterface(XNameAccess.class, uD); Object gn = xNA.getByName("givenname"); Object sn = xNA.getByName("sn"); - String fullname = (String) gn + " " + (String) sn; + String fullname = gn + PropertyNames.SPACE + sn; Calendar cal = new GregorianCalendar(); int year = cal.get(Calendar.YEAR); @@ -413,12 +413,12 @@ public class TextDocument int ff = du.getFormat(NumberFormatIndex.DATE_SYS_DDMMYY); String myDate = du.format(ff, currentDate); - XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); + XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument); XDocumentProperties xDocProps2 = xDocPropsSuppl.getDocumentProperties(); 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); @@ -449,7 +449,7 @@ public class TextDocument { try { - XTextContent xTextContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, oTextContent); + XTextContent xTextContent = UnoRuntime.queryInterface(XTextContent.class, oTextContent); xText.removeTextContent(xTextContent); return true; } @@ -469,11 +469,11 @@ public class TextDocument */ public static int getPageCount(Object model) { - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, model); + XModel xModel = UnoRuntime.queryInterface(XModel.class, model); XController xController = xModel.getCurrentController(); - XTextViewCursorSupplier xTextVCS = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xController); + XTextViewCursorSupplier xTextVCS = UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xController); XTextViewCursor xTextVC = xTextVCS.getViewCursor(); - XPageCursor xPC = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class, xTextVC); + XPageCursor xPC = UnoRuntime.queryInterface(XPageCursor.class, xTextVC); xPC.jumpToLastPage(); return xPC.getPage(); } diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.java b/wizards/com/sun/star/wizards/text/TextFieldHandler.java index e25227516058..78de28073f37 100644 --- a/wizards/com/sun/star/wizards/text/TextFieldHandler.java +++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.java @@ -65,12 +65,12 @@ public class TextFieldHandler public TextFieldHandler(XMultiServiceFactory xMSF, XTextDocument xTextDocument) { this.xMSFDoc = xMSF; - xTextFieldsSupplier = (XTextFieldsSupplier) UnoRuntime.queryInterface(XTextFieldsSupplier.class, xTextDocument); + xTextFieldsSupplier = UnoRuntime.queryInterface(XTextFieldsSupplier.class, xTextDocument); } public void refreshTextFields() { - XRefreshable xUp = (XRefreshable) UnoRuntime.queryInterface(XRefreshable.class, xTextFieldsSupplier.getTextFields()); + XRefreshable xUp = UnoRuntime.queryInterface(XRefreshable.class, xTextFieldsSupplier.getTextFields()); xUp.refresh(); } @@ -82,21 +82,20 @@ public class TextFieldHandler Object oTextField = Helper.getUnoPropertyValue(xTextRange, "TextField"); if (com.sun.star.uno.AnyConverter.isVoid(oTextField)) { - return ""; + return PropertyNames.EMPTY_STRING; } else { - XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField); + XDependentTextField xDependent = UnoRuntime.queryInterface(XDependentTextField.class, oTextField); XPropertySet xMaster = xDependent.getTextFieldMaster(); - String UserFieldContent = (String) xMaster.getPropertyValue("Content"); - return UserFieldContent; + return (String) xMaster.getPropertyValue("Content"); } } catch (com.sun.star.uno.Exception exception) { exception.printStackTrace(System.out); } - return ""; + return PropertyNames.EMPTY_STRING; } public void insertUserField(XTextCursor xTextCursor, String FieldName, String FieldTitle) @@ -104,12 +103,12 @@ public class TextFieldHandler try { XInterface xField = (XInterface) xMSFDoc.createInstance("com.sun.star.text.TextField.User"); - XDependentTextField xDepField = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, xField); - XTextContent xFieldContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xField); + XDependentTextField xDepField = UnoRuntime.queryInterface(XDependentTextField.class, xField); + XTextContent xFieldContent = UnoRuntime.queryInterface(XTextContent.class, xField); if (xTextFieldsSupplier.getTextFieldMasters().hasByName("com.sun.star.text.FieldMaster.User." + FieldName)) { Object oMaster = xTextFieldsSupplier.getTextFieldMasters().getByName("com.sun.star.text.FieldMaster.User." + FieldName); - XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, oMaster); + XComponent xComponent = UnoRuntime.queryInterface(XComponent.class, oMaster); xComponent.dispose(); } XPropertySet xPSet = createUserField(FieldName, FieldTitle); @@ -138,7 +137,7 @@ public class TextFieldHandler public XPropertySet createUserField(String FieldName, String FieldTitle) throws com.sun.star.uno.Exception { Object oMaster = xMSFDoc.createInstance("com.sun.star.text.FieldMaster.User"); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oMaster); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oMaster); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, FieldName); xPSet.setPropertyValue("Content", FieldTitle); @@ -160,7 +159,7 @@ public class TextFieldHandler while (xEnum.hasMoreElements()) { Object oTextField = xEnum.nextElement(); - XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField); + XDependentTextField xDependent = UnoRuntime.queryInterface(XDependentTextField.class, oTextField); XPropertySet xPropertySet = xDependent.getTextFieldMaster(); if (xPropertySet.getPropertySetInfo().hasPropertyByName(_PropertyName)) { @@ -235,16 +234,16 @@ public class TextFieldHandler while (xEnum.hasMoreElements()) { Object oTextField = xEnum.nextElement(); - XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField); + XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, oTextField); if (xSI.supportsService("com.sun.star.text.TextField.ExtendedUser")) { - XUpdatable xUp = (XUpdatable) UnoRuntime.queryInterface(XUpdatable.class, oTextField); + XUpdatable xUp = UnoRuntime.queryInterface(XUpdatable.class, oTextField); xUp.update(); } if (xSI.supportsService("com.sun.star.text.TextField.User")) { - XUpdatable xUp = (XUpdatable) UnoRuntime.queryInterface(XUpdatable.class, oTextField); + XUpdatable xUp = UnoRuntime.queryInterface(XUpdatable.class, oTextField); xUp.update(); } } @@ -270,11 +269,11 @@ public class TextFieldHandler while (xEnum.hasMoreElements()) { Object oTextField = xEnum.nextElement(); - XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField); + XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, oTextField); if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) { - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oTextField); xPSet.setPropertyValue("IsFixed", Boolean.FALSE); xPSet.setPropertyValue("DateTimeValue", dt); } @@ -294,11 +293,11 @@ public class TextFieldHandler while (xEnum.hasMoreElements()) { Object oTextField = xEnum.nextElement(); - XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField); + XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, oTextField); if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) { - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField); - xPSet.setPropertyValue("IsFixed", new Boolean(_bSetFixed)); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oTextField); + xPSet.setPropertyValue("IsFixed", Boolean.valueOf(_bSetFixed)); } } } diff --git a/wizards/com/sun/star/wizards/text/TextFrameHandler.java b/wizards/com/sun/star/wizards/text/TextFrameHandler.java index 562444a1ad84..babaf21120e3 100644 --- a/wizards/com/sun/star/wizards/text/TextFrameHandler.java +++ b/wizards/com/sun/star/wizards/text/TextFrameHandler.java @@ -39,12 +39,11 @@ public class TextFrameHandler public static XTextFrame getFrameByName(String sFrameName, XTextDocument xTD) throws NoSuchElementException, WrappedTargetException { - XTextFramesSupplier xFrameSupplier = (XTextFramesSupplier) UnoRuntime.queryInterface(XTextFramesSupplier.class, xTD); + XTextFramesSupplier xFrameSupplier = UnoRuntime.queryInterface(XTextFramesSupplier.class, xTD); if (xFrameSupplier.getTextFrames().hasByName(sFrameName)) { Object oTextFrame = xFrameSupplier.getTextFrames().getByName(sFrameName); - XTextFrame xTextFrame = (XTextFrame) UnoRuntime.queryInterface(XTextFrame.class, oTextFrame); - return xTextFrame; + return UnoRuntime.queryInterface(XTextFrame.class, oTextFrame); } return null; } diff --git a/wizards/com/sun/star/wizards/text/TextSectionHandler.java b/wizards/com/sun/star/wizards/text/TextSectionHandler.java index 42fd75879c3c..b20d016f8ee8 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 { @@ -58,7 +59,7 @@ public class TextSectionHandler this.xMSFDoc = xMSF; this.xTextDocument = xTextDocument; xText = xTextDocument.getText(); - xTextSectionsSupplier = (XTextSectionsSupplier) UnoRuntime.queryInterface(XTextSectionsSupplier.class, xTextDocument); + xTextSectionsSupplier = UnoRuntime.queryInterface(XTextSectionsSupplier.class, xTextDocument); } public void removeTextSectionbyName(String SectionName) @@ -66,7 +67,7 @@ public class TextSectionHandler try { XNameAccess xAllTextSections = xTextSectionsSupplier.getTextSections(); - if (xAllTextSections.hasByName(SectionName) == true) + if (xAllTextSections.hasByName(SectionName)) { Object oTextSection = xTextSectionsSupplier.getTextSections().getByName(SectionName); removeTextSection(oTextSection); @@ -88,7 +89,7 @@ public class TextSectionHandler { try { - XIndexAccess xAllTextSections = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); + XIndexAccess xAllTextSections = UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); Object oTextSection = xAllTextSections.getByIndex(xAllTextSections.getCount() - 1); removeTextSection(oTextSection); } @@ -102,7 +103,7 @@ public class TextSectionHandler { try { - XTextContent xTextContentTextSection = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, _oTextSection); + XTextContent xTextContentTextSection = UnoRuntime.queryInterface(XTextContent.class, _oTextSection); xText.removeTextContent(xTextContentTextSection); } catch (Exception exception) @@ -115,12 +116,12 @@ public class TextSectionHandler { try { - XIndexAccess xAllTextSections = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); + XIndexAccess xAllTextSections = UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); int TextSectionCount = xAllTextSections.getCount(); for (int i = TextSectionCount - 1; i >= 0; i--) { - XTextContent xTextContentTextSection = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xAllTextSections.getByIndex(i)); - XPropertySet xTextSectionPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextContentTextSection); + XTextContent xTextContentTextSection = UnoRuntime.queryInterface(XTextContent.class, xAllTextSections.getByIndex(i)); + XPropertySet xTextSectionPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xTextContentTextSection); boolean bRemoveTextSection = (!AnyConverter.toBoolean(xTextSectionPropertySet.getPropertyValue("IsVisible"))); if (bRemoveTextSection) { @@ -138,12 +139,12 @@ public class TextSectionHandler { try { - XIndexAccess xAllTextSections = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); + XIndexAccess xAllTextSections = UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); int TextSectionCount = xAllTextSections.getCount(); for (int i = TextSectionCount - 1; i >= 0; i--) { - XTextContent xTextContentTextSection = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xAllTextSections.getByIndex(i)); - XPropertySet xTextSectionPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextContentTextSection); + XTextContent xTextContentTextSection = UnoRuntime.queryInterface(XTextContent.class, xAllTextSections.getByIndex(i)); + XPropertySet xTextSectionPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xTextContentTextSection); xText.removeTextContent(xTextContentTextSection); } } @@ -158,10 +159,10 @@ public class TextSectionHandler try { Object oTextSection; - XIndexAccess xAllTextSections = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextSectionsSupplier.getTextSections()); + XIndexAccess xAllTextSections = 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 }); } @@ -217,7 +218,7 @@ public class TextSectionHandler { oSectionLink, SectionName }); - XNamed xSectionName = (XNamed) UnoRuntime.queryInterface(XNamed.class, oTextSection); + XNamed xSectionName = UnoRuntime.queryInterface(XNamed.class, oTextSection); String NewSectionName = xSectionName.getName(); if (NewSectionName.compareTo(SectionName) != 0) { @@ -251,14 +252,14 @@ public class TextSectionHandler try { Object xTextSection; - if (xTextSectionsSupplier.getTextSections().hasByName(sectionName) == true) + if (xTextSectionsSupplier.getTextSections().hasByName(sectionName)) { xTextSection = xTextSectionsSupplier.getTextSections().getByName(sectionName); } else { xTextSection = xMSFDoc.createInstance("com.sun.star.text.TextSection"); - XTextContent xTextContentSection = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xTextSection); + XTextContent xTextContentSection = UnoRuntime.queryInterface(XTextContent.class, xTextSection); position.getText().insertTextContent(position, xTextContentSection, false); } linkSectiontoTemplate(xTextSection, templateName, sectionName); diff --git a/wizards/com/sun/star/wizards/text/TextStyleHandler.java b/wizards/com/sun/star/wizards/text/TextStyleHandler.java index e6c952e65785..e9f6cd737e7d 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 { @@ -49,21 +50,21 @@ public class TextStyleHandler { this.xMSFDoc = xMSF; this.xTextDocument = xTextDocument; - xStyleFamiliesSupplier = (XStyleFamiliesSupplier) UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); + xStyleFamiliesSupplier = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); } public void loadStyleTemplates(String sTemplateUrl, String OptionString) { try { - XStyleLoader xStyleLoader = (XStyleLoader) UnoRuntime.queryInterface(XStyleLoader.class, xStyleFamiliesSupplier.getStyleFamilies()); + 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++) { CurOptionName = StyleOptions[i].Name; - StyleOptions[i].Value = new Boolean((CurOptionName.compareTo(OptionString) == 0) || (CurOptionName.compareTo("OverwriteStyles") == 0)); + StyleOptions[i].Value = Boolean.valueOf((CurOptionName.compareTo(OptionString) == 0) || (CurOptionName.compareTo("OverwriteStyles") == 0)); } xStyleLoader.loadStylesFromURL(sTemplateUrl, StyleOptions); } @@ -79,10 +80,10 @@ public class TextStyleHandler { XPropertySet xPropertySet = null; Object oStyleFamily = xStyleFamiliesSupplier.getStyleFamilies().getByName(sStyleFamily); - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oStyleFamily); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, oStyleFamily); if (xNameAccess.hasByName(sStyleName)) { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xNameAccess.getByName(sStyleName)); + xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xNameAccess.getByName(sStyleName)); } return xPropertySet; } @@ -97,7 +98,7 @@ public class TextStyleHandler { try { - _xPropPageStyle.setPropertyValue("IsLandscape", new Boolean(_bIsLandscape)); + _xPropPageStyle.setPropertyValue("IsLandscape", Boolean.valueOf(_bIsLandscape)); Size aPageSize = (Size) AnyConverter.toObject(Size.class, _xPropPageStyle.getPropertyValue("Size")); int nPageWidth = aPageSize.Width; int nPageHeight = aPageSize.Height; diff --git a/wizards/com/sun/star/wizards/text/TextTableHandler.java b/wizards/com/sun/star/wizards/text/TextTableHandler.java index d3646a7cfa37..ab7e46a62c0a 100644 --- a/wizards/com/sun/star/wizards/text/TextTableHandler.java +++ b/wizards/com/sun/star/wizards/text/TextTableHandler.java @@ -69,9 +69,9 @@ public class TextTableHandler this.xMSFDoc = xMSF; this.xTextDocument = xTextDocument; xText = xTextDocument.getText(); - xTextTablesSupplier = (XTextTablesSupplier) UnoRuntime.queryInterface(XTextTablesSupplier.class, xTextDocument); - xSimpleText = (XSimpleText) UnoRuntime.queryInterface(XSimpleText.class, xTextDocument.getText()); - XNumberFormatsSupplier xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); + xTextTablesSupplier = UnoRuntime.queryInterface(XTextTablesSupplier.class, xTextDocument); + xSimpleText = UnoRuntime.queryInterface(XSimpleText.class, xTextDocument.getText()); + XNumberFormatsSupplier xNumberFormatsSupplier = UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument); aCharLocale = (Locale) Helper.getUnoStructValue((Object) xTextDocument, "CharLocale"); oNumberFormatter = new NumberFormatter(xNumberFormatsSupplier, aCharLocale); } @@ -95,7 +95,7 @@ public class TextTableHandler if (xAllTextTables.hasByName(_sTableName)) { Object oTable = xAllTextTables.getByName(_sTableName); - xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, oTable); + xTextTable = UnoRuntime.queryInterface(XTextTable.class, oTable); } } catch (Exception exception) @@ -109,11 +109,10 @@ public class TextTableHandler { try { - XIndexAccess xAllTextTables = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextTablesSupplier.getTextTables()); + XIndexAccess xAllTextTables = UnoRuntime.queryInterface(XIndexAccess.class, xTextTablesSupplier.getTextTables()); int MaxIndex = xAllTextTables.getCount() - 1; Object oTable = xAllTextTables.getByIndex(MaxIndex); - XTextTable xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, oTable); - return xTextTable; + return UnoRuntime.queryInterface(XTextTable.class, oTable); } catch (Exception exception) { @@ -127,7 +126,7 @@ public class TextTableHandler try { com.sun.star.uno.XInterface xTextTable = (XInterface) xMSFDoc.createInstance("com.sun.star.text.TextTable"); - XTextContent xTextContentTable = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xTextTable); + XTextContent xTextContentTable = UnoRuntime.queryInterface(XTextContent.class, xTextTable); if (xTextCursor == null) { xTextCursor = xTextDocument.getText().createTextCursor(); @@ -145,7 +144,7 @@ public class TextTableHandler { try { - XIndexAccess xAllTextTables = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextTablesSupplier.getTextTables()); + XIndexAccess xAllTextTables = UnoRuntime.queryInterface(XIndexAccess.class, xTextTablesSupplier.getTextTables()); int TextTableCount = xAllTextTables.getCount(); for (int i = TextTableCount - 1; i >= 0; i--) { @@ -162,7 +161,7 @@ public class TextTableHandler { try { - XIndexAccess xAllTextTables = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTextTablesSupplier.getTextTables()); + XIndexAccess xAllTextTables = UnoRuntime.queryInterface(XIndexAccess.class, xTextTablesSupplier.getTextTables()); Object oTextTable = xAllTextTables.getByIndex(xAllTextTables.getCount() - 1); removeTextTable(oTextTable); } @@ -176,7 +175,7 @@ public class TextTableHandler { try { - XTextContent xTextContentTable = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, oTextTable); + XTextContent xTextContentTable = UnoRuntime.queryInterface(XTextContent.class, oTextTable); xTextDocument.getText().removeTextContent(xTextContentTable); } catch (Exception exception) @@ -190,7 +189,7 @@ public class TextTableHandler try { XNameAccess xAllTextTables = xTextTablesSupplier.getTextTables(); - if (xAllTextTables.hasByName(TableName) == true) + if (xAllTextTables.hasByName(TableName)) { removeTextTable(xAllTextTables.getByName(TableName)); } @@ -209,7 +208,7 @@ public class TextTableHandler if (xTextTableNames.hasByName(OldTableName)) { Object oTextTable = xTextTableNames.getByName(OldTableName); - XNamed xTextTableName = (XNamed) UnoRuntime.queryInterface(XNamed.class, oTextTable); + XNamed xTextTableName = UnoRuntime.queryInterface(XNamed.class, oTextTable); xTextTableName.setName(NewTableName); } } @@ -236,10 +235,10 @@ public class TextTableHandler { XFrame xFrame = this.xTextDocument.getCurrentController().getFrame(); int ColCount = xTextTable.getColumns().getCount(); - XCellRange xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, xTextTable); + XCellRange xCellRange = UnoRuntime.queryInterface(XCellRange.class, xTextTable); XCellRange xLocCellRange = xCellRange.getCellRangeByPosition(0, 0, ColCount - 1, 1); short iHoriOrient = AnyConverter.toShort(Helper.getUnoPropertyValue(xTextTable, "HoriOrient")); - XSelectionSupplier xSelection = (XSelectionSupplier) UnoRuntime.queryInterface(XSelectionSupplier.class, xTextDocument.getCurrentController()); + XSelectionSupplier xSelection = UnoRuntime.queryInterface(XSelectionSupplier.class, xTextDocument.getCurrentController()); xSelection.select(xLocCellRange); Desktop.dispatchURL(_xMSF, ".Uno:DistributeColumns", xFrame); Desktop.dispatchURL(_xMSF, ".Uno:SetOptimalColumnWidth", xFrame); diff --git a/wizards/com/sun/star/wizards/text/ViewHandler.java b/wizards/com/sun/star/wizards/text/ViewHandler.java index e29ad10cfbb1..d234f26e2bfe 100644 --- a/wizards/com/sun/star/wizards/text/ViewHandler.java +++ b/wizards/com/sun/star/wizards/text/ViewHandler.java @@ -59,26 +59,26 @@ public class ViewHandler { this.xMSFDoc = xMSF; this.xTextDocument = xTextDocument; - xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController()); - xViewSettingsSupplier = (XViewSettingsSupplier) UnoRuntime.queryInterface(XViewSettingsSupplier.class, xTextDocument.getCurrentController()); - xStyleFamiliesSupplier = (XStyleFamiliesSupplier) UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); + xTextViewCursorSupplier = UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController()); + xViewSettingsSupplier = UnoRuntime.queryInterface(XViewSettingsSupplier.class, xTextDocument.getCurrentController()); + xStyleFamiliesSupplier = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument); } public void selectFirstPage(TextTableHandler oTextTableHandler) { try { - XPageCursor xPageCursor = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class, xTextViewCursorSupplier.getViewCursor()); - XTextCursor xViewTextCursor = (XTextCursor) UnoRuntime.queryInterface(XTextCursor.class, xPageCursor); + XPageCursor xPageCursor = UnoRuntime.queryInterface(XPageCursor.class, xTextViewCursorSupplier.getViewCursor()); + XTextCursor xViewTextCursor = UnoRuntime.queryInterface(XTextCursor.class, xPageCursor); xPageCursor.jumpToFirstPage(); xPageCursor.jumpToStartOfPage(); Helper.setUnoPropertyValue(xPageCursor, "PageDescName", "First Page"); Object oPageStyles = xStyleFamiliesSupplier.getStyleFamilies().getByName("PageStyles"); - XNameAccess xName = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oPageStyles); + XNameAccess xName = UnoRuntime.queryInterface(XNameAccess.class, oPageStyles); Object oPageStyle = xName.getByName("First Page"); - XIndexAccess xAllTextTables = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oTextTableHandler.xTextTablesSupplier.getTextTables()); - XTextContent xTextTable = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xAllTextTables.getByIndex(0)); - XTextRange xRange = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xTextTable.getAnchor().getText()); + XIndexAccess xAllTextTables = UnoRuntime.queryInterface(XIndexAccess.class, oTextTableHandler.xTextTablesSupplier.getTextTables()); + XTextContent xTextTable = UnoRuntime.queryInterface(XTextContent.class, xAllTextTables.getByIndex(0)); + XTextRange xRange = UnoRuntime.queryInterface(XTextRange.class, xTextTable.getAnchor().getText()); xViewTextCursor.gotoRange(xRange, false); // if (xPageCursor.getPage() == (short) 1) { // Helper.setUnoPropertyValue(xTextTable, "PageDescName", "First Page"); diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java index 69583f14c8bd..aeebc069addc 100644 --- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java +++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java @@ -26,6 +26,7 @@ ************************************************************************/ package com.sun.star.wizards.ui; +import java.util.ArrayList; import java.util.Vector; import com.sun.star.wizards.common.*; import com.sun.star.wizards.db.*; @@ -44,7 +45,6 @@ public class AggregateComponent extends ControlScroller { "SUM", "AVG", "MIN", "MAX" }; - ; QueryMetaData CurDBMetaData; XButton optDetailQuery; XButton optSummaryQuery; @@ -79,7 +79,6 @@ public class AggregateComponent extends ControlScroller { curHelpID = _firstHelpID; this.CurDBMetaData = _CurDBMetaData; - ; Count = 1; optDetailQuery = CurUnoDialog.insertRadioButton("optDetailQuery", 0, new ActionListenerImpl(), new String[] @@ -88,7 +87,7 @@ public class AggregateComponent extends ControlScroller }, new Object[] { - new Integer(8), HelpIds.getHelpIdString(curHelpID), soptDetailQuery, new Integer(_iPosX), new Integer(iCompPosY - 42), new Short((short) 1), IStep, new Short(curtabindex++), new Integer(iCompWidth) + 8, HelpIds.getHelpIdString(curHelpID), soptDetailQuery, new Integer(_iPosX), new Integer(iCompPosY - 42), new Short((short) 1), IStep, new Short(curtabindex++), new Integer(iCompWidth) }); optSummaryQuery = CurUnoDialog.insertRadioButton("optSummaryQuery", 0, new ActionListenerImpl(), @@ -98,7 +97,7 @@ public class AggregateComponent extends ControlScroller }, new Object[] { - new Integer(16), HelpIds.getHelpIdString(curHelpID + 1), soptSummaryQuery, Boolean.TRUE, new Integer(_iPosX), new Integer(iCompPosY - 32), IStep, new Short(curtabindex++), new Integer(iCompWidth) + 16, HelpIds.getHelpIdString(curHelpID + 1), soptSummaryQuery, Boolean.TRUE, new Integer(_iPosX), new Integer(iCompPosY - 32), IStep, new Short(curtabindex++), new Integer(iCompWidth) }); CurUnoDialog.insertLabel("lblAggregate", new String[] @@ -107,7 +106,7 @@ public class AggregateComponent extends ControlScroller }, new Object[] { - new Integer(8), slblAggregate, new Integer(iCompPosX + 5), new Integer(iCompPosY - 10), IStep, new Short(curtabindex++), new Integer(90) + 8, slblAggregate, new Integer(iCompPosX + 5), new Integer(iCompPosY - 10), IStep, new Short(curtabindex++), 90 }); CurUnoDialog.insertLabel("lblFieldnames", new String[] @@ -116,7 +115,7 @@ public class AggregateComponent extends ControlScroller }, new Object[] { - new Integer(8), slblFieldNames, new Integer(iCompPosX + 101), new Integer(iCompPosY - 10), IStep, new Short(curtabindex++), new Integer(90) + 8, slblFieldNames, new Integer(iCompPosX + 101), new Integer(iCompPosY - 10), IStep, new Short(curtabindex++), 90 }); this.setTotalFieldCount(1); FontDescriptor oFontDescriptor = new FontDescriptor(); @@ -127,20 +126,20 @@ 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[] { - oFontDescriptor, new Integer(14), HelpIds.getHelpIdString(lastHelpIndex + 1), "+", new Integer(_iPosX + iCompWidth - 36), new Integer(iButtonPosY), IStep, new Short((curtabindex++)), new Integer(16) + oFontDescriptor, 14, HelpIds.getHelpIdString(lastHelpIndex + 1), "+", new Integer(_iPosX + iCompWidth - 36), new Integer(iButtonPosY), IStep, new Short((curtabindex++)), 16 }); 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[] { - oFontDescriptor, new Integer(14), HelpIds.getHelpIdString(lastHelpIndex + 2), "-", new Integer(_iPosX + iCompWidth - 16), new Integer(iButtonPosY), IStep, new Short(curtabindex++), new Integer(16) + oFontDescriptor, 14, HelpIds.getHelpIdString(lastHelpIndex + 2), "-", new Integer(_iPosX + iCompWidth - 16), new Integer(iButtonPosY), IStep, new Short(curtabindex++), 16 }); CurDBMetaData.Type = getQueryType(); } @@ -280,14 +279,14 @@ public class AggregateComponent extends ControlScroller ControlRow curcontrolrow = null; boolean biscomplete = true; CurDBMetaData.Type = getQueryType(); - CurUnoDialog.setControlProperty("btnminus", PropertyNames.PROPERTY_ENABLED, new Boolean((super.getTotalFieldCount() > 0) && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY))); + CurUnoDialog.setControlProperty("btnminus", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf((super.getTotalFieldCount() > 0) && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY))); int fieldcount = super.getCurFieldCount(); if (fieldcount > 0) { curcontrolrow = (ControlRow) ControlRowVector.elementAt(super.getCurFieldCount() - 1); biscomplete = curcontrolrow.isComplete(); } - CurUnoDialog.setControlProperty("btnplus", PropertyNames.PROPERTY_ENABLED, new Boolean(biscomplete && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY))); + CurUnoDialog.setControlProperty("btnplus", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(biscomplete && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY))); togglefollowingDialogSteps(); } @@ -295,8 +294,8 @@ public class AggregateComponent extends ControlScroller { CurDBMetaData.Type = getQueryType(); boolean benableComponent = isAggregateComponentEnabled(); - CurUnoDialog.setControlProperty("lblAggregate", PropertyNames.PROPERTY_ENABLED, new Boolean(benableComponent)); - CurUnoDialog.setControlProperty("lblFieldnames", PropertyNames.PROPERTY_ENABLED, new Boolean(benableComponent)); + CurUnoDialog.setControlProperty("lblAggregate", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benableComponent)); + CurUnoDialog.setControlProperty("lblFieldnames", PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(benableComponent)); toggleButtons(); super.toggleComponent(benableComponent); super.toggleControls(benableComponent); @@ -370,11 +369,10 @@ public class AggregateComponent extends ControlScroller CurDBMetaData.Type = getQueryType(); if (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY) { - Vector aggregatevector = new Vector(); + ArrayList<String[]> aggregatevector = new ArrayList<String[]>(); PropertyValue[][] aggregatelist = this.getScrollFieldValues(); PropertyValue[] currowproperties; PropertyValue curaggregateproperty; - int a = 0; if (CurDBMetaData.AggregateFieldNames != null) { for (int i = 0; i < aggregatelist.length; i++) @@ -390,12 +388,11 @@ public class AggregateComponent extends ControlScroller curaggregatename[0] = CurDBMetaData.NumericFieldNames[iselfield[0]]; curaggregatename[1] = this.sFunctionOperators[iselfunction[0]]; aggregatevector.add(curaggregatename); - a++; } } } } - CurDBMetaData.AggregateFieldNames = new String[a][2]; + CurDBMetaData.AggregateFieldNames = new String[aggregatevector.size()][2]; aggregatevector.toArray(CurDBMetaData.AggregateFieldNames); } @@ -407,7 +404,7 @@ public class AggregateComponent extends ControlScroller String sDisplayFunction = sFunctions[index]; sDuplicateAggregateFunction = JavaTools.replaceSubString(sDuplicateAggregateFunction, sDisplayFunction, "<FUNCTION>"); CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, sDuplicateAggregateFunction); - CurUnoDialog.vetoableChange(new java.beans.PropertyChangeEvent(CurUnoDialog, "Steps", new Integer(1), new Integer(2))); + CurUnoDialog.vetoableChange(new java.beans.PropertyChangeEvent(CurUnoDialog, "Steps", 1, 2)); return new String[][] { }; @@ -528,11 +525,11 @@ 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[] { - Boolean.TRUE, new Integer(12), HelpIds.getHelpIdString(_curHelpID++), new Integer(iCompPosX + 4), new Integer(ypos), UIConsts.INVISIBLESTEP, sFunctions, new Short(curtabindex++), new Integer(88) + Boolean.TRUE, 12, HelpIds.getHelpIdString(_curHelpID++), new Integer(iCompPosX + 4), new Integer(ypos), UIConsts.INVISIBLESTEP, sFunctions, new Short(curtabindex++), 88 }); xFieldListBox = CurUnoDialog.insertListBox(getFieldsControlName(index), 1, null, new ItemListenerImpl(), @@ -542,7 +539,7 @@ public class AggregateComponent extends ControlScroller }, new Object[] { - Boolean.TRUE, new Integer(12), HelpIds.getHelpIdString(_curHelpID++), new Integer(iCompPosX + 98), new Integer(ypos), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(86) + Boolean.TRUE, 12, HelpIds.getHelpIdString(_curHelpID++), new Integer(iCompPosX + 98), new Integer(ypos), UIConsts.INVISIBLESTEP, new Short(curtabindex++), 86 }); lastHelpIndex = _curHelpID - 1; } @@ -570,13 +567,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 41062757f0cf..e85343f42464 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, @@ -199,7 +199,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener Integer.valueOf(cols * (m_aButtonSize.Width + gap.Width) + gap.Width - 2 * btnSize.intValue() - 1) }); - Helper.setUnoPropertyValue(getModel(lblCounter), "Align", new Short((short) 1)); + Helper.setUnoPropertyValue(getModel(lblCounter), PropertyNames.PROPERTY_ALIGN, new Short((short) 1)); Helper.setUnoPropertyValue(getModel(btnBack), PropertyNames.PROPERTY_LABEL, "<"); Helper.setUnoPropertyValue(getModel(btnNext), PropertyNames.PROPERTY_LABEL, ">"); @@ -219,7 +219,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener for (int c = 0; c < cols; c++) { XButton aButton = createButton(dialog, r, c); - XControl aControl = (XControl)UnoRuntime.queryInterface(XControl.class, aButton); + XControl aControl = UnoRuntime.queryInterface(XControl.class, aButton); m_aButtons[r * cols + c] = aControl; } } @@ -238,7 +238,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener XButton aButton = dialog.insertImageButton(sButtonName, this, new String[] { - /* "Border", */ + /* PropertyNames.PROPERTY_BORDER, */ /* "BackgroundColor", */ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, @@ -269,7 +269,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener m_aButtonWidth }); - XWindow win = (XWindow) UnoRuntime.queryInterface(XWindow.class, aButton); + XWindow win = UnoRuntime.queryInterface(XWindow.class, aButton); win.setEnable(true); win.setVisible(true); return aButton; @@ -277,14 +277,12 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private int getButtonPosX(int _col) { - final int nXPos = pos.Width + _col * (m_aButtonSize.Width + gap.Width) + gap.Width; - return nXPos; + return pos.Width + _col * (m_aButtonSize.Width + gap.Width) + gap.Width; } private int getButtonPosY(int _row) { - final int nYPos = pos.Height + _row * (m_aButtonSize.Height + gap.Height) + gap.Height; - return nYPos; + return pos.Height + _row * (m_aButtonSize.Height + gap.Height) + gap.Height; } private void refreshImages() @@ -308,7 +306,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener { if (oResources.length == 1) { - Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, (String) oResources[0]); + Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]); } else if (oResources.length == 2) { @@ -350,7 +348,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private transient java.util.ArrayList<XItemListener> m_aItemListenerList; private void setVisible(Object control, boolean visible) { - final XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, control); + final XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, control); xWindow.setVisible(visible); } @@ -675,7 +673,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); } @@ -719,8 +717,8 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private void enableButtons() { - enable(btnNext, new Boolean(pageStart + rows * cols < listModel.getSize())); - enable(btnBack, new Boolean(pageStart > 0)); + enable(btnNext, Boolean.valueOf(pageStart + rows * cols < listModel.getSize())); + enable(btnBack, Boolean.valueOf(pageStart > 0)); } private void enable(Object control, Boolean enable) @@ -730,12 +728,12 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private Object getModel(Object control) { - return ((XControl) UnoRuntime.queryInterface(XControl.class, control)).getModel(); + return UnoRuntime.queryInterface(XControl.class, control).getModel(); } private void setBorder(Object control, Short border) { - Helper.setUnoPropertyValue(getModel(control), "Border", border); + Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_BORDER, border); //XWindowPeer peer = ((XControl)UnoRuntime.queryInterface(XControl.class,control)).getPeer(); //peer.invalidate(InvalidateStyle.CHILDREN); } @@ -770,7 +768,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,9 +889,9 @@ 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(); + int nButton = Integer.parseInt(sButton); // int image = getImageFromEvent(event); int index = getIndexFor(nButton); diff --git a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java index 5a2457a18d76..14a5f88796ba 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; @@ -142,7 +142,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator }, new Object[] { - Boolean.FALSE, new Integer(8), _reslblTables, new Integer(95), new Integer(27), IStep, new Short((short) 3), LabelWidth + Boolean.FALSE, 8, _reslblTables, 95, 27, IStep, new Short((short) 3), LabelWidth }); // DropDown Listbox TableNames xTableListBox = CurUnoDialog.insertListBox(sTableListBoxName, 0, null, new ItemListenerImpl(), @@ -152,7 +152,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator }, new Object[] { - Boolean.TRUE, Boolean.FALSE, new Integer(12), HelpIds.getHelpIdString(super.FirstHelpIndex - 1), new Short(UnoDialog.getListBoxLineCount()), new Integer(95), new Integer(37), IStep, new Short((short) 4), getListboxWidth() + Boolean.TRUE, Boolean.FALSE, 12, HelpIds.getHelpIdString(super.FirstHelpIndex - 1), new Short(UnoDialog.getListBoxLineCount()), 95, 37, IStep, new Short((short) 4), getListboxWidth() }); // XWindow xTableListBoxWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xTableListBox); fillupCommandListBox(); @@ -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) { @@ -320,9 +320,9 @@ public class CommandFieldSelection extends FieldSelection implements Comparator else { emptyFieldsListBoxes(); - iSelArray = new short[] { (short) iSelPos }; + iSelArray = new short[] {iSelPos}; } - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "SelectedItems", iSelArray); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, iSelArray); toggleCommandListBox(true); if (bgetFields) { @@ -366,8 +366,8 @@ public class CommandFieldSelection extends FieldSelection implements Comparator public void toggleCommandListBox(boolean _bdoenable) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlblTable), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xlblTable), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); } public String getSelectedCommandName() @@ -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, Boolean.valueOf(_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, Boolean.valueOf(_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 b2a736fcfb0a..59b01fee772b 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; @@ -118,7 +116,7 @@ public abstract class ControlScroller oImgControl = CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlImageControlModel", "imgBackground" + sIncSuffix, new String[] { - "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -130,11 +128,11 @@ public abstract class ControlScroller new AdjustmentListenerImpl(), new String[] { - "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[] { - new Short((short) 0), new Boolean(true), new Integer(ScrollHeight), HelpIds.getHelpIdString(curHelpIndex), new Integer(ScrollBarOrientation.VERTICAL), new Integer(iCompPosX + iCompWidth - iScrollBarWidth - 1), new Integer(iCompPosY + 1), IStep, new Integer(iScrollBarWidth) + new Short((short) 0), Boolean.TRUE, new Integer(ScrollHeight), HelpIds.getHelpIdString(curHelpIndex), new Integer(ScrollBarOrientation.VERTICAL), new Integer(iCompPosX + iCompWidth - iScrollBarWidth - 1), new Integer(iCompPosY + 1), IStep, new Integer(iScrollBarWidth) }); scrollfields = new Vector(); int ypos = iStartPosY + SORELFIRSTPOSY; @@ -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)); } /** @@ -173,7 +171,7 @@ public abstract class ControlScroller ntotfieldcount = _ntotfieldcount; setCurFieldCount(); nscrollvalue = 0; - Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), new String("ScrollValue"), new Integer(nscrollvalue)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), "ScrollValue", new Integer(nscrollvalue)); if (ntotfieldcount > nblockincrement) { Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[] @@ -245,7 +243,7 @@ public abstract class ControlScroller { if (_nscrollvalue >= 0) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), new String("ScrollValue"), new Integer(_nscrollvalue)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), "ScrollValue", new Integer(_nscrollvalue)); scrollControls(); } } @@ -301,7 +299,7 @@ public abstract class ControlScroller protected void toggleComponent(boolean _bdoenable) { boolean bdoenable = _bdoenable && (ntotfieldcount > nblockincrement); - CurUnoDialog.setControlProperty("TitleScrollBar" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable)); + CurUnoDialog.setControlProperty("TitleScrollBar" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenable)); } protected void toggleControls(boolean _bdoenable) @@ -312,7 +310,7 @@ public abstract class ControlScroller for (int m = 0; m < curproperties.length; m++) { PropertyValue curproperty = curproperties[m]; - CurUnoDialog.setControlProperty(curproperty.Name, PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); + CurUnoDialog.setControlProperty(curproperty.Name, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); } } @@ -326,7 +324,7 @@ public abstract class ControlScroller protected void setLineIncrementation(int _nlineincrement) { this.nlineincrement = _nlineincrement; - Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), new String("LineIncrement"), new Integer(nlineincrement)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), "LineIncrement", new Integer(nlineincrement)); } @@ -343,7 +341,7 @@ public abstract class ControlScroller PropertyNames.PROPERTY_ENABLED, "BlockIncrement", "ScrollValueMax" }, new Object[] { - new Boolean(ntotfieldcount > nblockincrement), new Integer(nblockincrement), new Integer(ntotfieldcount - nblockincrement) + Boolean.valueOf(ntotfieldcount > nblockincrement), new Integer(nblockincrement), new Integer(ntotfieldcount - nblockincrement) }); } @@ -397,12 +395,10 @@ public abstract class ControlScroller { if (guiRow + nscrollvalue < scrollfields.size()) { - PropertyValue pv = fieldInfo( + return fieldInfo( ((PropertyValue[]) scrollfields.elementAt(guiRow + nscrollvalue))[column], ((PropertyValue[]) scrollfields.elementAt(guiRow))[column]); //System.out.println("getting field info for : " + guiRow + "/" + column + ":" + pv.Value + "(" + pv.Name + ")" ); - - return pv; } else { @@ -453,7 +449,7 @@ public abstract class ControlScroller { Object oControlModel = UnoDialog.getModel(CurUnoDialog.xDlgContainer.getControl(controlname)); String propertyname = UnoDialog.getDisplayProperty(oControlModel); - if (propertyname != "") + if (!propertyname.equals(PropertyNames.EMPTY_STRING)) { CurUnoDialog.setControlProperty(controlname, propertyname, newvalue); } @@ -463,7 +459,7 @@ public abstract class ControlScroller { Object oControlModel = UnoDialog.getModel(CurUnoDialog.xDlgContainer.getControl(controlname)); String propertyname = UnoDialog.getDisplayProperty(oControlModel); - if (propertyname != "") + if (!propertyname.equals(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..1bf70e77faa6 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 @@ -90,7 +91,7 @@ public abstract class DBLimitedFieldSelection protected void moveupSelectedItems(int CurIndex, boolean bDoEnable) { // short iNextItemPos; - if ((bDoEnable == false) && (MAXSELINDEX > CurIndex)) + if ((!bDoEnable) && (MAXSELINDEX > CurIndex)) { for (int i = CurIndex; i < MAXSELINDEX; i++) { @@ -112,17 +113,14 @@ public abstract class DBLimitedFieldSelection int FieldCount = _FieldNames.length; String[] ViewFieldNames = new String[FieldCount + 1]; ViewFieldNames[0] = sNoField; - for (int i = 0; i < FieldCount; i++) - { - ViewFieldNames[i + 1] = _FieldNames[i]; - } + System.arraycopy(_FieldNames, 0, ViewFieldNames, 1, FieldCount); return ViewFieldNames; } 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 +134,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..db7a3fd959fc 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 @@ -75,7 +76,7 @@ public class DocumentPreview { //((XWindow)UnoRuntime.queryInterface(XWindow.class,control)).addPaintListener(this); - xControl = (XControl) UnoRuntime.queryInterface(XControl.class, control); + xControl = UnoRuntime.queryInterface(XControl.class, control); //register this object as a listener, to close the frame when disposing. //((XComponent) UnoRuntime.queryInterface(XComponent.class, control)).addEventListener(this); @@ -98,7 +99,7 @@ public class DocumentPreview protected XComponent setDocument(String url, PropertyValue[] lArgs) throws com.sun.star.lang.IllegalArgumentException, IOException, CloseVetoException { loadArgs = lArgs; - XComponentLoader xCompLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, xFrame); + XComponentLoader xCompLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame); xFrame.activate(); return xComponent = xCompLoader.loadComponentFromURL(url, "_self", 0, loadArgs); } @@ -115,7 +116,7 @@ public class DocumentPreview { if (xFrame != null) { - ((XCloseable) UnoRuntime.queryInterface(XCloseable.class, xFrame)).close(false); + UnoRuntime.queryInterface(XCloseable.class, xFrame).close(false); } } @@ -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 @@ -148,11 +149,11 @@ public class DocumentPreview public void createPreviewFrame(XMultiServiceFactory xmsf, XControl xControl) throws com.sun.star.uno.Exception, com.sun.star.lang.IllegalArgumentException { XWindowPeer controlPeer = xControl.getPeer(); - XWindow controlWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xControl); + XWindow controlWindow = UnoRuntime.queryInterface(XWindow.class, xControl); Rectangle r = controlWindow.getPosSize(); Object toolkit = xmsf.createInstance("com.sun.star.awt.Toolkit"); - XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, toolkit); + XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, toolkit); WindowDescriptor aDescriptor = new WindowDescriptor(); aDescriptor.Type = WindowClass.SIMPLE; @@ -163,9 +164,9 @@ public class DocumentPreview aDescriptor.WindowAttributes = VclWindowPeerAttribute.CLIPCHILDREN | WindowAttribute.SHOW; XWindowPeer xPeer = xToolkit.createWindow(aDescriptor); - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xPeer); + xWindow = UnoRuntime.queryInterface(XWindow.class, xPeer); Object frame = xmsf.createInstance("com.sun.star.frame.Frame"); - xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, frame); + xFrame = UnoRuntime.queryInterface(XFrame.class, frame); // XFrame xF = (XFrame) UnoRuntime.queryInterface(XFrame.class, Desktop.getDesktop(xmsf)); // xFrame = xF.findFrame("_blank", 0); xFrame.initialize(xWindow); diff --git a/wizards/com/sun/star/wizards/ui/FieldSelection.java b/wizards/com/sun/star/wizards/ui/FieldSelection.java index 6ec242243adb..9083b13ec49f 100644 --- a/wizards/com/sun/star/wizards/ui/FieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/FieldSelection.java @@ -210,7 +210,7 @@ public class FieldSelection SelListBoxPosX = new Integer(cmdShiftButtonPosX.intValue() + cmdButtonWidth + cmdButtonHoriDist); IStep = new Integer(_iStep); - if (bshowFourButtons == true) + if (bshowFourButtons) { ShiftButtonCount = 4; } @@ -230,7 +230,7 @@ public class FieldSelection }, new Object[] { - new Integer(8), slblFields, new Integer(CompPosX), new Integer(CompPosY), IStep, new Short(curtabindex), new Integer(109) + 8, slblFields, new Integer(CompPosX), new Integer(CompPosY), IStep, new Short(curtabindex), 109 }); // Listbox 'Available fields' @@ -251,10 +251,10 @@ public class FieldSelection }, new Object[] { - Boolean.FALSE, new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 1), ">", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, 14, HelpIds.getHelpIdString(_FirstHelpIndex + 1), ">", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); - if (bshowFourButtons == true) + if (bshowFourButtons) { btnmoveall = CurUnoDialog.insertButton("cmdMoveAll" + sIncSuffix, SOCMDMOVEALL, new ActionListenerImpl(), new String[] @@ -263,7 +263,7 @@ public class FieldSelection }, new Object[] { - new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 2), ">>", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + 14, HelpIds.getHelpIdString(_FirstHelpIndex + 2), ">>", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); } Object btnremoveselected = CurUnoDialog.insertButton("cmdRemoveSelected" + sIncSuffix, SOCMDREMOVESEL, new ActionListenerImpl(), @@ -273,10 +273,10 @@ public class FieldSelection }, new Object[] { - Boolean.FALSE, new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 3), "<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, 14, HelpIds.getHelpIdString(_FirstHelpIndex + 3), "<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); - if (bshowFourButtons == true) + if (bshowFourButtons) { btnremoveall = CurUnoDialog.insertButton("cmdRemoveAll" + sIncSuffix, SOCMDREMOVEALL, new ActionListenerImpl(), new String[] @@ -285,7 +285,7 @@ public class FieldSelection }, new Object[] { - new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 4), "<<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + 14, HelpIds.getHelpIdString(_FirstHelpIndex + 4), "<<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); } @@ -300,7 +300,7 @@ public class FieldSelection }, new Object[] { - new Integer(8), slblSelFields, SelListBoxPosX, new Integer(CompPosY), IStep, new Short(curtabindex++), ListBoxWidth + 8, slblSelFields, SelListBoxPosX, new Integer(CompPosY), IStep, new Short(curtabindex++), ListBoxWidth }); // ListBox 'Fields in the form' @@ -317,27 +317,27 @@ 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[] { - Boolean.FALSE, oFontDesc, new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 6), String.valueOf((char) 8743), cmdMoveButtonPosX, MoveButtonPosY[0], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, oFontDesc, 14, HelpIds.getHelpIdString(_FirstHelpIndex + 6), String.valueOf((char) 8743), cmdMoveButtonPosX, MoveButtonPosY[0], IStep, new Short(curtabindex++), CmdButtonWidth }); 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[] { - Boolean.FALSE, oFontDesc, new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 7), String.valueOf((char) 8744), cmdMoveButtonPosX, MoveButtonPosY[1], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, oFontDesc, 14, HelpIds.getHelpIdString(_FirstHelpIndex + 7), String.valueOf((char) 8744), cmdMoveButtonPosX, MoveButtonPosY[1], IStep, new Short(curtabindex++), CmdButtonWidth }); 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) { @@ -427,7 +427,7 @@ public class FieldSelection CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); - if (BDoEnable.booleanValue() == true) + if (BDoEnable.booleanValue()) { toggleListboxButtons((short) - 1, (short) - 1); } @@ -466,11 +466,11 @@ public class FieldSelection bmoveUpenabled = ((iSelIndices[0] > 0) && (iSelIndices.length == 1)); bmoveDownenabled = (((iSelIndices[SelListBoxSelLength - 1]) < (short) (SelectCount - 1)) && (iSelIndices.length == 1)); } - CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(SelectCount >= 1)); - CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bSelectSelected)); + CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(SelectCount >= 1)); + CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bSelectSelected)); toggleMoveButtons((FieldCount >= 1), bIsFieldSelected); - CurUnoDialog.setControlProperty("cmdMoveUp" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bmoveUpenabled)); - CurUnoDialog.setControlProperty("cmdMoveDown" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bmoveDownenabled)); + CurUnoDialog.setControlProperty("cmdMoveUp" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bmoveUpenabled)); + CurUnoDialog.setControlProperty("cmdMoveDown" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bmoveDownenabled)); } catch (Exception exception) { @@ -482,8 +482,8 @@ public class FieldSelection { boolean btoggleMoveAll = (((xFieldsListBox.getItemCount() + xSelectedFieldsListBox.getItemCount()) < maxfieldcount) && (_btoggleMoveAll)); boolean btoggleMoveSelected = (((xFieldsListBox.getSelectedItems().length + xSelectedFieldsListBox.getItemCount()) < maxfieldcount) && (_btoggleMoveSelected)); - CurUnoDialog.setControlProperty("cmdMoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(btoggleMoveAll)); - CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(btoggleMoveSelected)); + CurUnoDialog.setControlProperty("cmdMoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(btoggleMoveAll)); + CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(btoggleMoveSelected)); } public void setMultipleMode(boolean _bisMultiple) @@ -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 8dfc12e21fb3..8c8ee10a1a83 100644 --- a/wizards/com/sun/star/wizards/ui/FilterComponent.java +++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java @@ -113,6 +113,7 @@ public class FilterComponent final int SO_FOURTHBOOLFIELDNAME = 256 + 4; int SO_BOOLEANLIST[] = + { SO_FIRSTBOOLFIELDNAME, SO_SECONDBOOLFIELDNAME, SO_THIRDBOOLFIELDNAME, SO_FOURTHBOOLFIELDNAME }; @@ -127,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: @@ -136,7 +137,7 @@ public class FilterComponent case SO_FOURTHFIELDNAME: sControlName = getControlName(EventObject.Source); String sControlNameSuffix = sIncSuffix + "_" + getIndexNumber(sControlName); - XListBox xCurFieldListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, CurUnoDialog.xDlgContainer.getControl(sControlName)); + XListBox xCurFieldListBox = UnoRuntime.queryInterface(XListBox.class, CurUnoDialog.xDlgContainer.getControl(sControlName)); String CurDisplayFieldName = xCurFieldListBox.getSelectedItem(); FieldColumn CurFieldColumn = new FieldColumn(oQueryMetaData, CurDisplayFieldName); @@ -197,8 +198,7 @@ public class FilterComponent public static String getIndexNumber(String _sStr) { - String sLastNumber = _sStr.substring(_sStr.length() - 1, _sStr.length()); - return sLastNumber; + return _sStr.substring(_sStr.length() - 1, _sStr.length()); } /** @@ -222,16 +222,15 @@ public class FilterComponent { try { - XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, _oSourceevent); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel()); - final String sName = AnyConverter.toString(xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME)); - return sName; + XControl xControl = UnoRuntime.queryInterface(XControl.class, _oSourceevent); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel()); + return AnyConverter.toString(xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME)); } catch (Exception e) { e.printStackTrace(System.out); } - return ""; + return PropertyNames.EMPTY_STRING; } public PropertyValue[][] getFilterConditions() @@ -245,20 +244,19 @@ public class FilterComponent try { final String serviceName = "com.sun.star.beans.PropertyBag"; - final XPropertyContainer column = (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, oQueryMetaData.xMSF.createInstance(serviceName)); + final XPropertyContainer column = 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); if (composer.getQuery().length() == 0) { - final String fromClause = composer.getFromClause(); StringBuilder sql = new StringBuilder(); sql.append(composer.getSelectClause(true)); sql.append(' '); - sql.append(fromClause); + sql.append(composer.getFromClause()); composer.getQueryComposer().setElementaryQuery(sql.toString()); } composer.getQueryComposer().setStructuredFilter(new PropertyValue[][] @@ -267,39 +265,36 @@ public class FilterComponent for (int i = 0; i < RowCount; i++) { ControlRow currentControlRow = oControlRows[i]; - if (currentControlRow.isEnabled()) + if (currentControlRow.isEnabled() && currentControlRow.isConditionComplete()) { - if (currentControlRow.isConditionComplete()) + String sFieldName = currentControlRow.getSelectedFieldName(); + int nOperator = (int) currentControlRow.getSelectedOperator(); + FieldColumn aFieldColumn = oQueryMetaData.getFieldColumnByDisplayName(sFieldName); + columnSet.setPropertyValue(PropertyNames.PROPERTY_NAME, aFieldColumn.getFieldName()); + columnSet.setPropertyValue("Type", aFieldColumn.getXColumnPropertySet().getPropertyValue("Type")); + Object value = currentControlRow.getValue(); + switch (aFieldColumn.getFieldType()) { - String sFieldName = currentControlRow.getSelectedFieldName(); - int nOperator = (int) currentControlRow.getSelectedOperator(); - FieldColumn aFieldColumn = oQueryMetaData.getFieldColumnByDisplayName(sFieldName); - columnSet.setPropertyValue(PropertyNames.PROPERTY_NAME, aFieldColumn.getFieldName()); - columnSet.setPropertyValue("Type", aFieldColumn.getXColumnPropertySet().getPropertyValue("Type")); - Object value = currentControlRow.getValue(); - switch (aFieldColumn.getFieldType()) - { - case DataType.TIMESTAMP: - case DataType.DATE: - value = ((Double) value) - oQueryMetaData.getNullDateCorrection(); - break; - } - column.removeProperty("Value"); - final short operator = currentControlRow.getSelectedOperator(); - if ((operator == SQLFilterOperator.SQLNULL) - || (operator == SQLFilterOperator.NOT_SQLNULL) - || AnyConverter.isVoid(value)) - { - column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), new String()); - value = new Any(new Type(TypeClass.VOID), null); - } - else - { - column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), value); - } - columnSet.setPropertyValue("Value", value); - composer.getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL, nOperator); + case DataType.TIMESTAMP: + case DataType.DATE: + value = ((Double) value) - oQueryMetaData.getNullDateCorrection(); + break; + } + column.removeProperty("Value"); + final short operator = currentControlRow.getSelectedOperator(); + if ((operator == SQLFilterOperator.SQLNULL) + || (operator == SQLFilterOperator.NOT_SQLNULL) + || AnyConverter.isVoid(value)) + { + column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), ""); + value = new Any(new Type(TypeClass.VOID), null); + } + else + { + column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), value); } + columnSet.setPropertyValue("Value", value); + composer.getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL, nOperator); } } filterconditions = composer.getNormalizedStructuredFilter(); @@ -342,9 +337,9 @@ public class FilterComponent FieldName = _filtercondition.Name; } String sreturn = JavaTools.replaceSubString(_BaseString, FieldName, "<FIELDNAME>"); - String soperator = sLogicOperators[_filtercondition.Handle-1]; + 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)) @@ -358,14 +353,14 @@ public class FilterComponent { e.printStackTrace(System.out); } - return ""; + return PropertyNames.EMPTY_STRING; } private int getfilterstate() { boolean bisany = true; int ifilterstate = SOI_MATCHALL; - bisany = (this.optMatchAny.getState()) == true; + bisany = (this.optMatchAny.getState()); if (bisany) { ifilterstate = SOI_MATCHANY; @@ -566,7 +561,7 @@ public class FilterComponent m_bEnabled = _bEnabled; // Label Field - ControlElements[0] = (XInterface) CurUnoDialog.insertLabel("lblFieldNames" + sCompSuffix, + ControlElements[0] = CurUnoDialog.insertLabel("lblFieldNames" + sCompSuffix, new String[] { PropertyNames.PROPERTY_ENABLED, @@ -591,7 +586,7 @@ public class FilterComponent }); // Label Operator - ControlElements[1] = (XInterface) CurUnoDialog.insertLabel("lblOperators" + sCompSuffix, + ControlElements[1] = CurUnoDialog.insertLabel("lblOperators" + sCompSuffix, new String[] { PropertyNames.PROPERTY_ENABLED, @@ -616,7 +611,7 @@ public class FilterComponent }); // Label Value - ControlElements[2] = (XInterface) CurUnoDialog.insertLabel("lblValue" + sCompSuffix, + ControlElements[2] = CurUnoDialog.insertLabel("lblValue" + sCompSuffix, new String[] { PropertyNames.PROPERTY_ENABLED, @@ -641,7 +636,7 @@ public class FilterComponent }); // Listbox Fields - ControlElements[SOLSTFIELDNAME] = (XInterface) CurUnoDialog.insertListBox("lstFieldName" + sCompSuffix, SO_FIELDNAMELIST[Index], null, new ItemListenerImpl(), + ControlElements[SOLSTFIELDNAME] = CurUnoDialog.insertListBox("lstFieldName" + sCompSuffix, SO_FIELDNAMELIST[Index], null, new ItemListenerImpl(), new String[] { PropertyNames.PROPERTY_ENABLED, @@ -670,7 +665,7 @@ public class FilterComponent }); // Listbox Operators - ControlElements[SOLSTOPERATOR] = (XInterface) CurUnoDialog.insertListBox("lstOperator" + sCompSuffix, SO_CONDITIONLIST[Index], null, new ItemListenerImpl(), + ControlElements[SOLSTOPERATOR] = CurUnoDialog.insertListBox("lstOperator" + sCompSuffix, SO_CONDITIONLIST[Index], null, new ItemListenerImpl(), new String[] { PropertyNames.PROPERTY_ENABLED, @@ -681,7 +676,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 }, @@ -699,7 +694,7 @@ public class FilterComponent Short.valueOf(curtabindex++), Integer.valueOf(nOperatorWidth) }); - ControlElements[SOTXTVALUE] = (XInterface) CurUnoDialog.insertFormattedField("txtValue" + sCompSuffix, SO_TEXTFIELDLIST[Index], new TextListenerImpl(), + ControlElements[SOTXTVALUE] = CurUnoDialog.insertFormattedField("txtValue" + sCompSuffix, SO_TEXTFIELDLIST[Index], new TextListenerImpl(), new String[] { PropertyNames.PROPERTY_ENABLED, @@ -737,11 +732,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 */ @@ -764,7 +759,7 @@ public class FilterComponent if (!AnyConverter.isVoid(oValue)) { String sValue = (String.valueOf(oValue)); - return (!sValue.equals("")); + return (!sValue.equals(PropertyNames.EMPTY_STRING)); } } } @@ -781,9 +776,9 @@ public class FilterComponent { try { - XListBox xFieldsListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTFIELDNAME]); + XListBox xFieldsListBox = UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTFIELDNAME]); xFieldsListBox.selectItem(_filtercondition.Name, true); - XListBox xOperatorListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTOPERATOR]); + XListBox xOperatorListBox = UnoRuntime.queryInterface(XListBox.class, ControlElements[SOLSTOPERATOR]); xOperatorListBox.selectItemPos((short) (_filtercondition.Handle - 1), true); if (AnyConverter.isString(_filtercondition.Value)) @@ -791,8 +786,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); @@ -804,8 +799,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); @@ -839,7 +834,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; } @@ -870,7 +865,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) { @@ -878,7 +873,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 }); @@ -894,7 +889,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) @@ -910,7 +905,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 9d42aa45599e..02e7668db727 100644 --- a/wizards/com/sun/star/wizards/ui/ImageList.java +++ b/wizards/com/sun/star/wizards/ui/ImageList.java @@ -97,7 +97,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener public IRenderer counterRenderer = new SimpleCounterRenderer(); private Object dialogModel; private ImageKeyListener imageKeyListener; - private static final Integer BACKGROUND_COLOR = new Integer(16777216); //new Integer(SystemColor.window.getRGB() + 16777216); + private static final Integer BACKGROUND_COLOR = 16777216; //new Integer(SystemColor.window.getRGB() + 16777216); private final static Short HIDE_PAGE = new Short((short) 99); private final static Integer TRANSPARENT = new Integer(-1); private final static int LINE_HEIGHT = 8; //private MethodInvocation METHOD_MOUSE_ENTER_IMAGE; @@ -163,7 +163,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener new String[] { "BackgroundColor", - "Border", + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, @@ -202,7 +202,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener grbxSelectedImage = dialog.insertLabel(name + "_grbxSelected", new String[] { "BackgroundColor", - "Border", + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, @@ -215,14 +215,14 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener new Short((short) 1), new Integer(imageSize.Height + (selectionGap.Height * 2)), //height - new Integer(0), //posx - new Integer(0), //posy + 0, //posx + 0, //posy step, Boolean.TRUE, new Integer(selectionWidth) }); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, grbxSelectedImage); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, grbxSelectedImage); xWindow.addMouseListener(new OMouseListener()); final String[] pNames1 = new String[] @@ -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, @@ -252,7 +252,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener if (showButtons) { - final Integer btnSize = new Integer(14); + final Integer btnSize = 14; btnBack = dialog.insertButton(name + "_btnBack", "prevPage", this, pNames1, new Object[] { @@ -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, @@ -290,7 +290,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener new Integer(cols * (imageSize.Width + gap.Width) + gap.Width - 2 * btnSize.intValue() - 1) }); - Helper.setUnoPropertyValue(getModel(lblCounter), "Align", new Short((short) 1)); + Helper.setUnoPropertyValue(getModel(lblCounter), PropertyNames.PROPERTY_ALIGN, new Short((short) 1)); Helper.setUnoPropertyValue(getModel(btnBack), PropertyNames.PROPERTY_LABEL, "<"); Helper.setUnoPropertyValue(getModel(btnNext), PropertyNames.PROPERTY_LABEL, ">"); @@ -331,7 +331,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private Integer m_imageHeight, m_imageWidth; private final static String[] IMAGE_PROPS = new String[] { - "Border", + PropertyNames.PROPERTY_BORDER, "BackgroundColor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, @@ -366,7 +366,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener m_imageWidth }); - XWindow win = (XWindow) UnoRuntime.queryInterface(XWindow.class, image); + XWindow win = UnoRuntime.queryInterface(XWindow.class, image); win.addMouseListener(uiEventListener); win.addKeyListener(imageKeyListener); //uiEventListener.add(imageName,EventNames.EVENT_MOUSE_ENTERED,METHOD_MOUSE_ENTER_IMAGE); @@ -408,7 +408,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener { if (oResources.length == 1) { - Helper.setUnoPropertyValue(m_aImages[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, (String) oResources[0]); + Helper.setUnoPropertyValue(m_aImages[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]); } else if (oResources.length == 2) { @@ -500,7 +500,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private void setVisible(Object control, boolean visible) { - ((XWindow) UnoRuntime.queryInterface(XWindow.class, control)).setVisible(visible); + UnoRuntime.queryInterface(XWindow.class, control).setVisible(visible); } /** @@ -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)); } /** @@ -861,8 +861,8 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private void enableButtons() { - enable(btnNext, new Boolean(pageStart + rows * cols < listModel.getSize())); - enable(btnBack, new Boolean(pageStart > 0)); + enable(btnNext, Boolean.valueOf(pageStart + rows * cols < listModel.getSize())); + enable(btnBack, Boolean.valueOf(pageStart > 0)); } private void enable(Object control, Boolean enable) @@ -872,7 +872,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private Object getModel(Object control) { - return ((XControl) UnoRuntime.queryInterface(XControl.class, control)).getModel(); + return UnoRuntime.queryInterface(XControl.class, control).getModel(); } /* @@ -894,7 +894,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener */ private void setBorder(Object control, Short border) { - Helper.setUnoPropertyValue(getModel(control), "Border", border); + Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_BORDER, border); //XWindowPeer peer = ((XControl)UnoRuntime.queryInterface(XControl.class,control)).getPeer(); //peer.invalidate(InvalidateStyle.CHILDREN); } @@ -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; } } @@ -1081,7 +1081,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener { Helper.setUnoPropertyValue(m_aImages[image].getModel(), "Tabstop", Boolean.TRUE); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, m_aImages[image]); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, m_aImages[image]); xWindow.setFocus(); } diff --git a/wizards/com/sun/star/wizards/ui/PathSelection.java b/wizards/com/sun/star/wizards/ui/PathSelection.java index 6b50127017e1..fbeb54f84f35 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; @@ -81,7 +81,7 @@ public class PathSelection PropertyNames.PROPERTY_ENABLED, 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[] { - new Boolean(Enabled), new Integer(8), LabelText, new Integer(XPos), new Integer(YPos), new Integer(DialogStep), new Short(CurTabIndex), new Integer(Width) + Boolean.valueOf(Enabled), 8, LabelText, new Integer(XPos), new Integer(YPos), new Integer(DialogStep), new Short(CurTabIndex), new Integer(Width) }); xSaveTextBox = CurUnoDialog.insertTextField("txtSavePath", "callXPathSelectionListener", this, new String[] @@ -89,16 +89,16 @@ public class PathSelection PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Boolean(Enabled), new Integer(12), TxtHelpURL, new Integer(XPos), new Integer(YPos + 10), new Integer(DialogStep), new Short((short) (CurTabIndex + 1)), new Integer(Width - 26) + Boolean.valueOf(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[] { PropertyNames.PROPERTY_ENABLED, 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[] { - new Boolean(Enabled), new Integer(14), BtnHelpURL, "...", new Integer(XPos + Width - 16), new Integer(YPos + 9), new Integer(DialogStep), new Short((short) (CurTabIndex + 2)), new Integer(16) + Boolean.valueOf(Enabled), 14, BtnHelpURL, "...", new Integer(XPos + Width - 16), new Integer(YPos + 9), new Integer(DialogStep), new Short((short) (CurTabIndex + 2)), 16 }); } diff --git a/wizards/com/sun/star/wizards/ui/PeerConfig.java b/wizards/com/sun/star/wizards/ui/PeerConfig.java index 19617b593bd6..1fed4a961f7a 100644 --- a/wizards/com/sun/star/wizards/ui/PeerConfig.java +++ b/wizards/com/sun/star/wizards/ui/PeerConfig.java @@ -115,7 +115,7 @@ public class PeerConfig implements XWindowListener for (int i = 0; i < this.m_aPeerTasks.size(); i++) { PeerTask aPeerTask = (PeerTask) m_aPeerTasks.elementAt(i); - XVclWindowPeer xVclWindowPeer = (XVclWindowPeer) UnoRuntime.queryInterface(XVclWindowPeer.class, aPeerTask.xControl.getPeer()); + XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(XVclWindowPeer.class, aPeerTask.xControl.getPeer()); for (int n = 0; n < aPeerTask.propnames.length; n++) { xVclWindowPeer.setProperty(aPeerTask.propnames[n], aPeerTask.propvalues[n]); @@ -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); } @@ -167,7 +167,7 @@ public class PeerConfig implements XWindowListener */ public void setAccessibleName(Object oAPIControl, String _saccessname) { - XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, oAPIControl); + XControl xControl = UnoRuntime.queryInterface(XControl.class, oAPIControl); setPeerProperties(xControl, new String[] { "AccessibleName" @@ -196,7 +196,7 @@ public class PeerConfig implements XWindowListener */ public void setPeerProperties(Object oAPIControl, String[] _propnames, Object[] _propvalues) { - XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, oAPIControl); + XControl xControl = UnoRuntime.queryInterface(XControl.class, oAPIControl); setPeerProperties(xControl, _propnames, _propvalues); } diff --git a/wizards/com/sun/star/wizards/ui/SortingComponent.java b/wizards/com/sun/star/wizards/ui/SortingComponent.java index 3b57ca3f670a..50ffa59a254c 100644 --- a/wizards/com/sun/star/wizards/ui/SortingComponent.java +++ b/wizards/com/sun/star/wizards/ui/SortingComponent.java @@ -61,10 +61,10 @@ public class SortingComponent public void itemStateChanged(ItemEvent EventObject) { - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(false)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); int ikey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); enableNextSortListBox(ikey); - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(true)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); } public void disposing(com.sun.star.lang.EventObject eventObject) @@ -97,21 +97,21 @@ public class SortingComponent for (int i = 0; i < 4; i++) { bDoEnable = (i < 2); - CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lblSort" + new Integer(i + 1).toString(), new String[] + CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lblSort" + Integer.toString(i + 1), 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), new Integer(8), sSortHeader[i], new Integer(0), ICompPosX, new Integer(iCurPosY), IStep, new Short(curtabindex++), ICompWidth + Boolean.valueOf(bDoEnable), 8, sSortHeader[i], 0, ICompPosX, new Integer(iCurPosY), IStep, new Short(curtabindex++), ICompWidth }); HIDString = HelpIds.getHelpIdString(FirstHelpIndex); - xSortListBox[i] = CurUnoDialog.insertListBox("lstSort" + new Integer(i + 1).toString(), SOSORTLST[i], null, new ItemListenerImpl(), new String[] + xSortListBox[i] = CurUnoDialog.insertListBox("lstSort" + Integer.toString(i + 1), SOSORTLST[i], null, new ItemListenerImpl(), new String[] { "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), new Integer(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), new Integer(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), new Integer(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; @@ -165,10 +165,7 @@ public class SortingComponent int FieldCount = _FieldNames.length; String[] ViewFieldNames = new String[FieldCount + 1]; ViewFieldNames[0] = sNoSorting; - for (int i = 0; i < FieldCount; i++) - { - ViewFieldNames[i + 1] = _FieldNames[i]; - } + System.arraycopy(_FieldNames, 0, ViewFieldNames, 1, FieldCount); short[] SelList = null; for (int i = 0; i < 4; i++) { @@ -186,8 +183,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" + Integer.toString(i + 1), PropertyNames.STRING_ITEM_LIST, ViewFieldNames); + CurUnoDialog.setControlProperty("lstSort" + Integer.toString(i + 1), PropertyNames.SELECTED_ITEMS, SelList); toggleSortListBox(i, (i <= _SortFieldNames.length)); } } @@ -211,7 +208,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" + Integer.toString(_index + 1), PropertyNames.READ_ONLY, Boolean.valueOf(_breadonly)); } /** @@ -261,12 +258,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" }); + iCurState = ((Short) CurUnoDialog.getControlProperty("optAscend" + Integer.toString(i + 1), PropertyNames.PROPERTY_STATE)).shortValue(); + 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 @@ -276,7 +273,7 @@ public class SortingComponent { String sLocSortCriteriaisduplicate = JavaTools.replaceSubString(sSortCriteriaisduplicate, SortFieldNames.get(iduplicate)[0], "<FIELDNAME>"); CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, sLocSortCriteriaisduplicate); - CurUnoDialog.vetoableChange(new PropertyChangeEvent(CurUnoDialog, "Steps", new Integer(1), new Integer(2))); + CurUnoDialog.vetoableChange(new PropertyChangeEvent(CurUnoDialog, "Steps", 1, 2)); CurUnoDialog.setFocus("lstSort" + (iduplicate + 1)); return new String[][] { @@ -303,7 +300,7 @@ public class SortingComponent toggleSortListBox(i, (false)); if (i < MaxSortIndex) { - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + Integer.toString(i + 2), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); @@ -319,22 +316,22 @@ public class SortingComponent private void moveupSortItems(int CurIndex, boolean bDoEnable) { short iNextItemPos; - if ((bDoEnable == false) && (MAXSORTCRITERIAINDEX > CurIndex)) + if ((!bDoEnable) && (MAXSORTCRITERIAINDEX > CurIndex)) { for (int i = CurIndex; i < MAXSORTCRITERIAINDEX; i++) { iNextItemPos = xSortListBox[i + 1].getSelectedItemPos(); if (iNextItemPos != 0) { - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 1).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + Integer.toString(i + 1), PropertyNames.SELECTED_ITEMS, new short[] { iNextItemPos }); - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + Integer.toString(i + 2), PropertyNames.SELECTED_ITEMS, new short[] { }); toggleSortListBox(i, true); - CurUnoDialog.setControlProperty("lstSort" + new Integer(i + 2).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + Integer.toString(i + 2), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); @@ -357,13 +354,13 @@ public class SortingComponent { if (CurIndex < xSortListBox.length) { - CurUnoDialog.setControlProperty("lblSort" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - CurUnoDialog.setControlProperty("optAscend" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - CurUnoDialog.setControlProperty("optDescend" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable)); - if (bDoEnable == false) + CurUnoDialog.setControlProperty("lblSort" + Integer.toString(CurIndex + 1), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + CurUnoDialog.setControlProperty("lstSort" + Integer.toString(CurIndex + 1), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + CurUnoDialog.setControlProperty("optAscend" + Integer.toString(CurIndex + 1), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + CurUnoDialog.setControlProperty("optDescend" + Integer.toString(CurIndex + 1), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bDoEnable)); + if (!bDoEnable) { - CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), "SelectedItems", new short[] + CurUnoDialog.setControlProperty("lstSort" + Integer.toString(CurIndex + 1), PropertyNames.SELECTED_ITEMS, new short[] { 0 }); diff --git a/wizards/com/sun/star/wizards/ui/TitlesComponent.java b/wizards/com/sun/star/wizards/ui/TitlesComponent.java index ef9a568d2e01..4858c22a221d 100644 --- a/wizards/com/sun/star/wizards/ui/TitlesComponent.java +++ b/wizards/com/sun/star/wizards/ui/TitlesComponent.java @@ -55,14 +55,14 @@ public class TitlesComponent extends ControlScroller PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(8), _slblColumnNames, new Integer(iLabelPosX), new Integer(iCompPosY - 10), IStep, new Integer(60) + 8, _slblColumnNames, new Integer(iLabelPosX), new Integer(iCompPosY - 10), IStep, 60 }); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblColumnTitles", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(8), _slblColumnTitles, new Integer(90), new Integer(iCompPosY - 10), IStep, new Integer(152) + 8, _slblColumnTitles, 90, new Integer(iCompPosY - 10), IStep, 152 }); } @@ -111,7 +111,7 @@ public class TitlesComponent extends ControlScroller }, new Object[] { - new Integer(16), new Boolean(true), new Integer(iLabelPosX), new Integer(_iCompPosY + 1), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(30) + 16, Boolean.TRUE, new Integer(iLabelPosX), new Integer(_iCompPosY + 1), UIConsts.INVISIBLESTEP, new Short(curtabindex++), 30 }); xTextComponent = CurUnoDialog.insertTextField(stextfieldname, 0, null, @@ -121,7 +121,7 @@ public class TitlesComponent extends ControlScroller }, new Object[] { - new Integer(12), HelpIds.getHelpIdString(curHelpIndex++), new Integer(iLabelPosX + 30), new Integer(_iCompPosY), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(iCompWidth - 90 - 20) + 12, HelpIds.getHelpIdString(curHelpIndex++), new Integer(iLabelPosX + 30), new Integer(_iCompPosY), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(iCompWidth - 90 - 20) }); } } diff --git a/wizards/com/sun/star/wizards/ui/UIConsts.java b/wizards/com/sun/star/wizards/ui/UIConsts.java index 3115413035b6..9b1c547dbd9e 100644 --- a/wizards/com/sun/star/wizards/ui/UIConsts.java +++ b/wizards/com/sun/star/wizards/ui/UIConsts.java @@ -19,7 +19,7 @@ public interface UIConsts public static final int RID_IMG_REPORT = 1000; public static final int RID_IMG_FORM = 1100; public static final int RID_IMG_WEB = 1200; - public static final Integer INVISIBLESTEP = new Integer(99); + public static final Integer INVISIBLESTEP = 99; public static final String INFOIMAGEURL = "private:resource/dbu/image/19205"; public static final String INFOIMAGEURL_HC = "private:resource/dbu/image/19230"; /** @@ -27,12 +27,12 @@ public interface UIConsts * high tabindex because on every step their taborder must appear at the end */ public static final short SOFIRSTWIZARDNAVITABINDEX = 30000; - public static final Integer INTEGER_8 = new Integer(8); - public static final Integer INTEGER_12 = new Integer(12); - public static final Integer INTEGER_14 = new Integer(14); - public static final Integer INTEGER_16 = new Integer(16); - public static final Integer INTEGER_40 = new Integer(40); - public static final Integer INTEGER_50 = new Integer(50); + public static final Integer INTEGER_8 = 8; + public static final Integer INTEGER_12 = 12; + public static final Integer INTEGER_14 = 14; + public static final Integer INTEGER_16 = 16; + public static final Integer INTEGER_40 = 40; + public static final Integer INTEGER_50 = 50; /**Steps of the QueryWizard * */ @@ -46,7 +46,7 @@ public interface UIConsts public static final int SOSUMMARYPAGE = 8; public static final Integer[] INTEGERS = new Integer[] { - new Integer(0), new Integer(1), new Integer(2), new Integer(3), new Integer(4), new Integer(5), new Integer(6), new Integer(7), new Integer(8), new Integer(9), new Integer(10) + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; class CONTROLTYPE diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.java b/wizards/com/sun/star/wizards/ui/UnoDialog.java index e372a843a56a..7149503dfd6d 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.java @@ -82,19 +82,19 @@ public class UnoDialog implements EventNames this.xMSF = xMSF; ControlList = new Hashtable(); xDialogModel = (XInterface) xMSF.createInstance("com.sun.star.awt.UnoControlDialogModel"); - XMultiPropertySet xMultiPSetDlg = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, xDialogModel); + XMultiPropertySet xMultiPSetDlg = UnoRuntime.queryInterface(XMultiPropertySet.class, xDialogModel); xMultiPSetDlg.setPropertyValues(PropertyNames, PropertyValues); - MSFDialogModel = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel); + MSFDialogModel = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel); xUnoDialog = (XInterface) xMSF.createInstance("com.sun.star.awt.UnoControlDialog"); - xControl = (XControl) UnoRuntime.queryInterface(XControl.class, xUnoDialog); - XControlModel xControlModel = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, xDialogModel); + xControl = UnoRuntime.queryInterface(XControl.class, xUnoDialog); + XControlModel xControlModel = UnoRuntime.queryInterface(XControlModel.class, xDialogModel); xControl.setModel(xControlModel); - xPSetDlg = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDialogModel); - xDlgContainer = (XControlContainer) UnoRuntime.queryInterface(XControlContainer.class, xUnoDialog); - xDlgNames = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, xDialogModel); + xPSetDlg = UnoRuntime.queryInterface(XPropertySet.class, xDialogModel); + xDlgContainer = UnoRuntime.queryInterface(XControlContainer.class, xUnoDialog); + xDlgNames = UnoRuntime.queryInterface(XNameContainer.class, xDialogModel); // xDlgNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xDialogModel); - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xUnoDialog); - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xUnoDialog); + xComponent = UnoRuntime.queryInterface(XComponent.class, xUnoDialog); + xWindow = UnoRuntime.queryInterface(XWindow.class, xUnoDialog); // setPeerConfiguration(); // LLA: will be done, if really used! } @@ -107,9 +107,9 @@ public class UnoDialog implements EventNames public int getControlKey(Object EventObject, Hashtable ControlList) { int iKey; - XControl xContrl = (XControl) UnoRuntime.queryInterface(XControl.class, EventObject); + XControl xContrl = UnoRuntime.queryInterface(XControl.class, EventObject); XControlModel xControlModel = xContrl.getModel(); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xControlModel); try { String sName = (String) xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME); @@ -142,7 +142,7 @@ public class UnoDialog implements EventNames { if (m_xDlgNameAccess == null) { - m_xDlgNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xDialogModel); + m_xDlgNameAccess = UnoRuntime.queryInterface(XNameAccess.class, xDialogModel); } return m_xDlgNameAccess; } @@ -152,12 +152,12 @@ public class UnoDialog implements EventNames { if (PropertyValue != null) { - if (getDlgNameAccess().hasByName(ControlName) == false) + if (!getDlgNameAccess().hasByName(ControlName)) { return; } Object xControlModel = getDlgNameAccess().getByName(ControlName); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xControlModel); if (AnyConverter.isArray(PropertyValue)) { com.sun.star.uno.Type seqType = new com.sun.star.uno.Type(PropertyValue.getClass()); @@ -187,12 +187,12 @@ public class UnoDialog implements EventNames { if (PropertyValues != null) { - if (getDlgNameAccess().hasByName(ControlName) == false) + if (!getDlgNameAccess().hasByName(ControlName)) { return; } Object xControlModel = getDlgNameAccess().getByName(ControlName); - XMultiPropertySet xMultiPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, xControlModel); + XMultiPropertySet xMultiPSet = UnoRuntime.queryInterface(XMultiPropertySet.class, xControlModel); xMultiPSet.setPropertyValues(PropertyNames, PropertyValues); } } @@ -207,12 +207,8 @@ public class UnoDialog implements EventNames try { Object xControlModel = getDlgNameAccess().getByName(ControlName); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel); - Object oPropValue = xPSet.getPropertyValue(PropertyName); - // if (AnyConverter.isArray(oPropValue)) - // return Helper.getArrayValue(oPropValue); - // else - return oPropValue; + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xControlModel); + return xPSet.getPropertyValue(PropertyName); } catch (com.sun.star.uno.Exception exception) { // com.sun.star.container.NoSuchElementException, com.sun.star.beans.UnknownPropertyException, @@ -226,7 +222,7 @@ public class UnoDialog implements EventNames try { Object xControlModel = getDlgNameAccess().getByName(ControlName); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xControlModel); Property[] allProps = xPSet.getPropertySetInfo().getProperties(); for (int i = 0; i < allProps.length; i++) { @@ -243,20 +239,19 @@ public class UnoDialog implements EventNames public double getMAPConversionFactor(String ControlName) { XControl xControl2 = xDlgContainer.getControl(ControlName); - XView xView = (XView) UnoRuntime.queryInterface(XView.class, xControl2); + XView xView = UnoRuntime.queryInterface(XView.class, xControl2); Size aSize = xView.getSize(); double dblMAPWidth = (double) (((Integer) Helper.getUnoPropertyValue(xControl2.getModel(), PropertyNames.PROPERTY_WIDTH)).intValue()); - double dblFactor = (((double) (aSize.Width)) / dblMAPWidth); - return dblFactor; + return (((double) (aSize.Width)) / dblMAPWidth); } public Size getpreferredLabelSize(String LabelName, String sLabel) { XControl xControl2 = xDlgContainer.getControl(LabelName); - XFixedText xFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, xControl2); + XFixedText xFixedText = UnoRuntime.queryInterface(XFixedText.class, xControl2); String OldText = xFixedText.getText(); xFixedText.setText(sLabel); - XLayoutConstrains xLayoutConstrains = (XLayoutConstrains) UnoRuntime.queryInterface(XLayoutConstrains.class, xControl2); + XLayoutConstrains xLayoutConstrains = UnoRuntime.queryInterface(XLayoutConstrains.class, xControl2); Size aSize = xLayoutConstrains.getPreferredSize(); xFixedText.setText(OldText); return aSize; @@ -277,19 +272,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; } @@ -307,10 +302,10 @@ public class UnoDialog implements EventNames try { Object oFixedText = insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", sName, sPropNames, oPropValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFixedText); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oFixedText); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - Object oLabel = xDlgContainer.getControl(new String(sName)); - return (XFixedText) UnoRuntime.queryInterface(XFixedText.class, oLabel); + Object oLabel = xDlgContainer.getControl(sName); + return UnoRuntime.queryInterface(XFixedText.class, oLabel); } catch (java.lang.Exception ex) { @@ -334,10 +329,10 @@ public class UnoDialog implements EventNames public XButton insertButton(String sName, int iControlKey, XActionListener xActionListener, String[] sProperties, Object[] sValues) throws com.sun.star.uno.Exception { Object oButtonModel = insertControlModel("com.sun.star.awt.UnoControlButtonModel", sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oButtonModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oButtonModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - Object objectButton = xDlgContainer.getControl(new String(sName)); - XButton xButton = (XButton) UnoRuntime.queryInterface(XButton.class, objectButton); + Object objectButton = xDlgContainer.getControl(sName); + XButton xButton = UnoRuntime.queryInterface(XButton.class, objectButton); if (xActionListener != null) { xButton.addActionListener(xActionListener); @@ -353,10 +348,10 @@ public class UnoDialog implements EventNames public void insertCheckBox(String sName, int iControlKey, XItemListener xItemListener, String[] sProperties, Object[] sValues) throws com.sun.star.uno.Exception { Object oButtonModel = insertControlModel("com.sun.star.awt.UnoControlCheckBoxModel", sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oButtonModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oButtonModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - Object objectCheckBox = xDlgContainer.getControl(new String(sName)); - XCheckBox xCheckBox = (XCheckBox) UnoRuntime.queryInterface(XCheckBox.class, objectCheckBox); + Object objectCheckBox = xDlgContainer.getControl(sName); + XCheckBox xCheckBox = UnoRuntime.queryInterface(XCheckBox.class, objectCheckBox); if (xItemListener != null) { xCheckBox.addItemListener(xItemListener); @@ -371,10 +366,10 @@ public class UnoDialog implements EventNames public void insertNumericField(String sName, int iControlKey, XTextListener xTextListener, String[] sProperties, Object[] sValues) throws com.sun.star.uno.Exception { Object oNumericFieldModel = insertControlModel("com.sun.star.awt.UnoControlNumericFieldModel", sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oNumericFieldModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oNumericFieldModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - Object objectNumericField = xDlgContainer.getControl(new String(sName)); - XTextComponent xNumericField = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, objectNumericField); + Object objectNumericField = xDlgContainer.getControl(sName); + XTextComponent xNumericField = UnoRuntime.queryInterface(XTextComponent.class, objectNumericField); if (xTextListener != null) { xNumericField.addTextListener(xTextListener); @@ -391,10 +386,10 @@ public class UnoDialog implements EventNames try { Object oScrollModel = insertControlModel("com.sun.star.awt.UnoControlScrollBarModel", sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oScrollModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oScrollModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - Object oScrollBar = xDlgContainer.getControl(new String(sName)); - XScrollBar xScrollBar = (XScrollBar) UnoRuntime.queryInterface(XScrollBar.class, oScrollBar); + Object oScrollBar = xDlgContainer.getControl(sName); + XScrollBar xScrollBar = UnoRuntime.queryInterface(XScrollBar.class, oScrollBar); if (xAdjustmentListener != null) { xScrollBar.addAdjustmentListener(xAdjustmentListener); @@ -415,14 +410,12 @@ public class UnoDialog implements EventNames public XTextComponent insertTextField(String sName, int iControlKey, XTextListener xTextListener, String[] sProperties, Object[] sValues) { - XTextComponent xTextBox = insertEditField("com.sun.star.awt.UnoControlEditModel", sName, iControlKey, xTextListener, sProperties, sValues); - return xTextBox; + return insertEditField("com.sun.star.awt.UnoControlEditModel", sName, iControlKey, xTextListener, sProperties, sValues); } public XTextComponent insertFormattedField(String sName, int iControlKey, XTextListener xTextListener, String[] sProperties, Object[] sValues) { - XTextComponent xTextBox = insertEditField("com.sun.star.awt.UnoControlFormattedFieldModel", sName, iControlKey, xTextListener, sProperties, sValues); - return xTextBox; + return insertEditField("com.sun.star.awt.UnoControlFormattedFieldModel", sName, iControlKey, xTextListener, sProperties, sValues); } public XTextComponent insertEditField(String ServiceName, String sName, int iControlKey, XTextListener xTextListener, String[] sProperties, Object[] sValues) @@ -430,10 +423,10 @@ public class UnoDialog implements EventNames try { XInterface xTextModel = insertControlModel(ServiceName, sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xTextModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - XControl xTextField = xDlgContainer.getControl(new String(sName)); - XTextComponent xTextBox = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xTextField); + XControl xTextField = xDlgContainer.getControl(sName); + XTextComponent xTextBox = UnoRuntime.queryInterface(XTextComponent.class, xTextField); if (xTextListener != null) { xTextBox.addTextListener(xTextListener); @@ -452,10 +445,10 @@ public class UnoDialog implements EventNames public XListBox insertListBox(String sName, int iControlKey, XActionListener xActionListener, XItemListener xItemListener, String[] sProperties, Object[] sValues) throws com.sun.star.uno.Exception { XInterface xListBoxModel = insertControlModel("com.sun.star.awt.UnoControlListBoxModel", sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xListBoxModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xListBoxModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - XControl xControlListBox = xDlgContainer.getControl(new String(sName)); - XListBox xListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, xControlListBox); + XControl xControlListBox = xDlgContainer.getControl(sName); + XListBox xListBox = UnoRuntime.queryInterface(XListBox.class, xControlListBox); if (xItemListener != null) { xListBox.addItemListener(xItemListener); @@ -472,17 +465,17 @@ public class UnoDialog implements EventNames public XComboBox insertComboBox(String sName, int iControlKey, XActionListener xActionListener, XTextListener xTextListener, XItemListener xItemListener, String[] sProperties, Object[] sValues) throws com.sun.star.uno.Exception { XInterface xComboBoxModel = insertControlModel("com.sun.star.awt.UnoControlComboBoxModel", sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xComboBoxModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, xComboBoxModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - XControl xControlComboBox = xDlgContainer.getControl(new String(sName)); - XComboBox xComboBox = (XComboBox) UnoRuntime.queryInterface(XComboBox.class, xControlComboBox); + XControl xControlComboBox = xDlgContainer.getControl(sName); + XComboBox xComboBox = UnoRuntime.queryInterface(XComboBox.class, xControlComboBox); if (xItemListener != null) { xComboBox.addItemListener(xItemListener); } if (xTextListener != null) { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xComboBox); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, xComboBox); xTextComponent.addTextListener(xTextListener); } if (xActionListener != null) @@ -517,7 +510,7 @@ public class UnoDialog implements EventNames try { XRadioButton xRadioButton = insertRadioButton(sName, iControlKey, sProperties, sValues); - XButton xButton = (com.sun.star.awt.XButton) UnoRuntime.queryInterface(XButton.class, xRadioButton); + XButton xButton = UnoRuntime.queryInterface(XButton.class, xRadioButton); if (xActionListener != null) { xButton.addActionListener(xActionListener); @@ -544,11 +537,10 @@ public class UnoDialog implements EventNames try { XInterface oRadioButtonModel = insertControlModel("com.sun.star.awt.UnoControlRadioButtonModel", sName, sProperties, sValues); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRadioButtonModel); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oRadioButtonModel); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); - XControl xControlRadioButton = xDlgContainer.getControl(new String(sName)); - XRadioButton xRadioButton = (XRadioButton) UnoRuntime.queryInterface(XRadioButton.class, xControlRadioButton); - return xRadioButton; + XControl xControlRadioButton = xDlgContainer.getControl(sName); + return UnoRuntime.queryInterface(XRadioButton.class, xControlRadioButton); } catch (com.sun.star.uno.Exception exception) { @@ -619,7 +611,7 @@ public class UnoDialog implements EventNames try { int ncurstep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_STEP)); - Helper.setUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP, new Integer(99)); + Helper.setUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP, 99); Helper.setUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP, new Integer(ncurstep)); } catch (com.sun.star.uno.Exception exception) @@ -647,7 +639,7 @@ public class UnoDialog implements EventNames public void setFocus(String ControlName) { Object oFocusControl = xDlgContainer.getControl(ControlName); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, oFocusControl); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, oFocusControl); xWindow.setFocus(); } @@ -697,11 +689,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) @@ -735,10 +727,10 @@ public class UnoDialog implements EventNames { createWindowPeer(); } - xVclWindowPeer = (XVclWindowPeer) UnoRuntime.queryInterface(XVclWindowPeer.class, xWindowPeer); + xVclWindowPeer = UnoRuntime.queryInterface(XVclWindowPeer.class, xWindowPeer); // xVclWindowPeer.setProperty("AutoMnemonics", new Boolean(true)); - this.BisHighContrastModeActivated = new Boolean(this.isHighContrastModeActivated()); - xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, xUnoDialog); + this.BisHighContrastModeActivated = Boolean.valueOf(this.isHighContrastModeActivated()); + xDialog = UnoRuntime.queryInterface(XDialog.class, xUnoDialog); return xDialog.execute(); } @@ -749,8 +741,8 @@ public class UnoDialog implements EventNames { createWindowPeer(); } - XVclWindowPeer xVclWindowPeer = (XVclWindowPeer) UnoRuntime.queryInterface(XVclWindowPeer.class, xWindowPeer); - xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, xUnoDialog); + XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(XVclWindowPeer.class, xWindowPeer); + xDialog = UnoRuntime.queryInterface(XDialog.class, xUnoDialog); this.xWindow.setVisible(true); } @@ -774,7 +766,7 @@ public class UnoDialog implements EventNames */ public short executeDialog(XInterface xComponent) throws com.sun.star.uno.Exception { - XFrame frame = (XFrame) UnoRuntime.queryInterface(XFrame.class, xComponent); + XFrame frame = UnoRuntime.queryInterface(XFrame.class, xComponent); if (frame != null) { XWindow w = frame.getComponentWindow(); @@ -801,17 +793,17 @@ public class UnoDialog implements EventNames public void setAutoMnemonic(String ControlName, boolean bValue) { Object oControl = xDlgContainer.getControl(ControlName); - xControl = (XControl) UnoRuntime.queryInterface(XControl.class, oControl); + xControl = UnoRuntime.queryInterface(XControl.class, oControl); XWindowPeer xWindowPeer = xControl.getPeer(); - XVclWindowPeer xVclWindowPeer = (XVclWindowPeer) UnoRuntime.queryInterface(XVclWindowPeer.class, xControl.getPeer()); - xVclWindowPeer.setProperty("AutoMnemonics", new Boolean(bValue)); + XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(XVclWindowPeer.class, xControl.getPeer()); + xVclWindowPeer.setProperty("AutoMnemonics", Boolean.valueOf(bValue)); } public void modifyFontWeight(String ControlName, float FontWeight) { FontDescriptor oFontDesc = new FontDescriptor(); oFontDesc.Weight = FontWeight; - setControlProperty(ControlName, "FontDescriptor", oFontDesc); + setControlProperty(ControlName, PropertyNames.FONT_DESCRIPTOR, oFontDesc); } /** @@ -828,10 +820,10 @@ public class UnoDialog implements EventNames Object tk = xMSF.createInstance("com.sun.star.awt.Toolkit"); if (parentPeer == null) { - parentPeer = ((XToolkit) UnoRuntime.queryInterface(XToolkit.class, tk)).getDesktopWindow(); + parentPeer = UnoRuntime.queryInterface(XToolkit.class, tk).getDesktopWindow(); } - XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, tk); - xReschedule = (XReschedule) UnoRuntime.queryInterface(XReschedule.class, xToolkit); + XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, tk); + xReschedule = UnoRuntime.queryInterface(XReschedule.class, xToolkit); // TEUER! xControl.createPeer(xToolkit, parentPeer); xWindowPeer = xControl.getPeer(); @@ -855,7 +847,7 @@ public class UnoDialog implements EventNames public void deletefirstListboxEntry(String ListBoxName, String DelEntryName) { XControl xListControl = xDlgContainer.getControl(ListBoxName); - XListBox xListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, xListControl); + XListBox xListBox = UnoRuntime.queryInterface(XListBox.class, xListControl); String FirstItem = xListBox.getItem((short) 0); if (FirstItem.equals(DelEntryName)) { @@ -863,7 +855,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); } } @@ -872,17 +864,16 @@ public class UnoDialog implements EventNames public void setPeerProperty(String ControlName, String PropertyName, Object PropertyValue) { Object oControl = xDlgContainer.getControl(ControlName); - XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, oControl); + XControl xControl = UnoRuntime.queryInterface(XControl.class, oControl); XWindowPeer xControlPeer = xControl.getPeer(); - XVclWindowPeer xVclWindowPeer = (XVclWindowPeer) UnoRuntime.queryInterface(XVclWindowPeer.class, xControlPeer); + XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(XVclWindowPeer.class, xControlPeer); xVclWindowPeer.setProperty(PropertyName, PropertyValue); } public static Object getModel(Object control) { - XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, control); - XControlModel xModel = xControl.getModel(); - return xModel; + XControl xControl = UnoRuntime.queryInterface(XControl.class, control); + return xControl.getModel(); } public static void setEnabled(Object control, boolean enabled) @@ -902,7 +893,7 @@ public class UnoDialog implements EventNames */ public static int getControlModelType(Object oControlModel) { - XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oControlModel); + XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, oControlModel); if (xServiceInfo.supportsService("com.sun.star.awt.UnoControlFixedTextModel")) { return UIConsts.CONTROLTYPE.FIXEDTEXT; @@ -988,7 +979,7 @@ public class UnoDialog implements EventNames */ public static String getDisplayProperty(Object oControlModel) { - XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oControlModel); + XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, oControlModel); int itype = getControlModelType(oControlModel); return getDisplayProperty(itype); } @@ -1000,7 +991,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 +1027,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; } } @@ -1075,7 +1066,7 @@ public class UnoDialog implements EventNames int nBlue = getBlueColorShare(nUIColor); int nLuminance = ((nBlue * 28 + nGreen * 151 + nRed * 77) / 256); boolean bisactivated = (nLuminance <= 25); - BisHighContrastModeActivated = new Boolean(bisactivated); + BisHighContrastModeActivated = Boolean.valueOf(bisactivated); return bisactivated; } else @@ -1091,9 +1082,9 @@ public class UnoDialog implements EventNames public static int getRedColorShare(int _nColor) { - int nRed = (int) _nColor / 65536; + int nRed = _nColor / 65536; int nRedModulo = _nColor % 65536; - int nGreen = (int) (nRedModulo / 256); + int nGreen = nRedModulo / 256; int nGreenModulo = (nRedModulo % 256); int nBlue = nGreenModulo; return nRed; @@ -1101,17 +1092,17 @@ public class UnoDialog implements EventNames public static int getGreenColorShare(int _nColor) { - int nRed = (int) _nColor / 65536; + int nRed = _nColor / 65536; int nRedModulo = _nColor % 65536; - int nGreen = (int) (nRedModulo / 256); + int nGreen = nRedModulo / 256; return nGreen; } public static int getBlueColorShare(int _nColor) { - int nRed = (int) _nColor / 65536; + int nRed = _nColor / 65536; int nRedModulo = _nColor % 65536; - int nGreen = (int) (nRedModulo / 256); + int nGreen = nRedModulo / 256; int nGreenModulo = (nRedModulo % 256); int nBlue = nGreenModulo; return nBlue; diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.java b/wizards/com/sun/star/wizards/ui/UnoDialog2.java index 0769e1d23b38..a938b16213f5 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog2.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.java @@ -134,7 +134,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames } if (textChanged != null) { - XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xComboBox); + XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, xComboBox); xTextComponent.addTextListener((XTextListener) guiEventListener); guiEventListener.add(sName, EVENT_TEXT_CHANGED, textChanged, eventTarget); } @@ -186,7 +186,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames public XControl insertTitledBox(String sName, String[] sPropNames, Object[] oPropValues) { Object oTitledBox = insertControlModel2("com.sun.star.awt.UnoControlGroupBoxModel", sName, sPropNames, oPropValues); - return (XControl) UnoRuntime.queryInterface(XControl.class, oTitledBox); + return UnoRuntime.queryInterface(XControl.class, oTitledBox); } public XTextComponent insertTextField(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) @@ -209,11 +209,11 @@ public class UnoDialog2 extends UnoDialog implements EventNames XControl xImgControl = insertImage(Desktop.getUniqueName(getDlgNameAccess(), "imgHint"), new String[] { - "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Short((short) 0), new Integer(10), UIConsts.INFOIMAGEURL, new Integer(_posx), new Integer(_posy), Boolean.FALSE, new Integer(_iStep), new Integer(10) + new Short((short) 0), 10, UIConsts.INFOIMAGEURL, new Integer(_posx), new Integer(_posy), Boolean.FALSE, new Integer(_iStep), 10 }); super.getPeerConfiguration().setImageUrl(getModel(xImgControl), UIConsts.INFOIMAGEURL, UIConsts.INFOIMAGEURL_HC); return xImgControl; @@ -307,25 +307,25 @@ public class UnoDialog2 extends UnoDialog implements EventNames public XControl insertFixedLine(String sName, String[] sPropNames, Object[] oPropValues) { Object oLine = insertControlModel2("com.sun.star.awt.UnoControlFixedLineModel", sName, sPropNames, oPropValues); - return (XControl) UnoRuntime.queryInterface(XControl.class, oLine); + return UnoRuntime.queryInterface(XControl.class, oLine); } public XScrollBar insertScrollBar(String sName, String[] sPropNames, Object[] oPropValues) { Object oScrollBar = insertControlModel2("com.sun.star.awt.UnoControlScrollBarModel", sName, sPropNames, oPropValues); - return (XScrollBar) UnoRuntime.queryInterface(XScrollBar.class, oScrollBar); + return UnoRuntime.queryInterface(XScrollBar.class, oScrollBar); } public XProgressBar insertProgressBar(String sName, String[] sPropNames, Object[] oPropValues) { Object oProgressBar = insertControlModel2("com.sun.star.awt.UnoControlProgressBarModel", sName, sPropNames, oPropValues); - return (XProgressBar) UnoRuntime.queryInterface(XProgressBar.class, oProgressBar); + return UnoRuntime.queryInterface(XProgressBar.class, oProgressBar); } public XControl insertGroupBox(String sName, String[] sPropNames, Object[] oPropValues) { Object oGroupBox = insertControlModel2("com.sun.star.awt.UnoControlGroupBoxModel", sName, sPropNames, oPropValues); - return (XControl) UnoRuntime.queryInterface(XControl.class, oGroupBox); + return UnoRuntime.queryInterface(XControl.class, oGroupBox); } public Object insertControlModel2(String serviceName, String componentName, String[] sPropNames, Object[] oPropValues) @@ -347,8 +347,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames { ex.printStackTrace(); } - final Object aObj = xDlgContainer.getControl(componentName); - return aObj; + return xDlgContainer.getControl(componentName); } private void setControlPropertiesDebug(Object model, String[] names, Object[] values) @@ -369,13 +368,12 @@ public class UnoDialog2 extends UnoDialog implements EventNames public String translateURL(String relativeURL) { - return ""; + return PropertyNames.EMPTY_STRING; } public static Object getControlModel(Object unoControl) { - Object obj = ((XControl) UnoRuntime.queryInterface(XControl.class, unoControl)).getModel(); - return obj; + return UnoRuntime.queryInterface(XControl.class, unoControl).getModel(); } public int showMessageBox(String windowServiceName, int windowAttribute, String MessageText) diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java index c03ceb2dc257..5273994741c6 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.java +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java @@ -109,7 +109,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL { try { - XTopWindow top = (XTopWindow) UnoRuntime.queryInterface(XTopWindow.class, xWindow); + XTopWindow top = UnoRuntime.queryInterface(XTopWindow.class, xWindow); if (top != null) { top.toFront(); @@ -178,12 +178,12 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL public void setRoadmapInteractive(boolean _bInteractive) { - Helper.setUnoPropertyValue(oRoadmap, "Activated", new Boolean(_bInteractive)); + Helper.setUnoPropertyValue(oRoadmap, "Activated", Boolean.valueOf(_bInteractive)); } public void setRoadmapComplete(boolean bComplete) { - Helper.setUnoPropertyValue(oRoadmap, "Complete", new Boolean(bComplete)); + Helper.setUnoPropertyValue(oRoadmap, "Complete", Boolean.valueOf(bComplete)); } public boolean isRoadmapComplete() @@ -247,25 +247,25 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL new Object[] { new Integer(iDialogHeight - 26), - new Integer(0), - new Integer(0), - new Integer(0), + 0, + 0, + 0, new Short((short)0), Boolean.TRUE, - new Integer(85) + 85 }); - XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRoadmap); + XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, oRoadmap); xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, "rdmNavi"); - xSSFRoadmap = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, oRoadmap); - xIndexContRoadmap = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, oRoadmap); + xSSFRoadmap = UnoRuntime.queryInterface(XSingleServiceFactory.class, oRoadmap); + xIndexContRoadmap = UnoRuntime.queryInterface(XIndexContainer.class, oRoadmap); // XPropertySet xPropRoadmapModel = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRoadmap); // xPropRoadmapModel.addPropertyChangeListener("CurrentItemID", new WizardDialog.RoadmapItemListener(this.xDialogModel)); MethodInvocation mi = new MethodInvocation("itemStateChanged", this, com.sun.star.awt.ItemEvent.class); getGuiEventListener().add("rdmNavi", EventNames.EVENT_ITEM_CHANGED, mi); xRoadmapControl = this.xDlgContainer.getControl("rdmNavi"); - xRoadmapBroadcaster = (XItemEventBroadcaster) UnoRuntime.queryInterface(XItemEventBroadcaster.class, xRoadmapControl); + xRoadmapBroadcaster = UnoRuntime.queryInterface(XItemEventBroadcaster.class, xRoadmapControl); xRoadmapBroadcaster.addItemListener((XItemListener) getGuiEventListener()); // xRoadmapControl = this.xDlgContainer.getControl("rdmNavi"); @@ -310,11 +310,10 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL { Object oRoadmapItem = xSSFRoadmap.createInstance(); Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_LABEL, _sLabel); - Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnabled)); + Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bEnabled)); Helper.setUnoPropertyValue(oRoadmapItem, "ID", new Integer(_CurItemID)); xIndexContRoadmap.insertByIndex(Index, oRoadmapItem); - int NextIndex = Index + 1; - return NextIndex; + return Index + 1; } catch (com.sun.star.uno.Exception exception) { @@ -454,7 +453,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL Integer IButtonWidth = new Integer(iButtonWidth); int iButtonHeight = 14; Integer IButtonHeight = new Integer(iButtonHeight); - Integer ICurStep = new Integer(0); + Integer ICurStep = 0; int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_HEIGHT)).intValue(); int iDialogWidth = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_WIDTH)).intValue(); int iHelpPosX = 8; @@ -467,21 +466,21 @@ 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[] { - new Integer(1), new Integer(0), new Integer(0), new Integer(iDialogHeight - 26), ICurStep, new Integer(iDialogWidth) + 1, 0, 0, new Integer(iDialogHeight - 26), ICurStep, new Integer(iDialogWidth) }); 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[] { - new Integer(iBtnPosY - 6), new Integer(1), new Integer(85), new Integer(0), ICurStep, new Integer(1) + new Integer(iBtnPosY - 6), 1, 85, 0, ICurStep, 1 }); String[] propNames = new String[] @@ -496,30 +495,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); @@ -588,7 +587,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL XInterface xRoadmapItem = getRoadmapItemByID(_nStep); if (xRoadmapItem != null) { - Helper.setUnoPropertyValue(xRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled)); + Helper.setUnoPropertyValue(xRoadmapItem, PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bEnabled)); } } @@ -747,11 +746,11 @@ 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[] { - oFontDesc, new Integer(16), sRightPaneHeaders[i], Boolean.TRUE, new Integer(91), new Integer(8), new Integer(i + 1), new Short((short) 12), new Integer(212) + oFontDesc, 16, sRightPaneHeaders[i], Boolean.TRUE, 91, 8, new Integer(i + 1), new Short((short) 12), 212 }); } } diff --git a/wizards/com/sun/star/wizards/ui/event/AbstractListener.java b/wizards/com/sun/star/wizards/ui/event/AbstractListener.java index bbe9cee2eb86..464282a56f7d 100644 --- a/wizards/com/sun/star/wizards/ui/event/AbstractListener.java +++ b/wizards/com/sun/star/wizards/ui/event/AbstractListener.java @@ -128,7 +128,7 @@ public class AbstractListener */ public static String getEventSourceName(EventObject eventObject) { - XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, eventObject.Source); + XControl xControl = UnoRuntime.queryInterface(XControl.class, eventObject.Source); return (String) Helper.getUnoPropertyValue(xControl.getModel(), PropertyNames.PROPERTY_NAME, String.class); } } diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.java b/wizards/com/sun/star/wizards/ui/event/DataAware.java index 62eaaf657447..7da0981104ba 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/DataAware.java @@ -320,11 +320,11 @@ 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)) - return new Integer(0); + return 0; if (getMethod.getReturnType().equals(short[].class)) return new short[0]; } @@ -347,7 +347,7 @@ public abstract class DataAware { */ public void set(Object value, Object target) { try { - setMethod.invoke(target, new Object[] {value}); + setMethod.invoke(target, value); } catch (IllegalAccessException ex1) { ex1.printStackTrace(); } catch (InvocationTargetException ex2) { diff --git a/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java b/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java index 119b2b6e1e51..7d0d4194f892 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)) { @@ -388,7 +388,7 @@ public class DataAwareFields } if (field.getType().equals(Integer.class)) { - return new Integer(0); + return 0; } if (field.getType().equals(short[].class)) { @@ -460,7 +460,7 @@ public class DataAwareFields } else if (value instanceof String) { - return ((String) value).equals(TRUE); + return value.equals(TRUE); } else if (value instanceof short[]) { diff --git a/wizards/com/sun/star/wizards/ui/event/ListModelBinder.java b/wizards/com/sun/star/wizards/ui/event/ListModelBinder.java index b2dc75f22f48..73980b9afdd1 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 { @@ -63,7 +64,7 @@ public class ListModelBinder implements ListDataListener public ListModelBinder(Object unoListBox, ListModel listModel_) { - unoList = (XListBox) UnoRuntime.queryInterface(XListBox.class, unoListBox); + unoList = UnoRuntime.queryInterface(XListBox.class, unoListBox); unoListModel = UnoDataAware.getModel(unoListBox); setListModel(listModel_); } @@ -99,7 +100,7 @@ public class ListModelBinder implements ListDataListener protected void remove(short i1, short i2) { - unoList.removeItems((short) i1, (short) (i2 - i1 + 1)); + unoList.removeItems(i1, (short) (i2 - i1 + 1)); } protected void insert(short i) @@ -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) @@ -179,8 +180,8 @@ 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[] + XListBox xlist = UnoRuntime.queryInterface(XListBox.class, list); + Helper.setUnoPropertyValue(UnoDataAware.getModel(list), PropertyNames.STRING_ITEM_LIST, new String[] { }); for (short i = 0; i < items.length; i++) @@ -194,8 +195,8 @@ 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[] + XComboBox xComboBox = UnoRuntime.queryInterface(XComboBox.class, list); + 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..2f86de798bfd 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. @@ -87,10 +86,8 @@ public class MethodInvocation { if (mWithParam) { - return mMethod.invoke(mObject, new Object[] - { - (Object) param - }); + return mMethod.invoke(mObject, (Object) param + ); } else { diff --git a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.java b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.java index 7dddea572503..ed8bf03642a4 100644 --- a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.java @@ -47,7 +47,7 @@ public class RadioDataAware extends DataAware radioButtons = new XRadioButton[radioButs.length]; for (int i = 0; i < radioButs.length; i++) { - radioButtons[i] = (XRadioButton) UnoRuntime.queryInterface(XRadioButton.class, radioButs[i]); + radioButtons[i] = UnoRuntime.queryInterface(XRadioButton.class, radioButs[i]); } } @@ -89,7 +89,7 @@ public class RadioDataAware extends DataAware { final RadioDataAware da = new RadioDataAware(data, field - ? DataAwareFields.getFieldValueFor(data, dataProp, new Integer(0)) + ? DataAwareFields.getFieldValueFor(data, dataProp, 0) : new DataAware.PropertyValue(dataProp, data), buttons); XItemListener xil = UnoDataAware.itemListener(da, listener); for (int i = 0; i < da.radioButtons.length; i++) 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 b8024fb4f9c9..f97ae8f24577 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; } @@ -152,7 +152,7 @@ public class UnoDataAware extends DataAware private static UnoDataAware attachTextControl(Object data, String prop, Object unoText, final Listener listener, String unoProperty, boolean field, Object value) { - XTextComponent text = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, unoText); + XTextComponent text = UnoRuntime.queryInterface(XTextComponent.class, unoText); final UnoDataAware uda = new UnoDataAware(data, field ? DataAwareFields.getFieldValueFor(data, prop, value) @@ -179,17 +179,17 @@ 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) { - return attachTextControl(data, prop, unoControl, listener, "Date", field, new Integer(0)); + return attachTextControl(data, prop, unoControl, listener, "Date", field, 0); } public static UnoDataAware attachTimeControl(Object data, String prop, Object unoControl, Listener listener, boolean field) { - return attachTextControl(data, prop, unoControl, listener, "Time", field, new Integer(0)); + return attachTextControl(data, prop, unoControl, listener, "Time", field, 0); } public static UnoDataAware attachNumericControl(Object data, String prop, Object unoControl, Listener listener, boolean field) @@ -199,7 +199,7 @@ public class UnoDataAware extends DataAware public static UnoDataAware attachCheckBox(Object data, String prop, Object checkBox, final Listener listener, boolean field) { - XCheckBox xcheckBox = ((XCheckBox) UnoRuntime.queryInterface(XCheckBox.class, checkBox)); + XCheckBox xcheckBox = UnoRuntime.queryInterface(XCheckBox.class, checkBox); final UnoDataAware uda = new UnoDataAware(data, field ? DataAwareFields.getFieldValueFor(data, prop, new Short((short) 0)) @@ -232,26 +232,26 @@ 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); } public static UnoDataAware attachListBox(Object data, String prop, Object listBox, final Listener listener, boolean field) { - XListBox xListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, listBox); + XListBox xListBox = UnoRuntime.queryInterface(XListBox.class, listBox); final UnoDataAware uda = new UnoDataAware(data, 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; } public static Object getModel(Object control) { - return ((XControl) UnoRuntime.queryInterface(XControl.class, control)).getModel(); + return UnoRuntime.queryInterface(XControl.class, control).getModel(); } public static void setEnabled(Object control, boolean enabled) 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 f958d9016833..f707690394ea 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. @@ -198,11 +198,11 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID Helper.setUnoPropertyValues(xDialogModel, new String[] { - "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_CLOSEABLE, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - Boolean.TRUE, new Integer(160), HelpIds.getHelpIdString(HID_FTP), Boolean.TRUE, "FTPDialog", new Integer(167), new Integer(82), resources.resFTPDialog_title, new Integer(222) + Boolean.TRUE, 160, HelpIds.getHelpIdString(HID_FTP), Boolean.TRUE, "FTPDialog", 167, 82, resources.resFTPDialog_title, 222 }); //add controls to dialog @@ -235,13 +235,13 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID PROPNAMES_LABEL, new Object[] { - INTEGERS[8], resources.resln1_value, "ln1", INTEGERS[6], INTEGERS[6], new Short((short) 0), new Integer(210) + INTEGERS[8], resources.resln1_value, "ln1", INTEGERS[6], INTEGERS[6], new Short((short) 0), 210 }); lblFTPAddress = insertLabel("lblFTPAddress", PROPNAMES_LABEL, new Object[] { - INTEGERS[8], resources.reslblFTPAddress_value, "lblFTPAddress", INTEGER_12, new Integer(20), new Short((short) 1), new Integer(95) + INTEGERS[8], resources.reslblFTPAddress_value, "lblFTPAddress", INTEGER_12, 20, new Short((short) 1), 95 }); txtHost = insertTextField("txtHost", "disconnect", new String[] @@ -250,13 +250,13 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID_FTP_SERVER), "txtIP", new Integer(110), new Integer(18), new Short((short) 2), new Integer(106) + INTEGER_12, HelpIds.getHelpIdString(HID_FTP_SERVER), "txtIP", 110, 18, new Short((short) 2), 106 }); lblUsername = insertLabel("lblUsername", PROPNAMES_LABEL, new Object[] { - INTEGERS[8], resources.reslblUsername_value, "lblUsername", INTEGER_12, new Integer(36), new Short((short) 3), new Integer(85) + INTEGERS[8], resources.reslblUsername_value, "lblUsername", INTEGER_12, 36, new Short((short) 3), 85 }); txtUsername = insertTextField("txtUsername", "disconnect", new String[] @@ -265,13 +265,13 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID }, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID_FTP_USERNAME), "txtUsername", new Integer(110), new Integer(34), new Short((short) 4), new Integer(106) + INTEGER_12, HelpIds.getHelpIdString(HID_FTP_USERNAME), "txtUsername", 110, 34, new Short((short) 4), 106 }); lblPassword = insertLabel("lblPassword", PROPNAMES_LABEL, new Object[] { - INTEGERS[8], resources.reslblPassword_value, "lblPassword", INTEGER_12, new Integer(52), new Short((short) 5), new Integer(85) + INTEGERS[8], resources.reslblPassword_value, "lblPassword", INTEGER_12, 52, new Short((short) 5), 85 }); txtPassword = insertTextField("txtPassword", "disconnect", new String[] @@ -280,43 +280,43 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID }, new Object[] { - new Short((short) 42), INTEGER_12, HelpIds.getHelpIdString(HID_FTP_PASS), "txtPassword", new Integer(110), new Integer(50), new Short((short) 6), new Integer(106) + new Short((short) 42), INTEGER_12, HelpIds.getHelpIdString(HID_FTP_PASS), "txtPassword", 110, 50, new Short((short) 6), 106 }); ln2 = insertFixedLine("ln2", PROPNAMES_LABEL, new Object[] { - INTEGERS[8], resources.resln2_value, "ln2", INTEGERS[6], new Integer(68), new Short((short) 7), new Integer(210) + INTEGERS[8], resources.resln2_value, "ln2", INTEGERS[6], 68, new Short((short) 7), 210 }); btnTestConnection = insertButton("btnConnect", "connect", PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID_FTP_TEST), resources.resbtnConnect_value, "btnConnect", INTEGER_12, new Integer(80), new Short((short) 8), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID_FTP_TEST), resources.resbtnConnect_value, "btnConnect", INTEGER_12, 80, new Short((short) 8), INTEGER_50 }); imgStatus = insertImage("imgStatus", new String[] { - "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", "Tabstop", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", "Tabstop", PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Short((short) 0), INTEGER_14, new Integer(68), new Integer(80), Boolean.FALSE, Boolean.FALSE, INTEGER_14 + new Short((short) 0), INTEGER_14, 68, 80, Boolean.FALSE, Boolean.FALSE, INTEGER_14 }); lblStatus = insertLabel("lblStatus", PROPNAMES_LABEL, new Object[] { - INTEGERS[8], resources.resFTPDisconnected, "lblStatus", new Integer(86), new Integer(82), new Short((short) 9), new Integer(99) + INTEGERS[8], resources.resFTPDisconnected, "lblStatus", 86, 82, new Short((short) 9), 99 }); ln3 = insertFixedLine("ln3", PROPNAMES_LABEL, new Object[] { - INTEGERS[8], resources.resln3_value, "ln3", INTEGERS[6], new Integer(100), new Short((short) 10), new Integer(210) + INTEGERS[8], resources.resln3_value, "ln3", INTEGERS[6], 100, new Short((short) 10), 210 }); txtDir = insertTextField("txtDir", @@ -326,34 +326,34 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID }, new Object[] { - new Boolean(false), INTEGER_12, HelpIds.getHelpIdString(HID_FTP_TXT_PATH), "txtDir", INTEGER_12, new Integer(113), new Short((short) 11), resources.restxtDir_value, new Integer(184) + Boolean.FALSE, INTEGER_12, HelpIds.getHelpIdString(HID_FTP_TXT_PATH), "txtDir", INTEGER_12, 113, new Short((short) 11), resources.restxtDir_value, 184 }); btnDir = insertButton("btnDir", "chooseDirectory", PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID_FTP_BTN_PATH), resources.resbtnDir_value, "btnDir", new Integer(199), new Integer(112), new Short((short) 12), INTEGER_16 + INTEGER_14, HelpIds.getHelpIdString(HID_FTP_BTN_PATH), resources.resbtnDir_value, "btnDir", 199, 112, new Short((short) 12), INTEGER_16 }); btnOK = insertButton("btnOK", null, PROPNAMES_BUTTON2, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID_FTP_OK), resources.resbtnOK_value, "btnOK", new Integer(165), new Integer(142), new Short((short) PushButtonType.OK_value), new Short((short) 13), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID_FTP_OK), resources.resbtnOK_value, "btnOK", 165, 142, new Short((short) PushButtonType.OK_value), new Short((short) 13), INTEGER_50 }); btnCancel = insertButton("btnCancel", null, PROPNAMES_BUTTON2, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID_FTP_CANCEL), resources.resbtnCancel_value, "btnCancel", new Integer(113), new Integer(142), new Short((short) PushButtonType.CANCEL_value), new Short((short) 14), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID_FTP_CANCEL), resources.resbtnCancel_value, "btnCancel", 113, 142, new Short((short) PushButtonType.CANCEL_value), new Short((short) 14), INTEGER_50 }); btnHelp = insertButton("btnHelp", null, PROPNAMES_BUTTON2, new Object[] { - INTEGER_14, "", resources.resbtnHelp_value, "btnHelp", new Integer(57), new Integer(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)); } /** @@ -573,7 +573,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID * I get a ucb content. * I list the files in this content. * I call the ucb "open" command. - * I get the "Title" property of this content. + * I get the PropertyNames.PROPERTY_TITLE property of this content. * @param acountUrl * @throws Exception */ @@ -592,7 +592,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID ucb.executeCommand(content, "open", aArg); //get the title property of the content. - Object obj = ucb.getContentProperty(content, "Title", String.class); + Object obj = ucb.getContentProperty(content, PropertyNames.PROPERTY_TITLE, String.class); } @@ -708,10 +708,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID private String imageUrl(String s) { - String t = imagesDirectory + s; - //System.out.println(t); - return t; - + return imagesDirectory + s; } /** @@ -724,7 +721,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 df4f4142f858..3943271408fe 100644 --- a/wizards/com/sun/star/wizards/web/ImageListDialog.java +++ b/wizards/com/sun/star/wizards/web/ImageListDialog.java @@ -133,11 +133,11 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts Helper.setUnoPropertyValues(xDialogModel, new String[] { - "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_CLOSEABLE, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - Boolean.TRUE, new Integer(dialogHeight), HelpIds.getHelpIdString(hid), Boolean.TRUE, "imgDialog", new Integer(59), new Integer(24), INTEGERS[1], resources[RES_TITLE], new Integer(dialogWidth) + Boolean.TRUE, new Integer(dialogHeight), HelpIds.getHelpIdString(hid), Boolean.TRUE, "imgDialog", 59, 24, INTEGERS[1], resources[RES_TITLE], new Integer(dialogWidth) }); //Set member- FontDescriptors... fontDescriptor1.Weight = 150; @@ -153,19 +153,19 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts PROPNAMES, new Object[] { - Boolean.TRUE, INTEGER_14, HelpIds.getHelpIdString(hid + 3), resources[RES_OK], "btnOK", iButtonsX, new Integer(22), new Short((short) com.sun.star.awt.PushButtonType.OK_value), new Short((short) 7), INTEGER_50 + Boolean.TRUE, INTEGER_14, HelpIds.getHelpIdString(hid + 3), resources[RES_OK], "btnOK", iButtonsX, 22, new Short((short) com.sun.star.awt.PushButtonType.OK_value), new Short((short) 7), INTEGER_50 }); btnCancel = insertButton("btnCancel", null, PROPNAMES, new Object[] { - Boolean.FALSE, INTEGER_14, HelpIds.getHelpIdString(hid + 4), resources[RES_CANCEL], "btnCancel", iButtonsX, new Integer(41), new Short((short) com.sun.star.awt.PushButtonType.CANCEL_value), new Short((short) 8), INTEGER_50 + Boolean.FALSE, INTEGER_14, HelpIds.getHelpIdString(hid + 4), resources[RES_CANCEL], "btnCancel", iButtonsX, 41, new Short((short) com.sun.star.awt.PushButtonType.CANCEL_value), new Short((short) 8), INTEGER_50 }); btnHelp = insertButton("btnHelp", null, PROPNAMES, new Object[] { - Boolean.FALSE, INTEGER_14, "", resources[RES_HELP], "CommandButton3", iButtonsX, new Integer(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) @@ -202,17 +202,17 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts /*lblContainer = insertLabel("lblContainer", new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH}, - new Object[] { new Integer(176),"lblContainer",new Integer(6),new Integer(17),new Short((short)5),new Integer(214)} + new Object[] { 176,"lblContainer",6,17,new Short((short)5),214} );*/ 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[] { - fontDescriptor1, INTEGERS[8], resources[RES_LABEL], "lblTitle", INTEGERS[6], INTEGERS[6], INTEGERS[1], new Short((short) 4), new Integer(216) + fontDescriptor1, INTEGERS[8], resources[RES_LABEL], "lblTitle", INTEGERS[6], INTEGERS[6], INTEGERS[1], new Short((short) 4), 216 }); } @@ -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 e384e12737cb..b98ac5261e7a 100644 --- a/wizards/com/sun/star/wizards/web/LogTaskListener.java +++ b/wizards/com/sun/star/wizards/web/LogTaskListener.java @@ -28,6 +28,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; @@ -91,7 +92,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..f861a82865e3 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; @@ -163,13 +164,12 @@ public class Process implements WebWizardConst, ProcessErrors { } int publish = countPublish(); - int taskSteps = + return TASKS_IN_PREPARE + TASKS_IN_EXPORT + docs * TASKS_PER_DOC + TASKS_IN_GENERATE + xsl * TASKS_PER_XSL + TASKS_IN_PUBLISH + publish * TASKS_PER_PUBLISH + TASKS_IN_FINISHUP; - return taskSteps; } /** @@ -240,8 +240,7 @@ public class Process implements WebWizardConst, ProcessErrors { try { - String s = FileAccess.getOfficePath(xmsf, "Temp", "", ""); - return s; + return FileAccess.getOfficePath(xmsf, "Temp", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); } catch (Exception e) { @@ -308,7 +307,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 +353,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 +434,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 +518,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 +585,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 +696,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 c765e2410312..c0e6b08f6cff 100644 --- a/wizards/com/sun/star/wizards/web/StatusDialog.java +++ b/wizards/com/sun/star/wizards/web/StatusDialog.java @@ -84,11 +84,11 @@ public class StatusDialog extends UnoDialog2 implements TaskListener Helper.setUnoPropertyValues(xDialogModel, new String[] { - "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_CLOSEABLE, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - Boolean.FALSE, new Integer(6 + 25 + (b ? 27 : 7)), hid, Boolean.TRUE, "StatusDialog", new Integer(102), new Integer(52), new Integer(0), res[0], new Integer(width) + Boolean.FALSE, new Integer(6 + 25 + (b ? 27 : 7)), hid, Boolean.TRUE, "StatusDialog", 102, 52, 0, res[0], new Integer(width) }); short tabstop = 1; @@ -100,7 +100,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener }, new Object[] { - new Integer(8), taskName, new Integer(6), new Integer(6), new Short(tabstop++), new Integer(width * 2 / 3) + 8, taskName, 6, 6, new Short(tabstop++), new Integer(width * 2 / 3) }); lblCounter = insertLabel("lblCounter", new String[] @@ -109,7 +109,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener }, new Object[] { - new Integer(8), "", new Integer(width * 2 / 3), new Integer(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[] @@ -118,7 +118,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener }, new Object[] { - new Integer(10), new Integer(6), new Integer(16), new Short(tabstop++), new Integer(width - 12) + 10, 6, 16, new Short(tabstop++), new Integer(width - 12) }); @@ -131,7 +131,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener }, new Object[] { - new Integer(14), res[1], new Integer(width / 2 - 20), new Integer(6 + 25 + 7), new Short(tabstop++), new Integer(40) + 14, res[1], new Integer(width / 2 - 20), new Integer(6 + 25 + 7), new Short(tabstop++), 40 }); } @@ -245,7 +245,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener try { this.parent = parent_; - Helper.setUnoPropertyValue(this.xDialogModel, "Title", title); + Helper.setUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_TITLE, title); try { //TODO change this to another execute dialog method. 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..b37e0fff39e6 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 ! @@ -81,11 +81,11 @@ public abstract class WWD_Events extends WWD_Startup { super(xmsf); Create c = new Create(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, chkFTP); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, chkFTP); xWindow.addKeyListener(c); - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, chkLocalDir); + xWindow = UnoRuntime.queryInterface(XWindow.class, chkLocalDir); xWindow.addKeyListener(c); - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, chkZip); + xWindow = UnoRuntime.queryInterface(XWindow.class, chkZip); xWindow.addKeyListener(c); } @@ -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); @@ -310,7 +310,7 @@ public abstract class WWD_Events extends WWD_Startup { fillExportList(settings.getExporters(doc.appType)); } - else; // do nothing + selectedDoc = s; @@ -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 { @@ -1204,7 +1204,7 @@ public abstract class WWD_Events extends WWD_Startup //if (xCloseable != null) // xCloseable.close(false); - XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, myFrame); + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, myFrame); if (xCloseable != null) { xCloseable.close(false); @@ -1301,6 +1301,6 @@ public abstract class WWD_Events extends WWD_Startup task.advance(false); } } - }; + } } 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..c3bae2a10bc4 100644 --- a/wizards/com/sun/star/wizards/web/WWD_Startup.java +++ b/wizards/com/sun/star/wizards/web/WWD_Startup.java @@ -254,7 +254,7 @@ public abstract class WWD_Startup extends WWD_General this.buildStep7(proxies, exclamationURL); buildStepX(); - this.xMSF = xMSF; + this.xMSF = xmsf; XDesktop xDesktop = Desktop.getDesktop(xMSF); myFrame = OfficeDocument.createNewFrame(xMSF, this); Object doc = OfficeDocument.createNewDocument(myFrame, "swriter", false, true); @@ -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... @@ -388,7 +388,7 @@ public abstract class WWD_Startup extends WWD_General private XFrame getFrame(Object model) { - XModel xmodel = (XModel) UnoRuntime.queryInterface(XModel.class, model); + XModel xmodel = UnoRuntime.queryInterface(XModel.class, model); return xmodel.getCurrentController().getFrame(); } @@ -412,7 +412,7 @@ public abstract class WWD_Startup extends WWD_General //XWindow xContainerWindow = myFrame.getContainerWindow(); XWindow xContainerWindow = myFrame.getComponentWindow(); - XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow); + XWindowPeer xWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow); createWindowPeer(xWindowPeer); @@ -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 }); @@ -595,7 +595,7 @@ public abstract class WWD_Startup extends WWD_General //page 2 : document properties - docListDA = (UnoDataAware) UnoDataAware.attachListBox(this, "SelectedDoc", lstDocuments, null, false); + docListDA = UnoDataAware.attachListBox(this, "SelectedDoc", lstDocuments, null, false); docListDA.disableControls(new Object[] { /*btnDocDown, btnDocUp, */ @@ -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 e9d1d2fd7a87..7191e65bedb8 100644 --- a/wizards/com/sun/star/wizards/web/WebWizardDialog.java +++ b/wizards/com/sun/star/wizards/web/WebWizardDialog.java @@ -196,16 +196,16 @@ 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 = new Integer(91); - private static Integer INTEGER_97 = new Integer(97); - private static Integer INTEGER_103 = new Integer(103); - private static Integer INTEGER_169 = new Integer(169); //Resources Object + private static Integer INTEGER_91 = 91; + private static Integer INTEGER_97 = 97; + private static Integer INTEGER_103 = 103; + private static Integer INTEGER_169 = 169; //Resources Object WebWizardDialogResources resources; public WebWizardDialog(XMultiServiceFactory xmsf) @@ -219,11 +219,11 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC Helper.setUnoPropertyValues(xDialogModel, new String[] { - "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_CLOSEABLE, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MOVEABLE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_TITLE, PropertyNames.PROPERTY_WIDTH }, new Object[] { - Boolean.TRUE, new Integer(210), HelpIds.getHelpIdString(HID0_WEBWIZARD), Boolean.TRUE, "WebWizardDialog", new Integer(102), new Integer(52), INTEGERS[1], new Short((short) 6), resources.resWebWizardDialog_title, new Integer(330) + Boolean.TRUE, 210, HelpIds.getHelpIdString(HID0_WEBWIZARD), Boolean.TRUE, "WebWizardDialog", 102, 52, INTEGERS[1], new Short((short) 6), resources.resWebWizardDialog_title, 330 }); //Set member- FontDescriptors... @@ -254,7 +254,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TITLE, new Object[] { - fontDescriptor4, INTEGER_16, resources.reslbIntroTitle_value, Boolean.TRUE, "lbIntroTitle", new Integer(91), INTEGERS[8], INTEGERS[1], new Short(tabIndex++), new Integer(232) + fontDescriptor4, INTEGER_16, resources.reslbIntroTitle_value, Boolean.TRUE, "lbIntroTitle", 91, INTEGERS[8], INTEGERS[1], new Short(tabIndex++), 232 }); lblIntroduction = insertLabel("lblIntroduction", new String[] @@ -263,14 +263,14 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - new Integer(119), resources.reslblIntroduction_value, Boolean.TRUE, "lblIntroduction", new Integer(97), new Integer(28), INTEGERS[1], new Short(tabIndex++), new Integer(226) + 119, resources.reslblIntroduction_value, Boolean.TRUE, "lblIntroduction", 97, 28, INTEGERS[1], new Short(tabIndex++), 226 }); lnLoadSettings = insertFixedLine("lnLoadSettings", PROPNAMES_TXT, new Object[] { - INTEGERS[2], "", "lnLoadSettings", new Integer(91), new Integer(147), INTEGERS[1], new Short(tabIndex++), new Integer(234) + INTEGERS[2], PropertyNames.EMPTY_STRING, "lnLoadSettings", 91, 147, INTEGERS[1], new Short(tabIndex++), 234 }); lblLoadSettings = insertLabel("lblLoadSettings", new String[] @@ -279,7 +279,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - INTEGERS[8], resources.reslblLoadSettings_value, Boolean.TRUE, "lblLoadSettings", new Integer(97), new Integer(153), INTEGERS[1], new Short(tabIndex++), new Integer(226) + INTEGERS[8], resources.reslblLoadSettings_value, Boolean.TRUE, "lblLoadSettings", 97, 153, INTEGERS[1], new Short(tabIndex++), 226 }); lstLoadSettings = insertListBox("lstLoadSettings", null, LSTLOADSETTINGS_ITEM_CHANGED, new String[] @@ -288,7 +288,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID1_LST_SESSIONS), new Short((short) 14), "lstLoadSettings", new Integer(97), new Integer(165), INTEGERS[1], new Short(tabIndex++), new Integer(173) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID1_LST_SESSIONS), new Short((short) 14), "lstLoadSettings", 97, 165, INTEGERS[1], new Short(tabIndex++), 173 }); btnDelSession = insertButton("btnDelSession", BTNDELSESSION_ACTION_PERFORMED, new String[] @@ -297,7 +297,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - Boolean.FALSE, INTEGER_14, HelpIds.getHelpIdString(HID1_BTN_DEL_SES), new Short(com.sun.star.awt.ImageAlign.LEFT), resources.resbtnDelSession_value, "btnDelSession", new Integer(274), new Integer(164), INTEGERS[1], new Short(tabIndex++), INTEGER_50 + Boolean.FALSE, INTEGER_14, HelpIds.getHelpIdString(HID1_BTN_DEL_SES), new Short(com.sun.star.awt.ImageAlign.LEFT), resources.resbtnDelSession_value, "btnDelSession", 274, 164, INTEGERS[1], new Short(tabIndex++), INTEGER_50 }); } @@ -309,13 +309,13 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TITLE, new Object[] { - fontDescriptor4, INTEGER_16, resources.reslblContentTitle_value, Boolean.TRUE, "lblContentTitle", new Integer(91), INTEGERS[8], INTEGERS[2], new Short(tabIndex++), new Integer(232) + fontDescriptor4, INTEGER_16, resources.reslblContentTitle_value, Boolean.TRUE, "lblContentTitle", 91, INTEGERS[8], INTEGERS[2], new Short(tabIndex++), 232 }); lblSiteContent = insertLabel("lblSiteContent", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblSiteContent_value, "lblSiteContent", new Integer(97), new Integer(28), INTEGERS[2], new Short(tabIndex++), new Integer(105) + INTEGERS[8], resources.reslblSiteContent_value, "lblSiteContent", 97, 28, INTEGERS[2], new Short(tabIndex++), 105 }); lstDocuments = insertListBox("lstDocuments", null, null, new String[] @@ -324,44 +324,44 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - new Integer(123), HelpIds.getHelpIdString(HID2_LST_DOCS), new Short((short) 9), "lstDocuments", new Integer(97), new Integer(38), INTEGERS[2], new Short(tabIndex++), new Integer(103) + 123, HelpIds.getHelpIdString(HID2_LST_DOCS), new Short((short) 9), "lstDocuments", 97, 38, INTEGERS[2], new Short(tabIndex++), 103 }); btnAddDoc = insertButton("btnAddDoc", BTNADDDOC_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_ADD_DOC), resources.resbtnAddDoc_value, "btnAddDoc", new Integer(97), new Integer(165), INTEGERS[2], new Short(tabIndex++), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_ADD_DOC), resources.resbtnAddDoc_value, "btnAddDoc", 97, 165, INTEGERS[2], new Short(tabIndex++), INTEGER_50 }); btnRemoveDoc = insertButton("btnRemoveDoc", BTNREMOVEDOC_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_REM_DOC), resources.resbtnRemoveDoc_value, "btnRemoveDoc", new Integer(150), new Integer(165), INTEGERS[2], new Short(tabIndex++), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_REM_DOC), resources.resbtnRemoveDoc_value, "btnRemoveDoc", 150, 165, INTEGERS[2], new Short(tabIndex++), INTEGER_50 }); 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[] { - fontDescriptor7, INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_DOC_UP), resources.resbtnDocUp_value, "btnDocUp", new Integer(205), new Integer(87), INTEGERS[2], new Short(tabIndex++), new Integer(18) + fontDescriptor7, INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_DOC_UP), resources.resbtnDocUp_value, "btnDocUp", 205, 87, INTEGERS[2], new Short(tabIndex++), 18 }); 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[] { - fontDescriptor7, INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_DOC_DOWN), resources.resbtnDocDown_value, "btnDocDown", new Integer(205), new Integer(105), INTEGERS[2], new Short(tabIndex++), new Integer(18) + fontDescriptor7, INTEGER_14, HelpIds.getHelpIdString(HID2_BTN_DOC_DOWN), resources.resbtnDocDown_value, "btnDocDown", 205, 105, INTEGERS[2], new Short(tabIndex++), 18 }); lblDocExportFormat = insertLabel("lblDocExportFormat", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblDocExportFormat_value, "lblDocExportFormat", new Integer(235), new Integer(28), INTEGERS[2], new Short(tabIndex++), new Integer(89) + INTEGERS[8], resources.reslblDocExportFormat_value, "lblDocExportFormat", 235, 28, INTEGERS[2], new Short(tabIndex++), 89 }); lstDocTargetType = insertListBox("lstDocTargetType", null, null, new String[] @@ -370,7 +370,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID2_LST_DOC_EXPORT), new Short((short) 14), "lstDocTargetType", new Integer(235), new Integer(38), INTEGERS[2], new Short(tabIndex++), new Integer(89) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID2_LST_DOC_EXPORT), new Short((short) 14), "lstDocTargetType", 235, 38, INTEGERS[2], new Short(tabIndex++), 89 }); @@ -380,25 +380,25 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslnDocsInfo_value, "lnDocsInfo", new Integer(235), new Integer(66), INTEGERS[2], new Short(tabIndex++), new Integer(90) + INTEGERS[8], resources.reslnDocsInfo_value, "lnDocsInfo", 235, 66, INTEGERS[2], new Short(tabIndex++), 90 }); lblDocTitle = insertLabel("lblDocTitle", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblDocTitle_value, "lblDocTitle", new Integer(235), new Integer(78), INTEGERS[2], new Short(tabIndex++), new Integer(89) + INTEGERS[8], resources.reslblDocTitle_value, "lblDocTitle", 235, 78, INTEGERS[2], new Short(tabIndex++), 89 }); txtDocTitle = insertTextField("txtDocTitle", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID2_TXT_DOC_TITLE), "txtDocTitle", new Integer(235), new Integer(88), INTEGERS[2], new Short(tabIndex++), new Integer(89) + INTEGER_12, HelpIds.getHelpIdString(HID2_TXT_DOC_TITLE), "txtDocTitle", 235, 88, INTEGERS[2], new Short(tabIndex++), 89 }); lblDocInfo = insertLabel("lblDocInfo", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblDocInfo_value, "lblDocInfo", new Integer(235), new Integer(103), INTEGERS[2], new Short(tabIndex++), new Integer(89) + INTEGERS[8], resources.reslblDocInfo_value, "lblDocInfo", 235, 103, INTEGERS[2], new Short(tabIndex++), 89 }); txtDocInfo = insertTextField("txtDocInfo", null, new String[] @@ -407,19 +407,19 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - INTEGER_40, HelpIds.getHelpIdString(HID2_TXT_DOC_DESC), Boolean.TRUE, "txtDocInfo", new Integer(235), new Integer(113), INTEGERS[2], new Short(tabIndex++), new Integer(89) + INTEGER_40, HelpIds.getHelpIdString(HID2_TXT_DOC_DESC), Boolean.TRUE, "txtDocInfo", 235, 113, INTEGERS[2], new Short(tabIndex++), 89 }); lblDocAuthor = insertLabel("lblDocAuthor", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblDocAuthor_value, "lblDocAuthor", new Integer(235), new Integer(155), INTEGERS[2], new Short(tabIndex++), new Integer(89) + INTEGERS[8], resources.reslblDocAuthor_value, "lblDocAuthor", 235, 155, INTEGERS[2], new Short(tabIndex++), 89 }); txtDocAuthor = insertTextField("txtDocAuthor", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID2_TXT_DOC_AUTHOR), "txtDocAuthor", new Integer(235), new Integer(165), INTEGERS[2], new Short(tabIndex++), new Integer(89) + INTEGER_12, HelpIds.getHelpIdString(HID2_TXT_DOC_AUTHOR), "txtDocAuthor", 235, 165, INTEGERS[2], new Short(tabIndex++), 89 }); } @@ -429,13 +429,13 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TITLE, new Object[] { - fontDescriptor4, INTEGER_16, resources.reslblLayoutTitle_value, Boolean.TRUE, "lblLayoutTitle", new Integer(91), INTEGERS[8], INTEGERS[3], new Short((short) 29), new Integer(232) + fontDescriptor4, INTEGER_16, resources.reslblLayoutTitle_value, Boolean.TRUE, "lblLayoutTitle", 91, INTEGERS[8], INTEGERS[3], new Short((short) 29), 232 }); lblLayouts = insertLabel("lblLayouts", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblLayouts_value, "lblLayouts", new Integer(97), new Integer(28), INTEGERS[3], new Short((short) 30), new Integer(206) + INTEGERS[8], resources.reslblLayouts_value, "lblLayouts", 97, 28, INTEGERS[3], new Short((short) 30), 206 }); } @@ -446,7 +446,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TITLE, new Object[] { - fontDescriptor4, INTEGER_16, resources.reslblLayout2Title_value, Boolean.TRUE, "lblLayout2Title", new Integer(91), INTEGERS[8], INTEGERS[4], new Short((short) 33), new Integer(232) + fontDescriptor4, INTEGER_16, resources.reslblLayout2Title_value, Boolean.TRUE, "lblLayout2Title", 91, INTEGERS[8], INTEGERS[4], new Short((short) 33), 232 }); lnDisplay = insertLabel("lblDisplay", new String[] @@ -455,86 +455,86 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - INTEGER_16, resources.reslblDisplay_value, Boolean.TRUE, "lblDisplay", new Integer(97), new Integer(28), INTEGERS[4], new Short((short) 34), new Integer(226) + INTEGER_16, resources.reslblDisplay_value, Boolean.TRUE, "lblDisplay", 97, 28, INTEGERS[4], new Short((short) 34), 226 }); chkDocFilename = insertCheckBox("chkDocFilename", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_FILENAME), resources.reschkDocFilename_value, "chkDocFilename", new Integer(103), new Integer(50), new Short((short) 0), INTEGERS[4], new Short((short) 35), new Integer(99) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_FILENAME), resources.reschkDocFilename_value, "chkDocFilename", 103, 50, new Short((short) 0), INTEGERS[4], new Short((short) 35), 99 }); chbDocDesc = insertCheckBox("chbDocDesc", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_DESCRIPTION), resources.reschbDocDesc_value, "chbDocDesc", new Integer(103), new Integer(60), new Short((short) 0), INTEGERS[4], new Short((short) 36), new Integer(99) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_DESCRIPTION), resources.reschbDocDesc_value, "chbDocDesc", 103, 60, new Short((short) 0), INTEGERS[4], new Short((short) 36), 99 }); chbDocAuthor = insertCheckBox("chbDocAuthor", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_AUTHOR), resources.reschbDocAuthor_value, "chbDocAuthor", new Integer(103), new Integer(70), new Short((short) 0), INTEGERS[4], new Short((short) 37), new Integer(99) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_AUTHOR), resources.reschbDocAuthor_value, "chbDocAuthor", 103, 70, new Short((short) 0), INTEGERS[4], new Short((short) 37), 99 }); chkDocCreated = insertCheckBox("chkDocCreated", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_CR_DATE), resources.reschkDocCreated_value, "chkDocCreated", new Integer(103), new Integer(80), new Short((short) 0), INTEGERS[4], new Short((short) 38), new Integer(99) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_CR_DATE), resources.reschkDocCreated_value, "chkDocCreated", 103, 80, new Short((short) 0), INTEGERS[4], new Short((short) 38), 99 }); chkDocChanged = insertCheckBox("chkDocChanged", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_UP_DATE), resources.reschkDocChanged_value, "chkDocChanged", new Integer(103), new Integer(90), new Short((short) 0), INTEGERS[4], new Short((short) 39), new Integer(99) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_UP_DATE), resources.reschkDocChanged_value, "chkDocChanged", 103, 90, new Short((short) 0), INTEGERS[4], new Short((short) 39), 99 }); chkDocFormat = insertCheckBox("chkDocFormat", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_FORMAT), resources.reschkDocFormat_value, "chkDocFormat", new Integer(200), new Integer(50), new Short((short) 0), INTEGERS[4], new Short((short) 40), new Integer(110) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_FORMAT), resources.reschkDocFormat_value, "chkDocFormat", 200, 50, new Short((short) 0), INTEGERS[4], new Short((short) 40), 110 }); chkDocFormatIcon = insertCheckBox("chkDocFormatIcon", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_F_ICON), resources.reschkDocFormatIcon_value, "chkDocFormatIcon", new Integer(200), new Integer(60), new Short((short) 0), INTEGERS[4], new Short((short) 41), new Integer(110) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_F_ICON), resources.reschkDocFormatIcon_value, "chkDocFormatIcon", 200, 60, new Short((short) 0), INTEGERS[4], new Short((short) 41), 110 }); chkDocPages = insertCheckBox("chkDocPages", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_PAGES), resources.reschkDocPages_value, "chkDocPages", new Integer(200), new Integer(70), new Short((short) 0), INTEGERS[4], new Short((short) 42), new Integer(110) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_PAGES), resources.reschkDocPages_value, "chkDocPages", 200, 70, new Short((short) 0), INTEGERS[4], new Short((short) 42), 110 }); chkDocSize = insertCheckBox("chkDocSize", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_SIZE), resources.reschkDocSize_value, "chkDocSize", new Integer(200), new Integer(80), new Short((short) 0), INTEGERS[4], new Short((short) 43), new Integer(110) + INTEGERS[8], HelpIds.getHelpIdString(HID4_CHK_DISPLAY_SIZE), resources.reschkDocSize_value, "chkDocSize", 200, 80, new Short((short) 0), INTEGERS[4], new Short((short) 43), 110 }); lblOptimizeFor = insertLabel("lblOptimizeFor", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblOptimizeFor_value, "lblOptimizeFor", new Integer(97), new Integer(113), INTEGERS[4], new Short((short) 44), new Integer(226) + INTEGERS[8], resources.reslblOptimizeFor_value, "lblOptimizeFor", 97, 113, INTEGERS[4], new Short((short) 44), 226 }); optOptimize640x480 = insertRadioButton("optOptimize640x480", null, PROPNAMES_BUTTON, new Object[] { - INTEGERS[10], HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_640), resources.resoptOptimize640x480_value, "optOptimize640x480", new Integer(103), new Integer(133), INTEGERS[4], new Short((short) 45), new Integer(44) + INTEGERS[10], HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_640), resources.resoptOptimize640x480_value, "optOptimize640x480", 103, 133, INTEGERS[4], new Short((short) 45), 44 }); optOptimize800x600 = insertRadioButton("optOptimize800x600", null, PROPNAMES_BUTTON, new Object[] { - INTEGERS[10], HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_800), resources.resoptOptimize800x600_value, "optOptimize800x600", new Integer(103), new Integer(146), INTEGERS[4], new Short((short) 46), new Integer(44) + INTEGERS[10], HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_800), resources.resoptOptimize800x600_value, "optOptimize800x600", 103, 146, INTEGERS[4], new Short((short) 46), 44 }); optOptimize1024x768 = insertRadioButton("optOptimize1024x768", null, PROPNAMES_BUTTON, new Object[] { - INTEGERS[10], HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_1024), resources.resoptOptimize1024x768_value, "optOptimize1024x768", new Integer(103), new Integer(158), INTEGERS[4], new Short((short) 47), new Integer(44) + INTEGERS[10], HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_1024), resources.resoptOptimize1024x768_value, "optOptimize1024x768", 103, 158, INTEGERS[4], new Short((short) 47), 44 }); } @@ -544,13 +544,13 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC lblStyleTitle = insertLabel("lblStyleTitle", PROPNAMES_TITLE, new Object[] { - fontDescriptor4, INTEGER_16, resources.reslblStyleTitle_value, Boolean.TRUE, "lblStyleTitle", new Integer(91), INTEGERS[8], INTEGERS[5], new Short((short) 50), new Integer(232) + fontDescriptor4, INTEGER_16, resources.reslblStyleTitle_value, Boolean.TRUE, "lblStyleTitle", 91, INTEGERS[8], INTEGERS[5], new Short((short) 50), 232 }); lblStyle = insertLabel("lblStyle", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblStyle_value, "lblStyle", new Integer(97), new Integer(28), INTEGERS[5], new Short((short) 51), new Integer(80) + INTEGERS[8], resources.reslblStyle_value, "lblStyle", 97, 28, INTEGERS[5], new Short((short) 51), 80 }); lstStyles = insertListBox("lstStyles", null, LSTSTYLES_ITEM_CHANGED, new String[] @@ -559,48 +559,48 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID5_LST_STYLES), new Short((short) 14), "lstStyles", new Integer(179), new Integer(26), INTEGERS[5], new Short((short) 52), new Integer(145) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID5_LST_STYLES), new Short((short) 14), "lstStyles", 179, 26, INTEGERS[5], new Short((short) 52), 145 }); insertLabel("lblBackground", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblBackground, "lblBackground", new Integer(97), new Integer(46), INTEGERS[5], new Short((short) 51), new Integer(70) + INTEGERS[8], resources.reslblBackground, "lblBackground", 97, 46, INTEGERS[5], new Short((short) 51), 70 }); txtBackground = insertLabel("txtBackground", new String[] { - "Border", 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.PROPERTY_BORDER, 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[] { - new Short((short) 1), INTEGER_12, resources.resBackgroundNone, "txtBackground", new Integer(179), new Integer(44), INTEGERS[5], new Short((short) 52), new Integer(90) + new Short((short) 1), INTEGER_12, resources.resBackgroundNone, "txtBackground", 179, 44, INTEGERS[5], new Short((short) 52), 90 }); btnBackgrounds = insertButton("btnBackgrounds", BTNBACKGROUNDS_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID5_BTN_BACKGND), resources.resBtnChooseBackground, "btnBackgrounds", new Integer(274), new Integer(43), INTEGERS[5], new Short((short) 53), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID5_BTN_BACKGND), resources.resBtnChooseBackground, "btnBackgrounds", 274, 43, INTEGERS[5], new Short((short) 53), INTEGER_50 }); insertLabel("lblIconset", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblIconset, "lblIconset", new Integer(97), new Integer(64), INTEGERS[5], new Short((short) 51), new Integer(70) + INTEGERS[8], resources.reslblIconset, "lblIconset", 97, 64, INTEGERS[5], new Short((short) 51), 70 }); txtIconset = insertLabel("txtIconset", new String[] { - "Border", 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.PROPERTY_BORDER, 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[] { - new Short((short) 1), INTEGER_12, resources.resIconsetNone, "txtIconset", new Integer(179), new Integer(62), INTEGERS[5], new Short((short) 52), new Integer(90) + new Short((short) 1), INTEGER_12, resources.resIconsetNone, "txtIconset", 179, 62, INTEGERS[5], new Short((short) 52), 90 }); btnIconSets = insertButton("btnIconSets", BTNICONSETS_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID5_BTN_ICONS), resources.resBtnChooseIconset, "btnIconSets", new Integer(274), new Integer(61), INTEGERS[5], new Short((short) 54), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID5_BTN_ICONS), resources.resBtnChooseIconset, "btnIconSets", 274, 61, INTEGERS[5], new Short((short) 54), INTEGER_50 }); insertLabel("lblIconsetInfo", new String[] @@ -609,7 +609,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - INTEGER_16, resources.reslblIconSetInfo, Boolean.TRUE, "lblIconsetInfo", new Integer(179), new Integer(78), INTEGERS[5], new Short((short) 51), new Integer(145) + INTEGER_16, resources.reslblIconSetInfo, Boolean.TRUE, "lblIconsetInfo", 179, 78, INTEGERS[5], new Short((short) 51), 145 }); @@ -620,7 +620,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - new Integer(0), Boolean.FALSE, new Integer(78), "", "imgPreview", new Integer(91), new Integer(100), Boolean.FALSE, INTEGERS[5], new Short((short) 55), new Integer(232) + 0, Boolean.FALSE, 78, PropertyNames.EMPTY_STRING, "imgPreview", 91, 100, Boolean.FALSE, INTEGERS[5], new Short((short) 55), 232 }); } @@ -632,19 +632,19 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TITLE, new Object[] { - fontDescriptor4, INTEGERS[8], resources.reslblTitleGeneralPage_value, Boolean.TRUE, "lblTitleGeneralPage", new Integer(90), INTEGERS[9], INTEGERS[6], new Short(tabIndex++), new Integer(232) + fontDescriptor4, INTEGERS[8], resources.reslblTitleGeneralPage_value, Boolean.TRUE, "lblTitleGeneralPage", 90, INTEGERS[9], INTEGERS[6], new Short(tabIndex++), 232 }); lblSiteTitle = insertLabel("lblSiteTitle", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblSiteTitle_value, "lblSiteTitle", new Integer(97), new Integer(28), INTEGERS[6], new Short(tabIndex++), new Integer(80) + INTEGERS[8], resources.reslblSiteTitle_value, "lblSiteTitle", 97, 28, INTEGERS[6], new Short(tabIndex++), 80 }); txtSiteTitle = insertTextField("txtSiteTitle", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_TITLE), "txtSiteTitle", new Integer(179), new Integer(26), INTEGERS[6], new Short(tabIndex++), new Integer(145) + INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_TITLE), "txtSiteTitle", 179, 26, INTEGERS[6], new Short(tabIndex++), 145 }); @@ -652,7 +652,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_LBL, new Object[] { - INTEGERS[9], resources.reslblMetaData, "FixedLineMetaData", new Integer(97), new Integer(56), INTEGERS[6], new Short(tabIndex++), new Integer(228) + INTEGERS[9], resources.reslblMetaData, "FixedLineMetaData", 97, 56, INTEGERS[6], new Short(tabIndex++), 228 }); @@ -660,35 +660,35 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblSiteDesc_value, "lblSiteDesc", new Integer(103), new Integer(72), INTEGERS[6], new Short(tabIndex++), new Integer(80) + INTEGERS[8], resources.reslblSiteDesc_value, "lblSiteDesc", 103, 72, INTEGERS[6], new Short(tabIndex++), 80 }); txtSiteDesc = insertTextField("txtSiteDesc", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_DESC), "txtSiteDesc", new Integer(179), new Integer(70), INTEGERS[6], new Short(tabIndex++), new Integer(145) + INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_DESC), "txtSiteDesc", 179, 70, INTEGERS[6], new Short(tabIndex++), 145 }); lblEmail = insertLabel("lblEmail", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblEmail_value, "lblEmail", new Integer(103), new Integer(90), INTEGERS[6], new Short(tabIndex++), new Integer(80) + INTEGERS[8], resources.reslblEmail_value, "lblEmail", 103, 90, INTEGERS[6], new Short(tabIndex++), 80 }); txtEmail = insertTextField("txtEmail", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_EMAIL), "txtEmail", new Integer(179), new Integer(87), INTEGERS[6], new Short(tabIndex++), new Integer(145) + INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_EMAIL), "txtEmail", 179, 87, INTEGERS[6], new Short(tabIndex++), 145 }); lblCopyright = insertLabel("lblCopyright", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblCopyright_value, "lblCopyright", new Integer(103), new Integer(108), INTEGERS[6], new Short(tabIndex++), new Integer(80) + INTEGERS[8], resources.reslblCopyright_value, "lblCopyright", 103, 108, INTEGERS[6], new Short(tabIndex++), 80 }); txtCopyright = insertTextField("txtCopyright", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_COPYRIGHT), "txtCopyright", new Integer(179), new Integer(106), INTEGERS[6], new Short(tabIndex++), new Integer(145) + INTEGER_12, HelpIds.getHelpIdString(HID6_TXT_SITE_COPYRIGHT), "txtCopyright", 179, 106, INTEGERS[6], new Short(tabIndex++), 145 }); @@ -696,7 +696,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblSiteCreated_value, "lblSiteCreated", new Integer(103), new Integer(126), INTEGERS[6], new Short(tabIndex++), new Integer(80) + INTEGERS[8], resources.reslblSiteCreated_value, "lblSiteCreated", 103, 126, INTEGERS[6], new Short(tabIndex++), 80 }); dateSiteCreated = insertDateField("dateSiteCreated", null, new String[] @@ -705,13 +705,13 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID6_DATE_SITE_CREATED), "dateSiteCreated", new Integer(179), new Integer(124), INTEGERS[6], new Short(tabIndex++), new Integer(49) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID6_DATE_SITE_CREATED), "dateSiteCreated", 179, 124, INTEGERS[6], new Short(tabIndex++), 49 }); lblSiteUpdated = insertLabel("lblSiteUpdated", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblSiteUpdated_value, "lblSiteUpdated", new Integer(103), new Integer(144), INTEGERS[6], new Short(tabIndex++), new Integer(80) + INTEGERS[8], resources.reslblSiteUpdated_value, "lblSiteUpdated", 103, 144, INTEGERS[6], new Short(tabIndex++), 80 }); dateSiteUpdate = insertDateField("dateSiteUpdate", null, @@ -721,7 +721,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID6_DATE_SITE_UPDATED), "dateSiteUpdate", new Integer(179), new Integer(142), INTEGERS[6], new Short(tabIndex++), new Integer(49) + Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID6_DATE_SITE_UPDATED), "dateSiteUpdate", 179, 142, INTEGERS[6], new Short(tabIndex++), 49 }); @@ -736,92 +736,92 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TITLE, new Object[] { - fontDescriptor4, INTEGER_16, resources.reslblTitlePublish_value, Boolean.TRUE, "lblTitlePublish", new Integer(91), INTEGERS[8], INTEGERS[7], new Short(tabIndex++), new Integer(232) + fontDescriptor4, INTEGER_16, resources.reslblTitlePublish_value, Boolean.TRUE, "lblTitlePublish", 91, INTEGERS[8], INTEGERS[7], new Short(tabIndex++), 232 }); FixedLine1 = insertFixedLine("FixedLine1", PROPNAMES_LBL, new Object[] { - INTEGERS[9], resources.resFixedLine1_value, "FixedLine1", new Integer(97), new Integer(28), INTEGERS[7], new Short(tabIndex++), new Integer(228) + INTEGERS[9], resources.resFixedLine1_value, "FixedLine1", 97, 28, INTEGERS[7], new Short(tabIndex++), 228 }); btnPreview = insertButton("btnPreview", BTNPREVIEW_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_PREVIEW), resources.resbtnPreview_value, "btnPreview", new Integer(103), new Integer(40), INTEGERS[7], new Short(tabIndex++), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_PREVIEW), resources.resbtnPreview_value, "btnPreview", 103, 40, INTEGERS[7], new Short(tabIndex++), INTEGER_50 }); lblCreateSite = insertFixedLine("lblCreateSite", PROPNAMES_LBL, new Object[] { - INTEGERS[9], resources.reslblCreateSite_value, "lblCreateSite", new Integer(97), new Integer(56), INTEGERS[7], new Short(tabIndex++), new Integer(228) + INTEGERS[9], resources.reslblCreateSite_value, "lblCreateSite", 97, 56, INTEGERS[7], new Short(tabIndex++), 228 }); chkLocalDir = insertCheckBox("chkLocalDir", CHKLOCALDIR_ITEM_CHANGED, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID7_CHK_PUBLISH_LOCAL), resources.reschkLocalDir_value, "chkLocalDir", new Integer(103), new Integer(68), new Short((short) 0), INTEGERS[7], new Short(tabIndex++), new Integer(215) + INTEGERS[8], HelpIds.getHelpIdString(HID7_CHK_PUBLISH_LOCAL), resources.reschkLocalDir_value, "chkLocalDir", 103, 68, new Short((short) 0), INTEGERS[7], new Short(tabIndex++), 215 }); txtLocalDir = insertTextField("txtLocalDir", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID7_TXT_LOCAL), "txtLocalDir", new Integer(113), new Integer(78), INTEGERS[7], new Short(tabIndex++), new Integer(190) + INTEGER_12, HelpIds.getHelpIdString(HID7_TXT_LOCAL), "txtLocalDir", 113, 78, INTEGERS[7], new Short(tabIndex++), 190 }); btnLocalDir = insertButton("btnLocalDir", BTNLOCALDIR_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_LOCAL), resources.resbtnLocalDir_value, "btnLocalDir", new Integer(308), new Integer(77), INTEGERS[7], new Short(tabIndex++), INTEGER_16 + INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_LOCAL), resources.resbtnLocalDir_value, "btnLocalDir", 308, 77, INTEGERS[7], new Short(tabIndex++), INTEGER_16 }); chkZip = insertCheckBox("chkZip", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[9], HelpIds.getHelpIdString(HID7_CHK_PUBLISH_ZIP), resources.reschkZip_value, "chkZip", new Integer(103), new Integer(96), new Short((short) 0), INTEGERS[7], new Short(tabIndex++), new Integer(215) + INTEGERS[9], HelpIds.getHelpIdString(HID7_CHK_PUBLISH_ZIP), resources.reschkZip_value, "chkZip", 103, 96, new Short((short) 0), INTEGERS[7], new Short(tabIndex++), 215 }); txtZip = insertTextField("txtZip", null, PROPNAMES_TXT, new Object[] { - INTEGER_12, HelpIds.getHelpIdString(HID7_TXT_ZIP), "txtZip", new Integer(113), new Integer(108), INTEGERS[7], new Short(tabIndex++), new Integer(190) + INTEGER_12, HelpIds.getHelpIdString(HID7_TXT_ZIP), "txtZip", 113, 108, INTEGERS[7], new Short(tabIndex++), 190 }); btnZip = insertButton("btnZip", BTNZIP_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_ZIP), resources.resbtnZip_value, "btnZip", new Integer(308), new Integer(107), INTEGERS[7], new Short(tabIndex++), INTEGER_16 + INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_ZIP), resources.resbtnZip_value, "btnZip", 308, 107, INTEGERS[7], new Short(tabIndex++), INTEGER_16 }); chkFTP = insertCheckBox("chkFTP", null, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[8], HelpIds.getHelpIdString(HID7_CHK_PUBLISH_FTP), resources.reschkFTP_value, "chkFTP", new Integer(103), new Integer(124), new Short((short) 0), INTEGERS[7], new Short(tabIndex++), new Integer(215) + INTEGERS[8], HelpIds.getHelpIdString(HID7_CHK_PUBLISH_FTP), resources.reschkFTP_value, "chkFTP", 103, 124, new Short((short) 0), INTEGERS[7], new Short(tabIndex++), 215 }); - Integer FTP_STEP = disableFTP ? new Integer(99) : INTEGERS[7]; + Integer FTP_STEP = disableFTP ? 99 : INTEGERS[7]; lblFTP = insertLabel("lblFTP", new String[] { - "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Short((short) 1), INTEGER_12, "txtFTP", new Integer(113), new Integer(134), FTP_STEP, new Short(tabIndex++), new Integer(156) + new Short((short) 1), INTEGER_12, "txtFTP", 113, 134, FTP_STEP, new Short(tabIndex++), 156 }); btnFTP = insertButton("btnFTP", BTNFTP_ACTION_PERFORMED, PROPNAMES_BUTTON, new Object[] { - INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_FTP), resources.resbtnFTP_value, "btnFTP", new Integer(274), new Integer(133), FTP_STEP, new Short(tabIndex++), INTEGER_50 + INTEGER_14, HelpIds.getHelpIdString(HID7_BTN_FTP), resources.resbtnFTP_value, "btnFTP", 274, 133, FTP_STEP, new Short(tabIndex++), INTEGER_50 }); if (disableFTP) @@ -830,11 +830,11 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC insertImage("imgFTPDisabled", new String[] { - "BackgroundColor", "Border", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH + "BackgroundColor", PropertyNames.PROPERTY_BORDER, PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - new Integer(-1), new Short((short) 0), Boolean.FALSE, new Integer(10), exclamationURL, "imgFTPDisabled", new Integer(115), new Integer(135), Boolean.FALSE, INTEGERS[7], new Short(tabIndex++), new Integer(8) + new Integer(-1), new Short((short) 0), Boolean.FALSE, 10, exclamationURL, "imgFTPDisabled", 115, 135, Boolean.FALSE, INTEGERS[7], new Short(tabIndex++), 8 }); insertLabel("lblFTPDisabled", new String[] @@ -843,9 +843,9 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - new Integer(-1), INTEGER_8, resources.reslblFTPDisabled, Boolean.TRUE, "lblFTPDisabled", new Integer(125), new Integer(136), INTEGERS[7], new Short(tabIndex++), new Integer(226) + new Integer(-1), INTEGER_8, resources.reslblFTPDisabled, Boolean.TRUE, "lblFTPDisabled", 125, 136, INTEGERS[7], new Short(tabIndex++), 226 }); - //FTP_STEP = new Integer(99); + //FTP_STEP = 99; } //else @@ -853,19 +853,19 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC PROPNAMES_TXT, new Object[] { - INTEGERS[2], "", "lnSaveSetting", new Integer(97), new Integer(151), INTEGERS[7], new Short(tabIndex++), new Integer(228) + INTEGERS[2], PropertyNames.EMPTY_STRING, "lnSaveSetting", 97, 151, INTEGERS[7], new Short(tabIndex++), 228 }); chkSaveSettings = insertCheckBox("chkSaveSettings", CHKSAVESETTINGS_ITEM_CHANGED, PROPNAMES_CHKBOX, new Object[] { - INTEGERS[9], HelpIds.getHelpIdString(HID7_CHK_SAVE), resources.reschkSaveSettings_value, "chkSaveSettings", new Integer(97), new Integer(157), new Short((short) 1), INTEGERS[7], new Short(tabIndex++), new Integer(215) + INTEGERS[9], HelpIds.getHelpIdString(HID7_CHK_SAVE), resources.reschkSaveSettings_value, "chkSaveSettings", 97, 157, new Short((short) 1), INTEGERS[7], new Short(tabIndex++), 215 }); lblSaveSettings = insertLabel("lblSaveSettings", PROPNAMES_LBL, new Object[] { - INTEGERS[8], resources.reslblSaveSettings_value, "lblSaveSettings", new Integer(107), new Integer(169), INTEGERS[7], new Short(tabIndex++), new Integer(45) + INTEGERS[8], resources.reslblSaveSettings_value, "lblSaveSettings", 107, 169, INTEGERS[7], new Short(tabIndex++), 45 }); cbSaveSettings = insertComboBox("txtSaveSettings", TXTSAVESETTINGS_TEXT_CHANGED, TXTSAVESETTINGS_TEXT_CHANGED, TXTSAVESETTINGS_TEXT_CHANGED, new String[] @@ -874,7 +874,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC }, new Object[] { - Boolean.TRUE, Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID7_TXT_SAVE), new Short((short) 14), "txtSaveSettings", new Integer(179), new Integer(167), INTEGERS[7], new Short(tabIndex++), new Integer(145) + Boolean.TRUE, Boolean.TRUE, INTEGER_12, HelpIds.getHelpIdString(HID7_TXT_SAVE), new Short((short) 14), "txtSaveSettings", 179, 167, INTEGERS[7], new Short(tabIndex++), 145 }); } @@ -900,8 +900,8 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC /*for (int i = 0; i<8; i++) imgIconsPrev[i] = insertImage("imgIconPrev" + i, - new String[] { "BackgroundColor","Border",PropertyNames.PROPERTY_HEIGHT,PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, "Tabstop", PropertyNames.PROPERTY_WIDTH}, - new Object[] { new Integer(-1), new Short((short)0),new Integer(14),"file:///c:/bludisk.gif", new Integer(97 + i * 20 + 7 ),new Integer(147),Boolean.FALSE,INTEGERS[5],Boolean.FALSE,new Integer(14)}); + new String[] { "BackgroundColor",PropertyNames.PROPERTY_BORDER,PropertyNames.PROPERTY_HEIGHT,PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, "Tabstop", PropertyNames.PROPERTY_WIDTH}, + new Object[] { new Integer(-1), new Short((short)0),14,"file:///c:/bludisk.gif", new Integer(97 + i * 20 + 7 ),147,Boolean.FALSE,INTEGERS[5],Boolean.FALSE,14}); */ } @@ -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/CGDesign.java b/wizards/com/sun/star/wizards/web/data/CGDesign.java index 00c1ea10b949..4644eb96899f 100644 --- a/wizards/com/sun/star/wizards/web/data/CGDesign.java +++ b/wizards/com/sun/star/wizards/web/data/CGDesign.java @@ -72,7 +72,7 @@ public class CGDesign extends ConfigGroup implements XMLProvider public void setStyle(short[] newStyle) { - Object o = ((CGStyle) ((CGSettings) root).cp_Styles.getElementAt(newStyle[0])); + Object o = ((CGSettings) root).cp_Styles.getElementAt(newStyle[0]); cp_Style = (String) ((CGSettings) root).cp_Styles.getKey(o); } diff --git a/wizards/com/sun/star/wizards/web/data/CGDocument.java b/wizards/com/sun/star/wizards/web/data/CGDocument.java index 765e49d1f6ee..e3612acf88f3 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 @@ -177,8 +177,8 @@ public class CGDocument extends ConfigSetItem implements XMLProvider props[0] = Properties.createProperty("Hidden", Boolean.TRUE); props[1] = Properties.createProperty("MacroExecutionMode", new Short(MacroExecMode.NEVER_EXECUTE)); props[2] = Properties.createProperty("UpdateDocMode", new Short(UpdateDocMode.NO_UPDATE)); - XComponent component = ((XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop)).loadComponentFromURL(cp_URL, "_default", 0, props); - xProps = ((XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, component)).getDocumentProperties(); + XComponent component = UnoRuntime.queryInterface(XComponentLoader.class, desktop).loadComponentFromURL(cp_URL, "_default", 0, props); + xProps = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, component).getDocumentProperties(); } task.advance(true); //4 @@ -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,19 +237,19 @@ 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); isSOOpenable = - (appType == TypeDetection.WRITER_DOC || appType == TypeDetection.CALC_DOC || appType == TypeDetection.IMPRESS_DOC || appType == TypeDetection.DRAW_DOC) || appType == TypeDetection.HTML_DOC; + (appType.equals(TypeDetection.WRITER_DOC) || appType.equals(TypeDetection.CALC_DOC) || appType.equals(TypeDetection.IMPRESS_DOC) || appType.equals(TypeDetection.DRAW_DOC)) || appType.equals(TypeDetection.HTML_DOC); // String[] parts = media.split("_"); // line removed because of compatibility to JDK13 String[] parts = JavaTools.ArrayoutofString(media, "_"); - isSODocument = parts.length < 2 ? false : isSOOpenable && (parts[1].startsWith("Star")); + isSODocument = parts.length >= 2 && isSOOpenable && (parts[1].startsWith("Star")); } @@ -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..60e711c3c2ae 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_; @@ -124,7 +124,7 @@ public class CGSettings extends ConfigGroup } } } - return (CGExporter[]) v.toArray(EMPTY_ARRAY_1); + return (CGExporter[]) v.toArray(new CGExporter[v.size()]); } /** @@ -141,7 +141,7 @@ public class CGSettings extends ConfigGroup private void calcExportersTargetTypeNames(XMultiServiceFactory xmsf) throws Exception { Object typeDetect = xmsf.createInstance("com.sun.star.document.TypeDetection"); - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, typeDetect); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, typeDetect); for (int i = 0; i < cp_Exporters.getSize(); i++) { calcExporterTargetTypeName(xNameAccess, (CGExporter) cp_Exporters.getElementAt(i)); @@ -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; } diff --git a/wizards/com/sun/star/wizards/web/export/AbstractExporter.java b/wizards/com/sun/star/wizards/web/export/AbstractExporter.java index 97b1109add01..4f35c69e935b 100644 --- a/wizards/com/sun/star/wizards/web/export/AbstractExporter.java +++ b/wizards/com/sun/star/wizards/web/export/AbstractExporter.java @@ -73,7 +73,7 @@ public abstract class AbstractExporter implements Exporter { props.put("FilterData", filterData); } - XStorable xs = ((XStorable) UnoRuntime.queryInterface(XStorable.class, officeDocument)); + XStorable xs = UnoRuntime.queryInterface(XStorable.class, officeDocument); PropertyValue[] o = props.getProperties(); xs.storeToURL(targetUrl, o); } @@ -110,7 +110,7 @@ public abstract class AbstractExporter implements Exporter props.put("Hidden", Boolean.TRUE); props.put("MacroExecutionMode", new Short(MacroExecMode.NEVER_EXECUTE)); props.put("UpdateDocMode", new Short(UpdateDocMode.NO_UPDATE)); - document = ((XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop)).loadComponentFromURL(doc.cp_URL, "_blank", 0, props.getProperties()); + document = UnoRuntime.queryInterface(XComponentLoader.class, desktop).loadComponentFromURL(doc.cp_URL, "_blank", 0, props.getProperties()); } catch (com.sun.star.lang.IllegalArgumentException iaex) { @@ -134,7 +134,7 @@ public abstract class AbstractExporter implements Exporter (XComponent) UnoRuntime.queryInterface(XComponent.class, doc));*/ try { - XCloseable xc = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, doc); + XCloseable xc = UnoRuntime.queryInterface(XCloseable.class, doc); xc.close(false); } catch (Exception ex) diff --git a/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java b/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java index 698bf7f44c53..474ec34e3980 100644 --- a/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java +++ b/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java @@ -42,9 +42,9 @@ import com.sun.star.wizards.web.data.CGSession; public class ImpressHTMLExporter extends ConfiguredExporter { - private static final Integer SMALL_IMAGE = new Integer(512); - private static final Integer MEDIUM_IMAGE = new Integer(640); - private static final Integer LARGE_IMAGE = new Integer(800); + private static final Integer SMALL_IMAGE = 512; + private static final Integer MEDIUM_IMAGE = 640; + private static final Integer LARGE_IMAGE = 800; public boolean export(CGDocument source, String targetDirectory, XMultiServiceFactory xmsf, Task task) throws IOException { diff --git a/wizards/prj/d.lst b/wizards/prj/d.lst index f8ab876ba1c1..4b00b6ed5b45 100644 --- a/wizards/prj/d.lst +++ b/wizards/prj/d.lst @@ -1,23 +1,23 @@ -mkdir: %COMMON_DEST%\bin%_EXT%\hid -mkdir: %_DEST%\pck%_EXT% -..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid -..\%__SRC%\bin\*.zip %_DEST%\pck%_EXT%\*.zip - ..\%__SRC%\bin\wzi*.res %_DEST%\bin%_EXT%\wzi*.res -..\%__SRC%\bin\dbw*.res %_DEST%\bin%_EXT%\dbw*.res -..\%__SRC%\bin\tpl*.res %_DEST%\bin%_EXT%\tpl*.res -..\%__SRC%\bin\imp*.res %_DEST%\bin%_EXT%\imp*.res -..\%__SRC%\bin\wwz*.res %_DEST%\bin%_EXT%\wwz*.res -..\%__SRC%\bin\eur*.res %_DEST%\bin%_EXT%\eur*.res -..\%__SRC%\bin\cal*.res %_DEST%\bin%_EXT%\cal*.res -..\%__SRC%\bin\com*.res %_DEST%\bin%_EXT%\com*.res -REM ..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res +mkdir: %COMMON_DEST%\bin\hid +mkdir: %_DEST%\pck +..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin\hid\*.hid +..\%__SRC%\bin\*.zip %_DEST%\pck\*.zip + ..\%__SRC%\bin\wzi*.res %_DEST%\bin\wzi*.res +..\%__SRC%\bin\dbw*.res %_DEST%\bin\dbw*.res +..\%__SRC%\bin\tpl*.res %_DEST%\bin\tpl*.res +..\%__SRC%\bin\imp*.res %_DEST%\bin\imp*.res +..\%__SRC%\bin\wwz*.res %_DEST%\bin\wwz*.res +..\%__SRC%\bin\eur*.res %_DEST%\bin\eur*.res +..\%__SRC%\bin\cal*.res %_DEST%\bin\cal*.res +..\%__SRC%\bin\com*.res %_DEST%\bin\com*.res +REM ..\%__SRC%\bin\*.res %_DEST%\bin\*.res -..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar -..\%__SRC%\misc\agenda.component %_DEST%\xml%_EXT%\agenda.component -..\%__SRC%\misc\fax.component %_DEST%\xml%_EXT%\fax.component -..\%__SRC%\misc\form.component %_DEST%\xml%_EXT%\form.component -..\%__SRC%\misc\letter.component %_DEST%\xml%_EXT%\letter.component -..\%__SRC%\misc\query.component %_DEST%\xml%_EXT%\query.component -..\%__SRC%\misc\report.component %_DEST%\xml%_EXT%\report.component -..\%__SRC%\misc\table.component %_DEST%\xml%_EXT%\table.component -..\%__SRC%\misc\web.component %_DEST%\xml%_EXT%\web.component +..\%__SRC%\class\*.jar %_DEST%\bin\*.jar +..\%__SRC%\misc\agenda.component %_DEST%\xml\agenda.component +..\%__SRC%\misc\fax.component %_DEST%\xml\fax.component +..\%__SRC%\misc\form.component %_DEST%\xml\form.component +..\%__SRC%\misc\letter.component %_DEST%\xml\letter.component +..\%__SRC%\misc\query.component %_DEST%\xml\query.component +..\%__SRC%\misc\report.component %_DEST%\xml\report.component +..\%__SRC%\misc\table.component %_DEST%\xml\table.component +..\%__SRC%\misc\web.component %_DEST%\xml\web.component diff --git a/wizards/source/importwizard/FilesModul.xba b/wizards/source/importwizard/FilesModul.xba index cb999252b24c..e35e0b3a3ba9 100644 --- a/wizards/source/importwizard/FilesModul.xba +++ b/wizards/source/importwizard/FilesModul.xba @@ -41,6 +41,7 @@ Dim NewContentList() as String Dim XMLTemplateContentString as String Dim ApplIndex as Integer Dim bAssignFileName as Boolean +Dim bInterruptSearch as Boolean bInterruptSearch = False For i = 0 To MaxCollectIndex SearchDir = PathCollection(i,0) |