update copyright
[fedora-idea.git] / xml / impl / src / com / intellij / ide / browsers / BrowserSettingsProviderImpl.java
blobc583f89b5428a0abcda3ca5e85f71498c09975c8
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.ide.browsers;
18 import com.intellij.ide.BrowserSettingsProvider;
19 import com.intellij.openapi.diagnostic.Logger;
20 import com.intellij.openapi.options.ConfigurationException;
21 import org.jetbrains.annotations.NotNull;
23 import javax.swing.*;
25 /**
26 * @author spleaner
28 public class BrowserSettingsProviderImpl extends BrowserSettingsProvider {
29 private static final Logger LOG = Logger.getInstance("#com.intellij.ide.browsers.BrowserSettingsProviderImpl");
31 private WebBrowsersPanel mySettingsPanel;
32 private final BrowsersConfiguration myConfiguration;
34 public BrowserSettingsProviderImpl(@NotNull final BrowsersConfiguration configuration) {
35 myConfiguration = configuration;
38 public JComponent createComponent() {
39 if (mySettingsPanel == null) {
40 mySettingsPanel = new WebBrowsersPanel(myConfiguration);
43 return mySettingsPanel;
46 public boolean isModified() {
47 LOG.assertTrue(mySettingsPanel != null);
48 return mySettingsPanel.isModified();
51 public void apply() throws ConfigurationException {
52 LOG.assertTrue(mySettingsPanel != null);
53 mySettingsPanel.apply();
56 public void reset() {
57 LOG.assertTrue(mySettingsPanel != null);
58 mySettingsPanel.reset();
61 public void disposeUIResources() {
62 mySettingsPanel.dispose();
63 mySettingsPanel = null;