forked from jenkinsci/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
e412d9b
commit 5d85564
Showing
10 changed files
with
191 additions
and
126 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
package jenkins.model.menu.event; | ||
|
||
import org.kohsuke.stapler.export.ExportedBean; | ||
|
||
@ExportedBean | ||
public interface Action { | ||
} |
3 changes: 3 additions & 0 deletions
3
core/src/main/java/jenkins/model/menu/event/DoNothingAction.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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
package jenkins.model.menu.event; | ||
|
||
import org.kohsuke.stapler.export.ExportedBean; | ||
|
||
@ExportedBean | ||
public final class DoNothingAction implements Action {} |
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
48 changes: 48 additions & 0 deletions
48
core/src/main/java/jenkins/model/view/NewProjectActionFactory.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,48 @@ | ||
package jenkins.model.view; | ||
|
||
import hudson.Extension; | ||
import hudson.model.Action; | ||
import hudson.model.View; | ||
import java.util.Collection; | ||
import java.util.Set; | ||
import jenkins.model.TransientActionFactory; | ||
import jenkins.model.menu.Group; | ||
import jenkins.model.menu.event.LinkAction; | ||
|
||
@Extension | ||
public class NewProjectActionFactory extends TransientActionFactory<View> { | ||
|
||
@Override | ||
public Class<View> type() { | ||
return View.class; | ||
} | ||
|
||
@Override | ||
public Collection<? extends Action> createFor(View target) { | ||
if (!target.hasPermission(View.CREATE)) { | ||
return Set.of(); | ||
} | ||
|
||
return Set.of(new Action() { | ||
@Override | ||
public String getDisplayName() { | ||
return "New " + target.getNewPronoun(); | ||
} | ||
|
||
@Override | ||
public String getIconFileName() { | ||
return "symbol-add"; | ||
} | ||
|
||
@Override | ||
public Group getGroup() { | ||
return Group.FIRST_IN_APP_BAR; | ||
} | ||
|
||
@Override | ||
public jenkins.model.menu.event.Action getAction() { | ||
return LinkAction.of("newJob"); | ||
} | ||
}); | ||
} | ||
} |
70 changes: 0 additions & 70 deletions
70
core/src/main/java/jenkins/model/view/NewProjectMenuItem.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.