diff options
author | Ocke.Janssen <Ocke.Janssen@oracle.com> | 2010-11-24 14:22:48 +0100 |
---|---|---|
committer | Ocke.Janssen <Ocke.Janssen@oracle.com> | 2010-11-24 14:22:48 +0100 |
commit | 78ad8534bea3608a294fb8c6be49fb6778d4e80f (patch) | |
tree | 2c27f4e297357d56812ed32a1fad0070dadfcf67 /wizards/com/sun/star/wizards/db | |
parent | 6a7bbc11c1039e78ca10849bcad6c1c389a6e3b9 (diff) |
dba34b: make often used vars static
Diffstat (limited to 'wizards/com/sun/star/wizards/db')
4 files changed, 20 insertions, 17 deletions
diff --git a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java index 204ba2328321..a3ff8c12b712 100644 --- a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java +++ b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java @@ -31,6 +31,7 @@ import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.sdbc.DataType; import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.common.PropertyNames; // import com.sun.star.wizards.db.TypeInspector; public class ColumnPropertySet @@ -89,9 +90,9 @@ public class ColumnPropertySet for (int i = 0; i < _aNewColPropertyValues.length; i++) { String sPropName = _aNewColPropertyValues[i].Name; - if (_sNewName != null && sPropName.equals("Name")) + if (_sNewName != null && sPropName.equals(PropertyNames.PROPERTY_NAME)) { - xPropertySet.setPropertyValue("Name", _sNewName); + xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, _sNewName); } else if (sPropName.equals("Precision")) { @@ -170,12 +171,12 @@ public class ColumnPropertySet nType = ((Integer) _oValue).intValue(); xPropertySet.setPropertyValue("Type", new Integer(nType)); } - else if (_spropname.equals("Name")) + else if (_spropname.equals(PropertyNames.PROPERTY_NAME)) { String sName = (String) _oValue; if (!sName.equals("")) { - xPropertySet.setPropertyValue("Name", sName); + xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); } } else if (_spropname.equals("Scale")) diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 323ded34385a..4e7c82ee60e2 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -83,6 +83,7 @@ import com.sun.star.wizards.common.Properties; import com.sun.star.wizards.common.Resource; import com.sun.star.wizards.common.SystemDialog; import com.sun.star.uno.Any; +import com.sun.star.wizards.common.PropertyNames; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; @@ -611,7 +612,7 @@ public class DBMetaData XPropertySet xPSet = UnoRuntime.queryInterface( XPropertySet.class, m_dataSource ); if (xPSet != null) { - DataSourceName = AnyConverter.toString(xPSet.getPropertyValue("Name")); + DataSourceName = AnyConverter.toString(xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME)); } return getConnection(xConnection); } @@ -937,7 +938,7 @@ public class DBMetaData xCloseable.close(false); NamedValueCollection creationArgs = new NamedValueCollection(); - creationArgs.put( "Name", basename ); + creationArgs.put( PropertyNames.PROPERTY_NAME, basename ); creationArgs.put( "URL", documentURL ); creationArgs.put( "AsTemplate", i_createTemplate ); XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, _xDocNameAccess ); diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index 235da2d7c04a..461a256ce1c3 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -183,7 +183,7 @@ public class SQLQueryComposer try { XPropertySet xColumnPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xColumnIndexAccess.getByIndex(i)); - String sName = (String) xColumnPropertySet.getPropertyValue("Name"); + String sName = (String) xColumnPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME); if (JavaTools.FieldInTable(CurDBMetaData.getSortFieldNames(), sName) == -1) { boolean bascend = AnyConverter.toBoolean(xColumnPropertySet.getPropertyValue("IsAscending")); diff --git a/wizards/com/sun/star/wizards/db/TableDescriptor.java b/wizards/com/sun/star/wizards/db/TableDescriptor.java index 8e3b740417c4..c7f728648467 100644 --- a/wizards/com/sun/star/wizards/db/TableDescriptor.java +++ b/wizards/com/sun/star/wizards/db/TableDescriptor.java @@ -57,6 +57,7 @@ import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.common.PropertyNames; public class TableDescriptor extends CommandMetaData implements XContainerListener { @@ -169,7 +170,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen for (int i = 0; i < _fieldnames.length; i++) { XPropertySet xKeyColPropertySet = xKeyColFac.createDataDescriptor(); - xKeyColPropertySet.setPropertyValue("Name", _fieldnames[i]); + xKeyColPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, _fieldnames[i]); keycolumncontainer.add(xKeyColPropertySet); XPropertySet xColPropertySet = null; if (hasByName(_fieldnames[i])) @@ -221,7 +222,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - String sColumnName = (String) AnyConverter.toString(_xToBeAppendedPropertySet.getPropertyValue("Name")); + String sColumnName = (String) AnyConverter.toString(_xToBeAppendedPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME)); if (_xColumns.hasByName(sColumnName)) { String sMessage = JavaTools.replaceSubString(sColumnAlreadyExistsMessage, sColumnName, "%FIELDNAME"); @@ -265,7 +266,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen } if (breturn) { - assignTableProperty("Name", _tablename); + assignTableProperty(PropertyNames.PROPERTY_NAME, _tablename); assignTableProperty("CatalogName", _catalogname); assignTableProperty("SchemaName", _schemaname); xTableContainer = (XContainer) UnoRuntime.queryInterface(XContainer.class, getTableNamesAsNameAccess()); @@ -318,7 +319,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - xPropTableDataDescriptor.setPropertyValue("Name", ""); + xPropTableDataDescriptor.setPropertyValue(PropertyNames.PROPERTY_NAME, ""); if ((xKeyDrop != null) && (xIndexAccessKeys != null)) { int icount = xIndexAccessKeys.getCount(); @@ -391,7 +392,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - return modifyColumn(_soldname, "Name", _snewname); + return modifyColumn(_soldname, PropertyNames.PROPERTY_NAME, _snewname); } catch (Exception e) { @@ -413,7 +414,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen if (oColumnDescriptor.Name.equals(_sname)) { oColumnDescriptor.xColPropertySet.setPropertyValue(_spropname, _oValue); - if (_spropname.equals("Name")) + if (_spropname.equals(PropertyNames.PROPERTY_NAME)) { oColumnDescriptor.Name = (String) _oValue; } @@ -455,7 +456,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen if (oColumnDescriptor.Name.equals(_sname)) { oColumnDescriptor.xColPropertySet = _xColPropertySet; - oColumnDescriptor.Name = (String) _xColPropertySet.getPropertyValue("Name"); + oColumnDescriptor.Name = (String) _xColPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME); columncontainer.remove(i); columncontainer.insertElementAt(oColumnDescriptor, i); return true; @@ -624,7 +625,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - String sname = (String) Properties.getPropertyValue(_aNewPropertyValues, "Name"); + String sname = (String) Properties.getPropertyValue(_aNewPropertyValues, PropertyNames.PROPERTY_NAME); if (!hasByName(sname)) { ColumnPropertySet oPropertySet = new ColumnPropertySet(oTypeInspector, xColumnDataDescriptorFactory.createDataDescriptor()); @@ -694,7 +695,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { XPropertySet xColPropertySet = xColumnDataDescriptorFactory.createDataDescriptor(); IDFieldName = Desktop.getUniqueName(getColumnNames(), _columnname, ""); - xColPropertySet.setPropertyValue("Name", IDFieldName); + xColPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, IDFieldName); int nDataType = oTypeInspector.convertDataType(com.sun.star.sdbc.DataType.INTEGER); xColPropertySet.setPropertyValue("Type", new Integer(nDataType)); @@ -777,7 +778,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen try { XPropertySet xTablePropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, arg0.Element); - String stablename = AnyConverter.toString(xTablePropertySet.getPropertyValue("Name")); + String stablename = AnyConverter.toString(xTablePropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME)); String sschemaname = AnyConverter.toString(xPropTableDataDescriptor.getPropertyValue("SchemaName")); String scatalogname = AnyConverter.toString(xPropTableDataDescriptor.getPropertyValue("CatalogName")); ComposedTableName = new CommandName(this, scatalogname, sschemaname, stablename, false); |