public FormDataTableCellEditor(Project project, JBDebuggerFormTable.ItemInfo itemInfo) { component = new JPanel(new BorderLayout()); editor = new EditorTextField("", project, StdFileTypes.PLAIN_TEXT); component.add(editor, BorderLayout.CENTER); combobox = new ComboBoxWithWidePopup<>(ContainerUtil.ar("Text", "File")); combobox.setSelectedItem(StringUtil.isEmpty(itemInfo.type) ? "Text" : itemInfo.type); combobox.setFocusable(false); combobox.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { itemInfo.type = e.getItem().toString(); } }); component.add(combobox, BorderLayout.EAST); }
public FramesPanel(Project project, DebuggerStateManager stateManager) { super(project, stateManager); myStateManager = stateManager; setLayout(new BorderLayout()); myThreadsCombo = new ComboBoxWithWidePopup(); myThreadsCombo.setRenderer(new DebuggerComboBoxRenderer(myThreadsCombo.getRenderer())); myThreadsListener = new ThreadsListener(); myThreadsCombo.addItemListener(myThreadsListener); myFramesList = new FramesList(project); myFramesListener = new FramesListener(); myFramesList.addListSelectionListener(myFramesListener); myFramesList.addMouseListener(new MouseAdapter() { public void mousePressed(final MouseEvent e) { int index = myFramesList.locationToIndex(e.getPoint()); if (index >= 0 && myFramesList.isSelectedIndex(index)) { processListValue(myFramesList.getModel().getElementAt(index)); } } }); registerThreadsPopupMenu(myFramesList); setBorder(null); final ActionToolbar toolbar = createToolbar(); Wrapper threads = new Wrapper(); CustomLineBorder border = new CustomLineBorder(CaptionPanel.CNT_ACTIVE_BORDER_COLOR, 0, 0, 1, 0); threads.setBorder(border); threads.add(toolbar.getComponent(), BorderLayout.EAST); threads.add(myThreadsCombo, BorderLayout.CENTER); add(threads, BorderLayout.NORTH); add(ScrollPaneFactory.createScrollPane(myFramesList), BorderLayout.CENTER); }
public DestinationFolderComboBox() { super(new ComboBoxWithWidePopup()); }