Java 类com.intellij.ui.DottedBorder 实例源码

项目:consulo    文件:InplaceRefactoring.java   
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;
}
项目:intellij-ce-playground    文件:JBListTable.java   
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;
}
项目:intellij-ce-playground    文件:AbstractInplaceIntroducer.java   
public AbstractInplaceIntroducer(Project project,
                                 Editor editor,
                                 @Nullable E expr,
                                 @Nullable V localVariable,
                                 E[] occurrences,
                                 String title,
                                 final FileType languageFileType) {
  super(null, editor, project, title, occurrences, expr);
  myLocalVariable = localVariable;
  if (localVariable != null) {
    final PsiElement nameIdentifier = localVariable.getNameIdentifier();
    if (nameIdentifier != null) {
      myLocalMarker = createMarker(nameIdentifier);
    }
  }
  else {
    myLocalMarker = null;
  }
  myExprText = getExpressionText(expr);
  myLocalName = localVariable != null ? localVariable.getName() : null;

  Document document = EditorFactory.getInstance().createDocument("");
  UndoUtil.disableUndoFor(document);
  myPreview = (EditorEx)EditorFactory.getInstance().createEditor(document, project, languageFileType, true);
  myPreview.setOneLineMode(true);
  final EditorSettings settings = myPreview.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);
  myPreview.setHorizontalScrollbarVisible(false);
  myPreview.setVerticalScrollbarVisible(false);
  myPreview.setCaretEnabled(false);
  settings.setLineCursorWidth(1);

  final Color bg = myPreview.getColorsScheme().getColor(EditorColors.CARET_ROW_COLOR);
  myPreview.setBackgroundColor(bg);
  myPreview.setBorder(BorderFactory.createCompoundBorder(new DottedBorder(Color.gray), new LineBorder(bg, 2)));

  myPreviewComponent = new JPanel(new BorderLayout());
  myPreviewComponent.add(myPreview.getComponent(), BorderLayout.CENTER);
  myPreviewComponent.setBorder(new EmptyBorder(2, 2, 6, 2));

  myWholePanel = new JPanel(new GridBagLayout());
  myWholePanel.setBorder(null);

  showDialogAdvertisement(getActionName());
}
项目:tools-idea    文件:AbstractInplaceIntroducer.java   
public AbstractInplaceIntroducer(Project project,
                                 Editor editor,
                                 E expr,
                                 @Nullable V localVariable,
                                 E[] occurrences,
                                 String title,
                                 final FileType languageFileType) {
  super(null, editor, project, title, occurrences, expr);
  myLocalVariable = localVariable;
  if (localVariable != null) {
    final PsiElement nameIdentifier = localVariable.getNameIdentifier();
    if (nameIdentifier != null) {
      myLocalMarker = createMarker(nameIdentifier);
    }
  }
  else {
    myLocalMarker = null;
  }
  myExprText = getExpressionText(expr);
  myLocalName = localVariable != null ? localVariable.getName() : null;

  myPreview =
    (EditorEx)EditorFactory.getInstance().createEditor(EditorFactory.getInstance().createDocument(""), project, languageFileType, true);
  myPreview.setOneLineMode(true);
  final EditorSettings settings = myPreview.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);
  myPreview.setHorizontalScrollbarVisible(false);
  myPreview.setVerticalScrollbarVisible(false);
  myPreview.setCaretEnabled(false);
  settings.setLineCursorWidth(1);

  final Color bg = myPreview.getColorsScheme().getColor(EditorColors.CARET_ROW_COLOR);
  myPreview.setBackgroundColor(bg);
  myPreview.setBorder(BorderFactory.createCompoundBorder(new DottedBorder(Color.gray), new LineBorder(bg, 2)));

  myPreviewComponent = new JPanel(new BorderLayout());
  myPreviewComponent.add(myPreview.getComponent(), BorderLayout.CENTER);
  myPreviewComponent.setBorder(new EmptyBorder(2, 2, 6, 2));

  myWholePanel = new JPanel(new GridBagLayout());
  myWholePanel.setBorder(null);

  showDialogAdvertisement(getActionName());
}