JCheckBoxFixture titleCheckBox = window.checkBox(new CheckBoxMatcher("Panel Title Bar"));
titleCheckBox.click();
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
// check that both focus lost and enter will trigger focus for text fields
JTextComponentFixture textFixture = window.textBox(new TextFieldMatcher("Panel Title:"));
textFixture.enterText("abc").pressAndReleaseKey(KeyPressInfo.keyCode(KeyEvent.VK_ENTER));
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
titleCheckBox.focus();
// should not fire persistence event if the text hasn't changed
Mockito.verify(mockCanvasManifestation,Mockito.times(persistentCount)).fireFocusPersist();
textFixture.focus();
textFixture.enterText("123");
titleCheckBox.focus();
Mockito.verify(mockCanvasManifestation,Mockito.times(persistentCount)).fireFocusPersist();
// check that selecting the border color call persistence
JComboBoxFixture colorFixture = window.comboBox(new ComboBoxMatcher("Color:"));
colorFixture.selectItem(2);
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
window.toggleButton(new JToggleButtonMatcher("All borders")).click();
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
// check the no border button state
window.toggleButton(new JToggleButtonMatcher("No borders")).click();
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
window.comboBox(new ComboBoxMatcher("panelTitleFontComboBox")).selectItem("Serif");
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
PANEL_TITLE_FONT_SIZE_SPINNER.spinnerIn(window).select(18);
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
persistentCount++;
window.toggleButton(new JToggleButtonMatcher("panelTitleFontStyleBold")).click();
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
persistentCount++;
window.toggleButton(new JToggleButtonMatcher("panelTitleFontStyleItalic")).click();
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
window.toggleButton(new JToggleButtonMatcher("panelTitleFontStyleUnderline")).click();
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
window.comboBox(new ComboBoxMatcher("panelTitleFontColorComboBox")).selectItem(2);
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
window.comboBox(new ComboBoxMatcher("panelTitleBackgroundColorComboBox")).selectItem(2);
Mockito.verify(mockCanvasManifestation,Mockito.times(++persistentCount)).fireFocusPersist();
controlPanel.informZeroPanelsSelected();
titleCheckBox.requireDisabled();
textFixture.requireDisabled();
window.toggleButton(new JToggleButtonMatcher("All borders")).requireDisabled();
window.button(new JButtonMatcher("Align to bottom edge")).requireDisabled();
window.comboBox(new ComboBoxMatcher("panelTitleFontComboBox")).requireDisabled();
PANEL_TITLE_FONT_SIZE_SPINNER.spinnerIn(window).requireDisabled();
window.toggleButton(new JToggleButtonMatcher("panelTitleFontStyleBold")).requireDisabled();
window.toggleButton(new JToggleButtonMatcher("panelTitleFontStyleItalic")).requireDisabled();
window.toggleButton(new JToggleButtonMatcher("panelTitleFontStyleUnderline")).requireDisabled();
window.comboBox(new ComboBoxMatcher("panelTitleFontColorComboBox")).requireDisabled();
window.comboBox(new ComboBoxMatcher("panelTitleBackgroundColorComboBox")).requireDisabled();
controlPanel.informMultipleViewPanelsSelected(Collections.<Panel>emptyList());
titleCheckBox.requireEnabled();
textFixture.requireDisabled();
window.toggleButton(new JToggleButtonMatcher("All borders")).requireEnabled();
window.button(new JButtonMatcher("Align to bottom edge")).requireEnabled();
window.comboBox(new ComboBoxMatcher("panelTitleFontComboBox")).requireEnabled();
PANEL_TITLE_FONT_SIZE_SPINNER.spinnerIn(window).requireEnabled();
window.toggleButton(new JToggleButtonMatcher("panelTitleFontStyleBold")).requireEnabled();