Skip to content

Commit

Permalink
Updated UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna Potriasaeva authored and Anna Potriasaeva committed Apr 21, 2023
1 parent 14e414f commit 6007a9f
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,26 @@
import com.intellij.openapi.actionSystem.ex.ComboBoxAction;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.ui.JBColor;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import com.intellij.vcs.log.ui.MainVcsLogUi;
import com.intellij.vcs.log.ui.VcsLogInternalDataKeys;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.research.refactorinsight.services.WindowService;

import javax.swing.*;
import java.awt.*;
import java.util.Arrays;

import static java.awt.Font.*;

public class ComboBoxRefactoringAction extends ComboBoxAction implements DumbAware {

private enum Tab {
FILES("Files"),
REFACTORING("Refactoring Insight");
REFACTORING("Refactorings");
public final String label;
Tab(String label) {
this.label = label;
Expand All @@ -39,6 +45,25 @@ public void update(@NotNull AnActionEvent e) {
presentation.setText(getText(getValue()));
}

@Override
public @NotNull JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 6));
ComboBoxButton button = createComboBoxButton(presentation);
button.setBorder(BorderFactory.createEmptyBorder());
button.setForeground(JBColor.BLUE);
button.setMargin(JBUI.emptyInsets());
JLabel label = new JLabel("Show:");
label.setFont(new Font("Default", PLAIN, 11));
GridBagConstraints constraints = new GridBagConstraints(
0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER,
GridBagConstraints.BOTH, JBInsets.create(0, 0), 0, 0);
panel.add(label, constraints);
constraints.gridx = 1;
panel.add(button, constraints);
return panel;
}

@NotNull
@Override
protected DefaultActionGroup createPopupActionGroup(@NotNull JComponent button, @NotNull DataContext context) {
Expand Down

0 comments on commit 6007a9f

Please sign in to comment.