update copyrights
[fedora-idea.git] / platform / lang-impl / src / com / intellij / codeInsight / template / impl / LiveTemplatesConfigurable.java
blob2d573b2f71e091b0288c72f52c6f4c703c5cdc3b
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.
17 package com.intellij.codeInsight.template.impl;
19 import com.intellij.codeInsight.CodeInsightBundle;
20 import com.intellij.openapi.options.BaseConfigurable;
21 import com.intellij.openapi.options.SearchableConfigurable;
22 import com.intellij.openapi.util.IconLoader;
23 import org.jetbrains.annotations.Nullable;
25 import javax.swing.*;
27 public class LiveTemplatesConfigurable extends BaseConfigurable implements SearchableConfigurable {
28 private TemplateListPanel myPanel;
30 public boolean isModified() {
31 return myPanel != null && myPanel.isModified();
34 public JComponent createComponent() {
35 myPanel = new TemplateListPanel();
36 return myPanel;
39 public String getDisplayName() {
40 return CodeInsightBundle.message("templates.settings.page.title");
43 public Icon getIcon() {
44 return IconLoader.getIcon("/general/liveTemplates.png");
47 public void reset() {
48 myPanel.reset();
51 public void apply() {
52 myPanel.apply();
55 public void disposeUIResources() {
56 if (myPanel != null) {
57 myPanel.dispose();
59 myPanel = null;
62 public String getHelpTopic() {
63 return "editing.templates";
66 public String getId() {
67 return getHelpTopic();
70 @Nullable
71 public Runnable enableSearch(String option) {
72 return null;