コード例 #1
0
    private NewColorAndFontPanel createPanel() {
      if (mySubPanel == null) {
        mySubPanel = myFactory.createPanel(ColorAndFontOptions.this);
        mySubPanel.reset(this);
        mySubPanel.addSchemesListener(
            new ColorAndFontSettingsListener.Abstract() {
              @Override
              public void schemeChanged(final Object source) {
                if (!myIsReset) {
                  resetSchemesCombo(source);
                }
              }
            });

        mySubPanel.addDescriptionListener(
            new ColorAndFontSettingsListener.Abstract() {
              @Override
              public void fontChanged() {
                for (NewColorAndFontPanel panel : getPanels()) {
                  panel.updatePreview();
                }
              }
            });
      }
      return mySubPanel;
    }
コード例 #2
0
 private void resetSchemesCombo(Object source) {
   myIsReset = true;
   try {
     myRootSchemesPanel.resetSchemesCombo(source);
     if (mySubPanelFactories != null) {
       for (NewColorAndFontPanel subPartialConfigurable : getPanels()) {
         subPartialConfigurable.reset(source);
       }
     }
   } finally {
     myIsReset = false;
   }
 }
コード例 #3
0
 @Override
 public void disposeUIResources() {
   if (mySubPanel != null) {
     mySubPanel.disposeUIResources();
     mySubPanel = null;
   }
 }
コード例 #4
0
    @Override
    public boolean isModified() {
      createPanel();
      for (MyColorScheme scheme : mySchemes.values()) {
        if (mySubPanel.containsFontOptions()) {
          if (scheme.isFontModified() || scheme.isConsoleFontModified()) {
            myRevertChangesCompleted = false;
            return true;
          }
        } else {
          for (EditorSchemeAttributeDescriptor descriptor : scheme.getDescriptors()) {
            if (mySubPanel.contains(descriptor) && descriptor.isModified()) {
              myRevertChangesCompleted = false;
              return true;
            }
          }
        }
      }

      return false;
    }