提交 9f729f4a 编写于 作者: J jurgen

DBD model cleanup

Former-commit-id: 44191c45
上级 c07c1ceb
......@@ -19,7 +19,7 @@
package org.jkiss.dbeaver.model.data;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IContributionManager;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCResultSet;
......@@ -121,11 +121,12 @@ public interface DBDValueHandler
/**
* Fills context menu for certain value
* @param menuManager context menu manager
*
* @param manager context menu manager
* @param controller value controller
* @throws DBCException on error
*/
void fillContextMenu(IMenuManager menuManager, DBDValueController controller)
void contributeActions(IContributionManager manager, DBDValueController controller)
throws DBCException;
/**
......@@ -133,10 +134,10 @@ public interface DBDValueHandler
* @param propertySource property source
* @param controller value controller
*/
void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller);
void contributeProperties(PropertySourceAbstract propertySource, DBDValueController controller);
/**
* Shows value editor.
* Creates value editor.
* Value editor could be:
* <li>inline editor (control created withing inline placeholder)</li>
* <li>dialog (modal or modeless)</li>
......
......@@ -18,7 +18,7 @@
*/
package org.jkiss.dbeaver.model.impl;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IContributionManager;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.*;
......@@ -89,11 +89,11 @@ public class DBCDefaultValueHandler implements DBDValueHandler {
}
@Override
public void fillContextMenu(IMenuManager menuManager, DBDValueController controller) throws DBCException {
public void contributeActions(IContributionManager manager, DBDValueController controller) throws DBCException {
}
@Override
public void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller) {
public void contributeProperties(PropertySourceAbstract propertySource, DBDValueController controller) {
}
@Override
......
......@@ -21,7 +21,7 @@ package org.jkiss.dbeaver.model.impl.jdbc.data;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.Composite;
......@@ -93,14 +93,14 @@ public abstract class JDBCAbstractValueHandler implements DBDValueHandler {
}
@Override
public void fillContextMenu(IMenuManager menuManager, DBDValueController controller)
public void contributeActions(IContributionManager manager, DBDValueController controller)
throws DBCException
{
}
@Override
public void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller)
public void contributeProperties(PropertySourceAbstract propertySource, DBDValueController controller)
{
}
......
......@@ -83,9 +83,9 @@ public abstract class JDBCComplexValueHandler extends JDBCAbstractValueHandler {
}
@Override
public void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller)
public void contributeProperties(PropertySourceAbstract propertySource, DBDValueController controller)
{
super.fillProperties(propertySource, controller);
super.contributeProperties(propertySource, controller);
try {
Object value = controller.getValue();
if (value instanceof DBDComplexType) {
......
......@@ -21,7 +21,7 @@ package org.jkiss.dbeaver.model.impl.jdbc.data;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.widgets.Composite;
......@@ -222,18 +222,18 @@ public class JDBCContentValueHandler extends JDBCAbstractValueHandler {
}
@Override
public void fillContextMenu(IMenuManager menuManager, final DBDValueController controller)
public void contributeActions(IContributionManager manager, final DBDValueController controller)
throws DBCException
{
if (controller.getValue() instanceof DBDContent && !((DBDContent)controller.getValue()).isNull()) {
menuManager.add(new Action(CoreMessages.model_jdbc_save_to_file_, DBIcon.SAVE.getImageDescriptor()) {
manager.add(new Action(CoreMessages.model_jdbc_save_to_file_, DBIcon.SAVE.getImageDescriptor()) {
@Override
public void run() {
saveToFile(controller);
}
});
}
menuManager.add(new Action(CoreMessages.model_jdbc_load_from_file_, DBIcon.LOAD.getImageDescriptor()) {
manager.add(new Action(CoreMessages.model_jdbc_load_from_file_, DBIcon.LOAD.getImageDescriptor()) {
@Override
public void run() {
loadFromFile(controller);
......@@ -242,9 +242,9 @@ public class JDBCContentValueHandler extends JDBCAbstractValueHandler {
}
@Override
public void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller)
public void contributeProperties(PropertySourceAbstract propertySource, DBDValueController controller)
{
super.fillProperties(propertySource, controller);
super.contributeProperties(propertySource, controller);
try {
Object value = controller.getValue();
if (value instanceof DBDContent) {
......
......@@ -19,7 +19,7 @@
package org.jkiss.dbeaver.model.impl.jdbc.data;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
......@@ -267,10 +267,10 @@ public class JDBCDateTimeValueHandler extends JDBCAbstractValueHandler {
}
@Override
public void fillContextMenu(IMenuManager menuManager, final DBDValueController controller)
public void contributeActions(IContributionManager manager, final DBDValueController controller)
throws DBCException
{
menuManager.add(new Action(CoreMessages.model_jdbc_set_to_current_time) {
manager.add(new Action(CoreMessages.model_jdbc_set_to_current_time) {
@Override
public void run()
{
......@@ -280,9 +280,9 @@ public class JDBCDateTimeValueHandler extends JDBCAbstractValueHandler {
}
@Override
public void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller)
public void contributeProperties(PropertySourceAbstract propertySource, DBDValueController controller)
{
super.fillProperties(propertySource, controller);
super.contributeProperties(propertySource, controller);
propertySource.addProperty(
"Date/Time",
"format", //$NON-NLS-1$
......
......@@ -51,7 +51,7 @@ public class ColumnInfoPanel extends Composite {
{
PropertyCollector infoItem = new PropertyCollector(valueController.getAttribute(), false);
infoItem.collectProperties();
valueController.getValueHandler().fillProperties(infoItem, valueController);
valueController.getValueHandler().contributeProperties(infoItem, valueController);
if (valueController.getValueLocator() != null) {
infoItem.addProperty(null, "Key", CoreMessages.controls_column_info_panel_property_key, new CellKeyInfo(valueController) ); //$NON-NLS-1$
}
......
......@@ -559,7 +559,7 @@ public class ResultSetViewer extends Viewer implements IDataSourceProvider, ISpr
null);
PropertyCollector props = new PropertyCollector(valueController.getAttribute(), false);
props.collectProperties();
valueController.getValueHandler().fillProperties(props, valueController);
valueController.getValueHandler().contributeProperties(props, valueController);
return props;
}
}
......@@ -1428,7 +1428,7 @@ public class ResultSetViewer extends Viewer implements IDataSourceProvider, ISpr
// Menus from value handler
try {
manager.add(new Separator());
model.getColumn(cell.col).getValueHandler().fillContextMenu(manager, valueController);
model.getColumn(cell.col).getValueHandler().contributeActions(manager, valueController);
}
catch (Exception e) {
log.error(e);
......
......@@ -245,7 +245,7 @@ public class MySQLEnumValueHandler extends JDBCAbstractValueHandler {
}
/*
public void fillProperties(PropertySourceAbstract propertySource, DBDValueController controller)
public void contributeProperties(PropertySourceAbstract propertySource, DBDValueController controller)
{
propertySource.addProperty(
"max_length",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册