new support classes added
This commit is contained in:
parent
9764f546da
commit
83e0196c50
21 changed files with 798 additions and 9 deletions
51
src/com/coder/client/property/CoderClientProperty.java
Normal file
51
src/com/coder/client/property/CoderClientProperty.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package com.coder.client.property;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.controlsfx.control.PropertySheet;
|
||||
import org.controlsfx.property.editor.PropertyEditor;
|
||||
|
||||
public abstract class CoderClientProperty<T> implements PropertySheet.Item {
|
||||
|
||||
private String name;
|
||||
private T value;
|
||||
|
||||
public CoderClientProperty(String name, T defaultValue){
|
||||
this.name = name;
|
||||
this.value = defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void setValue(Object value) {
|
||||
this.value = (T)value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Class<? extends PropertyEditor<?>>> getPropertyEditorClass() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategory() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public abstract PropertyEditor<?> getEditor();
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue