-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a separator for the link menu (#158)
can be a text or when empty just a line
- Loading branch information
1 parent
8e771d0
commit dd3dcbc
Showing
12 changed files
with
166 additions
and
85 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/io/jenkins/plugins/customizable_header/AbstractLink.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,20 @@ | ||
package io.jenkins.plugins.customizable_header; | ||
|
||
import hudson.ExtensionList; | ||
import hudson.ExtensionPoint; | ||
import hudson.model.AbstractDescribableImpl; | ||
import jenkins.model.Jenkins; | ||
|
||
public abstract class AbstractLink extends AbstractDescribableImpl<AbstractLink> implements ExtensionPoint { | ||
|
||
public static ExtensionList<AbstractLink> all() { | ||
return Jenkins.get().getExtensionList(AbstractLink.class); | ||
} | ||
|
||
public abstract String getType(); | ||
|
||
@Override | ||
public LinkDescriptor getDescriptor() { | ||
return (LinkDescriptor) super.getDescriptor(); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/io/jenkins/plugins/customizable_header/LinkDescriptor.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,11 @@ | ||
package io.jenkins.plugins.customizable_header; | ||
|
||
import hudson.DescriptorExtensionList; | ||
import hudson.model.Descriptor; | ||
import jenkins.model.Jenkins; | ||
|
||
public class LinkDescriptor extends Descriptor<AbstractLink> { | ||
public static DescriptorExtensionList<AbstractLink, LinkDescriptor> all() { | ||
return Jenkins.get().getDescriptorList(AbstractLink.class); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/io/jenkins/plugins/customizable_header/LinkSeparator.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,43 @@ | ||
package io.jenkins.plugins.customizable_header; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.Extension; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
import org.kohsuke.stapler.DataBoundSetter; | ||
import org.kohsuke.stapler.export.Exported; | ||
import org.kohsuke.stapler.export.ExportedBean; | ||
|
||
@ExportedBean | ||
public class LinkSeparator extends AbstractLink { | ||
|
||
private String title; | ||
|
||
@DataBoundConstructor | ||
public LinkSeparator() { | ||
} | ||
|
||
@DataBoundSetter | ||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
@Exported | ||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
@Exported | ||
@Override | ||
public String getType() { | ||
return "separator"; | ||
} | ||
|
||
@Extension | ||
public static class DescriptorImpl extends LinkDescriptor { | ||
@Override | ||
@NonNull | ||
public String getDisplayName() { | ||
return "Separator"; | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/resources/io/jenkins/plugins/customizable_header/LinkSeparator/config.jelly
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,6 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form"> | ||
<f:entry field="title" title="${%Title}"> | ||
<f:textbox/> | ||
</f:entry> | ||
</j:jelly> |
1 change: 1 addition & 0 deletions
1
src/main/resources/io/jenkins/plugins/customizable_header/LinkSeparator/help-title.html
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 @@ | ||
When left empty a line will be used to separate the links. |
Oops, something went wrong.