diff options
Diffstat (limited to 'wizards/com/sun/star/wizards/ui')
19 files changed, 378 insertions, 361 deletions
diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java index 55a6b35dc7e9..69583f14c8bd 100644 --- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java +++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java @@ -30,7 +30,6 @@ import java.util.Vector; import com.sun.star.wizards.common.*; import com.sun.star.wizards.db.*; import com.sun.star.lang.EventObject; -//import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.beans.*; import com.sun.star.sdbc.SQLException; import com.sun.star.uno.AnyConverter; @@ -85,26 +84,26 @@ public class AggregateComponent extends ControlScroller optDetailQuery = CurUnoDialog.insertRadioButton("optDetailQuery", 0, new ActionListenerImpl(), new String[] { - "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width" + 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 }, new Object[] { - new Integer(8), "HID:" + curHelpID, soptDetailQuery, new Integer(_iPosX), new Integer(iCompPosY - 42), new Short((short) 1), IStep, new Short(curtabindex++), new Integer(iCompWidth) + 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) }); optSummaryQuery = CurUnoDialog.insertRadioButton("optSummaryQuery", 0, new ActionListenerImpl(), new String[] { - "Height", "HelpURL", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width" + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, 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[] { - new Integer(16), "HID:" + (curHelpID + 1), soptSummaryQuery, Boolean.TRUE, new Integer(_iPosX), new Integer(iCompPosY - 32), IStep, new Short(curtabindex++), new Integer(iCompWidth) + new Integer(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[] { - "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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[] { @@ -113,7 +112,7 @@ public class AggregateComponent extends ControlScroller CurUnoDialog.insertLabel("lblFieldnames", new String[] { - "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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[] { @@ -128,20 +127,20 @@ public class AggregateComponent extends ControlScroller CurUnoDialog.insertButton("btnplus", SOADDROW, new ActionListenerImpl(), new String[] { - "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + "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 }, new Object[] { - oFontDescriptor, new Integer(14), "HID:" + (lastHelpIndex + 1), "+", new Integer(_iPosX + iCompWidth - 36), new Integer(iButtonPosY), IStep, new Short((curtabindex++)), new Integer(16) + oFontDescriptor, new Integer(14), HelpIds.getHelpIdString(lastHelpIndex + 1), "+", new Integer(_iPosX + iCompWidth - 36), new Integer(iButtonPosY), IStep, new Short((curtabindex++)), new Integer(16) }); CurUnoDialog.insertButton("btnminus", SOREMOVEROW, new ActionListenerImpl(), new String[] { - "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + "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 }, new Object[] { - oFontDescriptor, new Integer(14), "HID:" + (lastHelpIndex + 2), "-", new Integer(_iPosX + iCompWidth - 16), new Integer(iButtonPosY), IStep, new Short(curtabindex++), new Integer(16) + oFontDescriptor, new Integer(14), HelpIds.getHelpIdString(lastHelpIndex + 2), "-", new Integer(_iPosX + iCompWidth - 16), new Integer(iButtonPosY), IStep, new Short(curtabindex++), new Integer(16) }); CurDBMetaData.Type = getQueryType(); } @@ -153,7 +152,7 @@ public class AggregateComponent extends ControlScroller public int getQueryType() { - if (((Short) CurUnoDialog.getControlProperty("optDetailQuery", "State")).intValue() == 1) + if (((Short) CurUnoDialog.getControlProperty("optDetailQuery", PropertyNames.PROPERTY_STATE)).intValue() == 1) { return QueryMetaData.QueryType.SODETAILQUERY; } @@ -281,14 +280,14 @@ public class AggregateComponent extends ControlScroller ControlRow curcontrolrow = null; boolean biscomplete = true; CurDBMetaData.Type = getQueryType(); - CurUnoDialog.setControlProperty("btnminus", "Enabled", new Boolean((super.getTotalFieldCount() > 0) && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY))); + CurUnoDialog.setControlProperty("btnminus", PropertyNames.PROPERTY_ENABLED, new Boolean((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", "Enabled", new Boolean(biscomplete && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY))); + CurUnoDialog.setControlProperty("btnplus", PropertyNames.PROPERTY_ENABLED, new Boolean(biscomplete && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY))); togglefollowingDialogSteps(); } @@ -296,8 +295,8 @@ public class AggregateComponent extends ControlScroller { CurDBMetaData.Type = getQueryType(); boolean benableComponent = isAggregateComponentEnabled(); - CurUnoDialog.setControlProperty("lblAggregate", "Enabled", new Boolean(benableComponent)); - CurUnoDialog.setControlProperty("lblFieldnames", "Enabled", new Boolean(benableComponent)); + CurUnoDialog.setControlProperty("lblAggregate", PropertyNames.PROPERTY_ENABLED, new Boolean(benableComponent)); + CurUnoDialog.setControlProperty("lblFieldnames", PropertyNames.PROPERTY_ENABLED, new Boolean(benableComponent)); toggleButtons(); super.toggleComponent(benableComponent); super.toggleControls(benableComponent); @@ -529,21 +528,21 @@ public class AggregateComponent extends ControlScroller xFunctionListBox = CurUnoDialog.insertListBox(getFunctionControlName(index), 1, null, new ItemListenerImpl(), new String[] { - "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "StringItemList", "TabIndex", "Width" + "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 }, new Object[] { - Boolean.TRUE, new Integer(12), "HID:" + _curHelpID++, new Integer(iCompPosX + 4), new Integer(ypos), UIConsts.INVISIBLESTEP, sFunctions, new Short(curtabindex++), new Integer(88) + Boolean.TRUE, new Integer(12), HelpIds.getHelpIdString(_curHelpID++), new Integer(iCompPosX + 4), new Integer(ypos), UIConsts.INVISIBLESTEP, sFunctions, new Short(curtabindex++), new Integer(88) }); xFieldListBox = CurUnoDialog.insertListBox(getFieldsControlName(index), 1, null, new ItemListenerImpl(), new String[] { - "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width" + "Dropdown", 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[] { - Boolean.TRUE, new Integer(12), "HID:" + _curHelpID++, new Integer(iCompPosX + 98), new Integer(ypos), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(86) + Boolean.TRUE, new Integer(12), HelpIds.getHelpIdString(_curHelpID++), new Integer(iCompPosX + 98), new Integer(ypos), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(86) }); lastHelpIndex = _curHelpID - 1; } diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java index 634261145079..41062757f0cf 100644 --- a/wizards/com/sun/star/wizards/ui/ButtonList.java +++ b/wizards/com/sun/star/wizards/ui/ButtonList.java @@ -34,16 +34,17 @@ import com.sun.star.awt.XControlModel; import com.sun.star.awt.XFixedText; import com.sun.star.awt.XItemEventBroadcaster; import com.sun.star.awt.XItemListener; -// import com.sun.star.awt.XView; import com.sun.star.awt.XWindow; import com.sun.star.lang.EventObject; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.IRenderer; import com.sun.star.wizards.common.PropertySetHelper; -// import com.sun.star.wizards.ui.event.*; +import com.sun.star.wizards.common.PropertyNames; import javax.swing.ListModel; import javax.swing.event.ListDataEvent; +import com.sun.star.wizards.common.HelpIds; +import com.sun.star.wizards.common.PropertyNames; /** * @@ -121,15 +122,15 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener lblImageText = dialog.insertLabel(m_aControlName + "_imageText", new String[] { - "Height", - "HelpURL", - "Label", - "PositionX", - "PositionY", - "Step", - "TabIndex", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, "Tabstop", - "Width" + PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -149,14 +150,14 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener { final String[] pNames1 = new String[] { - "Height", - "HelpURL", - "PositionX", - "PositionY", - "Step", - "TabIndex", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, "Tabstop", - "Width" + PropertyNames.PROPERTY_WIDTH }; final Integer btnSize = Integer.valueOf(14); @@ -165,7 +166,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener btnBack = dialog.insertButton(m_aControlName + "_btnBack", "prevPage", this, pNames1, new Object[] { btnSize, - "HID:" + helpURL++, + HelpIds.getHelpIdString(helpURL++), Integer.valueOf(pos.Width), Integer.valueOf(pos.Height + (m_aButtonSize.Height + gap.Height) * rows + gap.Height + imageTextHeight + 1), step, @@ -177,7 +178,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener btnNext = dialog.insertButton(m_aControlName + "_btnNext", "nextPage", this, pNames1, new Object[] { btnSize, - "HID:" + helpURL++, + HelpIds.getHelpIdString(helpURL++), Integer.valueOf(pos.Width + (m_aButtonSize.Width + gap.Width) * cols + gap.Width - btnSize.intValue() + 1), Integer.valueOf(pos.Height + (m_aButtonSize.Height + gap.Height) * rows + gap.Height + imageTextHeight + 1), step, @@ -199,8 +200,8 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener }); Helper.setUnoPropertyValue(getModel(lblCounter), "Align", new Short((short) 1)); - Helper.setUnoPropertyValue(getModel(btnBack), "Label", "<"); - Helper.setUnoPropertyValue(getModel(btnNext), "Label", ">"); + Helper.setUnoPropertyValue(getModel(btnBack), PropertyNames.PROPERTY_LABEL, "<"); + Helper.setUnoPropertyValue(getModel(btnNext), PropertyNames.PROPERTY_LABEL, ">"); } @@ -239,24 +240,24 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener { /* "Border", */ /* "BackgroundColor", */ - "Height", - "HelpURL", - /* "Label", */ - "PositionX", - "PositionY", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + /* PropertyNames.PROPERTY_LABEL, */ + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, /* "ScaleImage", */ - "Step", - "TabIndex", + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, "Tabstop", "Toggle", - "Width" + PropertyNames.PROPERTY_WIDTH }, new Object[] { /* Short.valueOf((short) 1), */ /* NO_BORDER, */ /* BACKGROUND_COLOR, */ m_aButtonHeight, - "HID:" + helpURL++, + HelpIds.getHelpIdString(helpURL++), /* "Test", */ Integer.valueOf(nButtonX), Integer.valueOf(nButtonY), @@ -307,16 +308,16 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener { if (oResources.length == 1) { - Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "ImageURL", (String) oResources[0]); + Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, (String) oResources[0]); } else if (oResources.length == 2) { oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResources[0], oResources[1]); -// Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "ImageURL", oResources[0]); +// Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]); } boolean bTabStop = Boolean.TRUE; // focusable ? Boolean.TRUE : Boolean.FALSE; Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "Tabstop", bTabStop); - // Object aEnabled = Helper.getUnoPropertyValue(m_aButtons[i].getModel(), "Enabled"); + // Object aEnabled = Helper.getUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_ENABLED); if (refreshOverNull) { setVisible(m_aButtons[i], true); @@ -329,7 +330,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private void refreshCounterText() { - Helper.setUnoPropertyValue(getModel(lblCounter), "Label", counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize()))); + Helper.setUnoPropertyValue(getModel(lblCounter), PropertyNames.PROPERTY_LABEL, counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize()))); } private int pageEnd() @@ -675,7 +676,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener { Object item = m_nCurrentSelection >= 0 ? getListModel().getElementAt(m_nCurrentSelection) : null; final String sText = " " + renderer.render(item); - Helper.setUnoPropertyValue(getModel(lblImageText), "Label", sText); + Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, sText); } /** @@ -724,7 +725,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener private void enable(Object control, Boolean enable) { - Helper.setUnoPropertyValue(getModel(control), "Enabled", enable); + Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enable); } private Object getModel(Object control) @@ -859,12 +860,12 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener if (i == m_nCurrentSelection) { final short one = 1; - aHelper.setPropertyValueDontThrow("State", Short.valueOf(one)); + aHelper.setPropertyValueDontThrow(PropertyNames.PROPERTY_STATE, Short.valueOf(one)); } else { final short zero = 0; - aHelper.setPropertyValueDontThrow("State", Short.valueOf(zero)); + aHelper.setPropertyValueDontThrow(PropertyNames.PROPERTY_STATE, Short.valueOf(zero)); } } } @@ -882,15 +883,15 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener XControlModel xModel = (XControlModel)UnoDialog2.getModel(actionEvent.Source); PropertySetHelper aHelper = new PropertySetHelper(xModel); - int nState = aHelper.getPropertyValueAsInteger("State", -1); + int nState = aHelper.getPropertyValueAsInteger(PropertyNames.PROPERTY_STATE, -1); if (nState == 0) { // this will avoid a wrong state, if already pressed. - aHelper.setPropertyValueDontThrow("State", Short.valueOf((short)1)); + aHelper.setPropertyValueDontThrow(PropertyNames.PROPERTY_STATE, Short.valueOf((short)1)); } // check which Button is pressed. - String sControlName = aHelper.getPropertyValueAsString("Name", ""); + String sControlName = aHelper.getPropertyValueAsString(PropertyNames.PROPERTY_NAME, ""); final String sButton = sControlName.substring(7 + m_aControlName.length()); int nButton = new Integer(sButton).intValue(); diff --git a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java index ddca1039706a..5a2457a18d76 100644 --- a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java @@ -138,7 +138,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator xlblTable = CurUnoDialog.insertLabel(sTableLabelName, new String[] { - "Enabled", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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[] { @@ -148,11 +148,11 @@ public class CommandFieldSelection extends FieldSelection implements Comparator xTableListBox = CurUnoDialog.insertListBox(sTableListBoxName, 0, null, new ItemListenerImpl(), new String[] { - "Dropdown", "Enabled", "Height", "HelpURL", "LineCount", "PositionX", "PositionY", "Step", "TabIndex", "Width" + "Dropdown", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - Boolean.TRUE, Boolean.FALSE, new Integer(12), "HID:" + (super.FirstHelpIndex - 1), new Short(UnoDialog.getListBoxLineCount()), new Integer(95), new Integer(37), IStep, new Short((short) 4), getListboxWidth() + 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() }); // XWindow xTableListBoxWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xTableListBox); fillupCommandListBox(); @@ -366,8 +366,8 @@ public class CommandFieldSelection extends FieldSelection implements Comparator public void toggleCommandListBox(boolean _bdoenable) { - Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "Enabled", new Boolean(_bdoenable)); - Helper.setUnoPropertyValue(UnoDialog.getModel(xlblTable), "Enabled", new Boolean(_bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); + Helper.setUnoPropertyValue(UnoDialog.getModel(xlblTable), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); } public String getSelectedCommandName() diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.java b/wizards/com/sun/star/wizards/ui/ControlScroller.java index f42fe81134a9..b2a736fcfb0a 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.java +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.java @@ -32,6 +32,7 @@ import com.sun.star.beans.*; import com.sun.star.awt.*; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.wizards.common.*; +import com.sun.star.wizards.common.HelpIds; import java.util.*; @@ -117,7 +118,7 @@ public abstract class ControlScroller oImgControl = CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlImageControlModel", "imgBackground" + sIncSuffix, new String[] { - "Border", "Height", "PositionX", "PositionY", "Step", "Width" + "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -129,11 +130,11 @@ public abstract class ControlScroller new AdjustmentListenerImpl(), new String[] { - "Border", "Enabled", "Height", "HelpURL", "Orientation", "PositionX", "PositionY", "Step", "Width" + "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 }, new Object[] { - new Short((short) 0), new Boolean(true), new Integer(ScrollHeight), "HID:" + curHelpIndex, new Integer(ScrollBarOrientation.VERTICAL), new Integer(iCompPosX + iCompWidth - iScrollBarWidth - 1), new Integer(iCompPosY + 1), IStep, new Integer(iScrollBarWidth) + 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) }); scrollfields = new Vector(); int ypos = iStartPosY + SORELFIRSTPOSY; @@ -177,7 +178,7 @@ public abstract class ControlScroller { Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[] { - "Enabled", "BlockIncrement", "LineIncrement", "ScrollValue", "ScrollValueMax" + PropertyNames.PROPERTY_ENABLED, "BlockIncrement", "LineIncrement", "ScrollValue", "ScrollValueMax" }, new Object[] { Boolean.TRUE, new Integer(nblockincrement), new Integer(nlineincrement), new Integer(nscrollvalue), new Integer(ntotfieldcount - nblockincrement) @@ -187,7 +188,7 @@ public abstract class ControlScroller { Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[] { - "Enabled", "ScrollValue" + PropertyNames.PROPERTY_ENABLED, "ScrollValue" }, new Object[] { Boolean.FALSE, new Integer(nscrollvalue) @@ -285,7 +286,7 @@ public abstract class ControlScroller { Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[] { - "Enabled", "ScrollValueMax" + PropertyNames.PROPERTY_ENABLED, "ScrollValueMax" }, new Object[] { Boolean.TRUE, new Integer(ntotfieldcount - nblockincrement) @@ -293,14 +294,14 @@ public abstract class ControlScroller } else { - Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), "Enabled", Boolean.FALSE); + Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); } } protected void toggleComponent(boolean _bdoenable) { boolean bdoenable = _bdoenable && (ntotfieldcount > nblockincrement); - CurUnoDialog.setControlProperty("TitleScrollBar" + sIncSuffix, "Enabled", new Boolean(bdoenable)); + CurUnoDialog.setControlProperty("TitleScrollBar" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable)); } protected void toggleControls(boolean _bdoenable) @@ -311,7 +312,7 @@ public abstract class ControlScroller for (int m = 0; m < curproperties.length; m++) { PropertyValue curproperty = curproperties[m]; - CurUnoDialog.setControlProperty(curproperty.Name, "Enabled", new Boolean(_bdoenable)); + CurUnoDialog.setControlProperty(curproperty.Name, PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable)); } } @@ -339,7 +340,7 @@ public abstract class ControlScroller this.nblockincrement = _nblockincrement; Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[] { - "Enabled", "BlockIncrement", "ScrollValueMax" + PropertyNames.PROPERTY_ENABLED, "BlockIncrement", "ScrollValueMax" }, new Object[] { new Boolean(ntotfieldcount > nblockincrement), new Integer(nblockincrement), new Integer(ntotfieldcount - nblockincrement) diff --git a/wizards/com/sun/star/wizards/ui/FieldSelection.java b/wizards/com/sun/star/wizards/ui/FieldSelection.java index 803f85948721..6ec242243adb 100644 --- a/wizards/com/sun/star/wizards/ui/FieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/FieldSelection.java @@ -28,7 +28,7 @@ package com.sun.star.wizards.ui; import com.sun.star.awt.FontDescriptor; import com.sun.star.awt.XListBox; -// import com.sun.star.wizards.common.*; +import com.sun.star.wizards.common.*; import com.sun.star.wizards.common.JavaTools; import java.util.*; @@ -78,7 +78,7 @@ public class FieldSelection public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject) { // int iPos; - com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", Boolean.FALSE); + com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); switch (iKey) { @@ -93,7 +93,7 @@ public class FieldSelection default: break; } - com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", Boolean.TRUE); + com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); } public void disposing(com.sun.star.lang.EventObject eventObject) @@ -226,7 +226,7 @@ public class FieldSelection CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblFields" + sIncSuffix, new String[] { - "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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[] { @@ -237,21 +237,21 @@ public class FieldSelection xFieldsListBox = CurUnoDialog.insertListBox("lstFields" + sIncSuffix, SOFLDSLST, new ActionListenerImpl(), new ItemListenerImpl(), new String[] { - "Height", "HelpURL", "MultiSelection", "PositionX", "PositionY", "Step", "TabIndex", "Width" + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "MultiSelection", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - ListBoxHeight, "HID:" + Integer.toString(_FirstHelpIndex), Boolean.TRUE, new Integer(CompPosX), ListBoxPosY, IStep, new Short((curtabindex++)), ListBoxWidth + ListBoxHeight, HelpIds.getHelpIdString(_FirstHelpIndex), Boolean.TRUE, new Integer(CompPosX), ListBoxPosY, IStep, new Short((curtabindex++)), ListBoxWidth }); Object btnmoveselected = CurUnoDialog.insertButton("cmdMoveSelected" + sIncSuffix, SOCMDMOVESEL, new ActionListenerImpl(), new String[] { - "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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[] { - Boolean.FALSE, new Integer(14), "HID:" + Integer.toString(_FirstHelpIndex + 1), ">", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 1), ">", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); if (bshowFourButtons == true) @@ -259,21 +259,21 @@ public class FieldSelection btnmoveall = CurUnoDialog.insertButton("cmdMoveAll" + sIncSuffix, SOCMDMOVEALL, new ActionListenerImpl(), new String[] { - "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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 Integer(14), "HID:" + Integer.toString(_FirstHelpIndex + 2), ">>", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 2), ">>", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); } Object btnremoveselected = CurUnoDialog.insertButton("cmdRemoveSelected" + sIncSuffix, SOCMDREMOVESEL, new ActionListenerImpl(), new String[] { - "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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[] { - Boolean.FALSE, new Integer(14), "HID:" + Integer.toString(_FirstHelpIndex + 3), "<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 3), "<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); if (bshowFourButtons == true) @@ -281,11 +281,11 @@ public class FieldSelection btnremoveall = CurUnoDialog.insertButton("cmdRemoveAll" + sIncSuffix, SOCMDREMOVEALL, new ActionListenerImpl(), new String[] { - "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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 Integer(14), "HID:" + Integer.toString(_FirstHelpIndex + 4), "<<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth + new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 4), "<<", cmdShiftButtonPosX, ShiftButtonPosY[a++], IStep, new Short(curtabindex++), CmdButtonWidth }); } @@ -296,7 +296,7 @@ public class FieldSelection CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblSelFields" + sIncSuffix, new String[] { - "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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[] { @@ -307,31 +307,31 @@ public class FieldSelection xSelectedFieldsListBox = CurUnoDialog.insertListBox("lstSelFields" + sIncSuffix, SOSELFLDSLST, new ActionListenerImpl(), new ItemListenerImpl(), new String[] { - "Height", "HelpURL", "MultiSelection", "PositionX", "PositionY", "Step", "TabIndex", "Width" + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "MultiSelection", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { - ListBoxHeight, "HID:" + Integer.toString(_FirstHelpIndex + 5), Boolean.TRUE, SelListBoxPosX, ListBoxPosY, IStep, new Short(curtabindex++), ListBoxWidth + ListBoxHeight, HelpIds.getHelpIdString(_FirstHelpIndex + 5), Boolean.TRUE, SelListBoxPosX, ListBoxPosY, IStep, new Short(curtabindex++), ListBoxWidth }); Object btnmoveup = CurUnoDialog.insertButton("cmdMoveUp" + sIncSuffix, SOCMDMOVEUP, new ActionListenerImpl(), new String[] { - "Enabled", "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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 }, new Object[] { - Boolean.FALSE, oFontDesc, new Integer(14), "HID:" + Integer.toString(_FirstHelpIndex + 6), String.valueOf((char) 8743), cmdMoveButtonPosX, MoveButtonPosY[0], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, oFontDesc, new Integer(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[] { - "Enabled", "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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 }, new Object[] { - Boolean.FALSE, oFontDesc, new Integer(14), "HID:" + Integer.toString(_FirstHelpIndex + 7), String.valueOf((char) 8744), cmdMoveButtonPosX, MoveButtonPosY[1], IStep, new Short(curtabindex++), CmdButtonWidth + Boolean.FALSE, oFontDesc, new Integer(14), HelpIds.getHelpIdString(_FirstHelpIndex + 7), String.valueOf((char) 8744), cmdMoveButtonPosX, MoveButtonPosY[1], IStep, new Short(curtabindex++), CmdButtonWidth }); CurUnoDialog.getPeerConfiguration().setAccessibleName(btnmoveselected, AccessTextMoveSelected); @@ -422,10 +422,10 @@ public class FieldSelection { try { - CurUnoDialog.setControlProperty("lblFields" + sIncSuffix, "Enabled", BDoEnable); - CurUnoDialog.setControlProperty("lblSelFields" + sIncSuffix, "Enabled", BDoEnable); - CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, "Enabled", BDoEnable); - CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, "Enabled", BDoEnable); + CurUnoDialog.setControlProperty("lblFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); + CurUnoDialog.setControlProperty("lblSelFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); + CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); + CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); if (BDoEnable.booleanValue() == true) { @@ -433,8 +433,8 @@ public class FieldSelection } else { - CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, "Enabled", BDoEnable); - CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, "Enabled", BDoEnable); + CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); + CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable); toggleMoveButtons(BDoEnable.booleanValue(), BDoEnable.booleanValue()); } } @@ -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, "Enabled", new Boolean(SelectCount >= 1)); - CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, "Enabled", new Boolean(bSelectSelected)); + CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(SelectCount >= 1)); + CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bSelectSelected)); toggleMoveButtons((FieldCount >= 1), bIsFieldSelected); - CurUnoDialog.setControlProperty("cmdMoveUp" + sIncSuffix, "Enabled", new Boolean(bmoveUpenabled)); - CurUnoDialog.setControlProperty("cmdMoveDown" + sIncSuffix, "Enabled", new Boolean(bmoveDownenabled)); + CurUnoDialog.setControlProperty("cmdMoveUp" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bmoveUpenabled)); + CurUnoDialog.setControlProperty("cmdMoveDown" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(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, "Enabled", new Boolean(btoggleMoveAll)); - CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, "Enabled", new Boolean(btoggleMoveSelected)); + CurUnoDialog.setControlProperty("cmdMoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(btoggleMoveAll)); + CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(btoggleMoveSelected)); } public void setMultipleMode(boolean _bisMultiple) diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java index 50b855ab3693..8dfc12e21fb3 100644 --- a/wizards/com/sun/star/wizards/ui/FilterComponent.java +++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java @@ -50,7 +50,9 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.wizards.common.NumberFormatter; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.HelpIds; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.db.FieldColumn; import com.sun.star.wizards.db.QueryMetaData; import com.sun.star.wizards.db.SQLQueryComposer; @@ -110,6 +112,7 @@ public class FilterComponent final int SO_THIRDBOOLFIELDNAME = 256 + 3; final int SO_FOURTHBOOLFIELDNAME = 256 + 4; int SO_BOOLEANLIST[] = + { SO_FIRSTBOOLFIELDNAME, SO_SECONDBOOLFIELDNAME, SO_THIRDBOOLFIELDNAME, SO_FOURTHBOOLFIELDNAME }; @@ -120,6 +123,7 @@ public class FilterComponent class ItemListenerImpl implements com.sun.star.awt.XItemListener { + public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject) { int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); @@ -220,7 +224,7 @@ public class FilterComponent { XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, _oSourceevent); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel()); - final String sName = AnyConverter.toString(xPSet.getPropertyValue("Name")); + final String sName = AnyConverter.toString(xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME)); return sName; } catch (Exception e) @@ -244,11 +248,11 @@ public class FilterComponent final XPropertyContainer column = (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, oQueryMetaData.xMSF.createInstance(serviceName)); column.addProperty("Type", PropertyAttribute.BOUND, DataType.VARCHAR); - column.addProperty("Name", PropertyAttribute.BOUND, ""); - column.addProperty("Value", (short)( PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE ), null ); + column.addProperty(PropertyNames.PROPERTY_NAME, PropertyAttribute.BOUND, ""); + column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), null); final XPropertySet columnSet = UnoRuntime.queryInterface(XPropertySet.class, column); - if ( composer.getQuery().length() == 0) + if (composer.getQuery().length() == 0) { final String fromClause = composer.getFromClause(); StringBuilder sql = new StringBuilder(); @@ -257,7 +261,9 @@ public class FilterComponent sql.append(fromClause); composer.getQueryComposer().setElementaryQuery(sql.toString()); } - composer.getQueryComposer().setStructuredFilter( new PropertyValue[][] {} ); + composer.getQueryComposer().setStructuredFilter(new PropertyValue[][] + { + }); for (int i = 0; i < RowCount; i++) { ControlRow currentControlRow = oControlRows[i]; @@ -268,30 +274,31 @@ public class FilterComponent String sFieldName = currentControlRow.getSelectedFieldName(); int nOperator = (int) currentControlRow.getSelectedOperator(); FieldColumn aFieldColumn = oQueryMetaData.getFieldColumnByDisplayName(sFieldName); - columnSet.setPropertyValue("Name", aFieldColumn.getFieldName()); + columnSet.setPropertyValue(PropertyNames.PROPERTY_NAME, aFieldColumn.getFieldName()); columnSet.setPropertyValue("Type", aFieldColumn.getXColumnPropertySet().getPropertyValue("Type")); Object value = currentControlRow.getValue(); - switch(aFieldColumn.getFieldType()) + switch (aFieldColumn.getFieldType()) { case DataType.TIMESTAMP: case DataType.DATE: - value = ((Double)value) - oQueryMetaData.getNullDateCorrection(); + value = ((Double) value) - oQueryMetaData.getNullDateCorrection(); break; } - column.removeProperty( "Value" ); + column.removeProperty("Value"); final short operator = currentControlRow.getSelectedOperator(); - if ( ( operator == SQLFilterOperator.SQLNULL ) - || ( operator == SQLFilterOperator.NOT_SQLNULL ) - || AnyConverter.isVoid( value ) - ) + 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 ); + 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 ); + { + column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), value); + } columnSet.setPropertyValue("Value", value); - composer.getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL,nOperator); + composer.getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL, nOperator); } } } @@ -303,7 +310,9 @@ public class FilterComponent String smsgDuplicateCondition = getDisplayCondition(sDuplicateCondition, aduplicatecondition, null); CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, smsgDuplicateCondition); CurUnoDialog.vetoableChange(new java.beans.PropertyChangeEvent(CurUnoDialog, "Steps", Integer.valueOf(1), Integer.valueOf(2))); - return new PropertyValue[][]{}; + return new PropertyValue[][] + { + }; } } catch (Exception ex) @@ -333,10 +342,12 @@ 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 = ""; - if (!AnyConverter.isVoid(_filtercondition.Value)) + if ((_filtercondition.Handle != SQLFilterOperator.SQLNULL) + && (_filtercondition.Handle != SQLFilterOperator.NOT_SQLNULL) + && !AnyConverter.isVoid(_filtercondition.Value)) { sDisplayValue = AnyConverter.toString(_filtercondition.Value); } @@ -418,20 +429,20 @@ public class FilterComponent CurUnoDialog.insertRadioButton("optMatchAll" + sIncSuffix, SOOPTANDMODE, new ItemListenerImpl(), new String[] { - "Height", - "HelpURL", - "Label", - "PositionX", - "PositionY", - "State", - "Step", - "TabIndex", - "Width" + 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 }, new Object[] { Integer.valueOf(9), - "HID:" + curHelpID++, + HelpIds.getHelpIdString(curHelpID++), soptMatchAll, Integer.valueOf(iPosX), Integer.valueOf(iPosY), @@ -443,19 +454,19 @@ public class FilterComponent optMatchAny = CurUnoDialog.insertRadioButton("optMatchAny" + sIncSuffix, SOOPTORMODE, new ItemListenerImpl(), new String[] { - "Height", - "HelpURL", - "Label", - "PositionX", - "PositionY", - "Step", - "TabIndex", - "Width" + 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[] { Integer.valueOf(9), - "HID:" + curHelpID++, + HelpIds.getHelpIdString(curHelpID++), soptMatchAny, Integer.valueOf(iPosX), Integer.valueOf(iPosY + 12), @@ -530,6 +541,7 @@ public class FilterComponent // ------------------------------------------------------------------------- final class ControlRow { + private final static int SOLSTFIELDNAME = 3; private final static int SOLSTOPERATOR = 4; private final static int SOTXTVALUE = 5; @@ -557,14 +569,14 @@ public class FilterComponent ControlElements[0] = (XInterface) CurUnoDialog.insertLabel("lblFieldNames" + sCompSuffix, new String[] { - "Enabled", - "Height", - "Label", - "PositionX", - "PositionY", - "Step", - "TabIndex", - "Width" + 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[] { @@ -582,14 +594,14 @@ public class FilterComponent ControlElements[1] = (XInterface) CurUnoDialog.insertLabel("lblOperators" + sCompSuffix, new String[] { - "Enabled", - "Height", - "Label", - "PositionX", - "PositionY", - "Step", - "TabIndex", - "Width" + 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[] { @@ -607,14 +619,14 @@ public class FilterComponent ControlElements[2] = (XInterface) CurUnoDialog.insertLabel("lblValue" + sCompSuffix, new String[] { - "Enabled", - "Height", - "Label", - "PositionX", - "PositionY", - "Step", - "TabIndex", - "Width" + 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[] { @@ -632,23 +644,23 @@ public class FilterComponent ControlElements[SOLSTFIELDNAME] = (XInterface) CurUnoDialog.insertListBox("lstFieldName" + sCompSuffix, SO_FIELDNAMELIST[Index], null, new ItemListenerImpl(), new String[] { - "Enabled", + PropertyNames.PROPERTY_ENABLED, "Dropdown", - "Height", - "HelpURL", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, "LineCount", - "PositionX", - "PositionY", - "Step", - "TabIndex", - "Width" + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH }, new Object[] { Boolean.valueOf(isEnabled()), Boolean.TRUE, Integer.valueOf(13), - "HID:" + _firstRowHelpID++, + HelpIds.getHelpIdString(_firstRowHelpID++), Short.valueOf(UnoDialog.getListBoxLineCount() /* 7 */), Integer.valueOf(nPosX1), Integer.valueOf(iCompPosY + 23), @@ -661,24 +673,24 @@ public class FilterComponent ControlElements[SOLSTOPERATOR] = (XInterface) CurUnoDialog.insertListBox("lstOperator" + sCompSuffix, SO_CONDITIONLIST[Index], null, new ItemListenerImpl(), new String[] { - "Enabled", + PropertyNames.PROPERTY_ENABLED, "Dropdown", - "Height", - "HelpURL", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, "LineCount", - "PositionX", - "PositionY", - "Step", + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, "StringItemList", - "TabIndex", - "Width" + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH }, new Object[] { Boolean.valueOf(isEnabled()), Boolean.TRUE, Integer.valueOf(13), - "HID:" + _firstRowHelpID++, + HelpIds.getHelpIdString(_firstRowHelpID++), Short.valueOf((short) sLogicOperators.length /* 7 */), Integer.valueOf(nPosX2), Integer.valueOf(iCompPosY + 23), @@ -690,20 +702,20 @@ public class FilterComponent ControlElements[SOTXTVALUE] = (XInterface) CurUnoDialog.insertFormattedField("txtValue" + sCompSuffix, SO_TEXTFIELDLIST[Index], new TextListenerImpl(), new String[] { - "Enabled", - "Height", - "HelpURL", - "PositionX", - "PositionY", - "Step", - "TabIndex", - "Width" + 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[] { Boolean.valueOf(isEnabled()), Integer.valueOf(13), - "HID:" + _firstRowHelpID++, + HelpIds.getHelpIdString(_firstRowHelpID++), Integer.valueOf(nPosX3), Integer.valueOf(iCompPosY + 23), IStep, @@ -735,16 +747,16 @@ public class FilterComponent { // disable value field - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), "Enabled", Boolean.FALSE); - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "Enabled", Boolean.FALSE); + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); return true; } else { // enable value field - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), "Enabled", Boolean.TRUE); - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "Enabled", Boolean.TRUE); + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), PropertyNames.PROPERTY_ENABLED, Boolean.TRUE); } if (nSelOperator != -1) { @@ -848,7 +860,7 @@ public class FilterComponent // enable all Controls Fieldname, operator, value for (int i = 0; i < ControlElements.length; i++) { - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[i]), "Enabled", Boolean.valueOf(_bEnabled)); + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[i]), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bEnabled)); } m_bEnabled = _bEnabled; if (isEnabled()) diff --git a/wizards/com/sun/star/wizards/ui/ImageList.java b/wizards/com/sun/star/wizards/ui/ImageList.java index dcd378369c5f..9d42aa45599e 100644 --- a/wizards/com/sun/star/wizards/ui/ImageList.java +++ b/wizards/com/sun/star/wizards/ui/ImageList.java @@ -43,7 +43,9 @@ import com.sun.star.awt.XWindow; import com.sun.star.lang.EventObject; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.HelpIds; import com.sun.star.wizards.common.IRenderer; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.ui.event.*; @@ -162,11 +164,11 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener { "BackgroundColor", "Border", - "Height", - "PositionX", - "PositionY", - "Step", - "Width" + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -189,7 +191,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener //XWindow win = (XWindow)UnoRuntime.queryInterface(XWindow.class,lblContainer); /*dialog.xWindow.addWindowListener(uiEventListener); - String dName = (String)Helper.getUnoPropertyValue(dialog.xDialogModel,"Name"); + String dName = (String)Helper.getUnoPropertyValue(dialog.xDialogModel,PropertyNames.PROPERTY_NAME); uiEventListener.add(dName,EventNames.EVENT_WINDOW_SHOWN,"disableContainerMouseEvents",this); */ @@ -201,12 +203,12 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener { "BackgroundColor", "Border", - "Height", - "PositionX", - "PositionY", - "Step", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, "Tabstop", - "Width" + PropertyNames.PROPERTY_WIDTH }, new Object[] { TRANSPARENT, @@ -225,14 +227,14 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener final String[] pNames1 = new String[] { - "Height", - "HelpURL", - "PositionX", - "PositionY", - "Step", - "TabIndex", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, "Tabstop", - "Width" + PropertyNames.PROPERTY_WIDTH }; lblImageText = dialog.insertLabel(name + "_imageText", pNames1, new Object[] @@ -255,7 +257,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener btnBack = dialog.insertButton(name + "_btnBack", "prevPage", this, pNames1, new Object[] { btnSize, - "HID:" + helpURL++, + HelpIds.getHelpIdString(helpURL++), new Integer(pos.Width), new Integer(pos.Height + (imageSize.Height + gap.Height) * rows + gap.Height + imageTextHeight + 1), step, @@ -267,7 +269,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener btnNext = dialog.insertButton(name + "_btnNext", "nextPage", this, pNames1, new Object[] { btnSize, - "HID:" + helpURL++, + HelpIds.getHelpIdString(helpURL++), new Integer(pos.Width + (imageSize.Width + gap.Width) * cols + gap.Width - btnSize.intValue() + 1), new Integer(pos.Height + (imageSize.Height + gap.Height) * rows + gap.Height + imageTextHeight + 1), step, @@ -289,8 +291,8 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener }); Helper.setUnoPropertyValue(getModel(lblCounter), "Align", new Short((short) 1)); - Helper.setUnoPropertyValue(getModel(btnBack), "Label", "<"); - Helper.setUnoPropertyValue(getModel(btnNext), "Label", ">"); + Helper.setUnoPropertyValue(getModel(btnBack), PropertyNames.PROPERTY_LABEL, "<"); + Helper.setUnoPropertyValue(getModel(btnNext), PropertyNames.PROPERTY_LABEL, ">"); } @@ -331,15 +333,15 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener { "Border", "BackgroundColor", - "Height", - "HelpURL", - "PositionX", - "PositionY", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", - "Step", - "TabIndex", + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, "Tabstop", - "Width" + PropertyNames.PROPERTY_WIDTH }; //used for optimization private Short m_tabIndex; @@ -354,7 +356,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener NO_BORDER, BACKGROUND_COLOR, m_imageHeight, - "HID:" + helpURL++, + HelpIds.getHelpIdString(helpURL++), new Integer(getImagePosX(_col)), new Integer(getImagePosY(_row)), scaleImages, @@ -406,7 +408,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener { if (oResources.length == 1) { - Helper.setUnoPropertyValue(m_aImages[i].getModel(), "ImageURL", (String) oResources[0]); + Helper.setUnoPropertyValue(m_aImages[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, (String) oResources[0]); } else if (oResources.length == 2) { @@ -425,7 +427,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private void refreshCounterText() { - Helper.setUnoPropertyValue(getModel(lblCounter), "Label", counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize()))); + Helper.setUnoPropertyValue(getModel(lblCounter), PropertyNames.PROPERTY_LABEL, counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize()))); } private int pageEnd() @@ -455,12 +457,12 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private void hideSelection() { - Helper.setUnoPropertyValue(getModel(grbxSelectedImage), "Step", HIDE_PAGE); + Helper.setUnoPropertyValue(getModel(grbxSelectedImage), PropertyNames.PROPERTY_STEP, HIDE_PAGE); setVisible(grbxSelectedImage, false); } private final static String[] MOVE_SELECTION = new String[] { - "PositionX", "PositionY", "Step" + PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP }; private Object[] MOVE_SELECTION_VALS = new Object[3]; /** Utility field holding list of ItemListeners. */ @@ -479,7 +481,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener Helper.setUnoPropertyValues(getModel(grbxSelectedImage), MOVE_SELECTION, MOVE_SELECTION_VALS); - if (((Number) Helper.getUnoPropertyValue(dialogModel, "Step")).shortValue() == step.shortValue()) + if (((Number) Helper.getUnoPropertyValue(dialogModel, PropertyNames.PROPERTY_STEP)).shortValue() == step.shortValue()) { setVisible(grbxSelectedImage, true); //now focus... } @@ -816,7 +818,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private void refreshImageText() { Object item = selected >= 0 ? getListModel().getElementAt(selected) : null; - Helper.setUnoPropertyValue(getModel(lblImageText), "Label", " " + renderer.render(item)); + Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, " " + renderer.render(item)); } /** @@ -865,7 +867,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private void enable(Object control, Boolean enable) { - Helper.setUnoPropertyValue(getModel(control), "Enabled", enable); + Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enable); } private Object getModel(Object control) @@ -900,7 +902,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener private int getImageFromEvent(Object event) { Object image = ((EventObject) event).Source; - String controlName = (String) Helper.getUnoPropertyValue(getModel(image), "Name"); + String controlName = (String) Helper.getUnoPropertyValue(getModel(image), PropertyNames.PROPERTY_NAME); return Integer.valueOf(controlName.substring(6 + name.length())).intValue(); } diff --git a/wizards/com/sun/star/wizards/ui/PathSelection.java b/wizards/com/sun/star/wizards/ui/PathSelection.java index 4cb101382c6d..6b50127017e1 100755 --- a/wizards/com/sun/star/wizards/ui/PathSelection.java +++ b/wizards/com/sun/star/wizards/ui/PathSelection.java @@ -31,6 +31,7 @@ import com.sun.star.awt.XTextComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.Exception; import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.SystemDialog; public class PathSelection @@ -77,7 +78,7 @@ public class PathSelection CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblSaveAs", new String[] { - "Enabled", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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) @@ -85,16 +86,16 @@ public class PathSelection xSaveTextBox = CurUnoDialog.insertTextField("txtSavePath", "callXPathSelectionListener", this, new String[] { - "Enabled", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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) }); //CurUnoDialog.setControlProperty("txtSavePath", "ReadOnly", Boolean.TRUE); - CurUnoDialog.setControlProperty("txtSavePath", "Enabled", Boolean.FALSE); + CurUnoDialog.setControlProperty("txtSavePath", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); CurUnoDialog.insertButton("cmdSelectPath", "triggerPathPicker", this, new String[] { - "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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) diff --git a/wizards/com/sun/star/wizards/ui/PeerConfig.java b/wizards/com/sun/star/wizards/ui/PeerConfig.java index d3871ee62a5b..19617b593bd6 100644 --- a/wizards/com/sun/star/wizards/ui/PeerConfig.java +++ b/wizards/com/sun/star/wizards/ui/PeerConfig.java @@ -33,6 +33,7 @@ import com.sun.star.lang.EventObject; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.PropertyNames; /** * @author rpiterman @@ -139,7 +140,7 @@ public class PeerConfig implements XWindowListener } if (!sImageUrl.equals("")) { - Helper.setUnoPropertyValue(aImageUrlTask.oModel, "ImageURL", sImageUrl); + Helper.setUnoPropertyValue(aImageUrlTask.oModel, PropertyNames.PROPERTY_IMAGEURL, sImageUrl); } } diff --git a/wizards/com/sun/star/wizards/ui/SortingComponent.java b/wizards/com/sun/star/wizards/ui/SortingComponent.java index 29b646d3e852..3b57ca3f670a 100644 --- a/wizards/com/sun/star/wizards/ui/SortingComponent.java +++ b/wizards/com/sun/star/wizards/ui/SortingComponent.java @@ -28,9 +28,9 @@ package com.sun.star.wizards.ui; import java.beans.PropertyChangeEvent; -import com.sun.star.wizards.common.JavaTools; import com.sun.star.wizards.common.*; import com.sun.star.awt.*; +import java.util.ArrayList; public class SortingComponent { @@ -61,10 +61,10 @@ public class SortingComponent public void itemStateChanged(ItemEvent EventObject) { - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(false)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(false)); int ikey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); enableNextSortListBox(ikey); - Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(true)); + Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(true)); } public void disposing(com.sun.star.lang.EventObject eventObject) @@ -99,34 +99,34 @@ public class SortingComponent bDoEnable = (i < 2); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lblSort" + new Integer(i + 1).toString(), new String[] { - "Enabled", "Height", "Label", "Orientation", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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 }, new Object[] { new Boolean(bDoEnable), new Integer(8), sSortHeader[i], new Integer(0), ICompPosX, new Integer(iCurPosY), IStep, new Short(curtabindex++), ICompWidth }); - HIDString = "HID:" + Integer.toString(FirstHelpIndex); + HIDString = HelpIds.getHelpIdString(FirstHelpIndex); xSortListBox[i] = CurUnoDialog.insertListBox("lstSort" + new Integer(i + 1).toString(), SOSORTLST[i], null, new ItemListenerImpl(), new String[] { - "Dropdown", "Enabled", "Height", "HelpURL", "LineCount", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width" + "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 }); //new Short((short) (17+i*4)) - HIDString = "HID:" + Integer.toString(FirstHelpIndex + 1); + HIDString = HelpIds.getHelpIdString(FirstHelpIndex + 1); XRadioButton xRadioButtonAsc = CurUnoDialog.insertRadioButton("optAscend" + Integer.toString(i + 1), 0, new String[] { - "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Tag", "Width" + 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 }); //, new Short((short) (18+i*4)) - HIDString = "HID:" + Integer.toString(FirstHelpIndex + 2); + HIDString = HelpIds.getHelpIdString(FirstHelpIndex + 2); XRadioButton xRadioButtonDesc = CurUnoDialog.insertRadioButton("optDescend" + Integer.toString(i + 1), 0, new String[] { - "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Tag", "Width" + 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 @@ -255,32 +255,26 @@ public class SortingComponent { short iCurState; String CurFieldName; - String CurFieldTitle; setMaxSortIndex(); - String[][] SortFieldNames = new String[MaxSortIndex + 1][2]; - String[] SortDescriptions = new String[MaxSortIndex + 1]; + // String[][] SortFieldNames = new String[MaxSortIndex + 1][2]; + ArrayList<String[]> SortFieldNames = new ArrayList<String[]>(); + ArrayList<String> SortDescriptions = new ArrayList<String>(); for (int i = 0; i <= MaxSortIndex; i++) { - CurFieldName = xSortListBox[i].getSelectedItem(); - SortFieldNames[i][0] = CurFieldName; - SortDescriptions[i] = CurFieldName; - iCurState = ((Short) CurUnoDialog.getControlProperty("optAscend" + new Integer(i + 1).toString(), "State")).shortValue(); - SortFieldNames[i][0] = CurFieldName; - if (iCurState == 1) + if (!((Boolean) CurUnoDialog.getControlProperty("lstSort" + (i + 1), "ReadOnly"))) { - SortFieldNames[i][1] = "ASC"; - } - else - { - SortFieldNames[i][1] = "DESC"; + 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" }); } } // When searching for a duplicate entry we can neglect wether the entries are to be sorted ascending or descending // TODO for the future we should deliver a messagebox when two different sorting modes have been applied to one field - int iduplicate = JavaTools.getDuplicateFieldIndex(SortDescriptions); + int iduplicate = JavaTools.getDuplicateFieldIndex(SortDescriptions.toArray(new String[SortDescriptions.size()])); if (iduplicate != -1) { - String sLocSortCriteriaisduplicate = JavaTools.replaceSubString(sSortCriteriaisduplicate, SortFieldNames[iduplicate][0], "<FIELDNAME>"); + 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.setFocus("lstSort" + (iduplicate + 1)); @@ -290,7 +284,7 @@ public class SortingComponent } else { - return SortFieldNames; + return SortFieldNames.toArray(new String[SortFieldNames.size()][2]); } } catch (Exception exception) @@ -314,7 +308,7 @@ public class SortingComponent 0 }); } - // xSortListBox[i+1].selectItemPos((short)0, true); + // xSortListBox[i+1].selectItemPos((short)0, true); } CurUnoDialog.setFocus("lblSort" + new Integer(CurIndex + 1)); MaxSortIndex = CurIndex - 1; @@ -363,10 +357,10 @@ public class SortingComponent { if (CurIndex < xSortListBox.length) { - CurUnoDialog.setControlProperty("lblSort" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable)); - CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable)); - CurUnoDialog.setControlProperty("optAscend" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable)); - CurUnoDialog.setControlProperty("optDescend" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable)); + 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("lstSort" + new Integer(CurIndex + 1).toString(), "SelectedItems", new short[] diff --git a/wizards/com/sun/star/wizards/ui/TitlesComponent.java b/wizards/com/sun/star/wizards/ui/TitlesComponent.java index d4091c964e14..ef9a568d2e01 100644 --- a/wizards/com/sun/star/wizards/ui/TitlesComponent.java +++ b/wizards/com/sun/star/wizards/ui/TitlesComponent.java @@ -52,14 +52,14 @@ public class TitlesComponent extends ControlScroller super(_CurUnoDialog, null, _iStep, _iCompPosX, _iCompPosY, _iCompWidth, _uitextfieldcount, 18, _firsthelpindex); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblColumnNames", new String[] { - "Height", "Label", "PositionX", "PositionY", "Step", "Width" + 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) }); CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblColumnTitles", new String[] { - "Height", "Label", "PositionX", "PositionY", "Step", "Width" + 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) @@ -107,7 +107,7 @@ public class TitlesComponent extends ControlScroller CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", slabelname, new String[] { - "Height", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width" + PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -117,11 +117,11 @@ public class TitlesComponent extends ControlScroller xTextComponent = CurUnoDialog.insertTextField(stextfieldname, 0, null, new String[] { - "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width" + 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 Integer(12), "HID:" + curHelpIndex++, new Integer(iLabelPosX + 30), new Integer(_iCompPosY), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(iCompWidth - 90 - 20) + new Integer(12), HelpIds.getHelpIdString(curHelpIndex++), new Integer(iLabelPosX + 30), new Integer(_iCompPosY), UIConsts.INVISIBLESTEP, new Short(curtabindex++), new Integer(iCompWidth - 90 - 20) }); } } @@ -158,17 +158,17 @@ public class TitlesComponent extends ControlScroller Integer TitleWidth = new Integer(iCompPosX + iCompWidth - TitlePosX.intValue() - iScrollBarWidth - 6); for (short i = 0; i <= ncurfieldcount; i++) { - CurUnoDialog.setControlProperty(getColumnName(i), "Width", FieldNameWidth); + CurUnoDialog.setControlProperty(getColumnName(i), PropertyNames.PROPERTY_WIDTH, FieldNameWidth); CurUnoDialog.setControlProperties(getTitleName(i), new String[] { - "PositionX", "Width" + PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_WIDTH }, new Object[] { TitlePosX, TitleWidth }); } - CurUnoDialog.setControlProperty("lblColumnNames", "Width", FieldNameWidth); - CurUnoDialog.setControlProperty("lblColumnTitles", "PositionX", TitlePosX); + CurUnoDialog.setControlProperty("lblColumnNames", PropertyNames.PROPERTY_WIDTH, FieldNameWidth); + CurUnoDialog.setControlProperty("lblColumnTitles", PropertyNames.PROPERTY_POSITION_X, TitlePosX); } public void initialize(String[] _fieldnames, Map _fieldtitleset) @@ -208,9 +208,9 @@ public class TitlesComponent extends ControlScroller public String getFieldNameByTitleControl(Object _fieldtitlemodel) { - String sTitleModelName = (String) Helper.getUnoPropertyValue(_fieldtitlemodel, "Name"); + String sTitleModelName = (String) Helper.getUnoPropertyValue(_fieldtitlemodel, PropertyNames.PROPERTY_NAME); String sindex = JavaTools.getSuffixNumber(sTitleModelName); - return (String) CurUnoDialog.getControlProperty(this.SOLABELPREFIX + sindex, "Label"); + return (String) CurUnoDialog.getControlProperty(this.SOLABELPREFIX + sindex, PropertyNames.PROPERTY_LABEL); } public String[] getFieldTitles() diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.java b/wizards/com/sun/star/wizards/ui/UnoDialog.java index 5a181b84c4b5..e372a843a56a 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.java @@ -112,7 +112,7 @@ public class UnoDialog implements EventNames XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel); try { - String sName = (String) xPSet.getPropertyValue("Name"); + String sName = (String) xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME); Integer KeyObject = (Integer) ControlList.get(sName); iKey = KeyObject.intValue(); } @@ -245,7 +245,7 @@ public class UnoDialog implements EventNames XControl xControl2 = xDlgContainer.getControl(ControlName); XView xView = (XView) UnoRuntime.queryInterface(XView.class, xControl2); Size aSize = xView.getSize(); - double dblMAPWidth = (double) (((Integer) Helper.getUnoPropertyValue(xControl2.getModel(), "Width")).intValue()); + double dblMAPWidth = (double) (((Integer) Helper.getUnoPropertyValue(xControl2.getModel(), PropertyNames.PROPERTY_WIDTH)).intValue()); double dblFactor = (((double) (aSize.Width)) / dblMAPWidth); return dblFactor; } @@ -308,7 +308,7 @@ public class UnoDialog implements EventNames { Object oFixedText = insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", sName, sPropNames, oPropValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFixedText); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); Object oLabel = xDlgContainer.getControl(new String(sName)); return (XFixedText) UnoRuntime.queryInterface(XFixedText.class, oLabel); } @@ -322,7 +322,7 @@ 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); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); Object objectButton = xDlgContainer.getControl( new String(sName)); XButton xButton = ( XButton ) UnoRuntime.queryInterface( XButton.class, objectButton ); xButton.addActionListener(xActionListener); @@ -335,7 +335,7 @@ public class UnoDialog implements EventNames { Object oButtonModel = insertControlModel("com.sun.star.awt.UnoControlButtonModel", sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oButtonModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); Object objectButton = xDlgContainer.getControl(new String(sName)); XButton xButton = (XButton) UnoRuntime.queryInterface(XButton.class, objectButton); if (xActionListener != null) @@ -354,7 +354,7 @@ public class UnoDialog implements EventNames { Object oButtonModel = insertControlModel("com.sun.star.awt.UnoControlCheckBoxModel", sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oButtonModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); Object objectCheckBox = xDlgContainer.getControl(new String(sName)); XCheckBox xCheckBox = (XCheckBox) UnoRuntime.queryInterface(XCheckBox.class, objectCheckBox); if (xItemListener != null) @@ -372,7 +372,7 @@ public class UnoDialog implements EventNames { Object oNumericFieldModel = insertControlModel("com.sun.star.awt.UnoControlNumericFieldModel", sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oNumericFieldModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); Object objectNumericField = xDlgContainer.getControl(new String(sName)); XTextComponent xNumericField = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, objectNumericField); if (xTextListener != null) @@ -392,7 +392,7 @@ public class UnoDialog implements EventNames { Object oScrollModel = insertControlModel("com.sun.star.awt.UnoControlScrollBarModel", sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oScrollModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); Object oScrollBar = xDlgContainer.getControl(new String(sName)); XScrollBar xScrollBar = (XScrollBar) UnoRuntime.queryInterface(XScrollBar.class, oScrollBar); if (xAdjustmentListener != null) @@ -431,7 +431,7 @@ public class UnoDialog implements EventNames { XInterface xTextModel = insertControlModel(ServiceName, sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); XControl xTextField = xDlgContainer.getControl(new String(sName)); XTextComponent xTextBox = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xTextField); if (xTextListener != null) @@ -453,7 +453,7 @@ public class UnoDialog implements EventNames { XInterface xListBoxModel = insertControlModel("com.sun.star.awt.UnoControlListBoxModel", sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xListBoxModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); XControl xControlListBox = xDlgContainer.getControl(new String(sName)); XListBox xListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, xControlListBox); if (xItemListener != null) @@ -473,7 +473,7 @@ public class UnoDialog implements EventNames { XInterface xComboBoxModel = insertControlModel("com.sun.star.awt.UnoControlComboBoxModel", sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xComboBoxModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); XControl xControlComboBox = xDlgContainer.getControl(new String(sName)); XComboBox xComboBox = (XComboBox) UnoRuntime.queryInterface(XComboBox.class, xControlComboBox); if (xItemListener != null) @@ -545,7 +545,7 @@ public class UnoDialog implements EventNames { XInterface oRadioButtonModel = insertControlModel("com.sun.star.awt.UnoControlRadioButtonModel", sName, sProperties, sValues); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRadioButtonModel); - xPSet.setPropertyValue("Name", sName); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); XControl xControlRadioButton = xDlgContainer.getControl(new String(sName)); XRadioButton xRadioButton = (XRadioButton) UnoRuntime.queryInterface(XRadioButton.class, xControlRadioButton); return xRadioButton; @@ -560,7 +560,7 @@ public class UnoDialog implements EventNames /** * @author bc93774 * The problem with setting the visibility of controls is that changing the current step - * of a dialog will automatically make all controls visible. The "Step" property always wins against + * of a dialog will automatically make all controls visible. The PropertyNames.PROPERTY_STEP property always wins against * the property "visible". Therfor a control meant to be invisible is placed on a step far far away. * @param the name of the control * @param iStep change the step if you want to make the control invisible @@ -569,8 +569,8 @@ public class UnoDialog implements EventNames { try { - int iCurStep = AnyConverter.toInt(getControlProperty(controlname, "Step")); - setControlProperty(controlname, "Step", new Integer(iStep)); + int iCurStep = AnyConverter.toInt(getControlProperty(controlname, PropertyNames.PROPERTY_STEP)); + setControlProperty(controlname, PropertyNames.PROPERTY_STEP, new Integer(iStep)); } catch (com.sun.star.uno.Exception exception) { @@ -581,7 +581,7 @@ public class UnoDialog implements EventNames /** * @author bc93774 * The problem with setting the visibility of controls is that changing the current step - * of a dialog will automatically make all controls visible. The "Step" property always wins against + * of a dialog will automatically make all controls visible. The PropertyNames.PROPERTY_STEP property always wins against * the property "visible". Therfor a control meant to be invisible is placed on a step far far away. * Afterwards the step property of the dialog has to be set with "repaintDialogStep". As the performance * of that method is very bad it should be used only once for all controls @@ -592,16 +592,16 @@ public class UnoDialog implements EventNames { try { - int iCurControlStep = AnyConverter.toInt(getControlProperty(controlname, "Step")); - int iCurDialogStep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, "Step")); + int iCurControlStep = AnyConverter.toInt(getControlProperty(controlname, PropertyNames.PROPERTY_STEP)); + int iCurDialogStep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_STEP)); int iNewStep; if (bIsVisible) { - setControlProperty(controlname, "Step", new Integer(iCurDialogStep)); + setControlProperty(controlname, PropertyNames.PROPERTY_STEP, new Integer(iCurDialogStep)); } else { - setControlProperty(controlname, "Step", UIConsts.INVISIBLESTEP); + setControlProperty(controlname, PropertyNames.PROPERTY_STEP, UIConsts.INVISIBLESTEP); } } catch (com.sun.star.uno.Exception exception) @@ -618,9 +618,9 @@ public class UnoDialog implements EventNames { try { - int ncurstep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, "Step")); - Helper.setUnoPropertyValue(xDialogModel, "Step", new Integer(99)); - Helper.setUnoPropertyValue(xDialogModel, "Step", new Integer(ncurstep)); + 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, new Integer(ncurstep)); } catch (com.sun.star.uno.Exception exception) { @@ -892,7 +892,7 @@ public class UnoDialog implements EventNames public static void setEnabled(Object control, Boolean enabled) { - Helper.setUnoPropertyValue(getModel(control), "Enabled", enabled); + Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enabled); } /** @@ -1004,11 +1004,11 @@ public class UnoDialog implements EventNames switch (itype) { case UIConsts.CONTROLTYPE.FIXEDTEXT: - return "Label"; + return PropertyNames.PROPERTY_LABEL; case UIConsts.CONTROLTYPE.BUTTON: - return "Label"; + return PropertyNames.PROPERTY_LABEL; case UIConsts.CONTROLTYPE.FIXEDLINE: - return "Label"; + return PropertyNames.PROPERTY_LABEL; case UIConsts.CONTROLTYPE.NUMERICFIELD: return "Value"; case UIConsts.CONTROLTYPE.CURRENCYFIELD: @@ -1024,11 +1024,11 @@ public class UnoDialog implements EventNames case UIConsts.CONTROLTYPE.PROGRESSBAR: return "ProgressValue"; case UIConsts.CONTROLTYPE.IMAGECONTROL: - return "ImageURL"; + return PropertyNames.PROPERTY_IMAGEURL; case UIConsts.CONTROLTYPE.RADIOBUTTON: - return "State"; + return PropertyNames.PROPERTY_STATE; case UIConsts.CONTROLTYPE.CHECKBOX: - return "State"; + return PropertyNames.PROPERTY_STATE; case UIConsts.CONTROLTYPE.EDITCONTROL: return "Text"; case UIConsts.CONTROLTYPE.COMBOBOX: diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.java b/wizards/com/sun/star/wizards/ui/UnoDialog2.java index 184a4a354b0c..0769e1d23b38 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog2.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.java @@ -32,6 +32,7 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.SystemDialog; import com.sun.star.wizards.ui.event.*; @@ -208,7 +209,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames XControl xImgControl = insertImage(Desktop.getUniqueName(getDlgNameAccess(), "imgHint"), new String[] { - "Border", "Height", "ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "Width" + "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -340,7 +341,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames Helper.setUnoPropertyValues(xControlModel, sPropNames, oPropValues); //setControlPropertiesDebug(xControlModel, sPropNames, oPropValues); //System.out.println(" Setting props successfull !"); - Helper.setUnoPropertyValue(xControlModel, "Name", componentName); + Helper.setUnoPropertyValue(xControlModel, PropertyNames.PROPERTY_NAME, componentName); } catch (Exception ex) { diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java index f17c44b82aa5..c03ceb2dc257 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.java +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java @@ -32,7 +32,6 @@ import com.sun.star.wizards.ui.event.CommonListener; import com.sun.star.wizards.ui.event.EventNames; import com.sun.star.wizards.ui.event.MethodInvocation; import com.sun.star.uno.UnoRuntime; -// import com.sun.star.awt.XItemEventBroadcaster; import com.sun.star.awt.*; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.XInterface; @@ -47,6 +46,8 @@ import com.sun.star.frame.XTerminateListener; import com.sun.star.frame.TerminationVetoException; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.beans.*; +import com.sun.star.wizards.common.HelpIds; +import com.sun.star.wizards.common.PropertyNames; public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeListener, XTerminateListener, XCompletion { @@ -163,7 +164,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL try { nNewStep = itemEvent.ItemId; - nOldStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, "Step")); + nOldStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP)); if (nNewStep != nOldStep) { switchToStep(); @@ -227,7 +228,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL { try { - int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, "Height")).intValue(); + int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_HEIGHT)).intValue(); // the roadmap control has got no real TabIndex ever // that is not correct, but changing this would need time, so it is used @@ -235,13 +236,13 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL oRoadmap = insertControlModel("com.sun.star.awt.UnoControlRoadmapModel", "rdmNavi", new String[] { - "Height", - "PositionX", - "PositionY", - "Step", - "TabIndex", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, "Tabstop", - "Width" + PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -254,7 +255,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL new Integer(85) }); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRoadmap); - xPSet.setPropertyValue("Name", "rdmNavi"); + xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, "rdmNavi"); xSSFRoadmap = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, oRoadmap); xIndexContRoadmap = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, oRoadmap); @@ -308,8 +309,8 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL try { Object oRoadmapItem = xSSFRoadmap.createInstance(); - Helper.setUnoPropertyValue(oRoadmapItem, "Label", _sLabel); - Helper.setUnoPropertyValue(oRoadmapItem, "Enabled", new Boolean(_bEnabled)); + Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_LABEL, _sLabel); + Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnabled)); Helper.setUnoPropertyValue(oRoadmapItem, "ID", new Integer(_CurItemID)); xIndexContRoadmap.insertByIndex(Index, oRoadmapItem); int NextIndex = Index + 1; @@ -386,7 +387,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL protected void changeToStep(int nNewStep) { - Helper.setUnoPropertyValue(xDialogModel, "Step", new Integer(nNewStep)); + Helper.setUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP, new Integer(nNewStep)); setCurrentRoadmapItemID((short) (nNewStep)); enableNextButton(getNextAvailableStep() > 0); enableBackButton(nNewStep != 1); @@ -454,8 +455,8 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL int iButtonHeight = 14; Integer IButtonHeight = new Integer(iButtonHeight); Integer ICurStep = new Integer(0); - int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, "Height")).intValue(); - int iDialogWidth = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, "Width")).intValue(); + 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; int iBtnPosY = iDialogHeight - iButtonHeight - 6; int iCancelPosX = iDialogWidth - iButtonWidth - 6; @@ -466,7 +467,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lnNaviSep", new String[] { - "Height", "Orientation", "PositionX", "PositionY", "Step", "Width" + PropertyNames.PROPERTY_HEIGHT, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -476,7 +477,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lnRoadSep", new String[] { - "Height", "Orientation", "PositionX", "PositionY", "Step", "Width" + PropertyNames.PROPERTY_HEIGHT, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -485,13 +486,13 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL String[] propNames = new String[] { - "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "PushButtonType", "Step", "TabIndex", "Width" + PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "PushButtonType", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }; - Helper.setUnoPropertyValue(super.xDialogModel, "HelpURL", "HID:" + hid); + Helper.setUnoPropertyValue(super.xDialogModel, PropertyNames.PROPERTY_HELPURL, HelpIds.getHelpIdString(hid)); insertButton("btnWizardHelp", HELP_ACTION_PERFORMED, new String[] { - "Enabled", "Height", "Label", "PositionX", "PositionY", "PushButtonType", "Step", "TabIndex", "Width" + PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "PushButtonType", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { @@ -500,25 +501,25 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL insertButton("btnWizardBack", BACK_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(false), IButtonHeight, "HID:" + (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 + 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 }); insertButton("btnWizardNext", NEXT_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(true), IButtonHeight, "HID:" + (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 + 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 }); insertButton("btnWizardFinish", FINISH_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(true), IButtonHeight, "HID:" + (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 + 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 }); insertButton("btnWizardCancel", CANCEL_ACTION_PERFORMED, propNames, new Object[] { - new Boolean(true), IButtonHeight, "HID:" + (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 + 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 }); setControlProperty("btnWizardNext", "DefaultButton", Boolean.TRUE); @@ -527,7 +528,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL // close the dialog. MethodInvocation windowHidden = new MethodInvocation("windowHidden", this); xWindow.addWindowListener((CommonListener) getGuiEventListener()); - String dialogName = (String) Helper.getUnoPropertyValue(xDialogModel, "Name"); + String dialogName = (String) Helper.getUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_NAME); getGuiEventListener().add(dialogName, EVENT_ACTION_PERFORMED, windowHidden); } @@ -569,17 +570,17 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL public void enableBackButton(boolean enabled) { - setControlProperty("btnWizardBack", "Enabled", enabled ? Boolean.TRUE : Boolean.FALSE); + setControlProperty("btnWizardBack", PropertyNames.PROPERTY_ENABLED, enabled ? Boolean.TRUE : Boolean.FALSE); } public void enableNextButton(boolean enabled) { - setControlProperty("btnWizardNext", "Enabled", enabled ? Boolean.TRUE : Boolean.FALSE); + setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, enabled ? Boolean.TRUE : Boolean.FALSE); } public void enableFinishButton(boolean enabled) { - setControlProperty("btnWizardFinish", "Enabled", enabled ? Boolean.TRUE : Boolean.FALSE); + setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, enabled ? Boolean.TRUE : Boolean.FALSE); } public void setStepEnabled(int _nStep, boolean bEnabled) @@ -587,7 +588,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL XInterface xRoadmapItem = getRoadmapItemByID(_nStep); if (xRoadmapItem != null) { - Helper.setUnoPropertyValue(xRoadmapItem, "Enabled", new Boolean(bEnabled)); + Helper.setUnoPropertyValue(xRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled)); } } @@ -622,7 +623,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL { return false; } - bIsEnabled = AnyConverter.toBoolean(Helper.getUnoPropertyValue(xRoadmapItem, "Enabled")); + bIsEnabled = AnyConverter.toBoolean(Helper.getUnoPropertyValue(xRoadmapItem, PropertyNames.PROPERTY_ENABLED)); return bIsEnabled; } catch (com.sun.star.uno.Exception exception) @@ -713,7 +714,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL { try { - return AnyConverter.toInt(Helper.getUnoPropertyValue(this.MSFDialogModel, "Step")); + return AnyConverter.toInt(Helper.getUnoPropertyValue(this.MSFDialogModel, PropertyNames.PROPERTY_STEP)); } catch (com.sun.star.uno.Exception exception) { @@ -746,7 +747,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL insertLabel("lblQueryTitle" + String.valueOf(i), new String[] { - "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width" + "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 }, new Object[] { diff --git a/wizards/com/sun/star/wizards/ui/event/AbstractListener.java b/wizards/com/sun/star/wizards/ui/event/AbstractListener.java index ebbcba96f58c..bbe9cee2eb86 100644 --- a/wizards/com/sun/star/wizards/ui/event/AbstractListener.java +++ b/wizards/com/sun/star/wizards/ui/event/AbstractListener.java @@ -30,6 +30,7 @@ import com.sun.star.awt.XControl; import com.sun.star.lang.EventObject; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.PropertyNames; import java.lang.reflect.InvocationTargetException; import java.util.Hashtable; @@ -128,6 +129,6 @@ public class AbstractListener public static String getEventSourceName(EventObject eventObject) { XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, eventObject.Source); - return (String) Helper.getUnoPropertyValue(xControl.getModel(), "Name", String.class); + 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 b81b8e71bcdb..62eaaf657447 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/DataAware.java @@ -31,6 +31,7 @@ import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; +import com.sun.star.wizards.common.PropertyNames; /** * @author rpiterman @@ -275,7 +276,7 @@ public abstract class DataAware { /** * creates a PropertyValue for the property with * the given name, of the given JavaBean object. - * @param propertyName the property to access. Must be a Cup letter (e.g. "Name" for getName() and setName("..."). ) + * @param propertyName the property to access. Must be a Cup letter (e.g. PropertyNames.PROPERTY_NAME for getName() and setName("..."). ) * @param propertyOwner the object which "own" or "contains" the property. */ public PropertyValue(String propertyName, Object propertyOwner) { diff --git a/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java b/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java index 74881d7b1f23..119b2b6e1e51 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java +++ b/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java @@ -27,7 +27,7 @@ package com.sun.star.wizards.ui.event; import java.lang.reflect.Field; - +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.uno.Any; /** diff --git a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java index c45a496c7849..86c50b13ce02 100644 --- a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java +++ b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java @@ -28,6 +28,7 @@ package com.sun.star.wizards.ui.event; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import com.sun.star.wizards.common.PropertyNames; /** * Encapsulate a Method invocation. diff --git a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java index 632609d85f05..b8024fb4f9c9 100644 --- a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java @@ -30,6 +30,7 @@ import com.sun.star.awt.*; import com.sun.star.lang.EventObject; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Helper; +import com.sun.star.wizards.common.PropertyNames; /** * @author rpiterman @@ -79,7 +80,7 @@ public class UnoDataAware extends DataAware protected void setToUI(Object value) { - //System.out.println("Settings uno property : "+ Helper.getUnoPropertyValue(this.unoModel,"Name") + "<-" +stringof(value)); + //System.out.println("Settings uno property : "+ Helper.getUnoPropertyValue(this.unoModel,PropertyNames.PROPERTY_NAME) + "<-" +stringof(value)); Helper.setUnoPropertyValue(unoModel, unoPropName, value); } @@ -203,7 +204,7 @@ public class UnoDataAware extends DataAware field ? DataAwareFields.getFieldValueFor(data, prop, new Short((short) 0)) : new DataAware.PropertyValue(prop, data), - checkBox, "State"); + checkBox, PropertyNames.PROPERTY_STATE); xcheckBox.addItemListener(itemListener(uda, listener)); return uda; } @@ -233,7 +234,7 @@ public class UnoDataAware extends DataAware return new UnoDataAware(data, field ? DataAwareFields.getFieldValueFor(data, prop, "") : new DataAware.PropertyValue(prop, data), - label, "Label"); + label, PropertyNames.PROPERTY_LABEL); } public static UnoDataAware attachListBox(Object data, String prop, Object listBox, final Listener listener, boolean field) @@ -260,6 +261,6 @@ public class UnoDataAware extends DataAware public static void setEnabled(Object control, Boolean enabled) { - Helper.setUnoPropertyValue(getModel(control), "Enabled", enabled); + Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enabled); } } |