JComponent (JComponent component) { if (component instanceof LabeledComponent) { component = ((LabeledComponent<?>)component).getComponent(); } if (component instanceof TagButton) { return ((TagButton)component).myButton; } if (component instanceof ComponentWithBrowseButton) { return ((ComponentWithBrowseButton<?>)component).getChildComponent(); } if (component instanceof RawCommandLineEditor) { return ((RawCommandLineEditor)component).getEditorField(); } return component; }