mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
editable project properties
This commit is contained in:
+16
-5
@@ -288,11 +288,10 @@ public interface IPlugInPort {
|
||||
void setDefaultPropertyValue(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Returns a list of properties that are mutual for all the selected
|
||||
* components. Resulting list may be empty if selected components do not
|
||||
* have mutual properties or can be null if the selection is empty.
|
||||
*
|
||||
* @return
|
||||
* @return a list of properties that are mutual for all the selected
|
||||
* components. Resulting list may be empty if selected components do
|
||||
* not have mutual properties or can be null if the selection is
|
||||
* empty.
|
||||
*/
|
||||
List<PropertyWrapper> getMutualSelectionProperties();
|
||||
|
||||
@@ -306,6 +305,18 @@ public interface IPlugInPort {
|
||||
*/
|
||||
void applyPropertiesToSelection(List<PropertyWrapper> properties) throws Exception;
|
||||
|
||||
/**
|
||||
* @return a list of editable properties of the current project.
|
||||
*/
|
||||
List<PropertyWrapper> getProjectProperties();
|
||||
|
||||
/**
|
||||
* Applies specified properties to the current project.
|
||||
*
|
||||
* @param properties
|
||||
*/
|
||||
void applyPropertiesToProject(List<PropertyWrapper> properties);
|
||||
|
||||
/**
|
||||
* Sets the new component slot. Specified component type will be used to
|
||||
* instantiate new component.
|
||||
|
||||
+4
-6
@@ -3,8 +3,6 @@ package org.diylc.common;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.diylc.core.IDIYComponent;
|
||||
|
||||
/**
|
||||
* Entity class for editable properties extracted from component objects.
|
||||
* Represents a single editable property together with it's current value.
|
||||
@@ -30,9 +28,9 @@ public class PropertyWrapper implements Cloneable {
|
||||
this.defaultable = defaultable;
|
||||
}
|
||||
|
||||
public void readFrom(IDIYComponent<?> component) throws IllegalArgumentException,
|
||||
public void readFrom(Object object) throws IllegalArgumentException,
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
this.value = getter.invoke(component);
|
||||
this.value = getter.invoke(object);
|
||||
}
|
||||
|
||||
// public void readUniqueFrom(IDIYComponent component)
|
||||
@@ -44,9 +42,9 @@ public class PropertyWrapper implements Cloneable {
|
||||
// }
|
||||
// }
|
||||
|
||||
public void writeTo(IDIYComponent<?> component) throws IllegalArgumentException,
|
||||
public void writeTo(Object object) throws IllegalArgumentException,
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
setter.invoke(component, value);
|
||||
setter.invoke(object, value);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
Reference in New Issue
Block a user