From 4613b15cc431df19e73b21caff63b3bbe262a761 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 4 Oct 2013 17:32:19 -0400 Subject: [PATCH] Split out ui-samples-plugin into its own repo. --- .idea/compiler.xml | 4 - .idea/encodings.xml | 1 - .idea/groovyc.xml | 1 - changelog.html | 2 + pom.xml | 1 - ui-samples-plugin/pom.xml | 119 -------------- .../ui_samples/AutoCompleteTextBox.java | 113 ------------- .../plugins/ui_samples/CopyButton.java | 29 ---- .../plugins/ui_samples/DropdownList.java | 93 ----------- .../plugins/ui_samples/DynamicComboBox.java | 64 -------- .../ui_samples/DynamicDropDownListBox.java | 54 ------- .../FormFieldValidationWithContext.java | 127 --------------- .../plugins/ui_samples/HeteroList.java | 150 ------------------ .../InpageNavigationWithBreadcrumb.java | 30 ---- .../plugins/ui_samples/JavaScriptProxy.java | 32 ---- .../ui_samples/ModularizeViewScript.java | 28 ---- .../ui_samples/NavigationContextMenu.java | 50 ------ .../plugins/ui_samples/NotificationBar.java | 29 ---- .../plugins/ui_samples/ProgressBar.java | 29 ---- .../ui_samples/ProgressivelyRendered.java | 77 --------- .../java/jenkins/plugins/ui_samples/Root.java | 52 ------ .../ui_samples/SyntaxHighlightedTextArea.java | 29 ---- .../jenkins/plugins/ui_samples/UISample.java | 135 ---------------- .../ui_samples/UISampleDescriptor.java | 13 -- .../src/main/resources/index.jelly | 3 - .../AutoCompleteTextBox/index.jelly | 36 ----- .../ui_samples/CopyButton/index.groovy | 20 --- .../ui_samples/CopyButton/index.properties | 11 -- .../DropdownList/Apple/config.jelly | 29 ---- .../DropdownList/Banana/config.jelly | 29 ---- .../ui_samples/DropdownList/index.jelly | 50 ------ .../ui_samples/DynamicComboBox/index.jelly | 38 ----- .../DynamicDropDownListBox/index.jelly | 41 ----- .../City/config.groovy | 7 - .../State/config.groovy | 19 --- .../index.groovy | 22 --- .../index.properties | 9 -- .../HeteroList/ChoiceEntry/config.jelly | 32 ---- .../ui_samples/HeteroList/Config/config.jelly | 33 ---- .../HeteroList/SimpleEntry/config.jelly | 31 ---- .../ui_samples/HeteroList/configure.jelly | 42 ----- .../plugins/ui_samples/HeteroList/index.jelly | 41 ----- .../header.groovy | 6 - .../index.groovy | 21 --- .../index.properties | 5 - .../ui_samples/JavaScriptProxy/index.jelly | 45 ------ .../ModularizeViewScript/index.groovy | 43 ----- .../NavigationContextMenu/index.groovy | 48 ------ .../NavigationContextMenu/index.properties | 27 ---- .../ui_samples/NotificationBar/index.groovy | 22 --- .../NotificationBar/index.properties | 6 - .../ui_samples/ProgressBar/index.groovy | 30 ---- .../ProgressivelyRendered/index.jelly | 50 ------ .../plugins/ui_samples/Root/index.jelly | 60 ------- .../SyntaxHighlightedTextArea/index.groovy | 33 ---- .../main/resources/lib/samples/sample.jelly | 51 ------ .../src/main/resources/lib/samples/taglib | 0 war/pom.xml | 2 - 58 files changed, 2 insertions(+), 2202 deletions(-) delete mode 100644 ui-samples-plugin/pom.xml delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/AutoCompleteTextBox.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/CopyButton.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DropdownList.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicComboBox.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicDropDownListBox.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/FormFieldValidationWithContext.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/HeteroList.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/JavaScriptProxy.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ModularizeViewScript.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NavigationContextMenu.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NotificationBar.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressBar.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressivelyRendered.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/Root.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISample.java delete mode 100644 ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISampleDescriptor.java delete mode 100644 ui-samples-plugin/src/main/resources/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/AutoCompleteTextBox/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.properties delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Apple/config.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Banana/config.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicComboBox/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicDropDownListBox/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/City/config.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/State/config.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.properties delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/ChoiceEntry/config.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/Config/config.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/SimpleEntry/config.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/configure.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/header.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.properties delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/JavaScriptProxy/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ModularizeViewScript/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.properties delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.properties delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressBar/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressivelyRendered/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/Root/index.jelly delete mode 100644 ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea/index.groovy delete mode 100644 ui-samples-plugin/src/main/resources/lib/samples/sample.jelly delete mode 100644 ui-samples-plugin/src/main/resources/lib/samples/taglib diff --git a/.idea/compiler.xml b/.idea/compiler.xml index cd8f01b071..7c9af026e3 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -5,8 +5,6 @@ - - @@ -42,7 +40,6 @@ - @@ -53,7 +50,6 @@ - diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 8b72c68c7d..bb7dc2c6f1 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -7,7 +7,6 @@ - diff --git a/.idea/groovyc.xml b/.idea/groovyc.xml index c24d9163c1..117b3f5aa7 100644 --- a/.idea/groovyc.xml +++ b/.idea/groovyc.xml @@ -4,7 +4,6 @@ - diff --git a/changelog.html b/changelog.html index 7ef98c0787..a07bb6c40c 100644 --- a/changelog.html +++ b/changelog.html @@ -63,6 +63,8 @@ Upcoming changes (issue 8957)
  • Split matrix authorization strategies into an independent plugin. +
  • + UI Samples plugin fully separated from core. To view samples during plugin development or at any other time, just install from the update center.
  • SCM polling sometimes broken since 1.527 due to a change in how environment variables are calculated. (issue 19307) diff --git a/pom.xml b/pom.xml index 222b5e53ba..7cff659191 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,6 @@ THE SOFTWARE. core - ui-samples-plugin war test cli diff --git a/ui-samples-plugin/pom.xml b/ui-samples-plugin/pom.xml deleted file mode 100644 index 75cadd59e3..0000000000 --- a/ui-samples-plugin/pom.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - 4.0.0 - - - org.jenkins-ci.main - pom - 1.535-SNAPSHOT - - - ui-samples-plugin - hpi - - Jenkins UI sample plugin - - - - org.jenkins-ci.main - jenkins-core - ${project.version} - provided - - - - org.jenkins-ci.main - jenkins-test-harness - ${project.version} - test - - - org.jenkins-ci.main - jenkins-war - war - ${project.version} - test - - - javax.servlet - servlet-api - 2.4 - provided - - - - - - ${project.artifactId} - package - - - src/main/resources - - - src/main/java - - - - - org.jenkins-ci.tools - maven-hpi-plugin - - true - - true - - - - org.kohsuke.stapler - maven-stapler-plugin - - true - - - org.jvnet.localizer - maven-localizer-plugin - - - - - generate - - - Messages.properties - target/generated-sources/localizer - - - - - - - - diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/AutoCompleteTextBox.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/AutoCompleteTextBox.java deleted file mode 100644 index 9a5e1afa99..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/AutoCompleteTextBox.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2010, InfraDNA, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import hudson.model.AutoCompletionCandidates; -import org.kohsuke.stapler.QueryParameter; - -/** - * Adding auto-completion to the text box. - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class AutoCompleteTextBox extends UISample { - @Override - public String getDescription() { - return "Provide auto-completion to the text box"; - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - /** - * This method provides auto-completion items for the 'state' field. - * Stapler finds this method via the naming convention. - * - * @param value - * The text that the user entered. - */ - public AutoCompletionCandidates doAutoCompleteState(@QueryParameter String value) { - AutoCompletionCandidates c = new AutoCompletionCandidates(); - for (String state : STATES) - if (state.toLowerCase().startsWith(value.toLowerCase())) - c.add(state); - return c; - } - } - - private static final String[] STATES = new String[]{ - "Alabama", - "Alaska", - "Arizona", - "Arkansas", - "California", - "Colorado", - "Connecticut", - "Delaware", - "Florida", - "Georgia", - "Hawaii", - "Idaho", - "Illinois", - "Indiana", - "Iowa", - "Kansas", - "Kentucky", - "Louisiana", - "Maine", - "Maryland", - "Massachusetts", - "Michigan", - "Minnesota", - "Mississippi", - "Missouri", - "Montana", - "Nebraska", - "Nevada", - "New Hampshire", - "New Jersey", - "New Mexico", - "New York", - "North Carolina", - "North Dakota", - "Ohio", - "Oklahoma", - "Oregon", - "Pennsylvania", - "Rhode Island", - "South Carolina", - "South Dakota", - "Tennessee", - "Texas", - "Utah", - "Vermont", - "Virginia", - "Washington", - "West Virginia", - "Wisconsin", - "Wyoming" - }; -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/CopyButton.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/CopyButton.java deleted file mode 100644 index 6a0075ed0a..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/CopyButton.java +++ /dev/null @@ -1,29 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Kohsuke Kawaguchi - */ -@Extension -public class CopyButton extends UISample { - @Override - public String getDescription() { - return "A small button to copy text into a clipboard"; - } - - public List getSourceFiles() { - // TODO: generate this from index - return Arrays.asList( - new SourceFile("index.groovy")); - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} - - diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DropdownList.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DropdownList.java deleted file mode 100644 index 8dcb85c95f..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DropdownList.java +++ /dev/null @@ -1,93 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.DescriptorExtensionList; -import hudson.Extension; -import hudson.ExtensionPoint; -import hudson.model.Describable; -import hudson.model.Descriptor; -import jenkins.model.Jenkins; -import hudson.util.XStream2; -import java.io.IOException; -import java.util.List; -import javax.servlet.ServletException; - -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; - -/** - * @author Alan.Harder@oracle.com - */ -@Extension -public class DropdownList extends UISample { - - @Override - public String getDescription() { - return "Show different form elements based on choice in a <select> control"; - } - - public Fruit getFruit() { - // Could return currently configured/saved item here to initialized form with this data - return null; - } - - public DescriptorExtensionList> getFruitDescriptors() { - return Jenkins.getInstance().>getDescriptorList(Fruit.class); - } - - // Process form data and show it as serialized XML - public void doSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException { - // stapler-class in form data tells Stapler which Fruit subclass to use - Fruit fruit = req.bindJSON(Fruit.class, req.getSubmittedForm().getJSONObject("fruit")); - rsp.setContentType("text/plain"); - new XStream2().toXML(fruit, rsp.getWriter()); - } - - @Override - public List getSourceFiles() { - List list = new java.util.ArrayList(super.getSourceFiles()); - list.add(new SourceFile("Apple/config.jelly")); - list.add(new SourceFile("Banana/config.jelly")); - return list; - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } - - public static abstract class Fruit implements ExtensionPoint, Describable { - protected String name; - protected Fruit(String name) { this.name = name; } - - public Descriptor getDescriptor() { - return Jenkins.getInstance().getDescriptor(getClass()); - } - } - - public static class FruitDescriptor extends Descriptor { - public FruitDescriptor(Class clazz) { - super(clazz); - } - public String getDisplayName() { - return clazz.getSimpleName(); - } - } - - public static class Apple extends Fruit { - private int seeds; - @DataBoundConstructor public Apple(int seeds) { - super("Apple"); - this.seeds = seeds; - } - @Extension public static final FruitDescriptor D = new FruitDescriptor(Apple.class); - } - - public static class Banana extends Fruit { - private boolean yellow; - @DataBoundConstructor public Banana(boolean yellow) { - super("Banana"); - this.yellow = yellow; - } - @Extension public static final FruitDescriptor D = new FruitDescriptor(Banana.class); - } -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicComboBox.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicComboBox.java deleted file mode 100644 index edb72122d7..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicComboBox.java +++ /dev/null @@ -1,64 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import hudson.util.ComboBoxModel; -import hudson.util.ListBoxModel; -import org.kohsuke.stapler.QueryParameter; - -/** - * Combo box that changes the contents based on the values of other controls. - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class DynamicComboBox extends UISample { - - @Override - public String getDescription() { - return "Updates the contents of a combo box control dynamically based on selections of other controls"; - } - - // these getter methods should return the current value, which form the initial selection. - - public String getAlbum() { - return "3"; - } - - public String getTitle() { - return "Rocker"; - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - /** - * This method determines the values of the album drop-down list box. - */ - public ListBoxModel doFillAlbumItems() { - ListBoxModel m = new ListBoxModel(); - m.add("Yellow Submarine","1"); - m.add("Abbey Road","2"); - m.add("Let It Be","3"); - return m; - } - - /** - * This method determines the values of the song title combo box. - * Note that it takes the album information as a parameter, so the contents - * of the combo box changes depending on the currently selected album. - */ - public ComboBoxModel doFillTitleItems(@QueryParameter int album) { - switch (album) { - case 1: - return new ComboBoxModel("Yellow Submarine","Only a Northern Song","All You Need Is Love"); - case 2: - return new ComboBoxModel("Come Together","Something","I Want You"); - case 3: - return new ComboBoxModel("The One After 909","Rocker","Get Back"); - default: - // if no value is selected in the album, we'll get 0 - return new ComboBoxModel(); - } - } - - } -} \ No newline at end of file diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicDropDownListBox.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicDropDownListBox.java deleted file mode 100644 index 73823869d0..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/DynamicDropDownListBox.java +++ /dev/null @@ -1,54 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import hudson.util.ListBoxModel; -import org.kohsuke.stapler.QueryParameter; - -import static java.util.Arrays.asList; - -/** - * Example of a dynamic drop-down list box that changes the contents dynamically based on the values of other controls. - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class DynamicDropDownListBox extends UISample { - - @Override - public String getDescription() { - return "Updates the contents of a <select> control dynamically based on selections of other controls"; - } - - // these getter methods should return the current value, which form the initial selection. - - public String getCountry() { - return "USA"; - } - - public String getState() { - return "USA:B"; - } - - public String getCity() { - return "USA:B:Z"; - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - public ListBoxModel doFillStateItems(@QueryParameter String country) { - ListBoxModel m = new ListBoxModel(); - for (String s : asList("A","B","C")) - m.add(String.format("State %s in %s", s, country), - country+':'+s); - return m; - } - - public ListBoxModel doFillCityItems(@QueryParameter String country, @QueryParameter String state) { - ListBoxModel m = new ListBoxModel(); - for (String s : asList("X","Y","Z")) - m.add(String.format("City %s in %s %s", s, state, country), - state+':'+s); - return m; - } - } -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/FormFieldValidationWithContext.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/FormFieldValidationWithContext.java deleted file mode 100644 index 68f6ec0690..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/FormFieldValidationWithContext.java +++ /dev/null @@ -1,127 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import hudson.RelativePath; -import hudson.model.AbstractDescribableImpl; -import hudson.model.Descriptor; -import hudson.util.FormValidation; -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.QueryParameter; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * How to access values of the nearby input fields when you do form field validation. - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class FormFieldValidationWithContext extends UISample { - private List states = new ArrayList(Arrays.asList( - new State("California",new City("Sacramento"), Arrays.asList(new City("San Francisco"),new City("Los Angeles"))), - new State("New York",new City("New York"), Arrays.asList(new City("Albany"),new City("Ithaca"))) - )); - - public FormFieldValidationWithContext() { - } - - @DataBoundConstructor - public FormFieldValidationWithContext(List states) { - this.states = states; - } - - @Override - public String getDescription() { - return "How to access values of the nearby input fields when you do form field validation"; - } - - public List getStates() { - return states; - } - - @Override - public List getSourceFiles() { - List r = super.getSourceFiles(); - r.add(new SourceFile("City/config.groovy")); - r.add(new SourceFile("State/config.groovy")); - return r; - } - - public static class State extends AbstractDescribableImpl { - /* - I'm lazy and just exposing fields as opposed to getter/setter. - Jenkins doesn't care and works correctly either way. - */ - public String name; - public City capital; - public List cities; - - @DataBoundConstructor - public State(String name, City capital, List cities) { - this.name = name; - this.capital = capital; - this.cities = cities; - } - - @Extension - public static class DescriptorImpl extends Descriptor { - @Override - public String getDisplayName() { - return ""; - } - - public FormValidation doCheckName(@QueryParameter String value, - @RelativePath("capital") @QueryParameter String name) { - /* - @RelativePath("capital") @QueryParameter - ... is short for - @RelativePath("capital") @QueryParameter("name") - ... and thus can be thought of "capital/name" - - so this matches the current city name entered as the capital of this state - */ - - return FormValidation.ok("Are you sure " + name + " is a capital of " + value + "?"); - } - } - } - - public static class City extends AbstractDescribableImpl { - public String name; - - @DataBoundConstructor - public City(String name) { - this.name = name; - } - - @Extension - public static class DescriptorImpl extends Descriptor { - @Override - public String getDisplayName() { - return ""; - } - - public FormValidation doCheckName(@QueryParameter String value, - @RelativePath("..") @QueryParameter String name) { - /* - @RelativePath("..") @QueryParameter - ... is short for - @RelativePath("..") @QueryParameter("name") - ... and thus can be thought of "../name" - - in the UI, fields for city is wrapped inside those of state, so "../name" binds - to the name field in the state. - */ - - if (name==null || value==null || value.contains(name)) return FormValidation.ok(); - return FormValidation.warning("City name doesn't contain "+name); - } - } - } - - @Extension - public static class DescriptorImpl extends UISampleDescriptor { - } -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/HeteroList.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/HeteroList.java deleted file mode 100644 index 6b832e8c62..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/HeteroList.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * The MIT License - * - * Copyright 2013 Jesse Glick. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import hudson.XmlFile; -import hudson.model.AbstractDescribableImpl; -import hudson.model.Descriptor; -import hudson.util.FormApply; -import hudson.util.ListBoxModel; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import javax.servlet.ServletException; -import jenkins.model.Jenkins; -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.StaplerRequest; - -@Extension public final class HeteroList extends UISample { - - @Override public String getDescription() { - return "Show a heterogeneous list of subitems with different data bindings for radio buttons and checkboxes"; - } - - @Override public List getSourceFiles() { - return super.getSourceFiles(); - // TODO add others - } - - @Extension public static final class DescriptorImpl extends UISampleDescriptor {} - - public XmlFile getConfigFile() { - return new XmlFile(new File(Jenkins.getInstance().getRootDir(), "stuff.xml")); - } - - private Config config; - - public HeteroList() throws IOException { - XmlFile xml = getConfigFile(); - if (xml.exists()) { - xml.unmarshal(this); - } - } - - public Config getConfig() { - return config; - } - - public void setConfig(Config config) { - this.config = config; - } - - public HttpResponse doConfigSubmit(StaplerRequest req) throws ServletException, IOException { - config = null; // otherwise bindJSON will never clear it once set - req.bindJSON(this, req.getSubmittedForm()); - getConfigFile().write(this); - return FormApply.success("."); - } - - public static final class Config extends AbstractDescribableImpl { - - private final List entries; - - @DataBoundConstructor public Config(List entries) { - this.entries = entries != null ? new ArrayList(entries) : Collections.emptyList(); - } - - public List getEntries() { - return Collections.unmodifiableList(entries); - } - - @Extension public static class DescriptorImpl extends Descriptor { - @Override public String getDisplayName() {return "";} - } - - } - - public static abstract class Entry extends AbstractDescribableImpl {} - - public static final class SimpleEntry extends Entry { - - private final String text; - - @DataBoundConstructor public SimpleEntry(String text) { - this.text = text; - } - - public String getText() { - return text; - } - - @Extension public static class DescriptorImpl extends Descriptor { - @Override public String getDisplayName() { - return "Simple Entry"; - } - } - - } - - public static final class ChoiceEntry extends Entry { - - private final String choice; - - @DataBoundConstructor public ChoiceEntry(String choice) { - this.choice = choice; - } - - public String getChoice() { - return choice; - } - - @Extension public static class DescriptorImpl extends Descriptor { - - @Override public String getDisplayName() { - return "Choice Entry"; - } - - public ListBoxModel doFillChoiceItems() { - return new ListBoxModel().add("good").add("bad").add("ugly"); - } - - } - } - -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb.java deleted file mode 100644 index 1c20d7fe89..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb.java +++ /dev/null @@ -1,30 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Kohsuke Kawaguchi - */ -@Extension -public class InpageNavigationWithBreadcrumb extends UISample { - @Override - public String getDescription() { - return "Adds in-page navigation with extra breadcrumb"; - } - - public List getSourceFiles() { - // TODO: generate this from index - return Arrays.asList( - new SourceFile("index.groovy"), - new SourceFile("header.groovy")); - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} - - diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/JavaScriptProxy.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/JavaScriptProxy.java deleted file mode 100644 index 80afaa2649..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/JavaScriptProxy.java +++ /dev/null @@ -1,32 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import org.kohsuke.stapler.bind.JavaScriptMethod; - -/** - * "Export" Java objects to JavaScript in the browser as a proxy object, so that - * you can make ajax-calls to the server later. - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class JavaScriptProxy extends UISample { - private int i; - - @Override - public String getDescription() { - return "Use JavaScript proxy objects to access server-side Java objects from inside the browser."; - } - - /** - * The annotation exposes this method to JavaScript proxy. - */ - @JavaScriptMethod - public int increment(int n) { - return i+=n; - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ModularizeViewScript.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ModularizeViewScript.java deleted file mode 100644 index 36eca31e3d..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ModularizeViewScript.java +++ /dev/null @@ -1,28 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; - -import java.util.Arrays; -import java.util.List; - -/** - * Define portions of view fragments in separate methods/classes to improve reuse. - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class ModularizeViewScript extends UISample { - @Override - public String getDescription() { - return "Define portions of view fragments in separate methods/classes to improve reuse"; - } - - public List getSourceFiles() { - // TODO: generate this from index - return Arrays.asList(new SourceFile("index.groovy")); - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NavigationContextMenu.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NavigationContextMenu.java deleted file mode 100644 index 6770a566ca..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NavigationContextMenu.java +++ /dev/null @@ -1,50 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import jenkins.model.ModelObjectWithChildren; -import jenkins.model.ModelObjectWithContextMenu; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; - -/** - * @author Kohsuke Kawaguchi - */ -@Extension -public class NavigationContextMenu extends UISample implements ModelObjectWithContextMenu, ModelObjectWithChildren { - @Override - public String getDescription() { - return "Integrate with navigational context menu to provider quick access around object graph"; - } - - /** - * This method is called via AJAX to obtain the context menu for this model object. - */ - public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse response) throws Exception { - if (false) { - // this implementation is suffice for most ModelObjects. It uses sidepanel.jelly/.groovy to - // generate the context menu - return new ContextMenu().from(this,request,response); - } else { - // otherwise you can also programatically create them. - // see the javadoc for various convenience methods to add items - return new ContextMenu() - .add("http://jenkins-ci.org/","Jenkins project") - .add("http://www.cloudbees.com/","CloudBees") - .add(new MenuItem().withContextRelativeUrl("/").withStockIcon("gear.png").withDisplayName("top page")); - } - } - - public ContextMenu doChildrenContextMenu(StaplerRequest request, StaplerResponse response) throws Exception { - // You implement this method in much the same way you do doContextMenu - return new ContextMenu() - .add("http://yahoo.com/","Yahoo") - .add("http://google.com/","Google") - .add("http://microsoft.com/","Microsoft"); - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} - - diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NotificationBar.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NotificationBar.java deleted file mode 100644 index cf81df117b..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/NotificationBar.java +++ /dev/null @@ -1,29 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Kohsuke Kawaguchi - */ -@Extension -public class NotificationBar extends UISample { - @Override - public String getDescription() { - return "Notification bar shows a transient message on the top of the page"; - } - - public List getSourceFiles() { - // TODO: generate this from index - return Arrays.asList( - new SourceFile("index.groovy")); - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} - - diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressBar.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressBar.java deleted file mode 100644 index 49b7094e80..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressBar.java +++ /dev/null @@ -1,29 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Kohsuke Kawaguchi - */ -@Extension -public class ProgressBar extends UISample { - @Override - public String getDescription() { - return "Shows you how to use the progress bar widget that's used in the executor view and other places"; - } - - public List getSourceFiles() { - // TODO: generate this from index - return Arrays.asList( - // new SourceFile(getClass().getSimpleName() + ".java"), // nothing interesting in the Java source file - new SourceFile("index.groovy")); - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} - diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressivelyRendered.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressivelyRendered.java deleted file mode 100644 index e70729e5be..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/ProgressivelyRendered.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The MIT License - * - * Copyright 2012 Jesse Glick. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import java.util.LinkedList; -import java.util.List; -import jenkins.util.ProgressiveRendering; -import net.sf.json.JSON; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Extension -public class ProgressivelyRendered extends UISample { - - @Override public String getDescription() { - return "Shows how to use progressively rendered content to avoid overloading the server with a slow HTTP request."; - } - - public ProgressiveRendering factor(final String numberS) { - return new ProgressiveRendering() { - final List newFactors = new LinkedList(); - @Override protected void compute() throws Exception { - int number = Integer.parseInt(numberS); // try entering a nonnumeric value! - // Deliberately inefficient: - for (int i = 1; i <= number; i++) { - if (canceled()) { - return; - } - if (i % 1000000 == 0) { - Thread.sleep(10); // take a breather - } - if (number % i == 0) { - synchronized (this) { - newFactors.add(i); - } - } - progress(((double) i) / number); - } - } - @Override protected synchronized JSON data() { - JSONArray r = new JSONArray(); - for (int i : newFactors) { - r.add(i); - } - newFactors.clear(); - return new JSONObject().accumulate("newfactors", r); - } - }; - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor {} - -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/Root.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/Root.java deleted file mode 100644 index f22e01f11c..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/Root.java +++ /dev/null @@ -1,52 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; -import hudson.model.RootAction; -import jenkins.model.ModelObjectWithContextMenu; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; - -import java.util.List; - -/** - * Entry point to all the UI samples. - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class Root implements RootAction, ModelObjectWithContextMenu { - public String getIconFileName() { - return "gear.png"; - } - - public String getDisplayName() { - return "UI Samples"; - } - - public String getUrlName() { - return "ui-samples"; - } - - public UISample getDynamic(String name) { - for (UISample ui : getAll()) - if (ui.getUrlName().equals(name)) - return ui; - return null; - } - - public List getAll() { - return UISample.all(); - } - - public List getAllGroovy() { - return UISample.getGroovySamples(); - } - - public List getAllOther() { - return UISample.getOtherSamples(); - } - - public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse response) throws Exception { - return new ContextMenu().addAll(getAll()); - } -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea.java deleted file mode 100644 index 514d572404..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea.java +++ /dev/null @@ -1,29 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.Extension; - -import java.util.Arrays; -import java.util.List; - -/** - * Syntax-highlighted text area (powered by CodeMirror). - * - * @author Kohsuke Kawaguchi - */ -@Extension -public class SyntaxHighlightedTextArea extends UISample { - @Override - public String getDescription() { - return "Syntax-highlighted text area powered by CodeMirror"; - } - - public List getSourceFiles() { - // TODO: generate this from index - return Arrays.asList(new SourceFile(getClass().getSimpleName() + ".java"), - new SourceFile("index.groovy")); - } - - @Extension - public static final class DescriptorImpl extends UISampleDescriptor { - } -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISample.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISample.java deleted file mode 100644 index 5ba7bae936..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISample.java +++ /dev/null @@ -1,135 +0,0 @@ -package jenkins.plugins.ui_samples; - -import static org.apache.commons.io.IOUtils.copy; -import hudson.ExtensionList; -import hudson.ExtensionPoint; -import hudson.model.Action; -import hudson.model.Describable; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import jenkins.model.Jenkins; - -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; - -/** - * @author Kohsuke Kawaguchi - */ -public abstract class UISample implements ExtensionPoint, Action, Describable { - public String getIconFileName() { - return "gear.png"; - } - - public String getUrlName() { - return getClass().getSimpleName(); - } - - /** - * Default display name. - */ - public String getDisplayName() { - return getClass().getSimpleName(); - } - - /** - * Source files associated with this sample. - */ - public List getSourceFiles() { - List r = new ArrayList(); - - r.add(new SourceFile(getClass().getSimpleName()+".java")); - for (String name : new String[]{"index.jelly","index.groovy"}) { - SourceFile s = new SourceFile(name); - if (s.resolve()!=null) - r.add(s); - } - return r; - } - - /** - * Binds {@link SourceFile}s into URL. - */ - public void doSourceFile(StaplerRequest req, StaplerResponse rsp) throws IOException { - String name = req.getRestOfPath().substring(1); // Remove leading / - for (SourceFile sf : getSourceFiles()) - if (sf.name.equals(name)) { - sf.doIndex(rsp); - return; - } - rsp.sendError(rsp.SC_NOT_FOUND); - } - - /** - * Returns a paragraph of natural text that describes this sample. - * Interpreted as HTML. - */ - public abstract String getDescription(); - - public UISampleDescriptor getDescriptor() { - return (UISampleDescriptor) Jenkins.getInstance().getDescriptorOrDie(getClass()); - } - - /** - * Returns all the registered {@link UISample}s. - */ - public static ExtensionList all() { - return Jenkins.getInstance().getExtensionList(UISample.class); - } - - public static List getGroovySamples() { - List r = new ArrayList(); - for (UISample uiSample : UISample.all()) { - for (SourceFile src : uiSample.getSourceFiles()) { - if (src.name.contains("groovy")) { - r.add(uiSample); - break; - } - } - } - return r; - } - - public static List getOtherSamples() { - List r = new ArrayList(); - OUTER: - for (UISample uiSample : UISample.all()) { - for (SourceFile src : uiSample.getSourceFiles()) { - if (src.name.contains("groovy")) { - continue OUTER; - } - } - r.add(uiSample); - } - return r; - } - - /** - * @author Kohsuke Kawaguchi - */ - public class SourceFile { - public final String name; - - public SourceFile(String name) { - this.name = name; - } - - public URL resolve() { - return UISample.this.getClass().getResource( - (name.endsWith(".jelly") || name.endsWith(".groovy")) ? UISample.this.getClass().getSimpleName()+"/"+name : name); - } - - /** - * Serves this source file. - */ - public void doIndex(StaplerResponse rsp) throws IOException { - rsp.setContentType("text/plain;charset=UTF-8"); - copy(resolve().openStream(),rsp.getOutputStream()); - } - } - -} diff --git a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISampleDescriptor.java b/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISampleDescriptor.java deleted file mode 100644 index d339263125..0000000000 --- a/ui-samples-plugin/src/main/java/jenkins/plugins/ui_samples/UISampleDescriptor.java +++ /dev/null @@ -1,13 +0,0 @@ -package jenkins.plugins.ui_samples; - -import hudson.model.Descriptor; - -/** - * @author Kohsuke Kawaguchi - */ -public abstract class UISampleDescriptor extends Descriptor { - @Override - public String getDisplayName() { - return clazz.getSimpleName(); - } -} diff --git a/ui-samples-plugin/src/main/resources/index.jelly b/ui-samples-plugin/src/main/resources/index.jelly deleted file mode 100644 index 42497a610a..0000000000 --- a/ui-samples-plugin/src/main/resources/index.jelly +++ /dev/null @@ -1,3 +0,0 @@ -
    - Demonstration of UI controls available in Jenkins based on Stapler, Jelly, Groovy and etc. -
    diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/AutoCompleteTextBox/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/AutoCompleteTextBox/index.jelly deleted file mode 100644 index 45381e7a3a..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/AutoCompleteTextBox/index.jelly +++ /dev/null @@ -1,36 +0,0 @@ - - - - -
    - - - - -
    -
    -
    -
    - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.groovy deleted file mode 100644 index 7d3f5a4b63..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.groovy +++ /dev/null @@ -1,20 +0,0 @@ -package jenkins.plugins.ui_samples.CopyButton; - -import lib.JenkinsTagLib -import lib.LayoutTagLib - -def st=namespace("jelly:stapler") - -t=namespace(JenkinsTagLib.class) -l=namespace(LayoutTagLib.class) - -namespace("/lib/samples").sample(title:_("Copy Button")) { - raw(_("blurb")) - - div(style:"margin:2em") { - text("Copy this text! ") - l.copyButton(message:"text copied",text:"here comes ABC",container:"DIV") - } - - raw(_("aboutContainerElement")) -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.properties b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.properties deleted file mode 100644 index a3c52f5643..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/CopyButton/index.properties +++ /dev/null @@ -1,11 +0,0 @@ -blurb=\ - l.copyButton tag creates a small button that allows users to paste text into the clipboard. \ - Browsers make it unbelievably hard to do this simple task, so that's why we use a tag to encapsulate it. \ - The tag requires two mandatory attributes. One is text, which represents the text to be copied into the clipboard. \ - The other is message, which represents a message to be displayed upon the successful copying into the clipboard. - -aboutContainerElement=\ - According to ZeroClipboard documentation, \ - which is what we use for the copying, it is desirable to have an outer block element that houses a button, to improve \ - the accuracy of positioning a hidden flash movie. This can be specified as a CSS selector in the container attribute. \ - Note that you do not need to set the position:relative manually, as this tag will automatically set it. \ No newline at end of file diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Apple/config.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Apple/config.jelly deleted file mode 100644 index 932613bd80..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Apple/config.jelly +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Banana/config.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Banana/config.jelly deleted file mode 100644 index 8079626f8c..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/Banana/config.jelly +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/index.jelly deleted file mode 100644 index c2f6b05a75..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DropdownList/index.jelly +++ /dev/null @@ -1,50 +0,0 @@ - - - - -
    - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicComboBox/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicComboBox/index.jelly deleted file mode 100644 index 0d66eedb85..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicComboBox/index.jelly +++ /dev/null @@ -1,38 +0,0 @@ - - - - -
    - - - - - - - -
    -
    -
    -
    diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicDropDownListBox/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicDropDownListBox/index.jelly deleted file mode 100644 index 7366121636..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/DynamicDropDownListBox/index.jelly +++ /dev/null @@ -1,41 +0,0 @@ - - - - -
    - - - - - - - - - - -
    -
    -
    -
    diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/City/config.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/City/config.groovy deleted file mode 100644 index b7dd63efdc..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/City/config.groovy +++ /dev/null @@ -1,7 +0,0 @@ -package jenkins.plugins.ui_samples.FormFieldValidationWithContext.City; - -def f = namespace(lib.FormTagLib) - -f.entry(title:"City Name", field:"name") { - f.textbox() -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/State/config.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/State/config.groovy deleted file mode 100644 index 53fdcd9ef9..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/State/config.groovy +++ /dev/null @@ -1,19 +0,0 @@ -package jenkins.plugins.ui_samples.FormFieldValidationWithContext.State; - -def f = namespace(lib.FormTagLib) - -f.entry(title:"State Name", field:"name") { - f.textbox() -} - -f.nested { - table { - f.section(title:"Capital city") { - f.property(field:"capital") - } - - f.entry(title:"Other cities") { - f.repeatableProperty(field:"cities") - } - } -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.groovy deleted file mode 100644 index ef37b97a2f..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.groovy +++ /dev/null @@ -1,22 +0,0 @@ -package jenkins.plugins.ui_samples.FormFieldValidationWithContext; - -import lib.JenkinsTagLib -import lib.FormTagLib - -def f=namespace(FormTagLib.class) - -t=namespace(JenkinsTagLib.class) - -namespace("/lib/samples").sample(title:_("Context-sensitive form validation")) { - p { - raw(_("blurb.context")) - raw(_("blurb.otheruse")) - raw(_("blurb.contrived")) - } - - f.form { - f.entry(title:"States") { - f.repeatableProperty(field:"states") - } - } -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.properties b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.properties deleted file mode 100644 index 16568baed4..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/FormFieldValidationWithContext/index.properties +++ /dev/null @@ -1,9 +0,0 @@ -blurb.context=\ - Form field validation can access values of the nearby input controls, which is useful for performing \ - complex context sensitive form validation. -blurb.otheruse=\ - The same technique can be also used for auto-completion, populating combobox/listbox, and so on. -blurb.contrived=\ - The example below is bit contrived, but all the input elements are named 'name' (for city name and state name), \ - and we use @RelativePath so that the validation of the state name refers to the capital name, \ - and the validation of the city name refers to the state name. \ No newline at end of file diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/ChoiceEntry/config.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/ChoiceEntry/config.jelly deleted file mode 100644 index 9fba952485..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/ChoiceEntry/config.jelly +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/Config/config.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/Config/config.jelly deleted file mode 100644 index abe64ce337..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/Config/config.jelly +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/SimpleEntry/config.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/SimpleEntry/config.jelly deleted file mode 100644 index e98b3ef2a3..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/SimpleEntry/config.jelly +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/configure.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/configure.jelly deleted file mode 100644 index e48529c9be..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/configure.jelly +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - -

    Configuration

    - - - - - - - - - -
    -
    -
    diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/index.jelly deleted file mode 100644 index 2ed9ee4a9f..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/HeteroList/index.jelly +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - -

    - Configure me! -

    - -

    - Current configuration: -

    -
    -                ${it.configFile.asString()}
    -            
    -
    -
    -
    diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/header.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/header.groovy deleted file mode 100644 index 58f1cde3fe..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/header.groovy +++ /dev/null @@ -1,6 +0,0 @@ -package jenkins.plugins.ui_samples.InpageNavigationWithBreadcrumb - -def l=namespace(lib.LayoutTagLib.class) - -// put them under your l.layout -l.breadcrumb(title:"Click me! Click me!",id:"id-of-breadcrumb-item") diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.groovy deleted file mode 100644 index 44b9d6e4c7..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.groovy +++ /dev/null @@ -1,21 +0,0 @@ -package jenkins.plugins.ui_samples.InpageNavigationWithBreadcrumb; - -import lib.JenkinsTagLib - -def st=namespace("jelly:stapler") - -t=namespace(JenkinsTagLib.class) - -namespace("/lib/samples").sample(title:_("In-page navigation via breadcrumb")) { - raw(_("blurb")) - - script """ - Event.observe(window,"load",function(){ - var menu = new breadcrumbs.ContextMenu(); - menu.add('#section1',rootURL+"/images/24x24/gear.png","Section 1") - menu.add('#section2',rootURL+"/images/24x24/gear.png","Section 2") - breadcrumbs.attachMenu('id-of-breadcrumb-item',menu); - }); -""" - -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.properties b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.properties deleted file mode 100644 index 46400ae7b9..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/InpageNavigationWithBreadcrumb/index.properties +++ /dev/null @@ -1,5 +0,0 @@ -blurb=You can add arbitrary additional items to the breadcrumb bar (see above), and associate menus with them. \ - This mechanism is convenient for adding anchors to a large page and provide quick access to the key parts. \ - A very typical place where you want to do this is in the configuration page. There's a <f:breadcrumb-config-outline> \ - tag specifically for this use case, which parses <f:section>s and use that to build the context menu. \ - See the freestyle job configuration page for an example of using this tag. \ No newline at end of file diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/JavaScriptProxy/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/JavaScriptProxy/index.jelly deleted file mode 100644 index 7192bbca48..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/JavaScriptProxy/index.jelly +++ /dev/null @@ -1,45 +0,0 @@ - - - - -

    - In Jenkins, you can export arbitrary server-side Java object to JavaScript via a proxy, - then invoke their methods from JavaScript. See the Wiki for more details. - In this sample, we call a method on the server to increment a counter. This object is a singleton, - so you'll see the same counter value across all the browsers. -

    - - - -
    - - - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ModularizeViewScript/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ModularizeViewScript/index.groovy deleted file mode 100644 index 5ea27a431f..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ModularizeViewScript/index.groovy +++ /dev/null @@ -1,43 +0,0 @@ -package jenkins.plugins.ui_samples.ModularizeViewScript - -import org.kohsuke.stapler.jelly.groovy.JellyBuilder -import jenkins.util.groovy.AbstractGroovyViewModule - -namespace("/lib/samples").sample(title:_("Define View Fragments Elsewhere")) { - - // normally this is how you generate tags, - // but these are actually just a syntax sugar for method calls to the "builder" object (which is set as the delegate of the script for you) - h2("One") - div (style:"border:1px solid blue") { - p("some pointless text") - } - - // so all we need to do is to pass around this delegate object and then you can generate fragments - // from elsewhere - new SomeGenerator(builder).generateSomeFragment() -} - - -// I defined this class here just to make the sample concise. -// this class can be defined anywhere, and typically you'd do this somewhere in your src/main/groovy -class SomeGenerator extends AbstractGroovyViewModule { - SomeGenerator(JellyBuilder builder) { - super(builder) - } - - def generateSomeFragment() { - h2("Two") - div(style:"background-color:gray; padding:2em") { - p("Hello") // once inside a closure, no explicit 'b.' reference is needed. this is just like other Groovy builders - - // calling other methods - generateMoreFragment("Testing generation"); - } - } - - def generateMoreFragment(String msg) { - h2(msg); - f.textarea(); - } -} - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.groovy deleted file mode 100644 index 8326b55ac3..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.groovy +++ /dev/null @@ -1,48 +0,0 @@ -package jenkins.plugins.ui_samples.NavigationContextMenu; - -import lib.JenkinsTagLib - -def st=namespace("jelly:stapler") - -t=namespace(JenkinsTagLib.class) - -def example(html) { - tr { - td { - text(html) - } - td { - raw(html) - } - } -} - -namespace("/lib/samples").sample(title:_("Navigational context menu integration")) { - raw(_("blurb")) - - h2(_("Defining context menu")) - raw(_("blurb.define")) - - h2(_("Breadcrumb integration")) - raw(_("blurb.breadcrumb")) - - - h2(_("Model hyperlink")) - raw(_("blurb.modelLink")) - table(border:1) { - example "self" - example "up" - } - - raw(_("blurb.modelLink.inside")) - table(border:1) { - example "self" - example "up" - } - - raw(_("blurb.tltr")) - table(border:1) { - example "self" - example "up" - } -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.properties b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.properties deleted file mode 100644 index 5af5fd3150..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NavigationContextMenu/index.properties +++ /dev/null @@ -1,27 +0,0 @@ -blurb=

    Jenkins consists of a large and complex graph of domain objects (ModelObject), where each node in the graph is a web page and edges are hyperlinks. \ - To help users navigate quickly on this graph, Jenkins provides a mechanism to attach context menus to model objects, \ - which can be used to hop multiple edges without going through individual hyperlinks. - -blurb.define=

    To define a context menu on ModelObject, implement ModelObjectWithContextMenu. \ - See the example for how to implement this method. - -blurb.breadcrumb=

    Implementing ModelObjectWithContextMenu is sufficient for the core to show the context menu \ - for your model object in the breadcrumb. Hover your mouse over the breadcrumb of this page to see context menu \ - associated with this sample. \ -

    \ - In addition, implementing \ - ModelObjectWithChildren \ - enables you to show children of your model object in the breadcrumb when you click the \u2018>\u2019 icon that separates \ - breadcrumb items. - -blurb.modelLink=

    By adding CSS class "model-link" to the <a> tags pointing to model objects with context menu, \ - you can enable the context menu support to that hyperlink. For example: - -blurb.modelLink.inside=\ -

    Unless the hyperlink appears inline, it is often better to pre-allocate a space for the context menu anchor \ - that appears when the mouse hovers over. To do this, also add the 'inside' CSS element. For example: - - -blurb.tltr=

    By default, context menu appears below the link ,but this is inconvenient when model links line up in a vertical list. \ - Add additional "tl-tr" CSS class (read it as 'top-left of the context menu to top-right of the target anchor) to \ - make context menu appear on the right. \ No newline at end of file diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.groovy deleted file mode 100644 index 8d1e6e8197..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.groovy +++ /dev/null @@ -1,22 +0,0 @@ -package jenkins.plugins.ui_samples.NotificationBar; - -import lib.JenkinsTagLib - -def st=namespace("jelly:stapler") - -t=namespace(JenkinsTagLib.class) - -namespace("/lib/samples").sample(title:_("Notification Bar")) { - raw(_("blurb")) - - raw("To show a notification bar, call notificationBar.show('message')") - button(onclick:"notificationBar.show('This is a notification');", "Show a notification bar") - - raw(_("blurb.hide")) - button(onclick:"notificationBar.hide();", "Hide it now") - - raw(_("blurb.stock")) - button(onclick:"notificationBar.show('it worked!', notificationBar.OK );", "OK") - button(onclick:"notificationBar.show('something went wrong',notificationBar.WARNING);", "WARNING") - button(onclick:"notificationBar.show('something went wrong',notificationBar.ERROR);", "ERROR") -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.properties b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.properties deleted file mode 100644 index da9ba766a4..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/NotificationBar/index.properties +++ /dev/null @@ -1,6 +0,0 @@ -blurb=

    Notification bar shows a message that disappears in a few seconds. \ - It is typically used to provide feedback for asynchronous operations. - -blurb.hide=

    A notification bar will auto-hide itself, but you can programmatically hide it via notificationBar.hide() - -blurb.stock=

    For typical notifications, there are several pre-defined option set available as constants that you can use as notificationBar.show(msg,notificationBar.OK) \ No newline at end of file diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressBar/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressBar/index.groovy deleted file mode 100644 index 7118008c41..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressBar/index.groovy +++ /dev/null @@ -1,30 +0,0 @@ -package jenkins.plugins.ui_samples.ProgressBar; - -import lib.JenkinsTagLib - -def st=namespace("jelly:stapler") - -t=namespace(JenkinsTagLib.class) - -namespace("/lib/samples").sample(title:_("Progress Bar")) { - // in this sample, we add extra margin around them - style(".progress-bar {margin:1em;}") - p("This page shows you how to use the progress bar widget") - - p("The 'pos' parameter controls the degree of progress, 0-100") - t.progressBar(pos:30) - t.progressBar(pos:60) - t.progressBar(pos:90) - p("-1 will draw the progress bar in the 'indeterminate' state"); - t.progressBar(pos:-1) - - p("The 'red' parameter turns the progress bar to red. Used to indicate that it's overdue") - t.progressBar(pos:99, red:true) - t.progressBar(pos:-1, red:true) - - p("Tooltip can be added with the 'tooltip' parameter. It can contain arbitrary HTML. Hover your mouse below to see.") - t.progressBar(pos:70, tooltip:"Allows arbitrary html") - - p("Hyperlink can be added with the 'href' pointer. Click the progress bar below") - t.progressBar(pos:70, href:"http://jenkins-ci.org/") -} diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressivelyRendered/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressivelyRendered/index.jelly deleted file mode 100644 index b8a949b284..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/ProgressivelyRendered/index.jelly +++ /dev/null @@ -1,50 +0,0 @@ - - - - -

    - Shows how to do something slow on the server while displaying progress. -

    - -
    - Enter a big number: -
    - - -

    Factors of ${number}:

    - -
      - - - - diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/Root/index.jelly b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/Root/index.jelly deleted file mode 100644 index baa8682cfa..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/Root/index.jelly +++ /dev/null @@ -1,60 +0,0 @@ - - - - - -

      UI Samples

      - -

      Groovy Templates

      - - - - - -
      - -
      -
      -
      -
      - -

      Jelly Templates

      - - - - - -
      - -
      -
      -
      -
      - -
      -
      -
      diff --git a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea/index.groovy b/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea/index.groovy deleted file mode 100644 index 25f8d94435..0000000000 --- a/ui-samples-plugin/src/main/resources/jenkins/plugins/ui_samples/SyntaxHighlightedTextArea/index.groovy +++ /dev/null @@ -1,33 +0,0 @@ -def st=namespace("jelly:stapler") - -namespace("/lib/samples").sample(title:_("Syntax Highlighted Text Area")) { - p("CodeMirror can be used to turn ordinary text area into syntax-highlighted content-assistable text area") - - // this loads the necessary JavaScripts, if it hasn't loaded already - // the first we load is the mode definition file (mode as in Emacs mode) - // the second is the theme. - // - // for other modes, look for "clike.js" in your IDE and see adjacent folders. - st.adjunct(includes:"org.kohsuke.stapler.codemirror.mode.clike.clike") - st.adjunct(includes:"org.kohsuke.stapler.codemirror.theme.default") - - // TODO: adjunct tag doesn't work because 'wroteHEAD' is not set correctly - // TODO: provide abstraction that hides CSS hookup - - // this text area is what we convert to the super text area - // we use CSS class to hook up the initialization script. In this particular demo, - // the ID attribute can be used, but in more general case (such as when you use this in your Builder, etc., - // a single web page may end up containing multiple instances of such text area, so the CSS class works better. - textarea("class":"my-groovy-textbox", style:"width:100%; height:10em") - - // see CodeMirror web site for more about how to control the newly instantiated text area. - script(""" - Behaviour.specify("TEXTAREA.my-groovy-textbox", "SyntaxHighlightedTextArea", 0, function(e) { - var w = CodeMirror.fromTextArea(e,{ - mode:"text/x-groovy", - lineNumbers: true - }).getWrapperElement(); - w.setAttribute("style","border:1px solid black; margin-top: 1em; margin-bottom: 1em") - }); - """) -} diff --git a/ui-samples-plugin/src/main/resources/lib/samples/sample.jelly b/ui-samples-plugin/src/main/resources/lib/samples/sample.jelly deleted file mode 100644 index b5250eada4..0000000000 --- a/ui-samples-plugin/src/main/resources/lib/samples/sample.jelly +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Page layout for UI samples and variable bindings that emulate the form environment. - - Page title - - - - - - - -

      ${title}

      -

      - -

      -

      Source Files

      - -

      Sample

      - -
      -
      -
      diff --git a/ui-samples-plugin/src/main/resources/lib/samples/taglib b/ui-samples-plugin/src/main/resources/lib/samples/taglib deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/war/pom.xml b/war/pom.xml index 1c278dee71..c9d24474d5 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -452,14 +452,12 @@ THE SOFTWARE. stapler.resourcePath ../core/src/main/resources; - ../ui-samples-plugin/src/main/resources; hudson.bundled.plugins - ${basedir}/../ui-samples-plugin/target/test-classes/the.hpl, ${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/*.hpi -- GitLab