com.ptc.wgmecad
Class PortUtils

java.lang.Object
  extended bycom.ptc.wgmecad.PortUtils

public class PortUtils
extends Object

A collection of utilities that differ client's behavior on R7 and X05.
Objective: to keep all clients file except this as much alike as possible in both streams, ideally - not differing at all.


Constructor Summary
PortUtils()
           
 
Method Summary
static String correctNumber(String number)
          Uppercases input arg in X05, returns as is in R7 as X-05 needs to uppercase Number fields automatically
static JTextField newNumberField()
          Returns new instance of UpperCaseJTextField for X-05, new instance javax.swing.JTextField for 7.0 as X-05 needs to uppercase Number fields automatically
static boolean validateAttribute(String attributeName, String attributeValue)
          Wrapper for com.ptc.epm.commands.util.AttributeHelper.validateAttribute which is throwing WTException in X05, and doesn't in R7
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortUtils

public PortUtils()
Method Detail

newNumberField

public static JTextField newNumberField()
Returns new instance of UpperCaseJTextField for X-05, new instance javax.swing.JTextField for 7.0 as X-05 needs to uppercase Number fields automatically

Returns:
new UpperCaseJTextField for X-05, new javax.swing.JTextField for 7.0

correctNumber

public static String correctNumber(String number)
Uppercases input arg in X05, returns as is in R7 as X-05 needs to uppercase Number fields automatically

Parameters:
number - Incoming doc number
Returns:
Uppercased input arg in X05, untouched in R7

validateAttribute

public static boolean validateAttribute(String attributeName,
                                        String attributeValue)
Wrapper for com.ptc.epm.commands.util.AttributeHelper.validateAttribute which is throwing WTException in X05, and doesn't in R7

Parameters:
attributeName - Attribute's name
attributeValue - Attribute's value
Returns:
true if the name exists and name/value pair is valid; false otherwise