### WTProperties Example Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/util/WTProperties.html Example of getting applet properties and a specific property. ```java Properties props = WTProperties.getAppletProperties(); String bar = props.getProperty("wt.foo.bar"); ... ``` -------------------------------- ### Example Code for Setting Up Context-Sensitive Help Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/help/HelpContext.html This is a comprehensive example demonstrating the setup of context-sensitive help within a Java AWT component's addNotify method. It includes component initialization, HelpContext creation, adding components with specific topic IDs, setting the tool description display, and adding an action listener to a button to show help contents. ```Java public void addNotify() { // Call parents addNotify method. super.addNotify(); // This code is automatically generated by Visual Cafe when you add // components to the visual environment. It instantiates and initializes // the components. To modify the code, only use code syntax that matches // what Visual Cafe can generate, or Visual Cafe may be unable to back // parse your Java file into its visual environment. //{{INIT_CONTROLS setLayout(null); setVisible(false); ... showContentsButton = new java.awt.Button(); showContentsButton.setLabel("Show Contents"); showContentsButton.setBounds(insets().left + 216,insets().top + 108,96,24); add(showContentsButton); display = new java.awt.TextField(); display.setBounds(insets().left + 180,insets().top + 36,168,36); add(display); ... //}} // Give the components a name that the help system recoginizes. showButton.setName("TopicId_ShowContents"); // Create the HelpDeskContext. It will scan through and default a topic for each component. helpContext = new HelpContextImpl( this, helpSystem, "YourContextId" ); // Since the component "display" name doesn't match its topic id re-add it to the HelpContext. helpContext.addComponentHelp( display, "TopidId_Display" ); // Supply a TextComponent which will be used to display the tool descriptions. helpContext.setToolDescriptionDisplay( statusField ); // Show help contents when showContens button is pressed. showContentsButton.addActionListener( // Anonymous inner class new java.awt.event.ActionListener() { public void actionPerformed( java.awt.event.ActionEvent event ) { helpContext.showContents(); } } ); } // addNotify() ``` -------------------------------- ### WTUser Initialization Examples Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/org/WTUser.html Examples of how to initialize a WTUser instance. ```Java protected void initialize() Supports initialization, following construction of an instance. ``` ```Java protected void initialize(String name) Supports initialization, following construction of an instance. ``` ```Java protected void initialize(String name, String dn) Supports initialization, following construction of an instance. ``` ```Java protected void initialize(String name, String dn, String service) Supports initialization, following construction of an instance. ``` ```Java protected void initialize(String name, DirectoryContextProvider context) Supports initialization, following construction of an instance. ``` -------------------------------- ### getWfFolder Folder Path Example Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/workflow/engine/WfEngineService.html Example of a folder path format for getWfFolder. ```plaintext /System/Workflows/invalid input: '<'folder-name> ``` -------------------------------- ### FlexibleChangeConverter run example Source: https://nakedbikermonk.github.io/windchill-javadoc/index-files/index-19.html Example command-line usage for the FlexibleChangeConverter to perform conversion actions. ```bash java wt.change2.flexible.FlexibleChangeConverter java wt.change2.flexible.FlexibleChangeConverter -action java wt.change2.flexible.FlexibleChangeConverter -action -u wcadmin -p wcadmin ``` -------------------------------- ### start Method Source: https://nakedbikermonk.github.io/windchill-javadoc/com/ptc/windchill/mpml/reports/MPMLReportDelegate.html Called at the start of execution for initial setup. ```java protected void start(ReportParams params) throws WTException ``` -------------------------------- ### Method Details: setUploadedFromPath Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/content/_ApplicationData.html Details for the setUploadedFromPath method. ```java public void setUploadedFromPath(String uploadedFromPath) throws WTPropertyVetoException The path where this piece of content was uploaded from ``` -------------------------------- ### getPropertyValue Method Implementation Example Source: https://nakedbikermonk.github.io/windchill-javadoc/com/ptc/core/businessfield/common/BusinessField.html Example of how to get a field's property value. ```java Object getPropertyValue(String propertyName, Locale locale, String screenName) Get the fields property value. **Supported API:** true Parameters: `propertyName` - The name of the property to get the value of. `locale` - The locale to get the property value for. This is only necessary when requesting the value of a localizable property. May be null. `screenName` - The name of the screen to get the property value of. This is only necessary when requesting the property value of an attribute defined for an attribute in a layout (i.e. group membership). May be null. Returns: The value of the property. May return null. The datatype returned will be whatever the datatype of the property definition. ``` -------------------------------- ### Example application main Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/util/WTProperties.html Initializes WTContext with command line arguments, replaces system properties with WTProperties, and retrieves a property. ```java public static void main (String args) { // Initialize WTContext with command line arguments WTContext.init(args); // Replace system properties with WTProperties Properties props = WTProperties.getLocalProperties(); System.setProperties(props); // Get our wt.foo.bar property String bar = props.getProperty("wt.foo.bar"); ... } ``` -------------------------------- ### getStartTimeStamp Method Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/esi/ESITransactionFacade.html Gets the start timestamp of the transaction. ```java Timestamp getStartTimeStamp() Gets the start timestamp of the transaction. **Supported API:** true See Also: * `ESITransaction` ``` -------------------------------- ### WTContainer initializer example Source: https://nakedbikermonk.github.io/windchill-javadoc/index-files/index-24.html Example of how implementors of WTContainer should create a new WTContainerInfo in their initializer. ```Java protected void initialize() throws WTException { super.initialize(); try { setContainerInfo(WTContainerInfo.newWTContainerInfo()); } catch (WTPropertyVetoException wtpve) { throw new WTException(wtpve); } } ``` -------------------------------- ### AssociationDisplayAssistant Usage Example Source: https://nakedbikermonk.github.io/windchill-javadoc/wt/facade/persistedcollection/AssociationDisplayAssistant.html An example demonstrating how to instantiate and use the AssociationDisplayAssistant to get a localized display name for a relation key. ```java AssociationDisplayAssistant displayAssistant = new AssociationDisplayAssistant(locale, "com.myCompany.myBundle"); String displayValue = displayAssistant.getDisplayName(thisRelationKey); ``` -------------------------------- ### Delegate Registration Example Source: https://nakedbikermonk.github.io/windchill-javadoc/com/ptc/core/businessRules/relationship/BusinessRuleSetRelationshipDelegate.html Example of a delegate registration for getting the resulting objects for a primary object. The selector is the relationship key used to look up the delegate instance. ```xml