提交 c8358277 编写于 作者: J jurgen

Properties moved to runtime

Former-commit-id: e73c9f07
上级 8b1dac78
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jkiss.dbeaver.model;
import org.jkiss.code.Nullable;
/**
* Property manager
*/
public interface DBPPropertyManager extends DBPPropertySource {
void addProperty(DBPPropertyDescriptor prop);
void addProperty(@Nullable String category, Object id, String name, Object value);
}
......@@ -22,9 +22,9 @@ import org.eclipse.jface.action.IContributionManager;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.exec.*;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
/**
* DBD Value Handler.
......@@ -138,7 +138,7 @@ public interface DBDValueHandler
* @param propertySource property source
* @param controller value controller
*/
void contributeProperties(@NotNull PropertySourceAbstract propertySource, @NotNull DBDValueController controller);
void contributeProperties(@NotNull DBPPropertyManager propertySource, @NotNull DBDValueController controller);
/**
* Creates value editor.
......
......@@ -19,12 +19,12 @@ package org.jkiss.dbeaver.model.impl.data;
import org.eclipse.jface.action.IContributionManager;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.*;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCLogicalOperator;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
/**
* Base value handler
......@@ -53,7 +53,7 @@ public abstract class BaseValueHandler implements DBDValueHandler {
}
@Override
public void contributeProperties(@NotNull PropertySourceAbstract propertySource, @NotNull DBDValueController controller)
public void contributeProperties(@NotNull DBPPropertyManager propertySource, @NotNull DBDValueController controller)
{
}
......
......@@ -24,6 +24,7 @@ import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.core.CoreMessages;
import org.jkiss.dbeaver.core.Log;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.data.*;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCSession;
......@@ -34,7 +35,6 @@ import org.jkiss.dbeaver.model.impl.data.formatters.DefaultDataFormatter;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.model.DBIcon;
import org.jkiss.dbeaver.ui.DBeaverIcons;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
import java.text.ParseException;
import java.util.Date;
......@@ -125,7 +125,7 @@ public abstract class DateTimeValueHandler extends BaseValueHandler implements D
}
@Override
public void contributeProperties(@NotNull PropertySourceAbstract propertySource, @NotNull DBDValueController controller)
public void contributeProperties(@NotNull DBPPropertyManager propertySource, @NotNull DBDValueController controller)
{
super.contributeProperties(propertySource, controller);
propertySource.addProperty(
......
......@@ -22,6 +22,7 @@ import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.core.CoreMessages;
import org.jkiss.dbeaver.core.Log;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.data.*;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCSession;
......@@ -31,7 +32,6 @@ import org.jkiss.dbeaver.model.exec.jdbc.JDBCSession;
import org.jkiss.dbeaver.model.impl.data.editors.ContentInlineEditor;
import org.jkiss.dbeaver.model.impl.data.editors.ContentPanelEditor;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
import org.jkiss.dbeaver.utils.ContentUtils;
import java.sql.Blob;
......@@ -196,7 +196,7 @@ public class JDBCContentValueHandler extends JDBCAbstractValueHandler {
}
@Override
public void contributeProperties(@NotNull PropertySourceAbstract propertySource, @NotNull DBDValueController controller)
public void contributeProperties(@NotNull DBPPropertyManager propertySource, @NotNull DBDValueController controller)
{
super.contributeProperties(propertySource, controller);
try {
......
......@@ -23,6 +23,7 @@ import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.core.Log;
import org.jkiss.dbeaver.model.DBPContextProvider;
import org.jkiss.dbeaver.model.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.DBPPropertySource;
import org.jkiss.dbeaver.model.exec.DBCExecutionContext;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
......@@ -39,7 +40,7 @@ import java.util.*;
/**
* PropertyCollector
*/
public abstract class PropertySourceAbstract implements DBPPropertySource, IPropertySourceMulti
public abstract class PropertySourceAbstract implements DBPPropertyManager, IPropertySourceMulti
{
static final Log log = Log.getLog(PropertySourceAbstract.class);
......@@ -63,7 +64,7 @@ public abstract class PropertySourceAbstract implements DBPPropertySource, IProp
this.loadLazyProps = loadLazyProps;
}
public PropertySourceAbstract addProperty(DBPPropertyDescriptor prop)
public void addProperty(DBPPropertyDescriptor prop)
{
if (prop instanceof ObjectPropertyDescriptor && ((ObjectPropertyDescriptor) prop).isHidden()) {
// Do not add it to property list
......@@ -71,15 +72,12 @@ public abstract class PropertySourceAbstract implements DBPPropertySource, IProp
props.add(prop);
}
propValues.put(prop.getId(), prop);
return this;
}
public PropertySourceAbstract addProperty(@Nullable String category, Object id, String name, Object value)
public void addProperty(@Nullable String category, Object id, String name, Object value)
{
props.add(new PropertyDescriptorEx(category, id, name, null, value == null ? null : value.getClass(), false, null, null, false));
propValues.put(id, value);
return this;
}
public void clearProperties()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册