-
Notifications
You must be signed in to change notification settings - Fork 37
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
ddbc2e5
commit 6b54082
Showing
6 changed files
with
224 additions
and
219 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
35 changes: 35 additions & 0 deletions
35
src/main/java/de/mirkosertic/desktopsearch/BooleanPropertyEditor.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,35 @@ | ||
/** | ||
* FreeDesktopSearch - A Search Engine for your Desktop | ||
* Copyright (C) 2013 Mirko Sertic | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package de.mirkosertic.desktopsearch; | ||
|
||
import javafx.beans.value.ObservableValue; | ||
import javafx.scene.control.CheckBox; | ||
import org.controlsfx.control.PropertySheet; | ||
import org.controlsfx.property.editor.AbstractPropertyEditor; | ||
|
||
public class BooleanPropertyEditor extends AbstractPropertyEditor<Boolean, CheckBox> { | ||
|
||
public BooleanPropertyEditor(PropertySheet.Item property) { | ||
super(property, new CheckBox()); | ||
} | ||
|
||
@Override | ||
protected ObservableValue<Boolean> getObservableValue() { | ||
return getEditor().selectedProperty(); | ||
} | ||
|
||
@Override | ||
public void setValue(Boolean aBoolean) { | ||
getEditor().selectedProperty().setValue(aBoolean); | ||
} | ||
} |
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
63 changes: 63 additions & 0 deletions
63
src/main/java/de/mirkosertic/desktopsearch/PropertyEditorItem.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,63 @@ | ||
/** | ||
* FreeDesktopSearch - A Search Engine for your Desktop | ||
* Copyright (C) 2013 Mirko Sertic | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package de.mirkosertic.desktopsearch; | ||
|
||
import javafx.beans.value.ObservableValue; | ||
import org.controlsfx.control.PropertySheet; | ||
import org.controlsfx.property.editor.PropertyEditor; | ||
|
||
import java.util.Optional; | ||
|
||
public abstract class PropertyEditorItem implements PropertySheet.Item { | ||
|
||
private final Class type; | ||
private final String category; | ||
private final String name; | ||
private final Class propertyEditor; | ||
|
||
public PropertyEditorItem(Class aType, String aCategory, String aName, Class aPropertyEditor) { | ||
type = aType; | ||
category = aCategory; | ||
name = aName; | ||
propertyEditor = aPropertyEditor; | ||
} | ||
|
||
@Override | ||
public Class<?> getType() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public String getCategory() { | ||
return category; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public Optional<ObservableValue<? extends Object>> getObservableValue() { | ||
return Optional.empty(); | ||
} | ||
|
||
public Optional<Class<? extends PropertyEditor<?>>> getPropertyEditorClass() { | ||
return Optional.of(propertyEditor); | ||
} | ||
} |
Oops, something went wrong.