diff options
Diffstat (limited to 'wizards/com/sun/star/wizards/ui/ButtonList.java')
-rw-r--r-- | wizards/com/sun/star/wizards/ui/ButtonList.java | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java index 770210e04706..41062757f0cf 100644 --- a/wizards/com/sun/star/wizards/ui/ButtonList.java +++ b/wizards/com/sun/star/wizards/ui/ButtonList.java @@ -40,9 +40,11 @@ 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.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; /** * @@ -120,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[] { @@ -148,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); @@ -198,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, ">"); } @@ -238,17 +240,17 @@ 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[] { @@ -306,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); @@ -328,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() @@ -674,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); } /** @@ -723,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) @@ -858,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)); } } } @@ -881,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(); |