Skip to content

Commit

Permalink
add changeNotes.html and description.html
Browse files Browse the repository at this point in the history
  • Loading branch information
liying2008 committed Apr 23, 2018
1 parent 9c7c11e commit 336cf10
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = 'cc.duduhuo'
version = '0.0.1'
version = '0.0.1-rc'
def name = 'git-conflict'

apply plugin: 'idea'
Expand All @@ -24,12 +24,13 @@ intellij {
version = '2018.1.1'
publish {
pluginId name
apply from: "local.properties"
if (file("local.properties").exists()) {
apply from: "local.properties"
}
intellij.updateSinceUntilBuild false
}
}
patchPluginXml {
changeNotes """
Highlight <span style="font-weight:bold;"><em>git conflict</em></span> content and <em>fix</em> conflicts more conveniently.
"""
pluginDescription(file("description.html").text)
changeNotes(file("changeNotes.html").text)
}
2 changes: 2 additions & 0 deletions changeNotes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h4>v0.0.1-rc</h4>
<li>The first release.</li>
2 changes: 2 additions & 0 deletions description.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Highlight <span style="font-weight:bold;"><em>git conflict</em></span> content and <em>fix</em> conflicts more
conveniently.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package cc.duduhuo.git.conflict.setting;

import com.intellij.openapi.options.SearchableConfigurable;

import javax.swing.*;

/**
Expand All @@ -10,7 +12,7 @@
* Remarks:
* =======================================================
*/
public abstract class ColorSettingsPanel {
public abstract class ColorSettingsPanel implements SearchableConfigurable {
protected JRadioButton radioDefault;
protected JRadioButton radioDarcula;
protected JPanel mainPanel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,20 @@
* Remarks:
* =======================================================
*/
public class ColorSettingsPanelImpl extends ColorSettingsPanel implements SearchableConfigurable {
public class ColorSettingsPanelImpl extends ColorSettingsPanel {
public ColorSettingsPanelImpl() {
super();
initUI();
}

private void initUI() {
this.radioDefault.setSelected(false);
this.radioDarcula.setSelected(false);
radioDefault.setSelected(false);
radioDarcula.setSelected(false);
if (GlobalSettings.getMarkColor().equals(SettingsService.ColorSettings.DEFAULT)) {
System.out.println("default==");
this.radioDefault.setSelected(true);
radioDefault.setSelected(true);
} else if (GlobalSettings.getMarkColor().equals(SettingsService.ColorSettings.DARCULA)) {
System.out.println("darcula==");
this.radioDarcula.setSelected(true);
radioDarcula.setSelected(true);
}
}

Expand All @@ -50,14 +49,14 @@ public String getDisplayName() {
@Nullable
@Override
public JComponent createComponent() {
return this.mainPanel;
return mainPanel;
}

@Override
public boolean isModified() {
if (this.radioDefault.isSelected()) {
if (radioDefault.isSelected()) {
return !GlobalSettings.getMarkColor().equals(SettingsService.ColorSettings.DEFAULT);
} else if (this.radioDarcula.isSelected()) {
} else if (radioDarcula.isSelected()) {
return !GlobalSettings.getMarkColor().equals(SettingsService.ColorSettings.DARCULA);
}
return false;
Expand All @@ -72,14 +71,17 @@ public void reset() {

@Override
public void apply() {
boolean isModified = isModified();
if (radioDefault.isSelected()) {
GlobalSettings.getMarkColor().setMarkColor(SettingsService.ColorSettings.DEFAULT);
Global.sCurrentColor = SettingsService.ColorSettings.DEFAULT;
} else if (radioDarcula.isSelected()) {
GlobalSettings.getMarkColor().setMarkColor(SettingsService.ColorSettings.DARCULA);
Global.sCurrentColor = SettingsService.ColorSettings.DARCULA;
}
TextAttr.loadTextAttr();
HighlightConflictAction.refreshHighlight();
if (isModified) {
TextAttr.loadTextAttr();
HighlightConflictAction.refreshHighlight();
}
}
}
3 changes: 0 additions & 3 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
<vendor email="[email protected]" url="https://github.com/liying2008/git-conflict">liying</vendor>
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
<idea-version since-build="162"/>
<description><![CDATA[
Highlight <span style="font-weight:bold;"><em>git conflict</em></span> content and <em>fix</em> conflicts more conveniently.
]]></description>

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
on how to target different products -->
Expand Down

0 comments on commit 336cf10

Please sign in to comment.