mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-102838 Add the link "Not YouTrack customer yet? Get YouTrack" onto the 'YouTrack server' integration
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.tasks.config.TaskRepositoryEditor;
|
||||
import com.intellij.util.Consumer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
@@ -39,6 +40,9 @@ public abstract class TaskRepositoryType<T extends TaskRepository> {
|
||||
@NotNull
|
||||
public abstract Icon getIcon();
|
||||
|
||||
@Nullable
|
||||
public String getAdvertiser() { return null; }
|
||||
|
||||
@NotNull
|
||||
public abstract TaskRepositoryEditor createEditor(T repository, Project project, Consumer<T> changeListener);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="552" height="306"/>
|
||||
<xy x="20" y="20" width="473" height="308"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -144,6 +144,16 @@
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="8235d" class="javax.swing.JTextPane" binding="myAdvertiser">
|
||||
<constraints>
|
||||
<grid row="0" column="2" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<enabled value="true"/>
|
||||
<text value="Not YouTrack customer yet? Get YouTrack"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="3d7e" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.tasks.TaskManager;
|
||||
import com.intellij.tasks.TaskRepository;
|
||||
import com.intellij.tasks.impl.BaseRepository;
|
||||
@@ -65,6 +66,7 @@ public class BaseRepositoryEditor<T extends BaseRepository> extends TaskReposito
|
||||
private JPanel myEditorPanel;
|
||||
protected JBCheckBox myLoginAnonymouslyJBCheckBox;
|
||||
protected JBTabbedPane myTabbedPane;
|
||||
private JTextPane myAdvertiser;
|
||||
|
||||
private boolean myApplying;
|
||||
protected Project myProject;
|
||||
@@ -115,6 +117,11 @@ public class BaseRepositoryEditor<T extends BaseRepository> extends TaskReposito
|
||||
myEditor = EditorFactory.getInstance().createEditor(myDocument);
|
||||
myEditorPanel.add(myEditor.getComponent(), BorderLayout.CENTER);
|
||||
myComment.setText("Available placeholders: " + repository.getComment());
|
||||
String advertiser = repository.getRepositoryType().getAdvertiser();
|
||||
if (advertiser != null) {
|
||||
Messages.installHyperlinkSupport(myAdvertiser);
|
||||
myAdvertiser.setText(advertiser);
|
||||
}
|
||||
|
||||
installListener(myAddCommitMessage);
|
||||
installListener(myDocument);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.tasks.impl.BaseRepositoryType;
|
||||
import com.intellij.util.Consumer;
|
||||
import icons.TasksIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
@@ -26,6 +27,12 @@ public class YouTrackRepositoryType extends BaseRepositoryType<YouTrackRepositor
|
||||
return TasksIcons.Youtrack;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getAdvertiser() {
|
||||
return "<html>Not YouTrack customer yet? Get <a href='http://www.jetbrains.com/youtrack/download/get_youtrack.html?idea_integration'>YouTrack</a></html>";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public YouTrackRepository createRepository() {
|
||||
return new YouTrackRepository(this);
|
||||
|
||||
Reference in New Issue
Block a user