use of com.intellij.ui.DottedBorder in project intellij-community by JetBrains.
the class JBListTable method createEditorTextFieldPresentation.
public static JComponent createEditorTextFieldPresentation(final Project project, final FileType type, final String text, boolean selected, boolean focused) {
final JPanel panel = new JPanel(new BorderLayout());
final EditorTextField field = new EditorTextField(text, project, type) {
@Override
protected boolean shouldHaveBorder() {
return false;
}
};
Font font = EditorColorsManager.getInstance().getGlobalScheme().getFont(EditorFontType.PLAIN);
font = new Font(font.getFontName(), font.getStyle(), 12);
field.setFont(font);
field.addSettingsProvider(EditorSettingsProvider.NO_WHITESPACE);
if (selected && focused) {
panel.setBackground(UIUtil.getTableSelectionBackground());
field.setAsRendererWithSelection(UIUtil.getTableSelectionBackground(), UIUtil.getTableSelectionForeground());
} else {
panel.setBackground(UIUtil.getTableBackground());
if (selected) {
panel.setBorder(new DottedBorder(UIUtil.getTableForeground()));
}
}
panel.add(field, BorderLayout.WEST);
return panel;
}
use of com.intellij.ui.DottedBorder in project intellij-community by JetBrains.
the class InplaceRefactoring method createPreviewComponent.
public static EditorEx createPreviewComponent(Project project, FileType languageFileType) {
Document document = EditorFactory.getInstance().createDocument("");
UndoUtil.disableUndoFor(document);
EditorEx previewEditor = (EditorEx) EditorFactory.getInstance().createEditor(document, project, languageFileType, true);
previewEditor.setOneLineMode(true);
final EditorSettings settings = previewEditor.getSettings();
settings.setAdditionalLinesCount(0);
settings.setAdditionalColumnsCount(1);
settings.setRightMarginShown(false);
settings.setFoldingOutlineShown(false);
settings.setLineNumbersShown(false);
settings.setLineMarkerAreaShown(false);
settings.setIndentGuidesShown(false);
settings.setVirtualSpace(false);
previewEditor.setHorizontalScrollbarVisible(false);
previewEditor.setVerticalScrollbarVisible(false);
previewEditor.setCaretEnabled(false);
settings.setLineCursorWidth(1);
final Color bg = previewEditor.getColorsScheme().getColor(EditorColors.CARET_ROW_COLOR);
previewEditor.setBackgroundColor(bg);
previewEditor.setBorder(BorderFactory.createCompoundBorder(new DottedBorder(Color.gray), new LineBorder(bg, 2)));
return previewEditor;
}
use of com.intellij.ui.DottedBorder in project intellij-community by JetBrains.
the class CopiesPanel method setFocusableForLinks.
@SuppressWarnings("MethodMayBeStatic")
private void setFocusableForLinks(final LinkLabel label) {
final Border border = new DottedBorder(new Insets(1, 2, 1, 1), JBColor.BLACK);
label.setFocusable(true);
label.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
super.focusGained(e);
label.setBorder(border);
}
@Override
public void focusLost(FocusEvent e) {
super.focusLost(e);
label.setBorder(null);
}
});
label.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (KeyEvent.VK_ENTER == e.getKeyCode()) {
label.doClick();
}
}
});
}
Aggregations