提交 22b4970d 编写于 作者: J jurgen

Properties model refactoring

Former-commit-id: 757faef3
上级 0a6a9131
......@@ -18,8 +18,8 @@
package org.jkiss.dbeaver.model.edit;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.jkiss.dbeaver.model.DBPObject;
import org.jkiss.dbeaver.model.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.edit.prop.DBEPropertyHandler;
/**
......@@ -29,6 +29,6 @@ public interface DBEObjectEditor <OBJECT_TYPE extends DBPObject> extends DBEObje
boolean canEditObject(OBJECT_TYPE object);
DBEPropertyHandler<OBJECT_TYPE> makePropertyHandler(OBJECT_TYPE object, IPropertyDescriptor property);
DBEPropertyHandler<OBJECT_TYPE> makePropertyHandler(OBJECT_TYPE object, DBPPropertyDescriptor property);
}
......@@ -18,10 +18,10 @@
package org.jkiss.dbeaver.model.impl.sql.edit;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.core.CoreMessages;
import org.jkiss.dbeaver.model.DBPNamedObject2;
import org.jkiss.dbeaver.model.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.DBPSaveableObject;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.edit.*;
......@@ -56,7 +56,7 @@ public abstract class SQLObjectEditor<OBJECT_TYPE extends DBSObject & DBPSaveabl
}
@Override
public final DBEPropertyHandler<OBJECT_TYPE> makePropertyHandler(OBJECT_TYPE object, IPropertyDescriptor property)
public final DBEPropertyHandler<OBJECT_TYPE> makePropertyHandler(OBJECT_TYPE object, DBPPropertyDescriptor property)
{
return new PropertyHandler(property);
}
......@@ -129,7 +129,7 @@ public abstract class SQLObjectEditor<OBJECT_TYPE extends DBSObject & DBPSaveabl
return null;
}
protected void validateObjectProperty(OBJECT_TYPE object, IPropertyDescriptor property, Object value) throws DBException
protected void validateObjectProperty(OBJECT_TYPE object, DBPPropertyDescriptor property, Object value) throws DBException
{
}
......@@ -150,7 +150,7 @@ public abstract class SQLObjectEditor<OBJECT_TYPE extends DBSObject & DBPSaveabl
extends ProxyPropertyDescriptor
implements DBEPropertyHandler<OBJECT_TYPE>, DBEPropertyReflector<OBJECT_TYPE>, DBEPropertyValidator<OBJECT_TYPE>
{
private PropertyHandler(IPropertyDescriptor property)
private PropertyHandler(DBPPropertyDescriptor property)
{
super(property);
}
......
......@@ -30,6 +30,7 @@ import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.jkiss.dbeaver.model.DBPNamedObject;
import org.jkiss.dbeaver.model.DBPPersistedObject;
import org.jkiss.dbeaver.model.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.meta.IPropertyValueEditorProvider;
import org.jkiss.dbeaver.model.meta.IPropertyValueTransformer;
import org.jkiss.dbeaver.model.meta.Property;
......@@ -53,7 +54,7 @@ import java.util.ResourceBundle;
/**
* ObjectPropertyDescriptor
*/
public class ObjectPropertyDescriptor extends ObjectAttributeDescriptor implements IPropertyDescriptorEx, IPropertyValueListProvider<Object>
public class ObjectPropertyDescriptor extends ObjectAttributeDescriptor implements DBPPropertyDescriptor, IPropertyDescriptorEx, IPropertyValueListProvider<Object>
{
private final Property propInfo;
private final String propName;
......
......@@ -21,16 +21,17 @@ import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.jkiss.dbeaver.model.DBPPropertyDescriptor;
/**
* ProxyPropertyDescriptor
*/
public class ProxyPropertyDescriptor implements IPropertyDescriptor
public class ProxyPropertyDescriptor implements DBPPropertyDescriptor
{
protected final IPropertyDescriptor original;
protected final DBPPropertyDescriptor original;
public ProxyPropertyDescriptor(IPropertyDescriptor original)
public ProxyPropertyDescriptor(DBPPropertyDescriptor original)
{
this.original = original;
}
......@@ -41,12 +42,6 @@ public class ProxyPropertyDescriptor implements IPropertyDescriptor
return this.original.getId();
}
@Override
public CellEditor createPropertyEditor(Composite parent)
{
return this.original.createPropertyEditor(parent);
}
@Override
public String getCategory()
{
......@@ -60,33 +55,30 @@ public class ProxyPropertyDescriptor implements IPropertyDescriptor
}
@Override
public String getDisplayName()
{
return this.original.getDisplayName();
public Class<?> getDataType() {
return original.getDataType();
}
@Override
public String[] getFilterFlags()
{
return this.original.getFilterFlags();
public boolean isRequired() {
return original.isRequired();
}
@Override
public Object getHelpContextIds()
{
return this.original.getHelpContextIds();
public Object getDefaultValue() {
return original.getDefaultValue();
}
@Override
public ILabelProvider getLabelProvider()
{
return this.original.getLabelProvider();
public boolean isEditable(Object object) {
return original.isEditable(object);
}
@Override
public boolean isCompatibleWith(IPropertyDescriptor anotherProperty)
public String getDisplayName()
{
return this.original.isCompatibleWith(anotherProperty);
return this.original.getDisplayName();
}
}
......@@ -17,8 +17,8 @@
*/
package org.jkiss.dbeaver.ext.wmi.edit;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.edit.DBEPersistAction;
import org.jkiss.dbeaver.ext.wmi.model.WMINamespace;
import org.jkiss.dbeaver.model.edit.DBECommand;
......@@ -39,7 +39,7 @@ public class WMINamespaceManager extends AbstractObjectManager<WMINamespace> imp
}
@Override
public DBEPropertyHandler<WMINamespace> makePropertyHandler(WMINamespace object, IPropertyDescriptor property)
public DBEPropertyHandler<WMINamespace> makePropertyHandler(WMINamespace object, DBPPropertyDescriptor property)
{
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册