本文整理匯總了Java中com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder類的典型用法代碼示例。如果您正苦於以下問題:Java DarculaTextBorder類的具體用法?Java DarculaTextBorder怎麽用?Java DarculaTextBorder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DarculaTextBorder類屬於com.intellij.ide.ui.laf.darcula.ui包,在下文中一共展示了DarculaTextBorder類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MySearchTextField
import com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder; //導入依賴的package包/類
public MySearchTextField() {
super(false);
JTextField editor = getTextEditor();
editor.setOpaque(false);
if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
editor.setUI((MacIntelliJTextFieldUI)MacIntelliJTextFieldUI.createUI(editor));
editor.setBorder(new MacIntelliJTextBorder());
} else {
editor.setUI((DarculaTextFieldUI)DarculaTextFieldUI.createUI(editor));
editor.setBorder(new DarculaTextBorder());
}
editor.putClientProperty("JTextField.Search.noBorderRing", Boolean.TRUE);
if (UIUtil.isUnderDarcula()) {
editor.setBackground(Gray._45);
editor.setForeground(Gray._240);
}
}
示例2: showErrorBorder
import com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder; //導入依賴的package包/類
/**
* 顯示JTextField是否為紅色邊框
*/
protected void showErrorBorder(JTextField field, boolean show) {
if (show) {
field.setBorder(BorderFactory.createLineBorder(JBColor.RED));
} else {
field.setBorder(new DarculaTextBorder());
}
}
示例3: SettingsSearch
import com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder; //導入依賴的package包/類
SettingsSearch() {
super(false);
addKeyListener(new KeyAdapter() {
});
if (Registry.is("ide.new.settings.dialog")) {
if (!SystemInfo.isMac) {
JTextField editor = getTextEditor();
editor.putClientProperty("JTextField.variant", "search");
if (!(editor.getUI() instanceof DarculaTextFieldUI)) {
editor.setUI((DarculaTextFieldUI)DarculaTextFieldUI.createUI(editor));
editor.setBorder(new DarculaTextBorder());
}
}
}
}
示例4: MyTextField
import com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder; //導入依賴的package包/類
private MyTextField() {
super(40);
if (!UIUtil.isUnderGTKLookAndFeel()) {
if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
if (!(getUI() instanceof MacIntelliJTextFieldUI)) {
setUI(MacIntelliJTextFieldUI.createUI(this));
}
setBorder(new MacIntelliJTextBorder());
} else {
if (!(getUI() instanceof DarculaTextFieldUI)) {
setUI(DarculaTextFieldUI.createUI(this));
}
setBorder(new DarculaTextBorder());
}
}
enableEvents(AWTEvent.KEY_EVENT_MASK);
myCompletionKeyStroke = getShortcut(IdeActions.ACTION_CODE_COMPLETION);
forwardStroke = getShortcut(IdeActions.ACTION_GOTO_FORWARD);
backStroke = getShortcut(IdeActions.ACTION_GOTO_BACK);
setFocusTraversalKeysEnabled(false);
putClientProperty("JTextField.variant", "search");
setDocument(new PlainDocument() {
@Override
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
super.insertString(offs, str, a);
if (str != null && str.length() > 1) {
handlePaste(str);
}
}
});
}