diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-12 12:11:25 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-19 14:57:13 +0200 |
commit | 3a8d3519889a68ddf209ea7c83307bec51cd6da0 (patch) | |
tree | ab67ef1b6f1f65443b7c4d0e086fdcff17f84283 /wizards | |
parent | fix intermittent crash in make check (diff) | |
download | core-3a8d3519889a68ddf209ea7c83307bec51cd6da0.tar.gz core-3a8d3519889a68ddf209ea7c83307bec51cd6da0.zip |
java: remove unused methods
Change-Id: Ibb905e6f3e7d92a0e558f1f6562e5b472cd2717b
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/common/Configuration.java | 22 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/Desktop.java | 11 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/FileAccess.java | 73 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/Helper.java | 17 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/JavaTools.java | 14 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/NumericalHelper.java | 572 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/PropertySetHelper.java | 34 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/form/FormConfiguration.java | 44 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/table/FieldFormatter.java | 12 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/UnoDialog2.java | 73 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/event/DataAware.java | 35 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/event/Task.java | 49 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/event/UnoDataAware.java | 37 |
13 files changed, 0 insertions, 993 deletions
diff --git a/wizards/com/sun/star/wizards/common/Configuration.java b/wizards/com/sun/star/wizards/common/Configuration.java index 9470577c82a2..d2f39c22cd95 100644 --- a/wizards/com/sun/star/wizards/common/Configuration.java +++ b/wizards/com/sun/star/wizards/common/Configuration.java @@ -336,28 +336,6 @@ public abstract class Configuration - private static XNameAccess getChildNodebyDisplayName(XNameAccess _xNameAccessNode, String _displayname, String _nodename) - { - String[] snames = null; - try - { - snames = _xNameAccessNode.getElementNames(); - for (int i = 0; i < snames.length; i++) - { - String curdisplayname = (String) Helper.getUnoPropertyValue(_xNameAccessNode.getByName(snames[i]), _nodename); - if (curdisplayname.equals(_displayname)) - { - return UnoRuntime.queryInterface(XNameAccess.class, _xNameAccessNode.getByName(snames[i])); - } - } - } - catch (Exception e) - { - e.printStackTrace(System.err); - } - return null; - } - public static XNameAccess getChildNodebyDisplayName(XMultiServiceFactory _xMSF, Locale _aLocale, XNameAccess _xNameAccessNode, String _displayname, String _nodename, int _nmaxcharcount) { String[] snames = null; diff --git a/wizards/com/sun/star/wizards/common/Desktop.java b/wizards/com/sun/star/wizards/common/Desktop.java index a09d4d85e51c..a9f029372790 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.java +++ b/wizards/com/sun/star/wizards/common/Desktop.java @@ -18,7 +18,6 @@ package com.sun.star.wizards.common; import com.sun.star.beans.PropertyValue; -import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; @@ -72,16 +71,6 @@ public class Desktop return xFrameSuppl.getActiveFrame(); } - private static XComponent getActiveComponent(XMultiServiceFactory _xMSF) - { - XFrame xFrame = getActiveFrame(_xMSF); - return UnoRuntime.queryInterface(XComponent.class, xFrame.getController().getModel()); - } - - - - - private static XDispatch getDispatcher(XFrame xFrame, String _stargetframe, com.sun.star.util.URL oURL) { try diff --git a/wizards/com/sun/star/wizards/common/FileAccess.java b/wizards/com/sun/star/wizards/common/FileAccess.java index 252f90219daa..12d4d4d4d8f0 100644 --- a/wizards/com/sun/star/wizards/common/FileAccess.java +++ b/wizards/com/sun/star/wizards/common/FileAccess.java @@ -26,7 +26,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Vector; -import com.sun.star.awt.VclWindowPeerAttribute; import com.sun.star.io.XActiveDataSink; import com.sun.star.io.XInputStream; import com.sun.star.io.XTextInputStream; @@ -339,40 +338,6 @@ public class FileAccess return ReturnPath; } - private static boolean createSubDirectory(XMultiServiceFactory xMSF, XSimpleFileAccess xSimpleFileAccess, String Path) - { - String sNoDirCreation = PropertyNames.EMPTY_STRING; - try - { - Resource oResource = new Resource(xMSF, "ImportWizard", "imp"); - sNoDirCreation = oResource.getResText(1050); - String sMsgDirNotThere = oResource.getResText(1051); - String sQueryForNewCreation = oResource.getResText(1052); - String OSPath = JavaTools.convertfromURLNotation(Path); - String sQueryMessage = JavaTools.replaceSubString(sMsgDirNotThere, OSPath, "%1"); - sQueryMessage = sQueryMessage + (char) 13 + sQueryForNewCreation; - int icreate = SystemDialog.showMessageBox(xMSF, "QueryBox", VclWindowPeerAttribute.YES_NO, sQueryMessage); - if (icreate == 2) - { - xSimpleFileAccess.createFolder(Path); - return true; - } - return false; - } - catch (com.sun.star.ucb.CommandAbortedException exception) - { - String sMsgNoDir = JavaTools.replaceSubString(sNoDirCreation, Path, "%1"); - SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMsgNoDir); - return false; - } - catch (com.sun.star.uno.Exception unoexception) - { - String sMsgNoDir = JavaTools.replaceSubString(sNoDirCreation, Path, "%1"); - SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMsgNoDir); - return false; - } - } - /** * We search in all given path for a given file */ @@ -566,24 +531,6 @@ public class FileAccess return filename; } - private boolean mkdir(String s) - { - try - { - fileAccess.createFolder(s); - return true; - } - catch (CommandAbortedException cax) - { - cax.printStackTrace(); - } - catch (com.sun.star.uno.Exception ex) - { - ex.printStackTrace(); - } - return false; - } - /** * @param def what to return in case of an exception * @return true if the given file exists or not. @@ -650,26 +597,6 @@ public class FileAccess - private String getNewFile(String parentDir, String name, String extension) - { - - int i = 0; - String url; - do - { - String filename = filename(name, extension, i++); - url = getURL(parentDir, filename); - } - while (exists(url, true)); - - return url; - } - - private static String filename(String name, String ext, int i) - { - return name + (i == 0 ? PropertyNames.EMPTY_STRING : String.valueOf(i)) + (ext.equals(PropertyNames.EMPTY_STRING) ? PropertyNames.EMPTY_STRING : "." + ext); - } - public static String connectURLs(String urlFolder, String urlFilename) { return urlFolder + (urlFolder.endsWith("/") ? PropertyNames.EMPTY_STRING : "/") + diff --git a/wizards/com/sun/star/wizards/common/Helper.java b/wizards/com/sun/star/wizards/common/Helper.java index aab3e7249483..e5e009d8879e 100644 --- a/wizards/com/sun/star/wizards/common/Helper.java +++ b/wizards/com/sun/star/wizards/common/Helper.java @@ -308,23 +308,6 @@ public class Helper return getDocumentDateAsDouble(date.Year * 10000 + date.Month * 100 + date.Day); } - private synchronized double getDocumentDateAsDouble(long javaTimeInMillis) - { - calendar.clear(); - JavaTools.setTimeInMillis(calendar, javaTimeInMillis); - - long date1 = getTimeInMillis(); - - /* - * docNullTime and date1 are in millis, but - * I need a day... - */ - return (date1 - docNullTime) / DAY_IN_MILLIS + 1; - - } - - - public String format(int formatIndex, DateTime date) { return formatter.convertNumberToString(formatIndex, getDocumentDateAsDouble(date)); diff --git a/wizards/com/sun/star/wizards/common/JavaTools.java b/wizards/com/sun/star/wizards/common/JavaTools.java index ac217f3aabc0..940b17d52530 100644 --- a/wizards/com/sun/star/wizards/common/JavaTools.java +++ b/wizards/com/sun/star/wizards/common/JavaTools.java @@ -310,14 +310,6 @@ public class JavaTools } } - private static String getFilenameOutOfPath(String sPath) - { - String[] Hierarchy = ArrayoutofString(sPath, "/"); - return Hierarchy[Hierarchy.length - 1]; - } - - - public static String convertfromURLNotation(String _sURLPath) { String sPath = PropertyNames.EMPTY_STRING; @@ -336,12 +328,6 @@ public class JavaTools - private static long getTimeInMillis(Calendar _calendar) - { - java.util.Date dDate = _calendar.getTime(); - return dDate.getTime(); - } - public static void setTimeInMillis(Calendar _calendar, long _timemillis) { java.util.Date dDate = new java.util.Date(); diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java index 12efa62e949a..bf02290d9ae6 100644 --- a/wizards/com/sun/star/wizards/common/NumericalHelper.java +++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java @@ -62,181 +62,6 @@ public class NumericalHelper /** - * get a byte value from the object - * @return a byte - * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted - */ - private static byte toByte(Object aValue) - throws com.sun.star.lang.IllegalArgumentException - { - - byte retValue = 0; - TypeObject aTypeObject = getTypeObject(aValue); - switch (aTypeObject.iType) - { - case BYTE_TYPE: - retValue = getByte(aTypeObject); - break; - case CHAR_TYPE: - retValue = (byte) getChar(aTypeObject); - break; - case SHORT_TYPE: - retValue = (byte) getShort(aTypeObject); - break; - case INT_TYPE: - retValue = (byte) getInt(aTypeObject); - break; - case LONG_TYPE: - retValue = (byte) getLong(aTypeObject); - break; - case FLOAT_TYPE: - retValue = (byte) getFloat(aTypeObject); - break; - case DOUBLE_TYPE: - retValue = (byte) getDouble(aTypeObject); - break; - case STRING_TYPE: - try - { - Byte b = new Byte((String) aTypeObject.aValue); - retValue = b.byteValue(); - } - catch (java.lang.NumberFormatException e) - { - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert to byte: " + aTypeObject.aValue); - } - break; - case BOOLEAN_TYPE: - retValue = getBool(aTypeObject) ? (byte) -1 : (byte) 0; - break; - default: - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert this type: " + aValue.getClass().getName()); - } - return retValue; - } - - - - /** - * get a short value from the object - * @return a short - * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted - */ - private static short toShort(Object aValue) - throws com.sun.star.lang.IllegalArgumentException - { - short retValue = 0; - TypeObject aTypeObject = getTypeObject(aValue); - switch (aTypeObject.iType) - { - case BYTE_TYPE: - retValue = getByte(aTypeObject); - break; - case CHAR_TYPE: - retValue = (byte) getChar(aTypeObject); - break; - case SHORT_TYPE: - retValue = getShort(aTypeObject); - break; - case INT_TYPE: - retValue = (short) getInt(aTypeObject); - break; - case LONG_TYPE: - retValue = (short) getLong(aTypeObject); - break; - case FLOAT_TYPE: - retValue = (short) getFloat(aTypeObject); - break; - case DOUBLE_TYPE: - retValue = (short) getDouble(aTypeObject); - break; - case STRING_TYPE: - try - { - Short s = new Short((String) aTypeObject.aValue); - retValue = s.shortValue(); - } - catch (java.lang.NumberFormatException e) - { - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert to short: " + aTypeObject.aValue); - } - break; - case BOOLEAN_TYPE: - retValue = getBool(aTypeObject) ? (short) -1 : (short) 0; - break; - default: - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert this type: " + aValue.getClass().getName()); - } - return retValue; - } - - - - - - - - /** - @param aValue a object this can contain anything - @return true, if the parameter aValue is type of real numbers - @deprecate, use isRealNumber() instead. - */ - private static boolean isNumerical(Object aValue) - { - try - { - TypeObject aTypeObject = getTypeObject(aValue); - switch (aTypeObject.iType) - { - case BYTE_TYPE: - case CHAR_TYPE: - case SHORT_TYPE: - case INT_TYPE: - case LONG_TYPE: - case DOUBLE_TYPE: - case FLOAT_TYPE: - return true; - default: - return false; - } - } - catch (com.sun.star.lang.IllegalArgumentException e) - { - return false; - } - } - - - - /** - @param aValue a object this can contain anything - * @return true, if the value is type of any integer values. double / float are not(!) integer values - */ - private static boolean isInteger(Object aValue) throws com.sun.star.lang.IllegalArgumentException - { - TypeObject aTypeObject = getTypeObject(aValue); - switch (aTypeObject.iType) - { - case BYTE_TYPE: - case CHAR_TYPE: - case SHORT_TYPE: - case INT_TYPE: - case LONG_TYPE: - return true; - default: - return false; - } - } - - - - - - /** * get an int value from the object * @return an int * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted @@ -292,116 +117,6 @@ public class NumericalHelper } /** - * get a long value from the object - * @return a long - * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted - */ - private static long toLong(Object aValue) - throws com.sun.star.lang.IllegalArgumentException - { - long retValue = 0; - TypeObject aTypeObject = getTypeObject(aValue); - switch (aTypeObject.iType) - { - case BYTE_TYPE: - retValue = getByte(aTypeObject); - break; - case CHAR_TYPE: - retValue = getChar(aTypeObject); - break; - case SHORT_TYPE: - retValue = getShort(aTypeObject); - break; - case INT_TYPE: - retValue = getInt(aTypeObject); - break; - case LONG_TYPE: - retValue = getLong(aTypeObject); - break; - case FLOAT_TYPE: - retValue = (long) getFloat(aTypeObject); - break; - case DOUBLE_TYPE: - retValue = (long) getDouble(aTypeObject); - break; - case STRING_TYPE: - try - { - Long l = new Long((String) aTypeObject.aValue); - retValue = l.longValue(); - } - catch (java.lang.NumberFormatException e) - { - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert to short: " + aTypeObject.aValue); - } - break; - case BOOLEAN_TYPE: - retValue = getBool(aTypeObject) ? -1 : 0; - break; - default: - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert this type: " + aValue.getClass().getName()); - } - return retValue; - } - - /** - * get a float value from the object - * @return a float - * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted - */ - private static float toFloat(Object aValue) - throws com.sun.star.lang.IllegalArgumentException - { - float retValue = (float) 0.0; - TypeObject aTypeObject = getTypeObject(aValue); - switch (aTypeObject.iType) - { - case BYTE_TYPE: - retValue = getByte(aTypeObject); - break; - case CHAR_TYPE: - retValue = getChar(aTypeObject); - break; - case SHORT_TYPE: - retValue = getShort(aTypeObject); - break; - case INT_TYPE: - retValue = getInt(aTypeObject); - break; - case LONG_TYPE: - retValue = getLong(aTypeObject); - break; - case FLOAT_TYPE: - retValue = getFloat(aTypeObject); - break; - case DOUBLE_TYPE: - retValue = (float) getDouble(aTypeObject); - break; - case STRING_TYPE: - try - { - Float f = new Float((String) aTypeObject.aValue); - retValue = f.floatValue(); - } - catch (java.lang.NumberFormatException e) - { - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert to short: " + aTypeObject.aValue); - } - break; - case BOOLEAN_TYPE: - retValue = getBool(aTypeObject) ? (float) -1 : (float) 0; - break; - default: - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert this type: " + aValue.getClass().getName()); - } - return retValue; - } - - /** * get a double value from the object * @return a double * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted @@ -457,55 +172,6 @@ public class NumericalHelper } /** - * get a String value from the object - * @return a String - * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted - */ - private static String toString(Object aValue) - throws com.sun.star.lang.IllegalArgumentException - { - String retValue = null; - TypeObject aTypeObject = getTypeObject(aValue); - switch (aTypeObject.iType) - { - case BYTE_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case CHAR_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case SHORT_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case INT_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case LONG_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case FLOAT_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case DOUBLE_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case STRING_TYPE: - retValue = (String) aTypeObject.aValue; - break; - case BOOLEAN_TYPE: - retValue = aTypeObject.aValue.toString(); - break; - case SEQUENCE_TYPE: - retValue = new String(toByteArray((aValue))); - break; - default: - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert this type: " + aValue.getClass().getName()); - } - return retValue; - } - - /** * get a boolean value from the object * @return a boolean * @throws com.sun.star.lang.IllegalArgumentException if the object cannot be converted @@ -561,142 +227,6 @@ public class NumericalHelper } /** - * get an int array from an object - * @param anArrayValue a value that is constructed into an array - * @return an integer array - */ - private static int[] toIntArray(Object anArrayValue) - throws com.sun.star.lang.IllegalArgumentException - { - int[] retValue = null; - TypeObject aTypeObject = getTypeObject(anArrayValue); - if (aTypeObject.iType == SEQUENCE_TYPE) - { - Object[] obj = convertSequenceToObjectArray(aTypeObject); - retValue = new int[obj.length]; - for (int i = 0; i < obj.length; i++) - { - retValue[i] = toInt(obj[i]); - } - } - else - { // object is not really an array - retValue = new int[] - { - toInt(anArrayValue) - }; - } - return retValue; - } - - /** - * get an byte array from an object - * @param anArrayValue a value that is constructed into an array - * @return a byte array - */ - private static byte[] toByteArray(Object anArrayValue) - throws com.sun.star.lang.IllegalArgumentException - { - byte[] retValue = null; - TypeObject aTypeObject = getTypeObject(anArrayValue); - if (aTypeObject.iType == SEQUENCE_TYPE) - { - Object[] obj = convertSequenceToObjectArray(aTypeObject); - retValue = new byte[obj.length]; - for (int i = 0; i < obj.length; i++) - { - retValue[i] = toByte(obj[i]); - } - } - else - { // object is not really an array - retValue = new byte[] - { - toByte(anArrayValue) - }; - } - return retValue; - } - - /** - * get a short array from an object - * @param anArrayValue a value that is constructed into an array - * @return a short array - */ - private static short[] toShortArray(Object anArrayValue) - throws com.sun.star.lang.IllegalArgumentException - { - short[] retValue = null; - TypeObject aTypeObject = getTypeObject(anArrayValue); - if (aTypeObject.iType == SEQUENCE_TYPE) - { - Object[] obj = convertSequenceToObjectArray(aTypeObject); - retValue = new short[obj.length]; - for (int i = 0; i < obj.length; i++) - { - retValue[i] = toShort(obj[i]); - } - } - else - { // object is not really an array - retValue = new short[] - { - toShort(anArrayValue) - }; - } - return retValue; - } - - /** - * get a string array from an object - * @param anArrayValue a value that is constructed into an array - * @return a short array - */ - private static String[] toStringArray(Object anArrayValue) - throws com.sun.star.lang.IllegalArgumentException - { - String[] retValue = null; - TypeObject aTypeObject = getTypeObject(anArrayValue); - if (aTypeObject.iType == SEQUENCE_TYPE) - { - Object[] obj = convertSequenceToObjectArray(aTypeObject); - retValue = new String[obj.length]; - for (int i = 0; i < obj.length; i++) - { - retValue[i] = toString(obj[i]); - } - } - else - { // object is not really an array - retValue = new String[] - { - toString(anArrayValue) - }; - } - return retValue; - } - - - - - - - - - - - - - - - - - - - - - - /** * get the type object from the given object * @param aValue an object representing a (numerical) value; can also be an 'any' * @return a type object: the object together with the its type information @@ -917,107 +447,5 @@ public class NumericalHelper transform(number); } } - - public String getResult() - { - return val.toString(); - } - } - - private static Object[] convertSequenceToObjectArray( - TypeObject sourceObject) - throws com.sun.star.lang.IllegalArgumentException - { - Object array = sourceObject.aValue; - Class<?> c = array.getClass(); - Object[] aShortVal = null; - if (c.equals(byte[].class)) - { - byte[] vals = (byte[]) array; - aShortVal = new Object[vals.length]; - for (int i = 0; i < vals.length; i++) - { - aShortVal[i] = new Byte(vals[i]); - } - } - else if (c.equals(short[].class)) - { - short[] vals = (short[]) array; - aShortVal = new Object[vals.length]; - for (int i = 0; i < vals.length; i++) - { - aShortVal[i] = new Short(vals[i]); - } - } - else if (c.equals(int[].class)) - { - int[] vals = (int[]) array; - aShortVal = new Object[vals.length]; - for (int i = 0; i < vals.length; i++) - { - aShortVal[i] = new Integer(vals[i]); - } - } - else if (c.equals(long[].class)) - { - long[] vals = (long[]) array; - aShortVal = new Object[vals.length]; - for (int i = 0; i < vals.length; i++) - { - aShortVal[i] = new Long(vals[i]); - } - } - else if (c.equals(float[].class)) - { - float[] vals = (float[]) array; - aShortVal = new Object[vals.length]; - for (int i = 0; i < vals.length; i++) - { - aShortVal[i] = new Float(vals[i]); - } - } - else if (c.equals(double[].class)) - { - double[] vals = (double[]) array; - aShortVal = new Object[vals.length]; - for (int i = 0; i < vals.length; i++) - { - aShortVal[i] = new Double(vals[i]); - } - } - else if (c.equals(boolean[].class)) - { - boolean[] vals = (boolean[]) array; - aShortVal = new Object[vals.length]; - for (int i = 0; i < vals.length; i++) - { - aShortVal[i] = Boolean.valueOf(vals[i]); - } - } - // if nothing did match, try this - if (aShortVal == null) - { - try - { - aShortVal = (Object[]) array; - } - catch (java.lang.ClassCastException e) - { - // unknown type cannot be converted - throw new com.sun.star.lang.IllegalArgumentException( - "Cannot convert unknown type: '" + e.getMessage() + "'"); - } - } - return aShortVal; - } - - - - - - private static double roundDouble(double _dblvalue, int _ndecimals) - { - double dblfactor = java.lang.Math.pow(10.0, _ndecimals); - return ((int) (_dblvalue * dblfactor)) / dblfactor; } } diff --git a/wizards/com/sun/star/wizards/common/PropertySetHelper.java b/wizards/com/sun/star/wizards/common/PropertySetHelper.java index 660d4906f690..bebab376c0d0 100644 --- a/wizards/com/sun/star/wizards/common/PropertySetHelper.java +++ b/wizards/com/sun/star/wizards/common/PropertySetHelper.java @@ -17,13 +17,9 @@ */ package com.sun.star.wizards.common; -import com.sun.star.beans.Property; import com.sun.star.uno.UnoRuntime; import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.XPropertySetInfo; import com.sun.star.uno.AnyConverter; -import com.sun.star.lang.XServiceInfo; - import java.util.HashMap; public class PropertySetHelper @@ -260,34 +256,4 @@ public class PropertySetHelper } return aObject; } - - - - /** - Debug helper, to show all properties which are available in the current object. - */ - private void showProperties() - { - String sName = PropertyNames.EMPTY_STRING; - - if (m_xPropertySet != null) - { - XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, m_xPropertySet); - if (xServiceInfo != null) - { - sName = xServiceInfo.getImplementationName(); - } - XPropertySetInfo xInfo = m_xPropertySet.getPropertySetInfo(); - Property[] aAllProperties = xInfo.getProperties(); - DebugHelper.writeInfo("Show all properties of Implementation of :'" + sName + "'"); - for (int i = 0; i < aAllProperties.length; i++) - { - DebugHelper.writeInfo(" - " + aAllProperties[i].Name); - } - } - else - { - DebugHelper.writeInfo("The given object don't support XPropertySet interface."); - } - } } diff --git a/wizards/com/sun/star/wizards/form/FormConfiguration.java b/wizards/com/sun/star/wizards/form/FormConfiguration.java index 3ef163cd6b6b..a871b1c4bb45 100644 --- a/wizards/com/sun/star/wizards/form/FormConfiguration.java +++ b/wizards/com/sun/star/wizards/form/FormConfiguration.java @@ -145,29 +145,6 @@ public class FormConfiguration Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bsupportsRelations && (chkcreateSubForm.getState() == 1))); } - private void toggleSteps() - { - if (chkcreateSubForm.getState() == 1) - { - if (optOnExistingRelation.getState()) - { - onexistingRelationSelection(); - } - else if (optSelectManually.getState()) - { - CurUnoDialog.enablefromStep(FormWizard.SOFIELDLINKER_PAGE, (CurSubFormFieldSelection.getSelectedFieldNames().length > 0)); - CurUnoDialog.setStepEnabled(FormWizard.SOSUBFORMFIELDS_PAGE, true); - } - } - else - { - CurUnoDialog.setStepEnabled(FormWizard.SOSUBFORMFIELDS_PAGE, false); - CurUnoDialog.setStepEnabled(FormWizard.SOFIELDLINKER_PAGE, false); - CurUnoDialog.enablefromStep(FormWizard.SOCONTROL_PAGE, true); - } - toggleRelationsListbox(); - } - public String getreferencedTableName() { if (areexistingRelationsdefined()) @@ -184,27 +161,6 @@ public class FormConfiguration return PropertyNames.EMPTY_STRING; } - private void onexistingRelationSelection() - { - String scurreferencedTableName = getreferencedTableName(); - if (scurreferencedTableName.length() > 0) - { - if (CurSubFormFieldSelection.getSelectedCommandName().equals(scurreferencedTableName)) - { - CurUnoDialog.enablefromStep(FormWizard.SOSUBFORMFIELDS_PAGE, true); - CurUnoDialog.setStepEnabled(FormWizard.SOFIELDLINKER_PAGE, false); - return; - } - else - { - CurUnoDialog.setStepEnabled(FormWizard.SOSUBFORMFIELDS_PAGE, true); - CurUnoDialog.enablefromStep(FormWizard.SOFIELDLINKER_PAGE, false); - return; - } - } - CurUnoDialog.enablefromStep(FormWizard.SOSUBFORMFIELDS_PAGE, false); - } - private void toggleRelationsListbox() { boolean bdoenable = bsupportsRelations && this.optOnExistingRelation.getState() && (chkcreateSubForm.getState() == 1); diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java index 399855a24fc3..a60a75c6e94e 100644 --- a/wizards/com/sun/star/wizards/table/FieldFormatter.java +++ b/wizards/com/sun/star/wizards/table/FieldFormatter.java @@ -239,18 +239,6 @@ public class FieldFormatter implements XItemListener - private String[] shiftArrayItem(String[] _slist, int _oldindex, int _shiftcount) - { - int newindex = _oldindex + _shiftcount; - if ((newindex >= 0) && (newindex < _slist.length)) - { - String buffer = _slist[newindex]; - _slist[newindex] = _slist[_oldindex]; - _slist[_oldindex] = buffer; - } - return _slist; - } - public boolean updateColumnofColumnDescriptor() { Object oColumn = Helper.getUnoPropertyValue(oColumnDescriptorModel, "Column"); diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.java b/wizards/com/sun/star/wizards/ui/UnoDialog2.java index 2d1ecbc70c0f..701d435ded3c 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog2.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.java @@ -105,30 +105,6 @@ public class UnoDialog2 extends UnoDialog return insertCheckBox(sName, itemChanged, this, sPropNames, oPropValues); } - private XComboBox insertComboBox(String sName, String actionPerformed, String itemChanged, String textChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - XComboBox xComboBox = (XComboBox) insertControlModel2("com.sun.star.awt.UnoControlComboBoxModel", sName, sPropNames, oPropValues, XComboBox.class); - if (actionPerformed != null) - { - xComboBox.addActionListener((XActionListener) guiEventListener); - guiEventListener.add(sName, EVENT_ACTION_PERFORMED, actionPerformed, eventTarget); - } - if (itemChanged != null) - { - xComboBox.addItemListener((XItemListener) guiEventListener); - guiEventListener.add(sName, EVENT_ITEM_CHANGED, itemChanged, eventTarget); - } - if (textChanged != null) - { - XTextComponent xTextComponent = UnoRuntime.queryInterface(XTextComponent.class, xComboBox); - xTextComponent.addTextListener((XTextListener) guiEventListener); - guiEventListener.add(sName, EVENT_TEXT_CHANGED, textChanged, eventTarget); - } - return xComboBox; - } - - - public XListBox insertListBox(String sName, String actionPerformed, String itemChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) { XListBox xListBox = (XListBox) insertControlModel2("com.sun.star.awt.UnoControlListBoxModel", sName, sPropNames, oPropValues, XListBox.class); @@ -210,55 +186,6 @@ public class UnoDialog2 extends UnoDialog return UnoRuntime.queryInterface(type, xField); } - private XControl insertFileControl(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - return (XControl) insertEditField(sName, sTextChanged, eventTarget, "com.sun.star.awt.UnoControlFileControlModel", sPropNames, oPropValues, XControl.class); - } - - - - private XCurrencyField insertCurrencyField(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - return (XCurrencyField) insertEditField(sName, sTextChanged, eventTarget, "com.sun.star.awt.UnoControlCurrencyFieldModel", sPropNames, oPropValues, XCurrencyField.class); - } - - - - private XDateField insertDateField(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - return (XDateField) insertEditField(sName, sTextChanged, eventTarget, "com.sun.star.awt.UnoControlDateFieldModel", sPropNames, oPropValues, XDateField.class); - } - - - - private XNumericField insertNumericField(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - return (XNumericField) insertEditField(sName, sTextChanged, eventTarget, "com.sun.star.awt.UnoControlNumericFieldModel", sPropNames, oPropValues, XNumericField.class); - } - - - - private XTimeField insertTimeField(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - return (XTimeField) insertEditField(sName, sTextChanged, eventTarget, "com.sun.star.awt.UnoControlTimeFieldModel", sPropNames, oPropValues, XTimeField.class); - } - - - - private XPatternField insertPatternField(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - return (XPatternField) insertEditField(sName, sTextChanged, eventTarget, "com.sun.star.awt.UnoControlPatternFieldModel", sPropNames, oPropValues, XPatternField.class); - } - - - - private XTextComponent insertFormattedField(String sName, String sTextChanged, Object eventTarget, String[] sPropNames, Object[] oPropValues) - { - return (XTextComponent) insertEditField(sName, sTextChanged, eventTarget, "com.sun.star.awt.UnoControlFormattedFieldModel", sPropNames, oPropValues, XTextComponent.class); - } - - - public XControl insertFixedLine(String sName, String[] sPropNames, Object[] oPropValues) { Object oLine = insertControlModel2("com.sun.star.awt.UnoControlFixedLineModel", sName, sPropNames, oPropValues); diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.java b/wizards/com/sun/star/wizards/ui/event/DataAware.java index ec9af54a2eab..17485dc012fb 100644 --- a/wizards/com/sun/star/wizards/ui/event/DataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/DataAware.java @@ -64,24 +64,6 @@ public abstract class DataAware { } /** - * sets a new data object. Optionally - * update the UI. - * @param obj the new data object. - * @param updateUI if true updateUI() will be called. - */ - private void setDataObject(Object obj, boolean updateUI) { - - if (obj != null && !value.isAssignable(obj.getClass())) - throw new ClassCastException("can not cast new DataObject to original Class"); - - dataObject = obj; - - if (updateUI) - updateUI(); - - } - - /** * Sets the given value to the data object. * this method delegates the job to the * Value object, but can be overwritten if @@ -115,23 +97,6 @@ public abstract class DataAware { protected abstract Object getFromUI(); /** - * updates the UI control according to the - * current state of the data object. - */ - private void updateUI() { - Object data = getFromData(); - Object ui = getFromUI(); - if (!equals(data, ui)) - try { - setToUI(data); - } catch (Exception ex) { - ex.printStackTrace(); - //TODO tell user... - } - enableControls(data); - } - - /** * enables * @param currentValue */ diff --git a/wizards/com/sun/star/wizards/ui/event/Task.java b/wizards/com/sun/star/wizards/ui/event/Task.java index 75608d9ffcaf..252fa8aad864 100644 --- a/wizards/com/sun/star/wizards/ui/event/Task.java +++ b/wizards/com/sun/star/wizards/ui/event/Task.java @@ -52,25 +52,6 @@ public class Task fireTaskStatusChanged(); } - private void advance(boolean success_) - { - if (success_) - { - successful++; - } - else - { - failed++; - } - fireTaskStatusChanged(); - if (failed + successful == max) - { - fireTaskFinished(); - } - } - - - public int getStatus() { return successful + failed; @@ -90,36 +71,6 @@ public class Task } } - private void fireTaskStarted() - { - TaskEvent te = new TaskEvent(this, TaskEvent.TASK_STARTED); - - for (int i = 0; i < listeners.size(); i++) - { - listeners.get(i).taskStarted(te); - } - } - - private void fireTaskFailed() - { - TaskEvent te = new TaskEvent(this, TaskEvent.TASK_FAILED); - - for (int i = 0; i < listeners.size(); i++) - { - listeners.get(i).taskFinished(te); - } - } - - private void fireTaskFinished() - { - TaskEvent te = new TaskEvent(this, TaskEvent.TASK_FINISHED); - - for (int i = 0; i < listeners.size(); i++) - { - listeners.get(i).taskFinished(te); - } - } - private void fireSubtaskNameChanged() { TaskEvent te = new TaskEvent(this, TaskEvent.SUBTASK_NAME_CHANGED); diff --git a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java index 310c83ec0a28..0ef03552b00b 100644 --- a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java +++ b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java @@ -120,43 +120,6 @@ public class UnoDataAware extends DataAware return Helper.getUnoPropertyValue(unoModel, unoPropName); } - private static UnoDataAware attachTextControl(Object data, String prop, Object unoText, final Listener listener, String unoProperty, boolean field, Object value) - { - XTextComponent text = UnoRuntime.queryInterface(XTextComponent.class, unoText); - final UnoDataAware uda = new UnoDataAware(data, - field - ? DataAwareFields.getFieldValueFor(data, prop, value) - : new DataAware.PropertyValue(prop, data), - text, unoProperty); - text.addTextListener(new XTextListener() - { - - public void textChanged(TextEvent te) - { - uda.updateData(); - if (listener != null) - { - listener.eventPerformed(te); - } - } - - public void disposing(EventObject eo) - { - } - }); - return uda; - } - - - - - - - - - - - static XItemListener itemListener(final DataAware da, final Listener listener) { return new XItemListener() |