mirror of
https://github.com/theonedev/onedev.git
synced 2025-12-08 18:26:30 +00:00
workshop update
This commit is contained in:
parent
499839d0e6
commit
78503ebd87
@ -1,18 +0,0 @@
|
||||
package com.pmease.commons.product;
|
||||
|
||||
public class Counter {
|
||||
|
||||
private int value;
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public void increase() {
|
||||
value++;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.pmease.commons.product.components;
|
||||
|
||||
public class LoginForm {
|
||||
|
||||
private String userName;
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
void onActionFromLogin() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" xmlns:p="tapestry:parameter">
|
||||
<t:actionlink t:id="login">login as ${userName}</t:actionlink>
|
||||
</t:container>
|
||||
@ -5,9 +5,8 @@ import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.tapestry5.annotations.InjectComponent;
|
||||
import org.apache.tapestry5.Block;
|
||||
import org.apache.tapestry5.annotations.Property;
|
||||
import org.apache.tapestry5.corelib.components.Zone;
|
||||
import org.apache.tapestry5.services.ComponentSource;
|
||||
|
||||
import com.pmease.commons.product.model.Repository;
|
||||
@ -24,8 +23,11 @@ public class Index {
|
||||
@Inject
|
||||
private ComponentSource componentSource;
|
||||
|
||||
@InjectComponent
|
||||
private Zone myZone;
|
||||
@Inject
|
||||
private Block emailBlock;
|
||||
|
||||
@Inject
|
||||
private Block loginBlock;
|
||||
|
||||
public List<User> getUsers() {
|
||||
List<User> users = new ArrayList<User>();
|
||||
@ -73,6 +75,13 @@ public class Index {
|
||||
user = new User();
|
||||
user.setName(userName);
|
||||
user.setEmail(userName + "@pmease.com");
|
||||
return myZone;
|
||||
return emailBlock;
|
||||
}
|
||||
|
||||
Object onActionFromLoginLink(String userName) {
|
||||
user = new User();
|
||||
user.setName(userName);
|
||||
user.setEmail(userName + "@pmease.com");
|
||||
return loginBlock;
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,20 +11,30 @@
|
||||
</p:else>
|
||||
</t:if>
|
||||
<p:else>
|
||||
<t:grid source="users" row="user">
|
||||
<t:grid source="users" row="user" add="action">
|
||||
<p:nameCell>
|
||||
<t:pagelink page="index" context="user.name">${user.name}</t:pagelink>
|
||||
</p:nameCell>
|
||||
<p:emailCell>
|
||||
<t:jquery.dialogajaxlink t:id="emailLink" t:dialog="myDialog" t:zone="myZone" context="user.name">open</t:jquery.dialogajaxlink>
|
||||
</p:emailCell>
|
||||
<p:actionCell>
|
||||
<t:jquery.dialogajaxlink t:id="loginLink" t:dialog="myDialog" t:zone="myZone" context="user.name">login</t:jquery.dialogajaxlink>
|
||||
</p:actionCell>
|
||||
</t:grid>
|
||||
</p:else>
|
||||
</t:if>
|
||||
<t:jquery.dialog t:clientId="myDialog">
|
||||
<t:zone t:id="myZone" id="myZone">
|
||||
${user.email}
|
||||
</t:zone>
|
||||
<t:zone id="myZone"></t:zone>
|
||||
</t:jquery.dialog>
|
||||
|
||||
<t:block t:id="emailBlock">
|
||||
${user.email}
|
||||
</t:block>
|
||||
|
||||
<t:block t:id="loginBlock">
|
||||
<t:loginForm></t:loginForm>
|
||||
</t:block>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
package com.pmease.commons.product.pages;
|
||||
|
||||
|
||||
public class Preference {
|
||||
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" xmlns:p="tapestry:parameter">
|
||||
<head>
|
||||
<title>Preferences</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user