-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
117 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<idea-plugin version="2"> | ||
<id>mobi.hsz.idea.gitignore</id> | ||
<name>.gitignore support</name> | ||
<version>0.5.4</version> | ||
<version>0.6</version> | ||
<vendor email="[email protected]" url="http://www.hsz.mobi">hsz</vendor> | ||
|
||
<description><![CDATA[ | ||
|
@@ -20,6 +20,7 @@ | |
<b>Features</b> | ||
<ul> | ||
<li><i>.gitignore</i> files syntax highlight</li> | ||
<li>Gitignore templates filtering and selecting in rules generator by name and content</li> | ||
<li>Show ignored files by specified Gitignore file (right click on <i>.gitignore</i> file)</li> | ||
<li>Create <i>.gitignore</i> file in currently selected directory</li> | ||
<li>Generate Gitignore rules basing on <a href="https://github.com/github/gitignore">GitHub's templates collection</a></li> | ||
|
@@ -33,9 +34,11 @@ | |
<b><i>Feature requests:</i></b> | ||
<ul> | ||
<li><i>Better Gitignore templates filtering and selecting in rules generator</i></li> | ||
<li><i>Better ignored files list</i></li> | ||
<li><i>Optional suggestion to add .gitignore file</i></li> | ||
<li><i>User custom ignore templates</i></li> | ||
<li><i>Node Packaged Modules support</i></li> | ||
<li><i>Mercurial support</i></li> | ||
</ul> | ||
<br/> | ||
|
@@ -49,6 +52,16 @@ | |
|
||
<change-notes><![CDATA[ | ||
Version 0.6 | ||
<ul> | ||
<li>Reimplemented templates generator (tree structure, checkboxes allow to add many templates at once)</li> | ||
<li>Find template by its content</li> | ||
<li>"Add template..." option in context menu</li> | ||
<li>Fixed no search input by default (<a href="https://github.com/hsz/idea-gitignore/issues/27">#27</a>)</li> | ||
<li>Fixed CommonDataKeys NoClassDefFoundError (<a href="https://github.com/hsz/idea-gitignore/issues/51">#51</a>)</li> | ||
<li>Fixed "Cannot create .gitignore, file already exists." (<a href="https://github.com/hsz/idea-gitignore/issues/55">#55</a>)</li> | ||
</ul> | ||
Version 0.5.4 | ||
<ul> | ||
<li>Better entries completion and references</li> | ||
|
@@ -185,6 +198,8 @@ | |
|
||
<editorNotificationProvider | ||
implementation="mobi.hsz.idea.gitignore.daemon.MissingGitignoreNotificationProvider"/> | ||
<editorNotificationProvider | ||
implementation="mobi.hsz.idea.gitignore.daemon.DonateNotificationProvider"/> | ||
|
||
<fileTypeFactory | ||
implementation="mobi.hsz.idea.gitignore.file.GitignoreFileTypeFactory"/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/mobi/hsz/idea/gitignore/daemon/DonateNotificationProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package mobi.hsz.idea.gitignore.daemon; | ||
|
||
import com.intellij.ide.BrowserUtil; | ||
import com.intellij.openapi.fileEditor.FileEditor; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.util.Key; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import com.intellij.ui.EditorNotificationPanel; | ||
import com.intellij.ui.EditorNotifications; | ||
import mobi.hsz.idea.gitignore.GitignoreBundle; | ||
import mobi.hsz.idea.gitignore.util.Icons; | ||
import mobi.hsz.idea.gitignore.util.Properties; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class DonateNotificationProvider extends EditorNotifications.Provider<EditorNotificationPanel> { | ||
private static final String DONATION_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SJAU4XWQ584QL"; | ||
private static final Key<EditorNotificationPanel> KEY = Key.create(GitignoreBundle.message("daemon.donate.me")); | ||
|
||
private final Project project; | ||
private final EditorNotifications notifications; | ||
|
||
public DonateNotificationProvider(Project project, @NotNull EditorNotifications notifications) { | ||
this.project = project; | ||
this.notifications = notifications; | ||
} | ||
|
||
@Override | ||
public Key<EditorNotificationPanel> getKey() { | ||
return KEY; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public EditorNotificationPanel createNotificationPanel(VirtualFile file, FileEditor fileEditor) { | ||
if (Properties.isIgnoreDonation(project)) { | ||
return null; | ||
} | ||
|
||
return createPanel(project); | ||
} | ||
|
||
private EditorNotificationPanel createPanel(@NotNull final Project project) { | ||
final EditorNotificationPanel panel = new EditorNotificationPanel(); | ||
panel.setText(GitignoreBundle.message("daemon.donate")); | ||
panel.createActionLabel(GitignoreBundle.message("daemon.donate.me"), new Runnable() { | ||
@Override | ||
public void run() { | ||
BrowserUtil.browse(DONATION_URL); | ||
Properties.setIgnoreDonation(project); | ||
notifications.updateAllNotifications(); | ||
} | ||
}); | ||
panel.createActionLabel(GitignoreBundle.message("global.cancel"), new Runnable() { | ||
@Override | ||
public void run() { | ||
Properties.setIgnoreDonation(project); | ||
notifications.updateAllNotifications(); | ||
} | ||
}); | ||
|
||
try { // ignore if older SDK does not support panel icon | ||
panel.icon(Icons.FILE); | ||
} catch (NoSuchMethodError ignored) {} | ||
|
||
return panel; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters