001package jmri.jmrit.whereused; 002 003import javax.swing.JTextArea; 004import jmri.NamedBean; 005import jmri.NamedBean.DisplayOptions; 006 007/** 008 * Find Block references. 009 * 010 * @author Dave Sand Copyright (C) 2020 011 */ 012 013public class BlockWhereUsed { 014 015 /** 016 * Populate a textarea with the where used content for the supplied sensor. 017 * @param block The block bean. 018 * @return a populated textarea. 019 */ 020 static public JTextArea getWhereUsed(NamedBean block) { 021 JTextArea textArea = new JTextArea(); 022 String label = Bundle.getMessage("MakeLabel", Bundle.getMessage("BeanNameBlock")); // NOI18N 023 textArea.append(Bundle.getMessage("ReferenceTitle", label, block.getDisplayName(DisplayOptions.USERNAME_SYSTEMNAME))); // NOI18N 024 textArea.append(Bundle.getMessage("ListenerCount", block.getNumPropertyChangeListeners())); // NOI18N 025 026 textArea.append(WhereUsedCollectors.checkLayoutBlocks(block)); 027 textArea.append(WhereUsedCollectors.checkSignalMastLogic(block)); 028 textArea.append(WhereUsedCollectors.checkSections(block)); 029 textArea.append(WhereUsedCollectors.checkPanels(block)); 030 textArea.append(WhereUsedCollectors.checkCTC(block)); 031 textArea.append(WhereUsedCollectors.checkLogixNGConditionals(block)); 032 return textArea; 033 } 034}