Projects >> intellij-community >>c7173e717cf2064dd41b6737300bebbe91984c3f

Chunk
Conflicting content
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.colors.EditorColorsManager;
<<<<<<< HEAD
import com.intellij.openapi.editor.impl.DocumentImpl;
import com.intellij.openapi.fileEditor.*;
=======
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorLocation;
import com.intellij.openapi.fileEditor.FileEditorState;
import com.intellij.openapi.fileEditor.FileEditorStateLevel;
>>>>>>> 21d84f1ab511f7f14d7a8ae71df2fa1ab35fdd8e
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
import com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl;
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
Solution content
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorLocation;
import com.intellij.openapi.fileEditor.FileEditorState;
import com.intellij.openapi.fileEditor.FileEditorStateLevel;
import com.intellij.openapi.editor.impl.DocumentImpl;
import com.intellij.openapi.fileEditor.*;
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
import com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl;
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
File
StudyEditor.java
Developer's decision
Combination
Kind of conflict
Import
Chunk
Conflicting content
    TaskFile taskFile = StudyTaskManager.getInstance(myProject).getTaskFile(file);
    if (taskFile != null) {
      Task currentTask = taskFile.getTask();
<<<<<<< HEAD
      String taskText = currentTask.getResourceText(myProject, currentTask.getText(), false);
      final JLabel taskTextLabel = new JLabel(taskText);
      taskTextLabel.setBorder(new EmptyBorder(15, 20, 0, 100));
      int fontSize = EditorColorsManager.getInstance().getGlobalScheme().getEditorFontSize();
      String fontName = EditorColorsManager.getInstance().getGlobalScheme().getEditorFontName();
      taskTextLabel.setFont(new Font(fontName, Font.PLAIN, fontSize));
      HideableTitledPanel taskTextPanel = new HideableTitledPanel(TASK_TEXT_HEADER, taskTextLabel, true);
      taskTextPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
      studyPanel.add(taskTextPanel);
=======
      String taskText = currentTask.getResourceText(project, currentTask.getText(), false);
      initializeTaskText(studyPanel, taskText);
>>>>>>> 21d84f1ab511f7f14d7a8ae71df2fa1ab35fdd8e
      JPanel studyButtonPanel = new JPanel(new GridLayout(1, 2));
      JPanel taskActionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
      studyButtonPanel.add(taskActionsPanel);
Solution content
    TaskFile taskFile = StudyTaskManager.getInstance(myProject).getTaskFile(file);
    if (taskFile != null) {
      Task currentTask = taskFile.getTask();
      String taskText = currentTask.getResourceText(project, currentTask.getText(), false);
      initializeTaskText(studyPanel, taskText);
      JPanel studyButtonPanel = new JPanel(new GridLayout(1, 2));
      JPanel taskActionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
      studyButtonPanel.add(taskActionsPanel);
File
StudyEditor.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
    }
  }

<<<<<<< HEAD
  private void initializeButtons(@NotNull final JPanel taskActionsPanel, @NotNull final TaskFile taskFile) {
=======
  private static void initializeTaskText(JPanel studyPanel, String taskText) {
    JTextPane taskTextPane = new JTextPane();
    taskTextPane.setContentType("text/html");
    taskTextPane.setEditable(false);
    taskTextPane.setText(taskText);
    EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
    int fontSize = editorColorsScheme.getEditorFontSize();
    String fontName = editorColorsScheme.getEditorFontName();
    setJTextPaneFont(taskTextPane, new Font(fontName, Font.PLAIN, fontSize), JBColor.BLACK);
    taskTextPane.setBackground(UIUtil.getPanelBackground());
    taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100));
    HideableTitledPanel taskTextPanel = new HideableTitledPanel(TASK_TEXT_HEADER, taskTextPane, true);
    taskTextPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
    studyPanel.add(taskTextPanel);
  }

  private static void setJTextPaneFont(JTextPane jtp, Font font, Color c) {
    MutableAttributeSet attrs = jtp.getInputAttributes();
    StyleConstants.setFontFamily(attrs, font.getFamily());
    StyleConstants.setFontSize(attrs, font.getSize());
    StyleConstants.setItalic(attrs, (font.getStyle() & Font.ITALIC) != 0);
    StyleConstants.setBold(attrs, (font.getStyle() & Font.BOLD) != 0);
    StyleConstants.setForeground(attrs, c);
    StyledDocument doc = jtp.getStyledDocument();
    doc.setCharacterAttributes(0, doc.getLength() + 1, attrs, false);
  }

  private void initializeButtons(@NotNull final Project project, @NotNull final JPanel taskActionsPanel, @NotNull final TaskFile taskFile) {
>>>>>>> 21d84f1ab511f7f14d7a8ae71df2fa1ab35fdd8e
    myCheckButton = addButton(taskActionsPanel, "Check task", StudyIcons.Resolve);
    myPrevTaskButton = addButton(taskActionsPanel, "Prev Task", StudyIcons.Prev);
    myNextTaskButton = addButton(taskActionsPanel, "Next Task", StudyIcons.Next);
Solution content
    }
  }

  private static void initializeTaskText(JPanel studyPanel, String taskText) {
    JTextPane taskTextPane = new JTextPane();
    taskTextPane.setContentType("text/html");
    taskTextPane.setEditable(false);
    taskTextPane.setText(taskText);
    EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
    int fontSize = editorColorsScheme.getEditorFontSize();
    String fontName = editorColorsScheme.getEditorFontName();
    setJTextPaneFont(taskTextPane, new Font(fontName, Font.PLAIN, fontSize), JBColor.BLACK);
    taskTextPane.setBackground(UIUtil.getPanelBackground());
    taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100));
    HideableTitledPanel taskTextPanel = new HideableTitledPanel(TASK_TEXT_HEADER, taskTextPane, true);
    taskTextPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
    studyPanel.add(taskTextPanel);
  }

  private static void setJTextPaneFont(JTextPane jtp, Font font, Color c) {
    MutableAttributeSet attrs = jtp.getInputAttributes();
    StyleConstants.setFontFamily(attrs, font.getFamily());
    StyleConstants.setFontSize(attrs, font.getSize());
    StyleConstants.setItalic(attrs, (font.getStyle() & Font.ITALIC) != 0);
    StyleConstants.setBold(attrs, (font.getStyle() & Font.BOLD) != 0);
    StyleConstants.setForeground(attrs, c);
    StyledDocument doc = jtp.getStyledDocument();
    doc.setCharacterAttributes(0, doc.getLength() + 1, attrs, false);
  }

  private void initializeButtons(@NotNull final JPanel taskActionsPanel, @NotNull final TaskFile taskFile) {
    myCheckButton = addButton(taskActionsPanel, "Check task", StudyIcons.Resolve);
    myPrevTaskButton = addButton(taskActionsPanel, "Prev Task", StudyIcons.Prev);
    myNextTaskButton = addButton(taskActionsPanel, "Next Task", StudyIcons.Next);
File
StudyEditor.java
Developer's decision
Combination
Kind of conflict
Method declaration
Method signature