# AbstractVisionComponent : preview and design mode detection

**URL:** <https://forum.inductiveautomation.com/t/abstractvisioncomponent-preview-and-design-mode-detection/7439>\
**Category:** Module Development\
**Created:** [October 20, 2013, 5:29pm UTC](https://forum.inductiveautomation.com/t/abstractvisioncomponent-preview-and-design-mode-detection/7439 "2013-10-20T17:29:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 20, 2013, 5:29pm UTC](https://forum.inductiveautomation.com/t/abstractvisioncomponent-preview-and-design-mode-detection/7439/1 "2013-10-20T17:29:21Z")

</div>

How to detect in an AbstractVisionComponent is we are in preview or design mode.  
How to be notified that the mode has changed ?  
I’ve only found onStartup/onShutdown when the component is created/destroyed.  
 ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![nclemeur](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nclemeur](https://forum.inductiveautomation.com/u/nclemeur)\
**Post date:** [October 31, 2013, 2:30am UTC](https://forum.inductiveautomation.com/t/abstractvisioncomponent-preview-and-design-mode-detection/7439/2 "2013-10-31T02:30:28Z")

</div>

Did you try to check what Connection Mode you were in? From the com.inductiveautomation.ignition.client.gateway\_interface.GatewayConnection javadoc, you probably need to look at the method getConnectionMode. If this is working, you might be able to register your own PropertyChangeListener or ConnectionListener, but it is not completely obvious from the documentation what events you’ll get, so might need to listen to all property changes initially and then filter out the one you don’t need. You can access the GatewayConnection through the static method GatewayConnectionManager.getInstance…

Hopefully this will work for you.

Cheers  
Nicolas

---

<div class="post-metadata">

**Author:** ![camatt3](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@camatt3](https://forum.inductiveautomation.com/u/camatt3)\
**Post date:** [August 3, 2017, 4:06am UTC](https://forum.inductiveautomation.com/t/abstractvisioncomponent-preview-and-design-mode-detection/7439/3 "2017-08-03T04:06:40Z")

</div>

In case anyone else trying to figure it out stumbles across this post, this worked for me:

import com.inductiveautomation.factorypmi.application.FPMISystem;  
if (FPMISystem.Mode.DESIGN == FPMISystem.getMode())  
…
