update copyright
[fedora-idea.git] / plugins / ui-designer / src / com / intellij / uiDesigner / wizard / BeanPropertyListCellRenderer.java
blob98fde0fecaf500fd95dee7c12d3798ff918be570
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.uiDesigner.wizard;
18 import com.intellij.ui.ColoredListCellRenderer;
19 import com.intellij.ui.SimpleTextAttributes;
20 import com.intellij.uiDesigner.UIDesignerBundle;
22 import javax.swing.*;
24 /**
25 * @author Anton Katilin
26 * @author Vladimir Kondratyev
28 final class BeanPropertyListCellRenderer extends ColoredListCellRenderer{
29 private final SimpleTextAttributes myAttrs1;
30 private final SimpleTextAttributes myAttrs2;
32 public BeanPropertyListCellRenderer() {
33 myAttrs1 = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
34 myAttrs2 = SimpleTextAttributes.REGULAR_ATTRIBUTES;
37 protected void customizeCellRenderer(
38 final JList list,
39 final Object value,
40 final int index,
41 final boolean selected,
42 final boolean hasFocus
43 ) {
44 final BeanProperty property = (BeanProperty)value;
45 if(property == null){
46 append(UIDesignerBundle.message("property.not.defined"), myAttrs2);
48 else{
49 append(property.myName, myAttrs1);
50 append(" ", myAttrs1);
51 append(property.myType, myAttrs2);