提交 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; ...@@ -22,9 +22,9 @@ import org.eclipse.jface.action.IContributionManager;
import org.jkiss.code.NotNull; import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable; import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.exec.*; import org.jkiss.dbeaver.model.exec.*;
import org.jkiss.dbeaver.model.struct.DBSTypedObject; import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
/** /**
* DBD Value Handler. * DBD Value Handler.
...@@ -138,7 +138,7 @@ public interface DBDValueHandler ...@@ -138,7 +138,7 @@ public interface DBDValueHandler
* @param propertySource property source * @param propertySource property source
* @param controller value controller * @param controller value controller
*/ */
void contributeProperties(@NotNull PropertySourceAbstract propertySource, @NotNull DBDValueController controller); void contributeProperties(@NotNull DBPPropertyManager propertySource, @NotNull DBDValueController controller);
/** /**
* Creates value editor. * Creates value editor.
......
...@@ -19,12 +19,12 @@ package org.jkiss.dbeaver.model.impl.data; ...@@ -19,12 +19,12 @@ package org.jkiss.dbeaver.model.impl.data;
import org.eclipse.jface.action.IContributionManager; import org.eclipse.jface.action.IContributionManager;
import org.jkiss.code.NotNull; import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.DBUtils; import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.*; import org.jkiss.dbeaver.model.data.*;
import org.jkiss.dbeaver.model.exec.DBCException; import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCLogicalOperator; import org.jkiss.dbeaver.model.exec.DBCLogicalOperator;
import org.jkiss.dbeaver.model.struct.DBSTypedObject; import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
/** /**
* Base value handler * Base value handler
...@@ -53,7 +53,7 @@ public abstract class BaseValueHandler implements DBDValueHandler { ...@@ -53,7 +53,7 @@ public abstract class BaseValueHandler implements DBDValueHandler {
} }
@Override @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; ...@@ -24,6 +24,7 @@ import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.core.CoreMessages; import org.jkiss.dbeaver.core.CoreMessages;
import org.jkiss.dbeaver.core.Log; import org.jkiss.dbeaver.core.Log;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.data.*; import org.jkiss.dbeaver.model.data.*;
import org.jkiss.dbeaver.model.exec.DBCException; import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCSession; import org.jkiss.dbeaver.model.exec.DBCSession;
...@@ -34,7 +35,6 @@ import org.jkiss.dbeaver.model.impl.data.formatters.DefaultDataFormatter; ...@@ -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.struct.DBSTypedObject;
import org.jkiss.dbeaver.model.DBIcon; import org.jkiss.dbeaver.model.DBIcon;
import org.jkiss.dbeaver.ui.DBeaverIcons; import org.jkiss.dbeaver.ui.DBeaverIcons;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date; import java.util.Date;
...@@ -125,7 +125,7 @@ public abstract class DateTimeValueHandler extends BaseValueHandler implements D ...@@ -125,7 +125,7 @@ public abstract class DateTimeValueHandler extends BaseValueHandler implements D
} }
@Override @Override
public void contributeProperties(@NotNull PropertySourceAbstract propertySource, @NotNull DBDValueController controller) public void contributeProperties(@NotNull DBPPropertyManager propertySource, @NotNull DBDValueController controller)
{ {
super.contributeProperties(propertySource, controller); super.contributeProperties(propertySource, controller);
propertySource.addProperty( propertySource.addProperty(
......
...@@ -22,6 +22,7 @@ import org.jkiss.code.NotNull; ...@@ -22,6 +22,7 @@ import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.core.CoreMessages; import org.jkiss.dbeaver.core.CoreMessages;
import org.jkiss.dbeaver.core.Log; import org.jkiss.dbeaver.core.Log;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.data.*; import org.jkiss.dbeaver.model.data.*;
import org.jkiss.dbeaver.model.exec.DBCException; import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCSession; import org.jkiss.dbeaver.model.exec.DBCSession;
...@@ -31,7 +32,6 @@ import org.jkiss.dbeaver.model.exec.jdbc.JDBCSession; ...@@ -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.ContentInlineEditor;
import org.jkiss.dbeaver.model.impl.data.editors.ContentPanelEditor; import org.jkiss.dbeaver.model.impl.data.editors.ContentPanelEditor;
import org.jkiss.dbeaver.model.struct.DBSTypedObject; import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract;
import org.jkiss.dbeaver.utils.ContentUtils; import org.jkiss.dbeaver.utils.ContentUtils;
import java.sql.Blob; import java.sql.Blob;
...@@ -196,7 +196,7 @@ public class JDBCContentValueHandler extends JDBCAbstractValueHandler { ...@@ -196,7 +196,7 @@ public class JDBCContentValueHandler extends JDBCAbstractValueHandler {
} }
@Override @Override
public void contributeProperties(@NotNull PropertySourceAbstract propertySource, @NotNull DBDValueController controller) public void contributeProperties(@NotNull DBPPropertyManager propertySource, @NotNull DBDValueController controller)
{ {
super.contributeProperties(propertySource, controller); super.contributeProperties(propertySource, controller);
try { try {
......
...@@ -23,6 +23,7 @@ import org.jkiss.code.Nullable; ...@@ -23,6 +23,7 @@ import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.core.Log; import org.jkiss.dbeaver.core.Log;
import org.jkiss.dbeaver.model.DBPContextProvider; import org.jkiss.dbeaver.model.DBPContextProvider;
import org.jkiss.dbeaver.model.DBPPropertyDescriptor; import org.jkiss.dbeaver.model.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.DBPPropertyManager;
import org.jkiss.dbeaver.model.DBPPropertySource; import org.jkiss.dbeaver.model.DBPPropertySource;
import org.jkiss.dbeaver.model.exec.DBCExecutionContext; import org.jkiss.dbeaver.model.exec.DBCExecutionContext;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor; import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
...@@ -39,7 +40,7 @@ import java.util.*; ...@@ -39,7 +40,7 @@ import java.util.*;
/** /**
* PropertyCollector * PropertyCollector
*/ */
public abstract class PropertySourceAbstract implements DBPPropertySource, IPropertySourceMulti public abstract class PropertySourceAbstract implements DBPPropertyManager, IPropertySourceMulti
{ {
static final Log log = Log.getLog(PropertySourceAbstract.class); static final Log log = Log.getLog(PropertySourceAbstract.class);
...@@ -63,7 +64,7 @@ public abstract class PropertySourceAbstract implements DBPPropertySource, IProp ...@@ -63,7 +64,7 @@ public abstract class PropertySourceAbstract implements DBPPropertySource, IProp
this.loadLazyProps = loadLazyProps; this.loadLazyProps = loadLazyProps;
} }
public PropertySourceAbstract addProperty(DBPPropertyDescriptor prop) public void addProperty(DBPPropertyDescriptor prop)
{ {
if (prop instanceof ObjectPropertyDescriptor && ((ObjectPropertyDescriptor) prop).isHidden()) { if (prop instanceof ObjectPropertyDescriptor && ((ObjectPropertyDescriptor) prop).isHidden()) {
// Do not add it to property list // Do not add it to property list
...@@ -71,15 +72,12 @@ public abstract class PropertySourceAbstract implements DBPPropertySource, IProp ...@@ -71,15 +72,12 @@ public abstract class PropertySourceAbstract implements DBPPropertySource, IProp
props.add(prop); props.add(prop);
} }
propValues.put(prop.getId(), 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)); props.add(new PropertyDescriptorEx(category, id, name, null, value == null ? null : value.getClass(), false, null, null, false));
propValues.put(id, value); propValues.put(id, value);
return this;
} }
public void clearProperties() public void clearProperties()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册