Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
d6b0ce6a
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d6b0ce6a
编写于
5月 04, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Debug panel UI - function selector
上级
24396772
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
212 addition
and
19 deletion
+212
-19
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DBGConfigurationPanel.java
...src/org/jkiss/dbeaver/debug/ui/DBGConfigurationPanel.java
+1
-1
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DBGConfigurationPanelContainer.java
...kiss/dbeaver/debug/ui/DBGConfigurationPanelContainer.java
+35
-0
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseDebugConfigurationTab.java
...jkiss/dbeaver/debug/ui/DatabaseDebugConfigurationTab.java
+26
-2
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/META-INF/MANIFEST.MF
...ss.dbeaver.ext.postgresql.debug.core/META-INF/MANIFEST.MF
+2
-1
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/PostgreDebugConstants.java
...s/dbeaver/ext/postgresql/debug/PostgreDebugConstants.java
+3
-3
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/core/PostgreSqlDebugCore.java
...beaver/ext/postgresql/debug/core/PostgreSqlDebugCore.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/PostgreResolver.java
...beaver/ext/postgresql/debug/internal/PostgreResolver.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugController.java
...ostgresql/debug/internal/impl/PostgreDebugController.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java
...stgresql/debug/ui/internal/PostgreDebugPanelFunction.java
+141
-8
未找到文件。
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DBGConfigurationPanel.java
浏览文件 @
d6b0ce6a
...
...
@@ -24,7 +24,7 @@ import java.util.Map;
public
interface
DBGConfigurationPanel
{
void
createPanel
(
@NotNull
Composite
parent
);
void
createPanel
(
@NotNull
Composite
parent
,
DBGConfigurationPanelContainer
container
);
void
loadConfiguration
(
@NotNull
DBPDataSourceContainer
dataSource
,
@NotNull
Map
<
String
,
Object
>
configuration
);
...
...
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DBGConfigurationPanelContainer.java
0 → 100644
浏览文件 @
d6b0ce6a
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.debug.ui
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableContext
;
/**
* Panel container
*/
public
interface
DBGConfigurationPanelContainer
{
DBPDataSourceContainer
getDataSource
();
void
updateDialogState
();
void
setWarningMessage
(
String
message
);
DBRRunnableContext
getRunnableContext
();
}
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseDebugConfigurationTab.java
浏览文件 @
d6b0ce6a
...
...
@@ -39,10 +39,12 @@ import org.jkiss.dbeaver.debug.internal.ui.DebugUIMessages;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBPImage
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableContext
;
import
org.jkiss.dbeaver.registry.DataSourceDescriptor
;
import
org.jkiss.dbeaver.registry.DataSourceProviderRegistry
;
import
org.jkiss.dbeaver.registry.DataSourceRegistry
;
import
org.jkiss.dbeaver.registry.driver.DriverDescriptor
;
import
org.jkiss.dbeaver.runtime.RunnableContextDelegate
;
import
org.jkiss.dbeaver.runtime.ui.DBUserInterface
;
import
org.jkiss.dbeaver.ui.DBeaverIcons
;
import
org.jkiss.dbeaver.ui.UIUtils
;
...
...
@@ -53,7 +55,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
public
class
DatabaseDebugConfigurationTab
extends
AbstractLaunchConfigurationTab
{
public
class
DatabaseDebugConfigurationTab
extends
AbstractLaunchConfigurationTab
implements
DBGConfigurationPanelContainer
{
private
DebugConfigurationPanelDescriptor
selectedDebugType
;
private
DBGConfigurationPanel
selectedDebugPanel
;
...
...
@@ -161,11 +163,12 @@ public class DatabaseDebugConfigurationTab extends AbstractLaunchConfigurationTa
for
(
Control
c
:
panelPlaceholder
.
getChildren
())
{
c
.
dispose
();
}
if
(
debugPanel
!=
null
)
{
try
{
selectedDebugType
=
debugPanel
;
selectedDebugPanel
=
debugPanel
.
createPanel
();
selectedDebugPanel
.
createPanel
(
panelPlaceholder
);
selectedDebugPanel
.
createPanel
(
panelPlaceholder
,
this
);
if
(
dataSource
!=
null
&&
currentConfiguration
!=
null
)
{
try
{
selectedDebugPanel
.
loadConfiguration
(
dataSource
,
currentConfiguration
.
getAttributes
());
...
...
@@ -285,4 +288,25 @@ public class DatabaseDebugConfigurationTab extends AbstractLaunchConfigurationTa
return
connectionCombo
.
getSelectedItem
()
!=
null
&&
selectedDebugType
!=
null
;
}
@Override
public
DBPDataSourceContainer
getDataSource
()
{
return
connectionCombo
.
getSelectedItem
();
}
@Override
public
void
updateDialogState
()
{
setDirty
(
true
);
updateLaunchConfigurationDialog
();
}
@Override
public
void
setWarningMessage
(
String
message
)
{
super
.
setWarningMessage
(
message
);
}
@Override
public
DBRRunnableContext
getRunnableContext
()
{
return
new
RunnableContextDelegate
(
getLaunchConfigurationDialog
());
}
}
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/META-INF/MANIFEST.MF
浏览文件 @
d6b0ce6a
...
...
@@ -10,4 +10,5 @@ Require-Bundle: org.eclipse.core.runtime,
org.jkiss.dbeaver.ext.postgresql,
org.jkiss.dbeaver.core,
org.jkiss.dbeaver.debug.core
Export-Package: org.jkiss.dbeaver.ext.postgresql.debug.core
Export-Package: org.jkiss.dbeaver.ext.postgresql.debug,
org.jkiss.dbeaver.ext.postgresql.debug.core
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/PostgreDebugConstants.java
浏览文件 @
d6b0ce6a
...
...
@@ -17,8 +17,6 @@
*/
package
org.jkiss.dbeaver.ext.postgresql.debug
;
import
org.jkiss.dbeaver.debug.DBGConstants
;
public
class
PostgreDebugConstants
{
public
static
final
String
ATTR_SCRIPT_TEXT
=
"PG.ATTR_SCRIPT_TEXT"
;
//$NON-NLS-1$
...
...
@@ -26,7 +24,9 @@ public class PostgreDebugConstants {
public
static
final
String
ATTR_ATTACH_KIND
=
"PG.ATTR_ATTACH_KIND"
;
//$NON-NLS-1$
public
static
final
String
ATTR_ATTACH_PROCESS
=
"PG.ATTACH_PROCESS"
;
//$NON-NLS-1$
public
static
final
String
ATTR_PROCEDURE_NAME
=
"PG.ATTR_PROCEDURE_NAME"
;
//$NON-NLS-1$
public
static
final
String
ATTR_PROCEDURE_OID
=
"PG.ATTR_PROCEDURE_OID"
;
//$NON-NLS-1$
public
static
final
String
ATTR_FUNCTION_OID
=
"PG.ATTR_FUNCTION_OID"
;
//$NON-NLS-1$
public
static
final
String
ATTR_DATABASE_NAME
=
"PG.ATTR_DATABASE_NAME"
;
//$NON-NLS-1$
public
static
final
String
ATTR_SCHEMA_NAME
=
"PG.ATTR_SCHEMA_NAME"
;
//$NON-NLS-1$
public
static
final
String
ATTACH_KIND_LOCAL
=
"LOCAL"
;
//$NON-NLS-1$
public
static
final
String
ATTACH_KIND_GLOBAL
=
"GLOBAL"
;
//$NON-NLS-1$
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/core/PostgreSqlDebugCore.java
浏览文件 @
d6b0ce6a
...
...
@@ -63,7 +63,7 @@ public class PostgreSqlDebugCore {
ILaunchConfigurationWorkingCopy
workingCopy
=
DebugCore
.
createConfiguration
(
container
,
CONFIGURATION_TYPE
,
name
);
workingCopy
.
setAttribute
(
DBGConstants
.
ATTR_DATASOURCE_ID
,
dataSourceContainer
.
getId
());
workingCopy
.
setAttribute
(
PostgreDebugConstants
.
ATTR_
PROCEDURE
_OID
,
String
.
valueOf
(
procedure
.
getObjectId
()));
workingCopy
.
setAttribute
(
PostgreDebugConstants
.
ATTR_
FUNCTION
_OID
,
String
.
valueOf
(
procedure
.
getObjectId
()));
workingCopy
.
setAttribute
(
PostgreDebugConstants
.
ATTR_PROCEDURE_NAME
,
procedureName
);
workingCopy
.
setAttribute
(
PostgreDebugConstants
.
ATTR_SCRIPT_TEXT
,
DebugCore
.
composeScriptText
(
procedure
));
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/PostgreResolver.java
浏览文件 @
d6b0ce6a
...
...
@@ -63,7 +63,7 @@ public class PostgreResolver implements DBGResolver {
HashMap
<
String
,
Object
>
context
=
new
HashMap
<
String
,
Object
>();
if
(
databaseObject
instanceof
PostgreProcedure
)
{
PostgreProcedure
procedure
=
(
PostgreProcedure
)
databaseObject
;
context
.
put
(
PostgreDebugConstants
.
ATTR_
PROCEDURE
_OID
,
procedure
.
getObjectId
());
context
.
put
(
PostgreDebugConstants
.
ATTR_
FUNCTION
_OID
,
procedure
.
getObjectId
());
}
return
context
;
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugController.java
浏览文件 @
d6b0ce6a
...
...
@@ -41,7 +41,7 @@ public class PostgreDebugController extends DBGBaseController {
try
{
PostgreDebugSession
pgSession
=
new
PostgreDebugSession
(
monitor
,
this
);
int
oid
=
CommonUtils
.
toInt
(
configuration
.
get
(
PostgreDebugConstants
.
ATTR_
PROCEDURE
_OID
));
int
oid
=
CommonUtils
.
toInt
(
configuration
.
get
(
PostgreDebugConstants
.
ATTR_
FUNCTION
_OID
));
int
pid
=
CommonUtils
.
toInt
(
configuration
.
get
(
PostgreDebugConstants
.
ATTR_ATTACH_PROCESS
));
String
kind
=
String
.
valueOf
(
configuration
.
get
(
PostgreDebugConstants
.
ATTR_ATTACH_KIND
));
boolean
global
=
PostgreDebugConstants
.
ATTACH_KIND_GLOBAL
.
equals
(
kind
);
...
...
@@ -56,7 +56,7 @@ public class PostgreDebugController extends DBGBaseController {
@Override
public
DBGBreakpointDescriptor
describeBreakpoint
(
Map
<
String
,
Object
>
attributes
)
{
Object
oid
=
attributes
.
get
(
PostgreDebugConstants
.
ATTR_
PROCEDURE
_OID
);
Object
oid
=
attributes
.
get
(
PostgreDebugConstants
.
ATTR_
FUNCTION
_OID
);
Object
lineNumber
=
attributes
.
get
(
IMarker
.
LINE_NUMBER
);
long
parsed
=
Long
.
parseLong
(
String
.
valueOf
(
lineNumber
));
return
new
PostgreDebugBreakpointDescriptor
(
oid
,
parsed
,
false
);
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java
浏览文件 @
d6b0ce6a
...
...
@@ -18,42 +18,122 @@
package
org.jkiss.dbeaver.ext.postgresql.debug.ui.internal
;
import
org.eclipse.jface.viewers.LabelProvider
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.SelectionAdapter
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.events.SelectionListener
;
import
org.eclipse.swt.graphics.Image
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.*
;
import
org.eclipse.swt.widgets.Button
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Group
;
import
org.eclipse.swt.widgets.Text
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.debug.ui.DBGConfigurationPanel
;
import
org.jkiss.dbeaver.debug.ui.DBGConfigurationPanelContainer
;
import
org.jkiss.dbeaver.ext.postgresql.debug.PostgreDebugConstants
;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource
;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreDatabase
;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreProcedure
;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreSchema
;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
import
org.jkiss.dbeaver.model.navigator.DBNModel
;
import
org.jkiss.dbeaver.model.navigator.DBNNode
;
import
org.jkiss.dbeaver.model.struct.DBSInstance
;
import
org.jkiss.dbeaver.model.struct.DBSObjectContainer
;
import
org.jkiss.dbeaver.ui.DBeaverIcons
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.controls.CSmartCombo
;
import
org.jkiss.dbeaver.ui.controls.CSmartSelector
;
import
org.jkiss.dbeaver.ui.dialogs.BrowseObjectDialog
;
import
org.jkiss.utils.CommonUtils
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Map
;
public
class
PostgreDebugPanelFunction
implements
DBGConfigurationPanel
{
private
DBGConfigurationPanelContainer
container
;
private
Button
kindLocal
;
private
Button
kindGlobal
;
private
C
ombo
functionText
;
private
C
SmartCombo
<
PostgreProcedure
>
functionCombo
;
private
Text
processIdText
;
private
SelectionListener
listener
=
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
container
.
updateDialogState
();
}
};
private
PostgreProcedure
selectedFunction
;
@Override
public
void
createPanel
(
Composite
parent
)
{
public
void
createPanel
(
Composite
parent
,
DBGConfigurationPanelContainer
container
)
{
this
.
container
=
container
;
{
Group
kindGroup
=
UIUtils
.
createControlGroup
(
parent
,
"Attach type"
,
2
,
GridData
.
HORIZONTAL_ALIGN_BEGINNING
,
SWT
.
DEFAULT
);
kindLocal
=
new
Button
(
kindGroup
,
SWT
.
RADIO
);
kindLocal
.
setText
(
"Local"
);
kindLocal
.
addSelectionListener
(
listener
);
kindGlobal
=
new
Button
(
kindGroup
,
SWT
.
RADIO
);
kindGlobal
.
setText
(
"Global"
);
kindGlobal
.
addSelectionListener
(
listener
);
}
{
Group
functionGroup
=
UIUtils
.
createControlGroup
(
parent
,
"Function"
,
2
,
GridData
.
VERTICAL_ALIGN_BEGINNING
,
SWT
.
DEFAULT
);
functionText
=
UIUtils
.
createLabelCombo
(
functionGroup
,
"Function"
,
""
,
SWT
.
BORDER
|
SWT
.
DROP_DOWN
|
SWT
.
READ_ONLY
);
UIUtils
.
createControlLabel
(
functionGroup
,
"Function"
);
functionCombo
=
new
CSmartSelector
<
PostgreProcedure
>(
functionGroup
,
SWT
.
BORDER
|
SWT
.
DROP_DOWN
|
SWT
.
READ_ONLY
,
new
LabelProvider
()
{
@Override
public
Image
getImage
(
Object
element
)
{
return
DBeaverIcons
.
getImage
(
DBIcon
.
TREE_PROCEDURE
);
}
@Override
public
String
getText
(
Object
element
)
{
if
(
element
==
null
)
{
return
"N/A"
;
}
return
((
PostgreProcedure
)
element
).
getFullQualifiedSignature
();
}
})
{
@Override
protected
void
dropDown
(
boolean
drop
)
{
if
(
drop
)
{
DBNModel
navigatorModel
=
DBeaverCore
.
getInstance
().
getNavigatorModel
();
DBNDatabaseNode
dsNode
=
navigatorModel
.
getNodeByObject
(
container
.
getDataSource
());
if
(
dsNode
!=
null
)
{
DBNNode
curNode
=
selectedFunction
==
null
?
null
:
navigatorModel
.
getNodeByObject
(
selectedFunction
);
DBNNode
node
=
BrowseObjectDialog
.
selectObject
(
parent
.
getShell
(),
"Select function to debug"
,
dsNode
,
curNode
,
new
Class
[]{
DBSInstance
.
class
,
DBSObjectContainer
.
class
,
PostgreProcedure
.
class
},
new
Class
[]{
PostgreProcedure
.
class
});
if
(
node
instanceof
DBNDatabaseNode
&&
((
DBNDatabaseNode
)
node
).
getObject
()
instanceof
PostgreProcedure
)
{
functionCombo
.
removeAll
();
selectedFunction
=
(
PostgreProcedure
)
((
DBNDatabaseNode
)
node
).
getObject
();
functionCombo
.
addItem
(
selectedFunction
);
functionCombo
.
select
(
selectedFunction
);
container
.
updateDialogState
();
}
}
}
}
};
functionCombo
.
addItem
(
null
);
GridData
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_BEGINNING
);
gd
.
widthHint
=
UIUtils
.
getFontHeight
(
function
Text
)
*
40
+
10
;
function
Text
.
setLayoutData
(
gd
);
gd
.
widthHint
=
UIUtils
.
getFontHeight
(
function
Combo
)
*
40
+
10
;
function
Combo
.
setLayoutData
(
gd
);
processIdText
=
UIUtils
.
createLabelText
(
functionGroup
,
"Process ID"
,
""
,
SWT
.
BORDER
,
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_BEGINNING
));
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_BEGINNING
);
gd
.
widthHint
=
UIUtils
.
getFontHeight
(
function
Text
)
*
10
+
10
;
gd
.
widthHint
=
UIUtils
.
getFontHeight
(
processId
Text
)
*
10
+
10
;
processIdText
.
setLayoutData
(
gd
);
}
}
...
...
@@ -66,15 +146,68 @@ public class PostgreDebugPanelFunction implements DBGConfigurationPanel {
}
else
{
kindLocal
.
setSelection
(
true
);
}
Object
processId
=
configuration
.
get
(
PostgreDebugConstants
.
ATTR_ATTACH_PROCESS
);
processIdText
.
setText
(
processId
==
null
?
""
:
processId
.
toString
());
long
functionId
=
CommonUtils
.
toLong
(
configuration
.
get
(
PostgreDebugConstants
.
ATTR_FUNCTION_OID
));
String
databaseName
=
(
String
)
configuration
.
get
(
PostgreDebugConstants
.
ATTR_DATABASE_NAME
);
String
schemaName
=
(
String
)
configuration
.
get
(
PostgreDebugConstants
.
ATTR_SCHEMA_NAME
);
if
(
functionId
!=
0
&&
dataSource
!=
null
)
{
try
{
container
.
getRunnableContext
().
run
(
true
,
true
,
monitor
->
{
try
{
if
(!
dataSource
.
isConnected
())
{
dataSource
.
connect
(
monitor
,
true
,
true
);
}
PostgreDataSource
ds
=
(
PostgreDataSource
)
dataSource
.
getDataSource
();
PostgreDatabase
database
=
ds
.
getDatabase
(
databaseName
);
if
(
database
!=
null
)
{
PostgreSchema
schema
=
database
.
getSchema
(
monitor
,
schemaName
);
if
(
schema
!=
null
)
{
selectedFunction
=
schema
.
getProcedure
(
monitor
,
functionId
);
}
else
{
container
.
setWarningMessage
(
"Schema '"
+
schemaName
+
"' not found"
);
}
}
else
{
container
.
setWarningMessage
(
"Database '"
+
databaseName
+
"' not found"
);
}
}
catch
(
DBException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
});
}
catch
(
InvocationTargetException
e
)
{
container
.
setWarningMessage
(
e
.
getTargetException
().
getMessage
());
}
catch
(
InterruptedException
e
)
{
// ignore
}
}
if
(
selectedFunction
!=
null
)
{
functionCombo
.
addItem
(
selectedFunction
);
functionCombo
.
select
(
selectedFunction
);
}
else
{
container
.
setWarningMessage
(
"Function '"
+
functionId
+
"' not found in schema '"
+
schemaName
+
"'"
);
}
}
@Override
public
void
saveConfiguration
(
DBPDataSourceContainer
dataSource
,
Map
<
String
,
Object
>
configuration
)
{
configuration
.
put
(
PostgreDebugConstants
.
ATTR_ATTACH_KIND
,
kindGlobal
.
getSelection
()
?
PostgreDebugConstants
.
ATTACH_KIND_GLOBAL
:
PostgreDebugConstants
.
ATTACH_KIND_LOCAL
);
configuration
.
put
(
PostgreDebugConstants
.
ATTR_ATTACH_PROCESS
,
processIdText
.
getText
());
if
(
selectedFunction
!=
null
)
{
configuration
.
put
(
PostgreDebugConstants
.
ATTR_FUNCTION_OID
,
selectedFunction
.
getObjectId
());
configuration
.
put
(
PostgreDebugConstants
.
ATTR_DATABASE_NAME
,
selectedFunction
.
getDatabase
().
getName
());
configuration
.
put
(
PostgreDebugConstants
.
ATTR_SCHEMA_NAME
,
selectedFunction
.
getSchema
().
getName
());
}
else
{
configuration
.
remove
(
PostgreDebugConstants
.
ATTR_FUNCTION_OID
);
configuration
.
remove
(
PostgreDebugConstants
.
ATTR_DATABASE_NAME
);
configuration
.
remove
(
PostgreDebugConstants
.
ATTR_SCHEMA_NAME
);
}
}
@Override
public
boolean
isValid
()
{
return
false
;
return
selectedFunction
!=
null
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录