com.intellij.ui.IdeBorderFactory Java Examples
The following examples show how to use
com.intellij.ui.IdeBorderFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TablePanel.java From CodeGen with MIT License | 6 votes |
public TablePanel(Table table) { $$$setupUI$$$(); rootPanel.setBorder(IdeBorderFactory.createTitledBorder(table.getTableName(), false)); //不可整列移动 fieldTable.getTableHeader().setReorderingAllowed(false); //不可拉动表格 fieldTable.getTableHeader().setResizingAllowed(false); fieldTable.getEmptyText().setText("No Columns"); JPanel panel = ToolbarDecorator.createDecorator(fieldTable) .setAddAction(it -> addAction()) .setRemoveAction(it -> removeAction()) .setEditAction(it -> editAction()) .createPanel(); panel.setPreferredSize(JBUI.size(600, 200)); columnsPanel.setBorder(IdeBorderFactory.createTitledBorder("Columns", false)); columnsPanel.add(panel, BorderLayout.CENTER); mainPanel.add(columnsPanel); modelTextField.setText(table.getModelName()); tableTextField.setText(table.getTableName()); initFields(table.getFields()); this.getRootComponent().registerKeyboardAction(e -> this.getRootComponent().disable(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); }
Example #2
Source File: PrintDialog.java From consulo with Apache License 2.0 | 6 votes |
private JPanel createWrappingPanel() { JPanel panel = new JPanel(); panel.setBorder(IdeBorderFactory.createTitledBorder(CodeEditorBundle.message("print.wrapping.group"), true)); panel.setLayout(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.gridy = 0; gbConstraints.gridx = 0; gbConstraints.gridwidth = 1; gbConstraints.gridheight = 1; gbConstraints.weightx = 1; gbConstraints.fill = GridBagConstraints.BOTH; myRbNoWrap = new JRadioButton(CodeEditorBundle.message("print.wrapping.none.radio")); panel.add(myRbNoWrap, gbConstraints); myRbWrapAtWordBreaks = new JRadioButton(CodeEditorBundle.message("print.wrapping.word.breaks.radio")); gbConstraints.gridy++; panel.add(myRbWrapAtWordBreaks, gbConstraints); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(myRbNoWrap); buttonGroup.add(myRbWrapAtWordBreaks); return panel; }
Example #3
Source File: DesktopAlertImpl.java From consulo with Apache License 2.0 | 6 votes |
@Nullable @Override @RequiredUIAccess protected JComponent createSouthPanel() { JPanel panel = (JPanel)super.createSouthPanel(); if (myRemember != null) { myRememberBox = new DesktopCheckBoxImpl(); myRememberBox.setLabelText(LocalizeValue.of(myRemember.getMessageBoxText())); myRememberBox.setValue(myRemember.isRememberByDefault()); DialogUtil.registerMnemonic(myRememberBox.toAWTComponent(), '&'); JComponent southPanel = panel; panel = addDoNotShowCheckBox(southPanel, myRememberBox.toAWTComponent()); panel.setBorder(IdeBorderFactory.createEmptyBorder(JBUI.insetsTop(8))); } return panel; }
Example #4
Source File: DetailViewImpl.java From consulo with Apache License 2.0 | 6 votes |
@Override public void setPropertiesPanel(@Nullable final JPanel panel) { if (panel == null) { if (myDetailPanelWrapper != null) { myDetailPanelWrapper.removeAll(); } myLabel.setText(myEmptyLabel); add(myLabel, BorderLayout.CENTER); } else if (panel != myDetailPanel) { remove(myLabel); if (myDetailPanelWrapper == null) { myDetailPanelWrapper = new JPanel(new GridLayout(1, 1)); myDetailPanelWrapper.setBorder(IdeBorderFactory.createEmptyBorder(5, 5, 5, 5)); myDetailPanelWrapper.add(panel); add(myDetailPanelWrapper, BorderLayout.NORTH); } else { myDetailPanelWrapper.removeAll(); myDetailPanelWrapper.add(panel); } } myDetailPanel = panel; revalidate(); repaint(); }
Example #5
Source File: PrintDialog.java From consulo with Apache License 2.0 | 6 votes |
private JPanel createStylePanel() { JPanel panel = new JPanel(); panel.setBorder(IdeBorderFactory.createTitledBorder(CodeEditorBundle.message("print.style.group"), true)); panel.setLayout(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.gridy = 0; gbConstraints.gridx = 0; gbConstraints.gridwidth = 1; gbConstraints.gridheight = 1; gbConstraints.weightx = 1; gbConstraints.fill = GridBagConstraints.BOTH; myCbColorPrinting = new JCheckBox(CodeEditorBundle.message("print.style.color.printing.checkbox")); panel.add(myCbColorPrinting, gbConstraints); myCbSyntaxPrinting = new JCheckBox(CodeEditorBundle.message("print.style.syntax.printing.checkbox")); gbConstraints.gridy++; panel.add(myCbSyntaxPrinting, gbConstraints); myCbPrintAsGraphics = new JCheckBox(CodeEditorBundle.message("print.style.print.as.graphics.checkbox")); gbConstraints.gridy++; panel.add(myCbPrintAsGraphics, gbConstraints); return panel; }
Example #6
Source File: PrintDialog.java From consulo with Apache License 2.0 | 6 votes |
private JPanel createOrientationPanel() { JPanel panel = new JPanel(); panel.setBorder(IdeBorderFactory.createTitledBorder(CodeEditorBundle.message("print.orientation.group"), true)); panel.setLayout(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.gridy = 0; gbConstraints.gridx = 0; gbConstraints.gridwidth = 1; gbConstraints.gridheight = 1; gbConstraints.weightx = 1; gbConstraints.fill = GridBagConstraints.BOTH; myRbPortrait = new JRadioButton(CodeEditorBundle.message("print.orientation.portrait.radio")); panel.add(myRbPortrait, gbConstraints); myRbLandscape = new JRadioButton(CodeEditorBundle.message("print.orientation.landscape.radio")); gbConstraints.gridy++; panel.add(myRbLandscape, gbConstraints); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(myRbPortrait); buttonGroup.add(myRbLandscape); return panel; }
Example #7
Source File: MongoEditionPanel.java From nosql4idea with Apache License 2.0 | 6 votes |
public void updateEditionTree(DBObject mongoDocument) { String panelTitle = "New document"; if (mongoDocument != null) { panelTitle = "Edition"; } mainPanel.setBorder(IdeBorderFactory.createTitledBorder(panelTitle, true)); editTableView = new JsonTreeTableView(JsonTreeModel.buildJsonTree(mongoDocument), JsonTreeTableView.COLUMNS_FOR_WRITING); editTableView.setName("editionTreeTable"); editionTreePanel.invalidate(); editionTreePanel.removeAll(); editionTreePanel.add(new JBScrollPane(editTableView)); editionTreePanel.validate(); buildPopupMenu(); }
Example #8
Source File: ArrangementGroupingRulesControl.java From consulo with Apache License 2.0 | 6 votes |
public ArrangementGroupingRulesControl(@Nonnull ArrangementStandardSettingsManager settingsManager, @Nonnull ArrangementColorsProvider colorsProvider) { super(new DefaultTableModel(0, 1)); mySettingsManager = settingsManager; setDefaultRenderer(Object.class, new MyRenderer()); getColumnModel().getColumn(0).setCellEditor(new MyEditor()); setShowColumns(false); setShowGrid(false); setBorder(IdeBorderFactory.createBorder()); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); List<CompositeArrangementSettingsToken> groupingTokens = settingsManager.getSupportedGroupingTokens(); if (groupingTokens != null) { for (CompositeArrangementSettingsToken token : groupingTokens) { ArrangementGroupingComponent component = new ArrangementGroupingComponent(token, colorsProvider, settingsManager); myComponents.put(token.getToken(), component); getModel().addRow(new Object[]{component}); } } }
Example #9
Source File: BuckSettingsUI.java From buck with Apache License 2.0 | 6 votes |
private JPanel initUISettingsSection() { autoFormatOnBlur = new JCheckBox("Auto-format build files in editor (using buildifier)"); showDebug = new JCheckBox("Show debug in tool window"); JPanel panel = new JPanel(new GridBagLayout()); panel.setBorder(IdeBorderFactory.createTitledBorder("UI Settings", true)); GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.LINE_START; constraints.weightx = 1; constraints.gridy = 0; panel.add(autoFormatOnBlur, constraints); constraints.gridy = 1; panel.add(showDebug, constraints); return panel; }
Example #10
Source File: LayoutProjectCodeDialog.java From consulo with Apache License 2.0 | 6 votes |
@Override protected JComponent createCenterPanel() { myTitle.setText(myText); myOptionsPanel.setBorder(IdeBorderFactory.createTitledBorder(CodeInsightBundle.message("reformat.directory.dialog.options"))); myFiltersPanel.setBorder(IdeBorderFactory.createTitledBorder(CodeInsightBundle.message("reformat.directory.dialog.filters"))); myMaskWarningLabel.setIcon(AllIcons.General.Warning); myMaskWarningLabel.setVisible(false); myIncludeSubdirsCb.setVisible(shouldShowIncludeSubdirsCb()); initFileTypeFilter(); initScopeFilter(); restoreCbsStates(); return myWholePanel; }
Example #11
Source File: CompareWithSelectedRevisionAction.java From consulo with Apache License 2.0 | 6 votes |
private static JPanel createCommentsPanel(final TableView<VcsFileRevision> table) { final JTextArea textArea = createTextArea(); table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { final VcsFileRevision revision = table.getSelectedObject(); if (revision == null) { textArea.setText(""); } else { textArea.setText(revision.getCommitMessage()); textArea.select(0, 0); } } }); JPanel jPanel = new JPanel(new BorderLayout()); final JScrollPane textScrollPane = ScrollPaneFactory.createScrollPane(textArea); textScrollPane.setBorder(IdeBorderFactory.createTitledBorder(VcsBundle.message("border.selected.revision.commit.message"), false )); jPanel.add(textScrollPane, BorderLayout.SOUTH); jPanel.setPreferredSize(new Dimension(300, 100)); return jPanel; }
Example #12
Source File: CompareWithSelectedRevisionAction.java From consulo with Apache License 2.0 | 6 votes |
private static JPanel createCommentsPanel(final TreeTableView treeTable) { JPanel panel = new JPanel(new BorderLayout()); final JTextArea textArea = createTextArea(); treeTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { final int index = treeTable.getSelectionModel().getMinSelectionIndex(); if (index == -1) { textArea.setText(""); } else { final VcsFileRevision revision = getRevisionAt(treeTable, index); if (revision != null) { textArea.setText(revision.getCommitMessage()); } else { textArea.setText(""); } } } }); final JScrollPane textScrollPane = ScrollPaneFactory.createScrollPane(textArea); panel.add(textScrollPane, BorderLayout.CENTER); textScrollPane.setBorder(IdeBorderFactory.createTitledBorder(VcsBundle.message("border.selected.revision.commit.message"), false )); return panel; }
Example #13
Source File: VcsCommitInfoBalloon.java From consulo with Apache License 2.0 | 6 votes |
public VcsCommitInfoBalloon(@Nonnull JTree tree) { myTree = tree; myEditorPane = new JEditorPane(UIUtil.HTML_MIME, ""); myEditorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); myEditorPane.setEditable(false); myEditorPane.setBackground(HintUtil.INFORMATION_COLOR); myEditorPane.setFont(UIUtil.getToolTipFont()); myEditorPane.setBorder(HintUtil.createHintBorder()); Border margin = IdeBorderFactory.createEmptyBorder(3, 3, 3, 3); myEditorPane.setBorder(new CompoundBorder(myEditorPane.getBorder(), margin)); myEditorPane.addHyperlinkListener(new HyperlinkAdapter() { @Override protected void hyperlinkActivated(HyperlinkEvent e) { BrowserUtil.browse(e.getURL()); } }); myWrapper = new Wrapper(myEditorPane); myPopupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(myWrapper, null); myPopupBuilder.setCancelOnClickOutside(true).setResizable(true).setMovable(true).setRequestFocus(false) .setMinSize(new Dimension(80, 30)); }
Example #14
Source File: InstalledPluginsManagerMain.java From consulo with Apache License 2.0 | 6 votes |
@Nonnull @Override public JComponent createCustomComponent(Presentation presentation) { final JComponent component = super.createCustomComponent(presentation); final JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.add(component, BorderLayout.CENTER); final JLabel comp = new JLabel("Show:"); comp.setIconTextGap(0); comp.setHorizontalTextPosition(SwingConstants.RIGHT); comp.setVerticalTextPosition(SwingConstants.CENTER); comp.setAlignmentX(Component.RIGHT_ALIGNMENT); panel.add(comp, BorderLayout.WEST); panel.setBorder(IdeBorderFactory.createEmptyBorder(0, 2, 0, 0)); return panel; }
Example #15
Source File: ToolEditorDialog.java From consulo with Apache License 2.0 | 5 votes |
private JPanel getOptionsPanel() { JPanel panel = new JPanel(new MigLayout("fill, gap 10")); panel.setBorder(IdeBorderFactory.createTitledBorder(ToolsBundle.message("tools.options.group"), true)); panel.add(mySynchronizedAfterRunCheckbox); panel.add(myUseConsoleCheckbox); panel.add(myOutputFiltersButton, "ax right, wrap"); panel.add(myShowConsoleOnStdOutCheckbox); panel.add(myShowConsoleOnStdErrCheckbox, "spanx 2"); return panel; }
Example #16
Source File: CommenterForm.java From consulo with Apache License 2.0 | 5 votes |
public CommenterForm(Language language, @Nullable String title) { myLanguage = language; if (title != null) { myCommenterPanel.setBorder(IdeBorderFactory.createTitledBorder(title)); } myLineCommentAtFirstColumnCb.addActionListener(e -> { if (myLineCommentAtFirstColumnCb.isSelected()) { myLineCommentAddSpaceCb.setSelected(false); } myLineCommentAddSpaceCb.setEnabled(!myLineCommentAtFirstColumnCb.isSelected()); }); customizeSettings(); }
Example #17
Source File: AbstractFindUsagesDialog.java From consulo with Apache License 2.0 | 5 votes |
@Nullable protected JPanel createUsagesOptionsPanel() { JPanel optionsPanel = new JPanel(); optionsPanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.options.group"), true)); optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS)); addUsagesOptions(optionsPanel); return optionsPanel.getComponents().length == 0 ? null : optionsPanel; }
Example #18
Source File: ArrangementGroupingComponent.java From consulo with Apache License 2.0 | 5 votes |
private void init() { setLayout(new GridBagLayout()); add(myRowIndexControl, new GridBag().anchor(GridBagConstraints.CENTER) .insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, ArrangementConstants.HORIZONTAL_GAP * 2) ); add(myGroupingTypeToken.getUiComponent(), new GridBag().anchor(GridBagConstraints.WEST).insets(0, 0, 0, 2)); if (myOrderTypeToken != null) { add(myOrderTypeToken.getUiComponent(), new GridBag().anchor(GridBagConstraints.WEST)); } add(new JLabel(" "), new GridBag().weightx(1).fillCellHorizontally()); setBackground(UIUtil.getListBackground()); setBorder(IdeBorderFactory.createEmptyBorder(ArrangementConstants.VERTICAL_GAP)); }
Example #19
Source File: ArrangementListRowDecorator.java From consulo with Apache License 2.0 | 5 votes |
private void init() { setLayout(new GridBagLayout()); GridBag constraints = new GridBag().anchor(GridBagConstraints.CENTER) .insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, ArrangementConstants.HORIZONTAL_GAP * 2); add(myRowIndexControl, constraints); add(new InsetsPanel(mySortLabel), new GridBag().anchor(GridBagConstraints.CENTER).insets(0, 0, 0, ArrangementConstants.HORIZONTAL_GAP)); add(myDelegate.getUiComponent(), new GridBag().weightx(1).anchor(GridBagConstraints.WEST)); add(myEditButton, new GridBag().anchor(GridBagConstraints.EAST)); setBorder(IdeBorderFactory.createEmptyBorder(ArrangementConstants.VERTICAL_GAP)); }
Example #20
Source File: RunConfigurationsComboBoxAction.java From consulo with Apache License 2.0 | 5 votes |
@Nonnull @Override public JComponent createCustomComponent(final Presentation presentation) { ComboBoxButton button = createComboBoxButton(presentation); NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout()); panel.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, 2)); panel.add(button.getComponent()); return panel; }
Example #21
Source File: ToolEditorDialog.java From consulo with Apache License 2.0 | 5 votes |
private JPanel getShowInPanel() { JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0)); panel.setBorder(IdeBorderFactory.createTitledBorder(ToolsBundle.message("tools.menu.group"), true)); panel.add(myShowInMainMenuCheckbox); panel.add(myShowInEditorCheckbox); panel.add(myShowInProjectTreeCheckbox); panel.add(myShowInSearchResultsPopupCheckbox); return panel; }
Example #22
Source File: FilterDialog.java From consulo with Apache License 2.0 | 5 votes |
@Override protected JComponent createCenterPanel() { JPanel panel = new JPanel(new GridBagLayout()); JLabel nameLabel = new JLabel(IdeBundle.message("label.todo.filter.name")); panel.add(nameLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 10), 0, 0)); panel.add(myNameField, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); JPanel patternsPanel = new JPanel(new GridBagLayout()); Border border = IdeBorderFactory.createTitledBorder(IdeBundle.message("group.todo.filter.patterns"), false); patternsPanel.setBorder(border); myTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable); scrollPane.setPreferredSize(new Dimension(550, myTable.getRowHeight() * 10)); patternsPanel.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // Column "Available" int width = new JCheckBox().getPreferredSize().width; TableColumn availableColumn = myTable.getColumnModel().getColumn(0); availableColumn.setPreferredWidth(width); availableColumn.setMaxWidth(width); availableColumn.setMinWidth(width); // panel.add(patternsPanel, new GridBagConstraints(0, 1, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); return panel; }
Example #23
Source File: DocCommentPanel.java From consulo with Apache License 2.0 | 5 votes |
public DocCommentPanel(String title) { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); myBorder = IdeBorderFactory.createTitledBorder(title, true, new Insets(IdeBorderFactory.TITLED_BORDER_TOP_INSET, UIUtil.DEFAULT_HGAP, IdeBorderFactory.TITLED_BORDER_BOTTOM_INSET, IdeBorderFactory.TITLED_BORDER_RIGHT_INSET)); this.setBorder(myBorder); myRbJavaDocAsIs = new JRadioButton(); myRbJavaDocAsIs.setText(RefactoringBundle.message("javadoc.as.is")); add(myRbJavaDocAsIs); myRbJavaDocAsIs.setFocusable(false); myRbJavaDocCopy = new JRadioButton(); myRbJavaDocCopy.setText(RefactoringBundle.message("javadoc.copy")); myRbJavaDocCopy.setFocusable(false); add(myRbJavaDocCopy); myRbJavaDocMove = new JRadioButton(); myRbJavaDocMove.setText(RefactoringBundle.message("javadoc.move")); myRbJavaDocMove.setFocusable(false); add(myRbJavaDocMove); ButtonGroup bg = new ButtonGroup(); bg.add(myRbJavaDocAsIs); bg.add(myRbJavaDocCopy); bg.add(myRbJavaDocMove); bg.setSelected(myRbJavaDocMove.getModel(), true); }
Example #24
Source File: TextFieldAction.java From consulo with Apache License 2.0 | 5 votes |
public JComponent createCustomComponent(Presentation presentation) { // honestly borrowed from SearchTextField final JPanel panel = new JPanel(new BorderLayout()); final JLabel label = new JLabel(TargetAWT.to(myIcon)); label.setOpaque(true); label.setBackground(myField.getBackground()); myField.setOpaque(true); panel.add(myField, BorderLayout.WEST); panel.add(label, BorderLayout.EAST); myField.setToolTipText(myDescription); label.setToolTipText(myDescription); final Border originalBorder; if (SystemInfo.isMac) { originalBorder = BorderFactory.createLoweredBevelBorder(); } else { originalBorder = myField.getBorder(); } panel.setBorder(new CompoundBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0), originalBorder)); myField.setOpaque(true); myField.setBorder(IdeBorderFactory.createEmptyBorder(0, 5, 0, 5)); new ClickListener() { @Override public boolean onClick(MouseEvent e, int clickCount) { actionPerformed(null); return true; } }.installOn(label); return panel; }
Example #25
Source File: DateFilterComponent.java From consulo with Apache License 2.0 | 5 votes |
public DateFilterComponent(final boolean showBorder, final DateFormat dateFormat) { if (showBorder) { myDatePanel.setBorder(IdeBorderFactory.createTitledBorder(VcsBundle.message("border.changes.filter.date.filter"), true)); } myDateAfter.setDateFormat(dateFormat); myDateBefore.setDateFormat(dateFormat); ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { updateAllEnabled(e); } }; myUseDateAfterFilter.addActionListener(listener); myUseDateBeforeFilter.addActionListener(listener); updateAllEnabled(null); }
Example #26
Source File: DetailsTabForm.java From consulo with Apache License 2.0 | 5 votes |
public DetailsTabForm(@Nullable Action analyzeAction, boolean internalMode) { myCommentsArea.setTitle(DiagnosticBundle.message("error.dialog.comment.prompt")); myCommentsArea.setLabelPosition(BorderLayout.NORTH); myDetailsPane.setBackground(UIUtil.getTextFieldBackground()); myDetailsPane.setPreferredSize(new Dimension(IdeErrorsDialog.COMPONENTS_WIDTH, internalMode ? 500 : 205)); myDetailsHolder.setBorder(IdeBorderFactory.createBorder()); if (analyzeAction != null) { myAnalyzeStacktraceButton.setAction(analyzeAction); } else { myAnalyzeStacktraceButton.setVisible(false); } myAssigneeComboBox.setRenderer(new DeveloperRenderer(myAssigneeComboBox.getRenderer())); myAssigneeComboBox.setPrototypeDisplayValue(new Developer(0, "Here Goes Some Very Long String")); myAssigneeComboBox.addActionListener(new ActionListenerProxy(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myAssigneeId = getAssigneeId(); } })); new ComboboxSpeedSearch(myAssigneeComboBox) { @Override protected String getElementText(Object element) { return element == null ? "" : ((Developer) element).getSearchableText(); } }; }
Example #27
Source File: CommentsTabForm.java From consulo with Apache License 2.0 | 5 votes |
public CommentsTabForm() { myCommentsArea.setTitle(DiagnosticBundle.message("error.dialog.comment.prompt")); myErrorComponent.getComponent().setPreferredSize(new Dimension(IdeErrorsDialog.COMPONENTS_WIDTH, -1)); myErrorComponent.setLabelLocation(BorderLayout.NORTH); myErrorComponent.getComponent().setEditable(false); myErrorComponent.getComponent().setBackground(UIUtil.getTextFieldBackground()); myErrorComponent.getComponent().setBorder(IdeBorderFactory.createBorder()); }
Example #28
Source File: LabeledTextComponent.java From consulo with Apache License 2.0 | 5 votes |
public LabeledTextComponent() { myTextPane = new JTextPane(); myComponent.setLabelLocation(BorderLayout.NORTH); myComponent.getLabel().setMinimumSize(new Dimension(0, -1)); myComponent.getComponent().setLayout(new BorderLayout()); myTextPane.setBackground(UIUtil.getTextFieldBackground()); myComponent.getComponent().add(new JBScrollPane(myTextPane)); myComponent.getComponent().setBorder(IdeBorderFactory.createBorder()); }
Example #29
Source File: KeyboardShortcutDialog.java From consulo with Apache License 2.0 | 5 votes |
public StrokePanel(String borderText) { setLayout(new BorderLayout()); setBorder(IdeBorderFactory.createTitledBorder(borderText, false)); myShortcutTextField = new ShortcutTextField(){ protected void updateCurrentKeyStrokeInfo() { KeyboardShortcutDialog.this.updateCurrentKeyStrokeInfo(); } }; add(myShortcutTextField); }
Example #30
Source File: NavigationGutterIconRenderer.java From consulo with Apache License 2.0 | 5 votes |
@RequiredUIAccess public void navigate(@Nullable final MouseEvent event, @Nullable final PsiElement elt) { final List<PsiElement> list = getTargetElements(); if (list.isEmpty()) { if (myEmptyText != null) { if (event != null) { final JComponent label = HintUtil.createErrorLabel(myEmptyText); label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7)); JBPopupFactory.getInstance().createBalloonBuilder(label) .setFadeoutTime(3000) .setFillColor(HintUtil.ERROR_COLOR) .createBalloon() .show(new RelativePoint(event), Balloon.Position.above); } } return; } if (list.size() == 1) { PsiNavigateUtil.navigate(list.iterator().next()); } else { if (event != null) { final JBPopup popup = NavigationUtil.getPsiElementPopup(PsiUtilCore.toPsiElementArray(list), myCellRenderer.compute(), myPopupTitle); popup.show(new RelativePoint(event)); } } }