You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
49 lines
1.1 KiB
package com.fr.design.remote; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
import com.fr.report.DesignAuthority; |
|
|
|
import javax.swing.Icon; |
|
|
|
public class RemoteDesignAuthorityCreator { |
|
|
|
private String name; |
|
private Icon icon; |
|
private Class clazz; |
|
private Class<? extends BasicBeanPane> editorClazz; |
|
|
|
|
|
public RemoteDesignAuthorityCreator(String name, Icon icon, Class clazz, Class<? extends BasicBeanPane> editorClazz) { |
|
this.name = name; |
|
this.icon = icon; |
|
this.clazz = clazz; |
|
this.editorClazz = editorClazz; |
|
} |
|
|
|
public boolean accept(Object object) { |
|
return this.clazz != null && this.clazz.isInstance(object); |
|
} |
|
|
|
public String getName() { |
|
return name; |
|
} |
|
|
|
public Icon getIcon() { |
|
return icon; |
|
} |
|
|
|
public Class getClazz() { |
|
return clazz; |
|
} |
|
|
|
public Class<? extends BasicBeanPane> getEditorClazz() { |
|
return editorClazz; |
|
} |
|
|
|
public void saveUpdatedBean(DesignAuthority authority, Object bean) { |
|
if (authority == null) { |
|
return; |
|
} |
|
authority.setItems(((DesignAuthority) bean).getItems()); |
|
} |
|
}
|
|
|