diff options
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternDialog.java')
-rw-r--r-- | platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternDialog.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternDialog.java index abdcf6c44047..f736a02d83bf 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/GenerateByPatternDialog.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.codeInsight.generation; import com.intellij.codeInsight.template.Template; @@ -13,6 +28,7 @@ import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.treeStructure.SimpleTree; import com.intellij.ui.treeStructure.Tree; import com.intellij.util.containers.MultiMap; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -55,8 +71,9 @@ public class GenerateByPatternDialog extends DialogWrapper { }; myTree.setRootVisible(false); myTree.setCellRenderer(new DefaultTreeCellRenderer() { + @NotNull @Override - public Component getTreeCellRendererComponent(JTree tree, + public Component getTreeCellRendererComponent(@NotNull JTree tree, Object value, boolean sel, boolean expanded, @@ -78,7 +95,7 @@ public class GenerateByPatternDialog extends DialogWrapper { myTree.setModel(new DefaultTreeModel(root)); myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() { @Override - public void valueChanged(TreeSelectionEvent e) { + public void valueChanged(@NotNull TreeSelectionEvent e) { update(); } }); @@ -141,6 +158,7 @@ public class GenerateByPatternDialog extends DialogWrapper { private DefaultMutableTreeNode createNode(@Nullable PatternDescriptor descriptor) { DefaultMutableTreeNode root = new DefaultMutableTreeNode(descriptor) { + @NotNull @Override public String toString() { Object object = getUserObject(); |