Java 类com.intellij.uiDesigner.propertyInspector.renderers.ColorRenderer 实例源码

项目:tools-idea    文件:ColorEditor.java   
protected void buildChooser() {
  setLayout(new BorderLayout());
  myDescriptorList = new JBList(myColorDescriptors);
  myDescriptorList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  myDescriptorList.setVisibleRowCount(15);
  myDescriptorList.setCellRenderer(new ColorRenderer());
  myDescriptorList.addListSelectionListener(new ListSelectionListener() {
    public void valueChanged(ListSelectionEvent e) {
      ColorDescriptor descriptor = (ColorDescriptor)myDescriptorList.getSelectedValue();
      getColorSelectionModel().setSelectedColor(new ColorDescriptorWrapper(descriptor));
    }
  });
  new ListSpeedSearch(myDescriptorList);
  add(ScrollPaneFactory.createScrollPane(myDescriptorList), BorderLayout.CENTER);
}
项目:consulo-ui-designer    文件:ColorEditor.java   
protected void buildChooser() {
  setLayout(new BorderLayout());
  myDescriptorList = new JBList(myColorDescriptors);
  myDescriptorList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  myDescriptorList.setVisibleRowCount(15);
  myDescriptorList.setCellRenderer(new ColorRenderer());
  myDescriptorList.addListSelectionListener(new ListSelectionListener() {
    public void valueChanged(ListSelectionEvent e) {
      ColorDescriptor descriptor = (ColorDescriptor)myDescriptorList.getSelectedValue();
      getColorSelectionModel().setSelectedColor(new ColorDescriptorWrapper(descriptor));
    }
  });
  new ListSpeedSearch(myDescriptorList);
  add(ScrollPaneFactory.createScrollPane(myDescriptorList), BorderLayout.CENTER);
}