-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#28 - initial commit for database related user management
- Loading branch information
1 parent
1dd93cd
commit 31d7d5c
Showing
109 changed files
with
11,155 additions
and
3,042 deletions.
There are no files selected for viewing
821 changes: 415 additions & 406 deletions
821
admin-tools-core/src/main/java/de/chandre/admintool/core/component/AdminComponentImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
1,603 changes: 811 additions & 792 deletions
1,603
admin-tools-core/src/main/java/de/chandre/admintool/core/component/MenuEntry.java
Large diffs are not rendered by default.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
admin-tools-core/src/main/java/de/chandre/admintool/core/ui/ATError.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,96 @@ | ||
package de.chandre.admintool.core.ui; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* convenient transfer object for error messages | ||
* | ||
* @author André | ||
* @since 1.1.7 | ||
*/ | ||
public class ATError implements Serializable { | ||
private static final long serialVersionUID = -4972646697107352412L; | ||
|
||
private String key; | ||
private String message; | ||
|
||
private String field; | ||
|
||
public ATError() { | ||
super(); | ||
} | ||
|
||
public ATError(String key, String message) { | ||
this(key, message, null); | ||
} | ||
|
||
public ATError(String key, String message, String field) { | ||
super(); | ||
this.key = key; | ||
this.message = message; | ||
this.field = field; | ||
} | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
public void setKey(String key) { | ||
this.key = key; | ||
} | ||
public String getMessage() { | ||
return message; | ||
} | ||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
public String getField() { | ||
return field; | ||
} | ||
|
||
public void setField(String field) { | ||
this.field = field; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((field == null) ? 0 : field.hashCode()); | ||
result = prime * result + ((key == null) ? 0 : key.hashCode()); | ||
return result; | ||
} | ||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
ATError other = (ATError) obj; | ||
if (field == null) { | ||
if (other.field != null) | ||
return false; | ||
} else if (!field.equals(other.field)) | ||
return false; | ||
if (key == null) { | ||
if (other.key != null) | ||
return false; | ||
} else if (!key.equals(other.key)) | ||
return false; | ||
if (message == null) { | ||
if (other.message != null) | ||
return false; | ||
} else if (!message.equals(other.message)) | ||
return false; | ||
return true; | ||
} | ||
@Override | ||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("ATError [key=").append(key).append(", message=").append(message).append(", field=") | ||
.append(field).append("]"); | ||
return builder.toString(); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
admin-tools-core/src/main/java/de/chandre/admintool/core/ui/select2/OptionGroupTO.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,39 @@ | ||
package de.chandre.admintool.core.ui.select2; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class OptionGroupTO extends OptionTO { | ||
private static final long serialVersionUID = 2324648170741736932L; | ||
|
||
private String text; | ||
private List<OptionTO> children = new ArrayList<>();; | ||
|
||
public OptionGroupTO() { | ||
super(); | ||
} | ||
public OptionGroupTO(String text) { | ||
super(); | ||
this.text = text; | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
public List<OptionTO> getChildren() { | ||
return children; | ||
} | ||
public void setChildren(List<OptionTO> children) { | ||
this.children = children; | ||
} | ||
public void addChild(OptionTO child) { | ||
this.children.add(child); | ||
} | ||
|
||
public boolean hasChildren() { | ||
return this.children != null && !this.children.isEmpty(); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
admin-tools-core/src/main/java/de/chandre/admintool/core/ui/select2/OptionTO.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,60 @@ | ||
package de.chandre.admintool.core.ui.select2; | ||
|
||
import java.io.Serializable; | ||
|
||
public class OptionTO implements Serializable { | ||
private static final long serialVersionUID = 6804008394662197234L; | ||
|
||
private String id; | ||
private String text; | ||
private boolean selected; | ||
private boolean disabled; | ||
|
||
public OptionTO() { | ||
super(); | ||
} | ||
|
||
public OptionTO(String id, String text) { | ||
this(id, text, false, false); | ||
} | ||
public OptionTO(String id, String text, boolean selected, boolean disabled) { | ||
super(); | ||
this.id = id; | ||
this.text = text; | ||
this.selected = selected; | ||
this.disabled = disabled; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
public String getText() { | ||
return text; | ||
} | ||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
public boolean isSelected() { | ||
return selected; | ||
} | ||
public void setSelected(boolean selected) { | ||
this.selected = selected; | ||
} | ||
public boolean isDisabled() { | ||
return disabled; | ||
} | ||
public void setDisabled(boolean disabled) { | ||
this.disabled = disabled; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("OptionTO [id=").append(id).append(", text=").append(text).append(", selected=").append(selected) | ||
.append(", disabled=").append(disabled).append("]"); | ||
return builder.toString(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
admin-tools-core/src/main/java/de/chandre/admintool/core/ui/select2/Select2GroupedTO.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,38 @@ | ||
package de.chandre.admintool.core.ui.select2; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Select2GroupedTO<E extends OptionTO> implements Serializable { | ||
private static final long serialVersionUID = 922341647233302483L; | ||
|
||
private List<E> result = new ArrayList<>();; | ||
|
||
public List<E> getResult() { | ||
return result; | ||
} | ||
|
||
public void setResult(List<E> result) { | ||
this.result = result; | ||
} | ||
|
||
public boolean addResult(E option) { | ||
if (option instanceof OptionGroupTO) { | ||
if (OptionGroupTO.class.cast(option).hasChildren()) { | ||
return this.result.add(option); | ||
} | ||
return false; | ||
} | ||
return this.result.add(option); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("Select2TO [result=").append(result).append("]"); | ||
return builder.toString(); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.