diff --git a/.travis.yml b/.travis.yml index e0342294..0fa9da2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ +os: linux dist: trusty -sudo: false language: java jdk: - oraclejdk8 @@ -11,10 +11,7 @@ cache: - $HOME/.gradle/wrapper/ deploy: provider: releases - api_key: - secure: "${GITHUB_KEY}" - skip_cleanup: true - file_glob: true + edge: true file: "build/distributions/gerrit-intellij-plugin-*.zip" on: tags: true diff --git a/build.gradle b/build.gradle index 323749af..87b5ed4d 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ dependencies { compile ('com.google.inject.extensions:guice-multibindings:4.1.0') { exclude group: 'com.google.guava', module: 'guava' } - compile ('com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.8.16') { + compile ('com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.9.2') { exclude group: 'com.google.code.gson', module: 'gson' exclude group: 'com.google.guava', module: 'guava' exclude group: 'commons-logging', module: 'commons-logging' diff --git a/gradle.properties b/gradle.properties index 388ec5a5..770e50e0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ ideaVersion=IC-2016.2.5 ijPluginRepoChannel= downloadIdeaSources=false -version=1.2.1-146 +version=1.2.2-146 javaVersion=1.8 diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java index f339f66a..f6ceddd6 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/GerritChangeDetailsPanel.java @@ -18,6 +18,9 @@ package com.urswolfer.intellij.plugin.gerrit.ui; +import static java.lang.Boolean.TRUE; +import static javax.swing.JEditorPane.HONOR_DISPLAY_PROPERTIES; + import com.google.common.collect.Lists; import com.google.gerrit.extensions.common.AccountInfo; import com.google.gerrit.extensions.common.ApprovalInfo; @@ -52,7 +55,6 @@ public class GerritChangeDetailsPanel { private static final String NOTHING_SELECTED = "nothingSelected"; private static final String LOADING = "loading"; private static final String DATA = "data"; - private static final String MULTIPLE_SELECTED = "multiple_selected"; private static final ThreadLocal APPROVAL_VALUE_FORMAT = new ThreadLocal() { @Override protected DecimalFormat initialValue() { @@ -70,16 +72,17 @@ public GerritChangeDetailsPanel(final Project project) { panel = new JPanel(new CardLayout()); panel.add(UIVcsUtil.errorPanel("Nothing selected", false), NOTHING_SELECTED); panel.add(UIVcsUtil.errorPanel("Loading...", false), LOADING); - panel.add(UIVcsUtil.errorPanel("Several commits selected", false), MULTIPLE_SELECTED); presentationData = new MyPresentationData(project); final JPanel wrapper = new JPanel(new BorderLayout()); + // could be ported to com.intellij.util.ui.HtmlPanel once minimal IntelliJ version is bumped jEditorPane = new JEditorPane(UIUtil.HTML_MIME, ""); jEditorPane.setPreferredSize(new Dimension(150, 100)); jEditorPane.setEditable(false); - jEditorPane.setBackground(UIUtil.getComboBoxDisabledBackground()); + jEditorPane.setOpaque(false); + jEditorPane.putClientProperty(HONOR_DISPLAY_PROPERTIES, TRUE); jEditorPane.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { @@ -89,17 +92,10 @@ public void hyperlinkUpdate(HyperlinkEvent e) { final JBScrollPane tableScroll = new JBScrollPane(jEditorPane); tableScroll.setBorder(null); - jEditorPane.setBorder(null); wrapper.add(tableScroll, SwingConstants.CENTER); - jEditorPane.setBackground(UIUtil.getTableBackground()); - wrapper.setBackground(UIUtil.getTableBackground()); panel.add(wrapper, DATA); - ((CardLayout) panel.getLayout()).show(panel, NOTHING_SELECTED); - } - - public void severalSelected() { - ((CardLayout) panel.getLayout()).show(panel, MULTIPLE_SELECTED); + nothingSelected(); } public void nothingSelected() { diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/CommentForm.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/CommentForm.java index 211b8033..58b0e621 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/CommentForm.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/ui/diff/CommentForm.java @@ -35,8 +35,6 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; /** * @author Urs Wolfer @@ -52,6 +50,7 @@ public class CommentForm extends JPanel { private final String filePath; private final Side commentSide; private final Comment commentToEdit; + private final JCheckBox resolvedCheckBox; private final EditorTextField reviewTextField; private JBPopup balloon; @@ -73,6 +72,8 @@ public CommentForm(Project project, reviewTextField = safeHtmlTextEditor.getMessageField(); add(safeHtmlTextEditor); + resolvedCheckBox = new JCheckBox("Resolved"); + addButtons(); reviewTextField.setPreferredSize(new Dimension(BALLOON_WIDTH, BALLOON_HEIGHT)); @@ -88,6 +89,7 @@ public void actionPerformed(ActionEvent e) { if (commentToEdit != null) { reviewTextField.setText(commentToEdit.message); + resolvedCheckBox.setSelected(!commentToEdit.unresolved); } } @@ -104,6 +106,8 @@ public void actionPerformed(ActionEvent actionEvent) { } }); + buttonPanel.add(resolvedCheckBox); + buttonPanel.add(Box.createHorizontalGlue()); JButton cancelButton = new JButton("Cancel"); @@ -129,6 +133,7 @@ private DraftInput createComment() { comment.message = getText(); comment.path = PathUtils.ensureSlashSeparators(filePath); comment.side = commentSide; + comment.unresolved = !resolvedCheckBox.isSelected(); SelectionModel selectionModel = editor.getSelectionModel(); if (selectionModel.hasSelection()) { diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index f5dce2ba..09604193 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -89,6 +89,13 @@ href="https://github.com/uwolfer/gerrit-intellij-plugin#pre-releases"> https://github.com/uwolfer/gerrit-intellij-plugin#pre-releases. +
  • 1.2.2
  • +
  • 1.2.1