@Override public Component getTitlePane(ComponentOperator operator) { ComponentSearcher cs = new ComponentSearcher((Container) operator.getSource()); cs.setOutput(operator.getOutput().createErrorOutput()); return (cs.findComponent(new ComponentChooser() { @Override public boolean checkComponent(Component comp) { if (System.getProperty("java.version").startsWith("1.2")) { return comp.getClass().getName().endsWith("InternalFrameTitlePane"); } else { return comp instanceof BasicInternalFrameTitlePane; } } @Override public String getDescription() { return "Title pane"; } @Override public String toString() { return "getTitlePane.ComponentChooser{description = " + getDescription() + '}'; } })); }
@Override public Component add(Component comp) { // Don't count internal swing components if (!(comp instanceof BasicInternalFrameTitlePane)) { hasContent = true; } return super.add(comp); }
public void testCreatePropertyChangeListener() { PropertyChangeListener listener = pane.createPropertyChangeListener(); assertTrue("!= null", listener != null); assertTrue("instanceof TitlePaneLayout", listener instanceof BasicInternalFrameTitlePane.PropertyChangeHandler); }
public void testCreateLayout() { LayoutManager layout = pane.createLayout(); assertTrue("!= null", layout != null); assertTrue("instanceof TitlePaneLayout", layout instanceof BasicInternalFrameTitlePane.TitlePaneLayout); }